Finish testing dual normals: push N dependent geometric term inside BSDF( ) evaluation, use geometric normals for receiver bias and base normal (for now) for diffuse, SSS and transmission.
EvaluateLight_Directional(lightLoopContext, posInput, lightData, bakeLightingData, N, L, color, attenuation);
float intensity = max(0, attenuation * NdotL); // Warning: attenuation can be greater than 1 due to the inverse square attenuation (when position is close to light)
// For shadow attenuation (ie receiver bias), always use the geometric normal:
float intensity = max(0, attenuation); // Warning: attenuation can be greater than 1 due to the inverse square attenuation (when position is close to light)
// Note: We use NdotL here to early out, but in case of coat this is not correct. But we are ok with this
// Note: the NdotL term is now applied in the BSDF() eval itself to account for different normals.
float intensity = max(0, attenuation * NdotL); // Warning: attenuation can be greater than 1 due to the inverse square attenuation (when position is close to light)
float intensity = max(0, attenuation); // Warning: attenuation can be greater than 1 due to the inverse square attenuation (when position is close to light)
// Note: We use NdotL here to early out, but in case of coat this is not correct. But we are ok with this
// Note: the NdotL term is now applied in the BSDF() eval itself to account for different normals.
UNITY_BRANCH if (intensity > 0.0)
{
// Simulate a sphere light with this hack
if (_DebugLightingMode == DEBUGLIGHTINGMODE_LUX_METER)
{
// Only lighting, not BSDF
intensity = max(0, attenuation * NdotL);
lighting.diffuse = color * intensity * lightData.diffuseScale;
}
#endif
if( (i == (0 IF_FEATURE_COAT(+1))) && _DebugEnvLobeMask.y == 0.0) continue;
if( (i == (1 IF_FEATURE_COAT(+1))) && _DebugEnvLobeMask.z == 0.0) continue;