|
|
|
|
|
|
base.Dispose(); |
|
|
|
Shader.globalRenderPipeline = ""; |
|
|
|
|
|
|
|
SupportedRenderingFeatures.active = new SupportedRenderingFeatures(); |
|
|
|
|
|
|
|
CoreUtils.Destroy(m_ErrorMaterial); |
|
|
|
CoreUtils.Destroy(m_CopyDepthMaterial); |
|
|
|
CoreUtils.Destroy(m_BlitMaterial); |
|
|
|
|
|
|
// state is update, causing RenderPostProcess here to not blit to FinalColorRT. Until the next frame the RT will have garbage.
|
|
|
|
if (LightweightUtils.HasFlag(config, FrameRenderingConfiguration.BeforeTransparentPostProcess)) |
|
|
|
{ |
|
|
|
RenderPostProcess(cmd, m_ColorRT, m_CopyColorRT, true); |
|
|
|
m_CurrCameraColorRT = (m_IsOffscreenCamera) ? BuiltinRenderTextureType.CameraTarget : m_ColorRT; |
|
|
|
RenderPostProcess(cmd, m_CurrCameraColorRT, m_CopyColorRT, true); |
|
|
|
m_CurrCameraColorRT = m_CopyColorRT; |
|
|
|
RenderTargetIdentifier colorRT = (m_IsOffscreenCamera) ? BuiltinRenderTextureType.CameraTarget : m_ColorRT; |
|
|
|
SetRenderTarget(cmd, colorRT, m_CopyDepth); |
|
|
|
SetRenderTarget(cmd, m_CurrCameraColorRT, m_CopyDepth); |
|
|
|
} |
|
|
|
|
|
|
|
context.ExecuteCommandBuffer(cmd); |
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
CommandBuffer cmd = CommandBufferPool.Get("After Transparent"); |
|
|
|
RenderPostProcess(cmd, BuiltinRenderTextureType.CurrentActive, BuiltinRenderTextureType.CameraTarget, false); |
|
|
|
RenderPostProcess(cmd, m_CurrCameraColorRT, BuiltinRenderTextureType.CameraTarget, false); |
|
|
|
context.ExecuteCommandBuffer(cmd); |
|
|
|
CommandBufferPool.Release(cmd); |
|
|
|
} |
|
|
|
|
|
|
var cmd = CommandBufferPool.Get("Blit"); |
|
|
|
if (m_IntermediateTextureArray) |
|
|
|
{ |
|
|
|
SetRenderTarget(cmd, BuiltinRenderTextureType.CameraTarget); |
|
|
|
cmd.Blit(m_CurrCameraColorRT, BuiltinRenderTextureType.CurrentActive); |
|
|
|
cmd.Blit(m_CurrCameraColorRT, BuiltinRenderTextureType.CameraTarget); |
|
|
|
Material blitMaterial = m_BlitMaterial; |
|
|
|
if (LightweightUtils.HasFlag(renderingConfig, FrameRenderingConfiguration.Stereo)) |
|
|
|
blitMaterial = null; |
|
|
|
|
|
|
|
Blit(cmd, renderingConfig, BuiltinRenderTextureType.CurrentActive, BuiltinRenderTextureType.CameraTarget, m_BlitMaterial); |
|
|
|
Blit(cmd, renderingConfig, m_CurrCameraColorRT, BuiltinRenderTextureType.CameraTarget, blitMaterial); |
|
|
|
} |
|
|
|
|
|
|
|
SetRenderTarget(cmd, BuiltinRenderTextureType.CameraTarget); |
|
|
|
|
|
|
if (opaqueOnly) |
|
|
|
{ |
|
|
|
m_CameraPostProcessLayer.RenderOpaqueOnly(m_PostProcessRenderContext); |
|
|
|
cmd.Blit(m_CopyColorRT, m_ColorRT); |
|
|
|
} |
|
|
|
else |
|
|
|
m_CameraPostProcessLayer.Render(m_PostProcessRenderContext); |
|
|
|