1
1
import Node from '../core/Node.js' ;
2
2
import { NodeUpdateType } from '../core/constants.js' ;
3
- import { float , nodeProxy , Fn , ivec2 , int } from '../tsl/TSLBase.js' ;
3
+ import { float , nodeProxy , Fn , ivec2 , int , If } from '../tsl/TSLBase.js' ;
4
4
import { uniform } from '../core/UniformNode.js' ;
5
5
import { reference } from './ReferenceNode.js' ;
6
6
import { positionLocal } from './Position.js' ;
@@ -24,7 +24,7 @@ const getMorph = /*@__PURE__*/ Fn( ( { bufferMap, influence, stride, width, dept
24
24
const y = texelIndex . div ( width ) ;
25
25
const x = texelIndex . sub ( y . mul ( width ) ) ;
26
26
27
- const bufferAttrib = textureLoad ( bufferMap , ivec2 ( x , y ) ) . depth ( depth ) ;
27
+ const bufferAttrib = textureLoad ( bufferMap , ivec2 ( x , y ) ) . depth ( depth ) . xyz ;
28
28
29
29
return bufferAttrib . mul ( influence ) ;
30
30
@@ -240,31 +240,35 @@ class MorphNode extends Node {
240
240
241
241
}
242
242
243
- if ( hasMorphPosition === true ) {
243
+ If ( influence . notEqual ( 0 ) , ( ) => {
244
244
245
- positionLocal . addAssign ( getMorph ( {
246
- bufferMap,
247
- influence,
248
- stride,
249
- width,
250
- depth : i ,
251
- offset : int ( 0 )
252
- } ) ) ;
245
+ if ( hasMorphPosition === true ) {
253
246
254
- }
247
+ positionLocal . addAssign ( getMorph ( {
248
+ bufferMap,
249
+ influence,
250
+ stride,
251
+ width,
252
+ depth : i ,
253
+ offset : int ( 0 )
254
+ } ) ) ;
255
+
256
+ }
255
257
256
- if ( hasMorphNormals === true ) {
258
+ if ( hasMorphNormals === true ) {
257
259
258
- normalLocal . addAssign ( getMorph ( {
259
- bufferMap,
260
- influence,
261
- stride,
262
- width,
263
- depth : i ,
264
- offset : int ( 1 )
265
- } ) ) ;
260
+ normalLocal . addAssign ( getMorph ( {
261
+ bufferMap,
262
+ influence,
263
+ stride,
264
+ width,
265
+ depth : i ,
266
+ offset : int ( 1 )
267
+ } ) ) ;
266
268
267
- }
269
+ }
270
+
271
+ } ) ;
268
272
269
273
} ) ;
270
274
0 commit comments