소스 검색

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

Brandon 2 달 전
부모
커밋
0ad0c008bd
3개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 0
      examples/jsm/lines/LineMaterial.js
  2. 0 1
      examples/webgl_lines_fat.html
  3. 0 3
      examples/webgl_lines_fat_raycasting.html

+ 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号