Browse Source

add max(... EPSILON) to new G_GGX_SmithCorrelated

Ben Houston 9 years ago
parent
commit
6af12202b1
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/renderers/shaders/ShaderChunk/bsdfs.glsl

+ 1 - 1
src/renderers/shaders/ShaderChunk/bsdfs.glsl

@@ -75,7 +75,7 @@ float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const i
 	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
 	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
 
-	return 0.5 / ( gv + gl );
+	return 0.5 / max( gv + gl, EPSILON );
 }