浏览代码

[fptl] non-shadowcasting directional lights were turning the scene black

/main
vlad-andreev 8 年前
当前提交
7bb76860
共有 2 个文件被更改,包括 7 次插入3 次删除
  1. 2
      Assets/ScriptableRenderLoop/fptl/FptlLighting.cs
  2. 8
      Assets/ScriptableRenderLoop/fptl/Internal-DeferredShading.shader

2
Assets/ScriptableRenderLoop/fptl/FptlLighting.cs


vy = worldToView.MultiplyVector(vy);
vz = worldToView.MultiplyVector(vz);
l.uShadowLightIndex = (uint)nLight;
l.uShadowLightIndex = (light.light.shadows != LightShadows.None) ? (uint)nLight : 0xffffffff;
l.vLaxisX = vx;
l.vLaxisY = vy;

8
Assets/ScriptableRenderLoop/fptl/Internal-DeferredShading.shader


DirectionalLight lightData = g_dirLightData[i];
float atten = 1;
float shadowScalar = SampleShadow(DIRECTIONAL_LIGHT, vPositionWs, 0, lightData.uShadowLightIndex);
atten *= shadowScalar;
[branch]
if (lightData.uShadowLightIndex != 0xffffffff)
{
float shadowScalar = SampleShadow(DIRECTIONAL_LIGHT, vPositionWs, 0, lightData.uShadowLightIndex);
atten *= shadowScalar;
}
UnityLight light;
light.color.xyz = lightData.vCol.xyz * atten;

正在加载...
取消
保存