Esempio n. 1
0
        public static HDCamera GetRenderHDCamera(PlanarReflectionProbe probe)
        {
            var camera = GetRenderCamera();

            probe.frameSettings.CopyTo(s_RenderCameraData.GetFrameSettings());

            return(HDCamera.Get(camera, null, probe.frameSettings));
        }
Esempio n. 2
0
        static void SetupFrameSettings(HDAdditionalCameraData additionalData, HDProbe probe)
        {
            HDRenderPipelineAsset hdrp = GraphicsSettings.renderPipelineAsset as HDRenderPipelineAsset;

            if (probe.mode == ReflectionProbeMode.Realtime)
            {
                hdrp.GetRealtimeReflectionFrameSettings().CopyTo(additionalData.GetFrameSettings());
            }
            else
            {
                hdrp.GetBakedOrCustomReflectionFrameSettings().CopyTo(additionalData.GetFrameSettings());
            }
            if (probe.captureSettings.renderingPath == HDAdditionalCameraData.RenderingPath.Custom)
            {
                probe.frameSettings.Override(additionalData.GetFrameSettings()).CopyTo(additionalData.GetFrameSettings());
            }
        }
Esempio n. 3
0
        void OnEnable()
        {
            m_SerializedCamera = new SerializedHDCamera(serializedObject);
            m_UIState.Reset(m_SerializedCamera, Repaint);

            m_PreviewCamera = EditorUtility.CreateGameObjectWithHideFlags("Preview Camera", HideFlags.HideAndDontSave, typeof(Camera)).GetComponent <Camera>();
            m_PreviewAdditionalCameraData = m_PreviewCamera.gameObject.AddComponent <HDAdditionalCameraData>();
            m_PreviewPostProcessLayer     = m_PreviewCamera.gameObject.AddComponent <PostProcessLayer>();
            m_PreviewCamera.enabled       = false;
            m_PreviewHDCamera             = new HDCamera(m_PreviewCamera);
            m_PreviewHDCamera.Update(m_PreviewPostProcessLayer, m_PreviewAdditionalCameraData.GetFrameSettings());
        }
Esempio n. 4
0
        public void Render(PlanarReflectionProbe probe, RenderTexture target, Camera viewerCamera = null)
        {
            var renderCamera = GetRenderCamera();

            // Copy current frameSettings of this probe to the HDAdditionalData of the render camera
            probe.frameSettings.CopyTo(s_RenderCameraData.GetFrameSettings());

            renderCamera.targetTexture = target;

            SetupCameraForRender(renderCamera, probe, viewerCamera);
            GL.invertCulling = IsProbeCaptureMirrored(probe, viewerCamera);
            renderCamera.Render();
            GL.invertCulling           = false;
            renderCamera.targetTexture = null;
            target.IncrementUpdateCount();
        }
Esempio n. 5
0
        public static HDCamera GetRenderHDCamera(PlanarReflectionProbe probe)
        {
            var camera = GetRenderCamera();

            probe.frameSettings.CopyTo(s_RenderCameraData.GetFrameSettings());

            var hdCamera = HDCamera.Get(camera);

            if (hdCamera == null)
            {
                // Warning: this is a bad design pattern.
                // An individual system should not create an HDCamera (which is a shared resource).
                hdCamera = HDCamera.Create(camera, null);
            }

            hdCamera.Update(probe.frameSettings, null, null);

            return(hdCamera);
        }