浏览代码

HDRenderLoop: Enable forward rendering correctly

/main
Sebastien Lagarde 8 年前
当前提交
c1813812
共有 1 个文件被更改,包括 26 次插入16 次删除
  1. 42
      Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs

42
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs


}
// 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);

正在加载...
取消
保存