File tree 1 file changed +15
-1
lines changed
src/materials/nodes/manager
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,20 @@ class NodeMaterialObserver {
126
126
127
127
}
128
128
129
+ /**
130
+ * Returns `true` if the current rendering produces motion vectors.
131
+ *
132
+ * @param {Renderer } renderer - The renderer.
133
+ * @return {boolean } Whether the current rendering produces motion vectors or not.
134
+ */
135
+ needsVelocity ( renderer ) {
136
+
137
+ const mrt = renderer . getMRT ( ) ;
138
+
139
+ return ( mrt !== null && mrt . has ( 'velocity' ) ) ;
140
+
141
+ }
142
+
129
143
/**
130
144
* Returns monitoring data for the given render object.
131
145
*
@@ -479,7 +493,7 @@ class NodeMaterialObserver {
479
493
*/
480
494
needsRefresh ( renderObject , nodeFrame ) {
481
495
482
- if ( this . hasNode || this . hasAnimation || this . firstInitialization ( renderObject ) )
496
+ if ( this . hasNode || this . hasAnimation || this . firstInitialization ( renderObject ) || this . needsVelocity ( nodeFrame . renderer ) )
483
497
return true ;
484
498
485
499
const { renderId } = nodeFrame ;
You can’t perform that action at this time.
0 commit comments