Exemplo n.º 1
0
        void EvaluateShadowDebugView(CommandBuffer cmd, HDCamera hdCamera)
        {
            // If this is the right debug mode and the index we are asking for is in the range
            HDRenderPipeline hdrp = (RenderPipelineManager.currentPipeline as HDRenderPipeline);

            if (FullScreenDebugMode.ScreenSpaceShadows == hdrp.m_CurrentDebugDisplaySettings.data.fullScreenDebugMode)
            {
                if (!hdrp.rayTracingSupported || (m_ScreenSpaceShadowChannelSlot <= hdrp.m_CurrentDebugDisplaySettings.data.screenSpaceShadowIndex))
                {
                    // In this case we have not rendered any screenspace shadows, so push a black texture on the debug display
                    hdrp.PushFullScreenDebugTexture(hdCamera, cmd, TextureXR.GetBlackTextureArray(), FullScreenDebugMode.ScreenSpaceShadows);
                    return;
                }

                // Fetch the buffer where we we will store our result
                RTHandle debugResultBuffer = GetRayTracingBuffer(InternalRayTracingBuffers.RGBA0);

                // Generate the debug view
                SSShadowDebugParameters sssdParams    = PrepareSSShadowDebugParameters(hdCamera, (int)hdrp.m_CurrentDebugDisplaySettings.data.screenSpaceShadowIndex);
                SSShadowDebugResources  sssdResources = PrepareSSShadowDebugResources(debugResultBuffer);
                ExecuteShadowDebugView(cmd, sssdParams, sssdResources);

                // Push the full screen debug texture
                hdrp.PushFullScreenDebugTexture(hdCamera, cmd, debugResultBuffer, FullScreenDebugMode.ScreenSpaceShadows);
            }
        }
        internal void InitializeForRendering(RenderGraph renderGraph)
        {
            blackTexture = renderGraph.ImportTexture(m_BlackTexture2D);
            whiteTexture = renderGraph.ImportTexture(m_WhiteTexture2D);

            clearTextureXR      = renderGraph.ImportTexture(TextureXR.GetClearTexture());
            magentaTextureXR    = renderGraph.ImportTexture(TextureXR.GetMagentaTexture());
            blackTextureXR      = renderGraph.ImportTexture(TextureXR.GetBlackTexture());
            blackTextureArrayXR = renderGraph.ImportTexture(TextureXR.GetBlackTextureArray());
            blackUIntTextureXR  = renderGraph.ImportTexture(TextureXR.GetBlackUIntTexture());
            blackTexture3DXR    = renderGraph.ImportTexture(TextureXR.GetBlackTexture3D());
            whiteTextureXR      = renderGraph.ImportTexture(TextureXR.GetWhiteTexture());
        }
Exemplo n.º 3
0
 void BindBlackShadowTexture(CommandBuffer cmd)
 {
     // We always need to bind an array here.
     cmd.SetGlobalTexture(HDShaderIDs._ScreenSpaceShadowsTexture, TextureXR.GetBlackTextureArray());
 }