浏览代码

fixed error in shadow sampling of local lights.

/main
Felipe Lira 7 年前
当前提交
577f4336
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 4
      ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Lighting.hlsl

4
ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Lighting.hlsl


for (int i = 0; i < pixelLightCount; ++i)
{
Light light = GetLight(half(i), inputData.positionWS);
light.attenuation *= LocalLightRealtimeShadowAttenuation(inputData.shadowCoord, inputData.positionWS);
light.attenuation *= LocalLightRealtimeShadowAttenuation(i, inputData.positionWS);
color += LightingPhysicallyBased(brdfData, light, inputData.normalWS, inputData.viewDirectionWS);
}
#endif

for (int i = 0; i < pixelLightCount; ++i)
{
Light light = GetLight(half(i), inputData.positionWS);
light.attenuation *= LocalLightRealtimeShadowAttenuation(inputData.shadowCoord, inputData.positionWS);
light.attenuation *= LocalLightRealtimeShadowAttenuation(i, inputData.positionWS);
half3 attenuatedLightColor = light.color * light.attenuation;
diffuseColor += LightingLambert(attenuatedLightColor, light.direction, inputData.normalWS);
specularColor += LightingSpecular(attenuatedLightColor, light.direction, inputData.normalWS, inputData.viewDirectionWS, specularGloss, shininess);

正在加载...
取消
保存