예제 #1
0
        protected override void Render(ScriptableRenderContext context, Camera[] cameras)
        {
            int maxWidth  = 1;
            int maxHeight = 1;

            foreach (var camera in cameras)
            {
                maxWidth  = Mathf.Max(maxWidth, camera.pixelWidth);
                maxHeight = Mathf.Max(maxHeight, camera.pixelHeight);
            }
            //RTHandles.SetReferenceSize(maxWidth,maxHeight,m_MSAASample);
            RTHandles.SetReferenceSize(1920, 1080, m_MSAASample);
            ShaderBindings.SetPerFrameShaderVariables(context);
            foreach (Camera camera in cameras)
            {
#if UNITY_EDITOR
                if (camera.cameraType == CameraType.SceneView)
                {
                    ScriptableRenderContext.EmitWorldGeometryForSceneView(camera);
                }
#endif

                CullingResults cullingResults = Cull(context, camera);
                ShaderBindings.SetPerCameraShaderVariables(context, camera);
                DrawCamera(context, cullingResults, camera);
            }
        }
        protected override void Render(ScriptableRenderContext context, Camera[] cameras)
        {
            ShaderBindings.SetPerFrameShaderVariables(context);
            foreach (Camera camera in cameras)
            {
#if UNITY_EDITOR
                if (camera.cameraType == CameraType.SceneView)
                {
                    ScriptableRenderContext.EmitWorldGeometryForSceneView(camera);
                }
#endif

                CullingResults cullingResults = Cull(context, camera);
                ShaderBindings.SetPerCameraShaderVariables(context, camera);
                DrawCamera(context, cullingResults, camera);
            }
        }
        protected override void Render(ScriptableRenderContext context, Camera[] cameras)
        {
            Camera portalCamera = cameras.Length > 1 ? cameras[1] : null;

            ShaderBindings.SetPerFrameShaderVariables(context);
            foreach (Camera camera in cameras)
            {
                if (camera == portalCamera)
                {
                    continue;
                }

#if UNITY_EDITOR
                if (camera.cameraType == CameraType.SceneView)
                {
                    ScriptableRenderContext.EmitWorldGeometryForSceneView(camera);
                }
#endif

                DrawCamera(context, camera, portalCamera);
            }
        }