Skip to content

Commit

Permalink
Merge pull request #12 from judysng/Atom/njud/six-point-lighting
Browse files Browse the repository at this point in the history
Remove specular lighting from templates as well
  • Loading branch information
cgalvan authored Aug 11, 2022
2 parents fcc225b + badd425 commit 235a7ca
Showing 1 changed file with 1 addition and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,26 +37,7 @@ float3 GetDiffuseLighting(Surface surface, LightingData lightingData, float3 lig

float3 GetSpecularLighting(Surface surface, LightingData lightingData, const float3 lightIntensity, const float3 dirToLight)
{
float3 specular = SpecularGGX(lightingData.dirToCamera, dirToLight, surface.normal, surface.specularF0, lightingData.NdotV, surface.roughnessA2, lightingData.multiScatterCompensation);

if(o_clearCoat_feature_enabled)
{
float3 halfVector = normalize(dirToLight + lightingData.dirToCamera);
float NdotH = saturate(dot(surface.clearCoat.normal, halfVector));
float NdotL = saturate(dot(surface.clearCoat.normal, dirToLight));
float HdotL = saturate(dot(halfVector, dirToLight));

// HdotV = HdotL due to the definition of half vector
float3 clearCoatF = FresnelSchlick(HdotL, 0.04) * surface.clearCoat.factor;
float clearCoatRoughness = max(surface.clearCoat.roughness * surface.clearCoat.roughness, 0.0005f);
float3 clearCoatSpecular = ClearCoatGGX(NdotH, HdotL, NdotL, surface.clearCoat.normal, clearCoatRoughness, clearCoatF);

specular = specular * (1.0 - clearCoatF) + clearCoatSpecular;
}

specular *= lightIntensity;

return specular;
return float3(0.0f, 0.0f, 0.0f);
}

// Then include everything else
Expand Down

0 comments on commit 235a7ca

Please sign in to comment.