소스 검색

add max(... EPSILON) to new G_GGX_SmithCorrelated

Ben Houston 9 년 전
부모
커밋
6af12202b1
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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 );
 }