File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed
Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -195,15 +195,33 @@ class InstanceNode extends Node {
195195 */
196196 update ( /*frame*/ ) {
197197
198- if ( this . instanceMatrix . usage !== DynamicDrawUsage && this . buffer !== null && this . instanceMatrix . version !== this . buffer . version ) {
198+ if ( this . buffer !== null ) {
199199
200- this . buffer . version = this . instanceMatrix . version ;
200+ // keep update ranges in sync
201+
202+ this . buffer . clearUpdateRanges ( ) ;
203+ this . buffer . updateRanges . push ( ... this . instanceMatrix . updateRanges ) ;
204+
205+ // update version if necessary
206+
207+ if ( this . instanceMatrix . usage !== DynamicDrawUsage && this . instanceMatrix . version !== this . buffer . version ) {
208+
209+ this . buffer . version = this . instanceMatrix . version ;
210+
211+ }
201212
202213 }
203214
204- if ( this . instanceColor && this . instanceColor . usage !== DynamicDrawUsage && this . bufferColor !== null && this . instanceColor . version !== this . bufferColor . version ) {
215+ if ( this . instanceColor && this . bufferColor !== null ) {
216+
217+ this . bufferColor . clearUpdateRanges ( ) ;
218+ this . bufferColor . updateRanges . push ( ... this . instanceColor . updateRanges ) ;
219+
220+ if ( this . instanceColor . usage !== DynamicDrawUsage && this . instanceColor . version !== this . bufferColor . version ) {
205221
206- this . bufferColor . version = this . instanceColor . version ;
222+ this . bufferColor . version = this . instanceColor . version ;
223+
224+ }
207225
208226 }
209227
You can’t perform that action at this time.
0 commit comments