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

MaterialNode: Fix `dashOffset` with `LineDashedMaterial`. (#31008)

* MaterialNode: Fix `dashOffset` with `LineDashedMaterial`.

* Examples: Fix dash scale property.
Michael Herzog 11 месяцев назад
Родитель
Сommit
6e73733830
2 измененных файлов с 5 добавлено и 1 удалено
  1. 1 1
      examples/webgpu_lines_fat_wireframe.html
  2. 4 0
      src/nodes/accessors/MaterialNode.js

+ 1 - 1
examples/webgpu_lines_fat_wireframe.html

@@ -220,7 +220,7 @@
 
 				gui.add( param, 'dash scale', 0.5, 1, 0.1 ).onChange( function ( val ) {
 
-					matLine.dashScale = val;
+					matLine.scale = val;
 					matLineDashed.scale = val;
 
 				} );

+ 4 - 0
src/nodes/accessors/MaterialNode.js

@@ -386,6 +386,10 @@ class MaterialNode extends Node {
 
 			node = this.getTexture( scope ).r.sub( 1.0 ).mul( this.getFloat( 'aoMapIntensity' ) ).add( 1.0 );
 
+		} else if ( scope === MaterialNode.LINE_DASH_OFFSET ) {
+
+			node = ( material.dashOffset ) ? this.getFloat( scope ) : float( 0 );
+
 		} else {
 
 			const outputType = this.getNodeType( builder );

粤ICP备19079148号