其他分享
首页 > 其他分享> > URP代码分析

URP代码分析

作者:互联网

在这里插入图片描述
在这里插入图片描述

 protected override void Render(ScriptableRenderContext renderContext, Camera[] cameras)
        {
            BeginFrameRendering(renderContext, cameras);

            GraphicsSettings.lightsUseLinearIntensity = (QualitySettings.activeColorSpace == ColorSpace.Linear);
            GraphicsSettings.useScriptableRenderPipelineBatching = asset.useSRPBatcher;
            SetupPerFrameShaderConstants();

#if ENABLE_VR && ENABLE_XR_MODULE
            SetupXRStates();
#endif

            SortCameras(cameras);
            for (int i = 0; i < cameras.Length; ++i)
            {
                var camera = cameras[i];
#if ENABLE_VR && ENABLE_XR_MODULE
                if (IsStereoEnabled(camera) && xrSkipRender)
                    continue;
#endif
                if (IsGameCamera(camera))
                {
                    RenderCameraStack(renderContext, camera);
                }
                else
                {
                    BeginCameraRendering(renderContext, camera);
#if VISUAL_EFFECT_GRAPH_0_0_1_OR_NEWER
                    //It should be called before culling to prepare material. When there isn't any VisualEffect component, this method has no effect.
                    VFX.VFXManager.PrepareCamera(camera);
#endif
                    UpdateVolumeFramework(camera, null);

                    RenderSingleCamera(renderContext, camera);
                    EndCameraRendering(renderContext, camera);
                }
            }

            EndFrameRendering(renderContext, cameras);
        }

标签:分析,ENABLE,代码,cameras,camera,URP,&&,endif,renderContext
来源: https://blog.csdn.net/wodownload2/article/details/110870689