diff --git a/src/renderers/shaders/ShaderChunk/bsdfs.glsl.js b/src/renderers/shaders/ShaderChunk/bsdfs.glsl.js index f7ede2c7aea5e77741329d446d951b0afd2d4338..da4bd60e0553865d23cbfeb8a45a08fdb0639256 100644 --- a/src/renderers/shaders/ShaderChunk/bsdfs.glsl.js +++ b/src/renderers/shaders/ShaderChunk/bsdfs.glsl.js @@ -134,9 +134,9 @@ vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 view float dotNL = saturate( dot( normal, incidentLight.direction ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotLH ); + vec3 F = F_Schlick( f0, f90, dotVH ); float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV ); @@ -313,12 +313,10 @@ vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in Ge vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir ); - //float dotNL = saturate( dot( geometry.normal, incidentLight.direction ) ); - //float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); float dotNH = saturate( dot( geometry.normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); + float dotVH = saturate( dot( geometry.viewDir, halfDir ) ); - vec3 F = F_Schlick( specularColor, vec3( 1.0 ), dotLH ); + vec3 F = F_Schlick( specularColor, vec3( 1.0 ), dotVH ); float G = G_BlinnPhong_Implicit( /* dotNL, dotNV */ );