|
|
|
|
|
|
RenderTargetIdentifier[] m_ColorMRTs; |
|
|
|
RenderTargetIdentifier[] m_RTIDs = new RenderTargetIdentifier[k_MaxDbuffer]; |
|
|
|
|
|
|
|
RenderTexture m_HTile; |
|
|
|
RenderTargetIdentifier m_HTileRT; |
|
|
|
|
|
|
|
|
|
|
|
public void InitDBuffers(RenderTextureDescriptor rtDesc, CommandBuffer cmd) |
|
|
|
{ |
|
|
|
dbufferCount = Decal.GetMaterialDBufferCount(); |
|
|
|
|
|
|
return m_ColorMRTs; |
|
|
|
} |
|
|
|
|
|
|
|
public void ClearNormalTarget(Color clearColor, CommandBuffer cmd) |
|
|
|
public void ClearNormalTargetAndHTile(Color clearColor, CommandBuffer cmd) |
|
|
|
CoreUtils.SetRenderTarget(cmd, m_HTileRT, ClearFlag.Color, CoreUtils.clearColorAllBlack); |
|
|
|
public void SetHTile(CommandBuffer cmd) |
|
|
|
{ |
|
|
|
cmd.SetRandomWriteTarget(3, m_HTile); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void Resize(HDCamera camera) |
|
|
|
{ |
|
|
|
CoreUtils.ResizeHTile(m_HTile, ref m_HTileRT, camera.renderTextureDesc); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
CreateDepthStencilBuffer(hdCamera); |
|
|
|
m_SSSBufferManager.Resize(hdCamera); |
|
|
|
m_DbufferManager.Resize(hdCamera); |
|
|
|
} |
|
|
|
|
|
|
|
if (resolutionChanged || m_LightLoop.NeedResize()) |
|
|
|
|
|
|
|
|
|
|
// we need to do a separate clear for normals, because they are cleared to a different color
|
|
|
|
Color clearColorNormal = new Color(0.5f, 0.5f, 0.5f, 1.0f); // for normals 0.5 is neutral
|
|
|
|
m_DbufferManager.ClearNormalTarget(clearColorNormal, cmd); |
|
|
|
m_DbufferManager.ClearNormalTargetAndHTile(clearColorNormal, cmd); |
|
|
|
m_DbufferManager.SetHTile(cmd); |
|
|
|
cmd.ClearRandomWriteTargets(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|