Example #1
0
        void RenderForward(CullResults cullResults, Camera camera, ScriptableRenderContext renderContext, bool renderOpaque)
        {
            // TODO: Currently we can't render opaque object forward when deferred is enabled
            // miss option
            if (!debugParameters.ShouldUseForwardRenderingOnly() && renderOpaque)
            {
                return;
            }

            using (new Utilities.ProfilingSample("Forward Pass", renderContext))
            {
                Utilities.SetRenderTarget(renderContext, m_CameraColorBufferRT, m_CameraDepthStencilBufferRT);

                if (m_LightLoop != null)
                {
                    m_LightLoop.RenderForward(camera, renderContext, renderOpaque);
                }

                if (renderOpaque)
                {
                    RenderOpaqueRenderList(cullResults, camera, renderContext, "Forward", Utilities.kRendererConfigurationBakedLighting);
                }
                else
                {
                    RenderTransparentRenderList(cullResults, camera, renderContext, "Forward", Utilities.kRendererConfigurationBakedLighting);
                }
            }
        }
Example #2
0
        void RenderForward(CullResults cullResults, Camera camera, ScriptableRenderContext renderContext, bool renderOpaque)
        {
            // TODO: Currently we can't render opaque object forward when deferred is enabled
            // miss option
            if (!m_Owner.renderingSettings.ShouldUseForwardRenderingOnly() && renderOpaque)
            {
                return;
            }

            using (new Utilities.ProfilingSample("Forward Pass", renderContext))
            {
                Utilities.SetRenderTarget(renderContext, m_CameraColorBufferRT, m_CameraDepthStencilBufferRT);

                if (m_LightLoop != null)
                {
                    m_LightLoop.RenderForward(camera, renderContext, renderOpaque);
                }

                bool debugLighting = globalDebugSettings.lightingDebugSettings.lightingDebugMode != LightingDebugMode.None;

                string forwardPassName = debugLighting ? "ForwardDebugLighting" : "Forward";
                if (renderOpaque)
                {
                    RenderOpaqueRenderList(cullResults, camera, renderContext, forwardPassName, Utilities.kRendererConfigurationBakedLighting);
                }
                else
                {
                    RenderTransparentRenderList(cullResults, camera, renderContext, forwardPassName, Utilities.kRendererConfigurationBakedLighting);
                }
            }
        }