浏览代码

Merge remote-tracking branch 'refs/remotes/origin/master' into ShaderLibrary

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

8
Assets/ScriptableRenderLoop/fptl/FptlLighting.cs


static void CopyDepthAfterGBuffer(RenderLoop loop)
{
var cmd = new CommandBuffer();
cmd.name = "Copy depth";
cmd.CopyTexture(new RenderTargetIdentifier(kGBufferZ), new RenderTargetIdentifier(kCameraDepthTexture));
loop.ExecuteCommandBuffer(cmd);
cmd.Dispose();

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;

for (int nLight = 0; nLight < activeLights.Length; nLight++)
{
nNumLightsIncludingTooMany++;
if (nNumLightsIncludingTooMany > MAX_LIGHTS)
continue;

cullResults = CullResults.Cull(ref cullingParams, renderLoop);
ExecuteRenderLoop(camera, cullResults, renderLoop);
}
renderLoop.Submit();
}
void FinalPass(RenderLoop loop)

m_skyboxHelper.Draw(loop, camera);
FinalPass(loop);
loop.Submit();
}
void NewFrame()

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;

正在加载...
取消
保存