FreezeVR-URP/Library/PackageCache/com.unity.render-pipelines.universal@11.0.0/Runtime/ForwardRenderer.cs
/// <summary>
/// Checks if the pipeline needs to create a intermediate render texture.
/// </summary>
/// <param name="cameraData">CameraData contains all relevant render target information for the camera.</param>
/// <seealso cref="CameraData"/>
/// <returns>Return true if pipeline needs to render to a intermediate render texture.</returns>
Checks if the pipeline needs to create a intermediate render texture.
Checks if the pipeline needs to create a intermediate render texture .
bool RequiresIntermediateColorTexture(ref CameraData cameraData)
        {
            if (cameraData.renderType == CameraRenderType.Base && !cameraData.resolveFinalTarget)
                return true;
            if (this.actualRenderingMode == RenderingMode.Deferred)
                return true;
            bool isSceneViewCamera = cameraData.isSceneViewCamera;
            var cameraTargetDescriptor = cameraData.cameraTargetDescriptor;
            int msaaSamples = cameraTargetDescriptor.msaaSamples;
            bool isScaledRender = !Mathf.Approximately(cameraData.renderScale, 1.0f);
            bool isCompatibleBackbufferTextureDimension = cameraTargetDescriptor.dimension == TextureDimension.Tex2D;
            bool requiresExplicitMsaaResolve = msaaSamples > 1 && PlatformRequiresExplicitMsaaResolve();
            bool isOffscreenRender = cameraData.targetTexture != null && !isSceneViewCamera;
            bool isCapturing = cameraData.captureActions != null;
#if ENABLE_VR && ENABLE_XR_MODULE
            if (cameraData.xr.enabled)
                isCompatibleBackbufferTextureDimension = cameraData.xr.renderTargetDesc.dimension == cameraTargetDescriptor.dimension;
#endif
            bool requiresBlitForOffscreenCamera = cameraData.postProcessEnabled || cameraData.requiresOpaqueTexture || requiresExplicitMsaaResolve || !cameraData.isDefaultViewport;
            if (isOffscreenRender)
                return requiresBlitForOffscreenCamera;
            return requiresBlitForOffscreenCamera || isSceneViewCamera || isScaledRender || cameraData.isHdrEnabled ||
                !isCompatibleBackbufferTextureDimension || isCapturing || cameraData.requireSrgbConversion;
        }
bool RequiresIntermediateColorTexture ( ref CameraData cameraData ) { if ( cameraData . renderType == CameraRenderType . Base && ! cameraData . resolveFinalTarget ) return true ; if ( this . actualRenderingMode == RenderingMode . Deferred ) return true ; bool isSceneViewCamera = cameraData . isSceneViewCamera ; var cameraTargetDescriptor = cameraData . cameraTargetDescriptor ; int msaaSamples = cameraTargetDescriptor . msaaSamples ; bool isScaledRender = ! Mathf . Approximately ( cameraData . renderScale , 1.0f ) ; bool isCompatibleBackbufferTextureDimension = cameraTargetDescriptor . dimension == TextureDimension . Tex2D ; bool requiresExplicitMsaaResolve = msaaSamples > 1 && PlatformRequiresExplicitMsaaResolve ( ) ; bool isOffscreenRender = cameraData . targetTexture != null && ! isSceneViewCamera ; bool isCapturing = cameraData . captureActions != null ; if ENABLE_VR && ENABLE_XR_MODULE if ( cameraData . xr . enabled ) isCompatibleBackbufferTextureDimension = cameraData . xr . renderTargetDesc . dimension == cameraTargetDescriptor . dimension ; endif bool requiresBlitForOffscreenCamera = cameraData . postProcessEnabled || cameraData . requiresOpaqueTexture || requiresExplicitMsaaResolve || ! cameraData . isDefaultViewport ; if ( isOffscreenRender ) return requiresBlitForOffscreenCamera ; return requiresBlitForOffscreenCamera || isSceneViewCamera || isScaledRender || cameraData . isHdrEnabled || ! isCompatibleBackbufferTextureDimension || isCapturing || cameraData . requireSrgbConversion ; }
Checks if the pipeline needs to create a intermediate render texture.
Checks if the pipeline needs to create a intermediate render texture .
// When rendering a camera stack we always create an intermediate render texture to composite camera results. // We create it upon rendering the Base camera. // Always force rendering into intermediate color texture if deferred rendering mode is selected. // Reason: without intermediate color texture, the target camera texture is y-flipped. // However, the target camera texture is bound during gbuffer pass and deferred pass. // Gbuffer pass will not be y-flipped because it is MRT (see ScriptableRenderContext implementation), // while deferred pass will be y-flipped, which breaks rendering. // This incurs an extra blit into at the end of rendering.
Return true if pipeline needs to render to a intermediate render texture.
Return true if pipeline needs to render to a intermediate render texture .
CameraData
ref
cameraData
CameraData contains all relevant render target information for the camera.
CameraData contains all relevant render target information for the camera .
seealso
None