|
|
@ -216,6 +216,7 @@ namespace UnityEngine.Rendering.PostProcessing |
|
|
|
|
|
|
|
|
RenderTexture m_opaqueOnly; |
|
|
RenderTexture m_opaqueOnly; |
|
|
RenderTexture m_upscaledOutput; |
|
|
RenderTexture m_upscaledOutput; |
|
|
|
|
|
RenderTexture m_originalTargetTexture; |
|
|
|
|
|
|
|
|
bool m_SettingsUpdateNeeded = true; |
|
|
bool m_SettingsUpdateNeeded = true; |
|
|
bool m_IsRenderingInSceneView = false; |
|
|
bool m_IsRenderingInSceneView = false; |
|
|
@ -296,7 +297,20 @@ namespace UnityEngine.Rendering.PostProcessing |
|
|
superResolution.ResetCameraViewport(m_CurrentContext); |
|
|
superResolution.ResetCameraViewport(m_CurrentContext); |
|
|
|
|
|
|
|
|
// Blit the upscaled image to the backbuffer
|
|
|
// Blit the upscaled image to the backbuffer
|
|
|
Graphics.Blit(m_upscaledOutput, dst); |
|
|
|
|
|
|
|
|
if (m_originalTargetTexture != null) |
|
|
|
|
|
{ |
|
|
|
|
|
Graphics.Blit(m_upscaledOutput, m_originalTargetTexture); |
|
|
|
|
|
RenderTexture.active = dst; |
|
|
|
|
|
|
|
|
|
|
|
// Put the original target texture back at the end of the frame
|
|
|
|
|
|
m_Camera.targetTexture = m_originalTargetTexture; |
|
|
|
|
|
m_originalTargetTexture = null; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
Graphics.Blit(m_upscaledOutput, dst); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
RenderTexture.ReleaseTemporary(m_upscaledOutput); |
|
|
RenderTexture.ReleaseTemporary(m_upscaledOutput); |
|
|
m_upscaledOutput = null; |
|
|
m_upscaledOutput = null; |
|
|
return; |
|
|
return; |
|
|
@ -448,6 +462,16 @@ namespace UnityEngine.Rendering.PostProcessing |
|
|
{ |
|
|
{ |
|
|
volumeTrigger = transform; |
|
|
volumeTrigger = transform; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void LateUpdate() |
|
|
|
|
|
{ |
|
|
|
|
|
// Temporarily take control of the camera's target texture, so that the upscaled output doesn't get clipped
|
|
|
|
|
|
if (m_Camera.targetTexture != null && m_CurrentContext.IsSuperResolutionActive()) |
|
|
|
|
|
{ |
|
|
|
|
|
m_originalTargetTexture = m_Camera.targetTexture; |
|
|
|
|
|
m_Camera.targetTexture = null; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void OnPreCull() |
|
|
void OnPreCull() |
|
|
{ |
|
|
{ |
|
|
|