|
|
|
|
|
|
|
|
|
|
if (m_RequiredDepth) |
|
|
|
{ |
|
|
|
cmd.GetTemporaryRT(CameraRenderTargetID.depth, rtWidth, rtHeight, kCameraDepthBufferBits, FilterMode.Bilinear, RenderTextureFormat.Depth); |
|
|
|
RenderTextureDescriptor depthRTDesc = new RenderTextureDescriptor(rtWidth, rtHeight, RenderTextureFormat.Depth, kCameraDepthBufferBits); |
|
|
|
cmd.GetTemporaryRT(CameraRenderTargetID.depth, depthRTDesc, FilterMode.Bilinear); |
|
|
|
cmd.GetTemporaryRT(CameraRenderTargetID.depthCopy, rtWidth, rtHeight, kCameraDepthBufferBits, FilterMode.Bilinear, RenderTextureFormat.Depth); |
|
|
|
cmd.GetTemporaryRT(CameraRenderTargetID.depthCopy, depthRTDesc, FilterMode.Bilinear); |
|
|
|
|
|
|
|
RenderTextureDescriptor colorRTDesc = new RenderTextureDescriptor(rtWidth, rtHeight, m_ColorFormat, kCameraDepthBufferBits); |
|
|
|
colorRTDesc.msaaSamples = msaaSamples; |
|
|
|
colorRTDesc.enableRandomWrite = false; |
|
|
|
cmd.GetTemporaryRT(CameraRenderTargetID.color, rtWidth, rtHeight, kCameraDepthBufferBits, |
|
|
|
FilterMode.Bilinear, m_ColorFormat, RenderTextureReadWrite.Default, msaaSamples); |
|
|
|
cmd.GetTemporaryRT(CameraRenderTargetID.color, colorRTDesc, FilterMode.Bilinear); |
|
|
|
m_CurrCameraColorRT = m_ColorRT; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
if (LightweightUtils.HasFlag(renderingConfig, FrameRenderingConfiguration.BeforeTransparentPostProcess)) |
|
|
|
{ |
|
|
|
cmd.GetTemporaryRT(CameraRenderTargetID.copyColor, rtWidth, rtHeight, kCameraDepthBufferBits, |
|
|
|
FilterMode.Bilinear, m_ColorFormat, RenderTextureReadWrite.Default, msaaSamples); |
|
|
|
} |
|
|
|
cmd.GetTemporaryRT(CameraRenderTargetID.copyColor, colorRTDesc, FilterMode.Point); |
|
|
|
} |
|
|
|
|
|
|
|
private void SetupIntermediateResourcesStereo(CommandBuffer cmd, int msaaSamples) |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (ForceClear()) |
|
|
|
if (ForceClear()) |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
ClearFlag clearFlag = ClearFlag.None; |
|
|
|
|
|
|
|
|
|
|
private void SetRenderTarget(CommandBuffer cmd, RenderTargetIdentifier colorRT, RenderTargetIdentifier depthRT, ClearFlag clearFlag = ClearFlag.None) |
|
|
|
{ |
|
|
|
if (depthRT == BuiltinRenderTextureType.None) |
|
|
|
if (depthRT == BuiltinRenderTextureType.None) |
|
|
|
{ |
|
|
|
SetRenderTarget (cmd, colorRT, clearFlag); |
|
|
|
return; |
|
|
|