public void Render(
            ScriptableRenderContext context, Camera camera,
            bool useDynamicBatching, bool useGPUInstancing, bool useLightsPerObject,
            ShadowSettings shadowSettings, PostFXSettings postFXSettings
            )
        {
            this.context = context;
            this.camera  = camera;

            PrepareBuffer();
            PrepareForSceneWindow();
            if (!Cull(shadowSettings.maxDistance))
            {
                return;
            }

            buffer.BeginSample(SampleName);
            ExecuteBuffer();
            lighting.Setup(context, cullingResults, shadowSettings, useLightsPerObject);
            postFXStack.Setup(context, camera, postFXSettings);
            buffer.EndSample(SampleName);
            Setup();
            DrawVisibleGeometry(useDynamicBatching, useGPUInstancing, useLightsPerObject);
            DrawUnsupportedShaders();
            DrawGizmosBeforeFX();
            if (postFXStack.IsActive)
            {
                postFXStack.Render(frameBufferId);
            }
            DrawGizmosAfterFX();
            Cleanup();
            Submit();
        }
示例#2
0
 public void Setup(ScriptableRenderContext context, Camera camera, PostFXSettings settings)
 {
     this.context  = context;
     this.camera   = camera;
     this.settings = camera.cameraType <= CameraType.SceneView ? settings : null;
     ApplySceneViewState();
 }
 public CustomRenderPipeline(
     bool useDynamicBatching, bool useGPUInstancing, bool useSRPBatcher,
     bool useLightsPerObject, ShadowSettings shadowSettings,
     PostFXSettings postFXSettings
     )
 {
     this.postFXSettings     = postFXSettings;
     this.shadowSettings     = shadowSettings;
     this.useDynamicBatching = useDynamicBatching;
     this.useGPUInstancing   = useGPUInstancing;
     this.useLightsPerObject = useLightsPerObject;
     GraphicsSettings.useScriptableRenderPipelineBatching = useSRPBatcher;
     GraphicsSettings.lightsUseLinearIntensity            = true;
     InitializeForEditor();
 }