Browse Source

Fix shader

Garrett Johnson 4 years ago
parent
commit
c44e3f7a3d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      example/customMaterial.js

+ 1 - 1
example/customMaterial.js

@@ -96,7 +96,7 @@ const topoShader = {
 
 			// thickness scale
 			float upwardness = dot( worldNormal, vec3( 0.0, 1.0, 0.0 ) );
-			float yInv = saturate( 1.0 - abs( upwardness ) );
+			float yInv = clamp( 1.0 - abs( upwardness ), 0.0, 1.0 );
 			float thicknessScale = pow( yInv, 0.4 );
 			thicknessScale *= 0.25 + 0.5 * ( vViewPosition.z + 1.0 ) / 2.0;