|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// This pass is use in case of forward opaque and deferred rendering. We need to render forward objects before tile lighting pass
|
|
|
|
void RenderForwardOpaqueDepth(CullResults cull, Camera camera, RenderLoop renderLoop) |
|
|
|
void RenderForwardOnlyDepthPrepass(CullResults cull, Camera camera, RenderLoop renderLoop) |
|
|
|
// If we have render a depth prepass, no need for this pass
|
|
|
|
if (debugParameters.useDepthPrepass) |
|
|
|
// If we are forward only we don't need to render ForwardOpaqueDepth object
|
|
|
|
// But in case we request a prepass we render it
|
|
|
|
if (debugParameters.useForwardRenderingOnly && !debugParameters.useDepthPrepass) |
|
|
|
// TODO: Use the render queue index to only send the forward opaque!
|
|
|
|
// or use the new MAterial.SetPassEnable ?
|
|
|
|
RenderOpaqueRenderList(cull, camera, renderLoop, "DepthOnly"); |
|
|
|
RenderOpaqueRenderList(cull, camera, renderLoop, "ForwardOnlyDepthOnly"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
RenderTransparentRenderList(cullResults, camera, renderLoop, "Forward", Utilities.kRendererConfigurationBakedLighting); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Render material that are forward opaque only (like eye)
|
|
|
|
// TODO: Think about hair that could be render both as opaque and transparent...
|
|
|
|
void RenderForwardOnly(CullResults cullResults, Camera camera, RenderLoop renderLoop) |
|
|
|
{ |
|
|
|
using (new Utilities.ProfilingSample("Forward Only Pass", renderLoop)) |
|
|
|
{ |
|
|
|
// Bind material data
|
|
|
|
m_LitRenderLoop.Bind(); |
|
|
|
|
|
|
|
Utilities.SetRenderTarget(renderLoop, m_CameraColorBufferRT, m_CameraDepthBufferRT); |
|
|
|
|
|
|
|
m_lightLoop.RenderForward(camera, renderLoop, true); |
|
|
|
RenderOpaqueRenderList(cullResults, camera, renderLoop, "ForwardOnly"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RenderDepthPrepass(cullResults, camera, renderLoop); |
|
|
|
|
|
|
|
RenderGBuffer(cullResults, camera, renderLoop); |
|
|
|
|
|
|
|
// Forward opaque with deferred tile require that we fill the depth buffer
|
|
|
|
// Forward opaque with deferred/cluster tile require that we fill the depth buffer
|
|
|
|
// TODO: ask Morten why this pass is not before GBuffer ? Will make more sense and avoid
|
|
|
|
// to do gbuffer pass on unseen mesh.
|
|
|
|
// TODO: how do we select only the object that must be render forward ?
|
|
|
|
// this is all object with gbuffer pass disabled ?
|
|
|
|
//RenderForwardOpaqueDepth(cullResults, camera, renderLoop);
|
|
|
|
RenderForwardOnlyDepthPrepass(cullResults, camera, renderLoop); |
|
|
|
RenderGBuffer(cullResults, camera, renderLoop); |
|
|
|
|
|
|
|
if (debugParameters.debugViewMaterial != 0) |
|
|
|
{ |
|
|
|
|
|
|
} |
|
|
|
RenderDeferredLighting(camera, renderLoop); |
|
|
|
|
|
|
|
// TODO: enable this for tile forward opaque
|
|
|
|
// RenderForward(cullResults, camera, renderLoop, true);
|
|
|
|
RenderForward(cullResults, camera, renderLoop, true); |
|
|
|
RenderForwardOnly(cullResults, camera, renderLoop); |
|
|
|
|
|
|
|
RenderSky(camera, renderLoop); |
|
|
|
|
|
|
|