|
|
|
|
|
|
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() |
|
|
|