Exemple #1
0
        private void InitCascadeTextures(int cascadeResolution)
        {
            DestroyCascadeTextures();

            m_cascadeShadowmapArray = MyRwTextures.CreateShadowmapArray(cascadeResolution, cascadeResolution,
                                                                        m_initializedShadowCascadesCount, Format.R24G8_Typeless, Format.D24_UNorm_S8_UInt, Format.R24_UNorm_X8_Typeless, "Cascades shadowmaps");
            m_cascadeShadowmapBackup = MyRwTextures.CreateShadowmapArray(cascadeResolution, cascadeResolution,
                                                                         m_initializedShadowCascadesCount, Format.R24G8_Typeless, Format.D24_UNorm_S8_UInt, Format.R24_UNorm_X8_Typeless, "Cascades shadowmaps backup");

            if (m_cascadesReferenceCount == 0 && MyScene.SeparateGeometry)
            {
                m_combinedShadowmapArray = MyRwTextures.CreateRenderTargetArray(cascadeResolution, cascadeResolution,
                                                                                m_initializedShadowCascadesCount, Format.R32_Float, Format.R32_Float, "Combined shadowmaps");
            }

            ++m_cascadesReferenceCount;
        }
        private void InitCascadeTextures(int cascadeResolution)
        {
            DestroyCascadeTextures();

            MyRender11.Log.WriteLine("InitCascadeTextures: " + m_cascadesReferenceCount + " / " + MyScene.SeparateGeometry);
            m_cascadeShadowmapArray = MyRwTextures.CreateShadowmapArray(cascadeResolution, cascadeResolution,
                                                                        m_initializedShadowCascadesCount, Format.R32_Typeless, Format.D32_Float, Format.R32_Float, "Cascades shadowmaps");
            m_cascadeShadowmapBackup = MyRwTextures.CreateShadowmapArray(cascadeResolution, cascadeResolution,
                                                                         m_initializedShadowCascadesCount, Format.R32_Typeless, Format.D32_Float, Format.R32_Float, "Cascades shadowmaps backup");

            if (m_cascadesReferenceCount == 0 && MyScene.SeparateGeometry)
            {
                MyRender11.Log.WriteLine("InitCascadeTextures m_combinedShadowmapArray");
                m_combinedShadowmapArray = MyRwTextures.CreateRenderTargetArray(cascadeResolution, cascadeResolution,
                                                                                m_initializedShadowCascadesCount, Format.R32_Float, Format.R32_Float, "Combined shadowmaps");
            }

            ++m_cascadesReferenceCount;
        }