Просмотр исходного кода

LineMaterial: Set needsupdate when changing worldUnits property (#32952)

Brandon 2 недель назад
Родитель
Сommit
0ad0c008bd

+ 6 - 0
examples/jsm/lines/LineMaterial.js

@@ -484,6 +484,12 @@ class LineMaterial extends ShaderMaterial {
 
 	set worldUnits( value ) {
 
+		if ( ( value === true ) !== this.worldUnits ) {
+
+			this.needsUpdate = true;
+
+		}
+
 		if ( value === true ) {
 
 			this.defines.WORLD_UNITS = '';

+ 0 - 1
examples/webgl_lines_fat.html

@@ -228,7 +228,6 @@
 				gui.add( param, 'world units' ).onChange( function ( val ) {
 
 					matLine.worldUnits = val;
-					matLine.needsUpdate = true;
 
 				} );
 

+ 0 - 3
examples/webgl_lines_fat_raycasting.html

@@ -307,10 +307,7 @@
 				gui.add( params, 'world units' ).onChange( function ( val ) {
 
 					matLine.worldUnits = val;
-					matLine.needsUpdate = true;
-
 					matThresholdLine.worldUnits = val;
-					matThresholdLine.needsUpdate = true;
 
 				} );
 

粤ICP备19079148号