Skip to content

Commit 19c76f8

Browse files
authored
TSL: Fix positionView sub-build (#32691)
1 parent 37278f5 commit 19c76f8

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/materials/nodes/NodeMaterial.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,9 +535,9 @@ class NodeMaterial extends Material {
535535

536536
builder.addStack();
537537

538-
const mvp = subBuild( this.setupVertex( builder ), 'VERTEX' );
538+
const mvp = this.setupVertex( builder );
539539

540-
const vertexNode = this.vertexNode || mvp;
540+
const vertexNode = subBuild( this.vertexNode || mvp, 'VERTEX' );
541541

542542
builder.context.clipSpace = vertexNode;
543543

src/nodes/accessors/Position.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const positionWorld = /*@__PURE__*/ ( Fn( ( builder ) => {
6767

6868
return modelWorldMatrix.mul( positionLocal ).xyz.toVarying( builder.getSubBuildProperty( 'v_positionWorld' ) );
6969

70-
}, 'vec3' ).once( [ 'POSITION' ] ) )();
70+
}, 'vec3' ).once( [ 'POSITION', 'VERTEX' ] ) )();
7171

7272
/**
7373
* TSL object that represents the position world direction of the current rendered object.
@@ -103,7 +103,7 @@ export const positionView = /*@__PURE__*/ ( Fn( ( builder ) => {
103103

104104
return builder.context.setupPositionView().toVarying( 'v_positionView' );
105105

106-
}, 'vec3' ).once( [ 'POSITION' ] ) )();
106+
}, 'vec3' ).once( [ 'POSITION', 'VERTEX' ] ) )();
107107

108108
/**
109109
* TSL object that represents the position view direction of the current rendered object.

src/nodes/core/VaryingNode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class VaryingNode extends Node {
3636
*
3737
* @type {Node}
3838
*/
39-
this.node = node;
39+
this.node = subBuild( node, 'VERTEX' );
4040

4141
/**
4242
* The name of the varying in the shader. If no name is defined,

0 commit comments

Comments
 (0)