Skip to content

Commit d2c88ab

Browse files
authored
TextureNode: Rename .uv() -> .sample() (#1439)
* TextureNode: Rename .uv() -> .sample() * Update three.js * Add src * Update patch and delete src
1 parent fb83610 commit d2c88ab

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

src-testing/changes.patch

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ index 97456dbc..c99ecb8a 100644
288288

289289
addMethodChaining('toAttribute', bufferNode => bufferAttribute(bufferNode.value));
290290
diff --git a/src-testing/src/nodes/accessors/TextureNode.ts b/src-testing/src/nodes/accessors/TextureNode.ts
291-
index a3c00279..5503218c 100644
291+
index 4841d46c..d69010bc 100644
292292
--- a/src-testing/src/nodes/accessors/TextureNode.ts
293293
+++ b/src-testing/src/nodes/accessors/TextureNode.ts
294294
@@ -4,17 +4,44 @@ import { textureSize } from './TextureSizeNode.js';
@@ -436,10 +436,10 @@ index a3c00279..5503218c 100644
436436

437437
- uv(uvNode) {
438438
+ uv(uvNode: ShaderNodeObject<Node> | null) {
439-
const textureNode = this.clone();
440-
textureNode.uvNode = nodeObject(uvNode);
441-
textureNode.referenceNode = this.getSelf();
442-
@@ -270,7 +297,7 @@ class TextureNode extends UniformNode {
439+
// @deprecated, r172
440+
441+
console.warn('THREE.TextureNode: .uv() has been renamed. Use .sample() instead.');
442+
@@ -278,7 +305,7 @@ class TextureNode extends UniformNode {
443443
return nodeObject(textureNode);
444444
}
445445

@@ -448,7 +448,7 @@ index a3c00279..5503218c 100644
448448
const textureNode = this.clone();
449449
textureNode.biasNode = nodeObject(amountNode).mul(maxMipLevel(textureNode));
450450
textureNode.referenceNode = this.getSelf();
451-
@@ -278,7 +305,7 @@ class TextureNode extends UniformNode {
451+
@@ -286,7 +313,7 @@ class TextureNode extends UniformNode {
452452
return nodeObject(textureNode);
453453
}
454454

three.js

Submodule three.js updated 49 files

types/three/src/nodes/accessors/TextureNode.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,13 @@ export default class TextureNode extends UniformNode<Texture> {
3131

3232
getSampler(): boolean;
3333

34+
/**
35+
* @deprecated
36+
*/
3437
uv(uvNode: NodeRepresentation): ShaderNodeObject<Node>;
3538

39+
sample(uvNode: NodeRepresentation): ShaderNodeObject<Node>;
40+
3641
blur(amountNode: NodeRepresentation): ShaderNodeObject<Node>;
3742

3843
level(levelNode: NodeRepresentation): ShaderNodeObject<Node>;

0 commit comments

Comments
 (0)