浏览代码

Fix the attenuation bug

/main
Evgenii Golubev 7 年前
当前提交
61c099cd
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 6
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl

6
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl


attenuation *= INV_PI * F_Transm_Schlick(0, 0.5, NdotV) * F_Transm_Schlick(0, 0.5, abs(backNdotL));
#endif
float intensity = saturate(attenuation * backNdotL);
float intensity = max(0, attenuation * backNdotL); // Warning: attenuation can be greater than 1
return intensity * bsdfData.transmittance;
}

float attenuation;
EvaluateLight_Directional(lightLoopContext, posInput, lightData, bakeLightingData, N, L, color, attenuation);
float intensity = saturate(attenuation * NdotL);
float intensity = max(0, attenuation * NdotL); // Warning: attenuation can be greater than 1
// Note: We use NdotL here to early out, but in case of clear coat this is not correct. But we are ok with this
[branch] if (intensity > 0.0)

EvaluateLight_Punctual(lightLoopContext, posInput, lightData, bakeLightingData, N, L,
lightToSample, distances, color, attenuation);
float intensity = saturate(attenuation * NdotL);
float intensity = max(0, attenuation * NdotL); // Warning: attenuation can be greater than 1
// Note: We use NdotL here to early out, but in case of clear coat this is not correct. But we are ok with this
[branch] if (intensity > 0.0)

正在加载...
取消
保存