|
|
|
|
|
|
// In case of forward SSS we will bind all the required target. It is up to the shader to write into it or not.
|
|
|
|
if (m_FrameSettings.enableSubsurfaceScattering) |
|
|
|
{ |
|
|
|
RenderTargetIdentifier[] m_MRTWithSSS = new RenderTargetIdentifier[2 + m_SSSBufferManager.sssBufferCount]; |
|
|
|
RenderTargetIdentifier[] m_MRTWithSSS = |
|
|
|
new RenderTargetIdentifier[2 + m_SSSBufferManager.sssBufferCount]; |
|
|
|
m_MRTWithSSS[0] = m_CameraColorBuffer; // Store the specular color
|
|
|
|
m_MRTWithSSS[1] = m_CameraSssDiffuseLightingBuffer; |
|
|
|
for (int i = 0; i < m_SSSBufferManager.sssBufferCount; ++i) |
|
|
|
|
|
|
HDUtils.SetRenderTarget(cmd, hdCamera, m_CameraColorBuffer, m_CameraDepthStencilBuffer); |
|
|
|
} |
|
|
|
|
|
|
|
m_ForwardAndForwardOnlyPassNames[0] = m_ForwardOnlyPassNames[0] = HDShaderPassNames.s_ForwardOnlyName; |
|
|
|
m_ForwardAndForwardOnlyPassNames[0] = m_ForwardOnlyPassNames[0] = |
|
|
|
HDShaderPassNames.s_ForwardOnlyName; |
|
|
|
var passNames = m_FrameSettings.enableForwardRenderingOnly ? m_ForwardAndForwardOnlyPassNames : m_ForwardOnlyPassNames; |
|
|
|
var passNames = m_FrameSettings.enableForwardRenderingOnly |
|
|
|
? m_ForwardAndForwardOnlyPassNames |
|
|
|
: m_ForwardOnlyPassNames; |
|
|
|
RenderOpaqueRenderList(cullResults, camera, renderContext, cmd, passNames, m_currentRendererConfigurationBakedLighting, null, m_DepthStateOpaqueWithPrepass); |
|
|
|
RenderOpaqueRenderList(cullResults, camera, renderContext, cmd, passNames, |
|
|
|
m_currentRendererConfigurationBakedLighting, null, m_DepthStateOpaqueWithPrepass); |
|
|
|
DecalSystem.instance.SetAtlas(cmd); // for clustered decals
|
|
|
|
if (m_FrameSettings.enableDBuffer) // enable d-buffer flag value is being interpreted more like enable decals in general now that we have clustered
|
|
|
|
{ |
|
|
|
DecalSystem.instance.SetAtlas(cmd); // for clustered decals
|
|
|
|
} |
|
|
|
RenderTransparentRenderList(cullResults, camera, renderContext, cmd, m_AllTransparentPassNames, m_currentRendererConfigurationBakedLighting, pass == ForwardPass.PreRefraction ? HDRenderQueue.k_RenderQueue_PreRefraction : HDRenderQueue.k_RenderQueue_Transparent); |
|
|
|
} |
|
|
|
} |
|
|
|