Explorar o código

add max(... EPSILON) to new G_GGX_SmithCorrelated

Ben Houston %!s(int64=9) %!d(string=hai) anos
pai
achega
6af12202b1
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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 );
 }