Example #1
0
        private void OnBeginCameraRenderingSRP(ScriptableRenderContext context, Camera cam)
        {
            ValidateMaterial();
            SubmitRenderList(cam);

            if (Profile == null)
            {
                return;
            }
            if (cam.cameraType != CameraType.Game && cam.cameraType != CameraType.SceneView)
            {
                return;
            }
            if (cam.name.EndsWith("Preview Camera"))
            {
                return;
            }
            if (ReflCameras.ContainsValue(cam))
            {
                //cam is a reflection camera
                return;
            }
            else
            {
                if (Profile.EnableReflection)
                {
                    RenderReflectionTextureSRP(context, cam);
                }
                if (Profile.EnableRefraction)
                {
                    //RenderRefractionTextureSRP(context, cam);
                }
            }
        }
Example #2
0
        private void OnWillRenderObject()
        {
            if (PCommon.CurrentRenderPipeline == PRenderPipelineType.Universal)
            {
                return;
            }

            if (Profile == null)
            {
                return;
            }

            Camera currentCam = Camera.current;

            if (currentCam == null)
            {
                return;
            }
            if (currentCam.cameraType != CameraType.Game && currentCam.cameraType != CameraType.SceneView)
            {
                return;
            }
            if (currentCam.name.EndsWith("Preview Camera"))
            {
                return;
            }
            if (ReflCameras.ContainsValue(currentCam))
            {
                return;
            }

            if (Profile.EnableReflection)
            {
                RenderReflectionTexture(currentCam);
            }
        }