@@ -33,15 +33,25 @@ export const positionPrevious = /*@__PURE__*/ positionGeometry.toVarying( 'posit
3333 * @tsl
3434 * @type {VaryingNode<vec3> }
3535 */
36- export const positionWorld = /*@__PURE__ */ modelWorldMatrix . mul ( positionLocal ) . xyz . toVarying ( 'v_positionWorld' ) . context ( { needsPositionReassign : true } ) ;
36+ export const positionWorld = /*@__PURE__ */ ( Fn ( ( builder ) => {
37+
38+ return modelWorldMatrix . mul ( positionLocal ) . xyz . toVarying ( builder . getNamespace ( 'v_positionWorld' ) ) ;
39+
40+ } , 'vec3' ) . once ( 'POSITION' ) ) ( ) ;
3741
3842/**
3943 * TSL object that represents the position world direction of the current rendered object.
4044 *
4145 * @tsl
4246 * @type {Node<vec3> }
4347 */
44- export const positionWorldDirection = /*@__PURE__ */ positionLocal . transformDirection ( modelWorldMatrix ) . toVarying ( 'v_positionWorldDirection' ) . normalize ( ) . toVar ( 'positionWorldDirection' ) . context ( { needsPositionReassign : true } ) ;
48+ export const positionWorldDirection = /*@__PURE__ */ ( Fn ( ( builder ) => {
49+
50+ const vertexPWD = positionLocal . transformDirection ( modelWorldMatrix ) . toVarying ( builder . getNamespace ( 'v_positionWorldDirection' ) ) ;
51+
52+ return vertexPWD . normalize ( ) . toVar ( 'positionWorldDirection' ) ;
53+
54+ } , 'vec3' ) . once ( 'POSITION' ) ) ( ) ;
4555
4656/**
4757 * TSL object that represents the vertex position in view space of the current rendered object.
@@ -51,9 +61,9 @@ export const positionWorldDirection = /*@__PURE__*/ positionLocal.transformDirec
5161 */
5262export const positionView = /*@__PURE__ */ ( Fn ( ( builder ) => {
5363
54- return builder . context . setupPositionView ( ) ;
64+ return builder . context . setupPositionView ( ) . toVarying ( builder . getNamespace ( 'v_positionView' ) ) ;
5565
56- } , 'vec3' ) . once ( ) ) ( ) . toVarying ( 'v_positionView ' ) . context ( { needsPositionReassign : true } ) ;
66+ } , 'vec3' ) . once ( 'POSITION ' ) ) ( ) ;
5767
5868/**
5969 * TSL object that represents the position view direction of the current rendered object.
0 commit comments