Ver Fonte

Clean up.

Mr.doob há 8 meses atrás
pai
commit
827a421c0f
1 ficheiros alterados com 2 adições e 3 exclusões
  1. 2 3
      examples/webgpu_loader_materialx.html

+ 2 - 3
examples/webgpu_loader_materialx.html

@@ -123,8 +123,7 @@
 
 				const gridXZ = Fn( ( [ gridSize = float( 1.0 ), dotWidth = float( 0.1 ), lineWidth = float( 0.02 ) ] ) => {
 
-					const worldPos = positionWorld;
-					const coord = worldPos.xz.div( gridSize );
+					const coord = positionWorld.xz.div( gridSize );
 					const grid = fract( coord );
 					
 					// Screen-space derivative for automatic antialiasing
@@ -135,7 +134,7 @@
 					const squareDist = max( abs( grid.x.sub( 0.5 ) ), abs( grid.y.sub( 0.5 ) ) );
 					const dots = smoothstep( dotWidth.add( smoothing ), dotWidth.sub( smoothing ), squareDist );
 					
-					// Create grid lines with derivative-based antialiasing
+					// Create grid lines
 					const lineX = smoothstep( lineWidth.add( smoothing ), lineWidth.sub( smoothing ), abs( grid.x.sub( 0.5 ) ) );
 					const lineZ = smoothstep( lineWidth.add( smoothing ), lineWidth.sub( smoothing ), abs( grid.y.sub( 0.5 ) ) );
 					const lines = max( lineX, lineZ );

粤ICP备19079148号