internal static void UpdateEnvironmentProbes() { if (MyRender11.IsIntelBrokenCubemapsWorkaround) { return; } if (m_cubemapDepth == RwTexId.NULL) { m_cubemapDepth = MyRwTextures.CreateShadowmapArray(256, 256, 6, Format.R24G8_Typeless, Format.D24_UNorm_S8_UInt, Format.R24_UNorm_X8_Typeless); } if (m_envProbe.cubemapPrefiltered == RwTexId.NULL) { m_envProbe.cubemapPrefiltered = MyRwTextures.CreateCubemap(256, Format.R16G16B16A16_Float, "environment prefitlered probe"); m_envProbe.workCubemap = MyRwTextures.CreateCubemap(256, Format.R16G16B16A16_Float, "environment probe"); m_envProbe.workCubemapPrefiltered = MyRwTextures.CreateCubemap(256, Format.R16G16B16A16_Float, "environment prefitlered probe"); m_envProbe.prevWorkCubemapPrefiltered = MyRwTextures.CreateCubemap(256, Format.R16G16B16A16_Float, "environment prefitlered probe"); m_envProbe.ImmediateProbe(); } else { m_envProbe.StepUpdateProbe(); } }
internal static void UpdateEnvironmentProbes(MyCullQuery cullQuery) { if (MyRender11.IsIntelBrokenCubemapsWorkaround) { return; } if (m_cubemapDepth == RwTexId.NULL) { m_cubemapDepth = MyRwTextures.CreateShadowmapArray(MyEnvironmentProbe.CubeMapResolution, MyEnvironmentProbe.CubeMapResolution, 6, Format.R24G8_Typeless, Format.D24_UNorm_S8_UInt, Format.R24_UNorm_X8_Typeless); } if (Instance.cubemapPrefiltered == RwTexId.NULL) { Instance.cubemapPrefiltered = MyRwTextures.CreateCubemap(MyEnvironmentProbe.CubeMapResolution, Format.R16G16B16A16_Float, "Environment Prefiltered Probe"); Instance.workCubemap = MyRwTextures.CreateCubemap(MyEnvironmentProbe.CubeMapResolution, Format.R16G16B16A16_Float, "Environment Probe"); Instance.workCubemapPrefiltered = MyRwTextures.CreateCubemap(MyEnvironmentProbe.CubeMapResolution, Format.R16G16B16A16_Float, "Environment Prefiltered Probe"); Instance.prevWorkCubemapPrefiltered = MyRwTextures.CreateCubemap(MyEnvironmentProbe.CubeMapResolution, Format.R16G16B16A16_Float, "Environment Prefiltered Probe"); Instance.ImmediateProbe(cullQuery); } else { Instance.StepUpdateProbe(cullQuery); } }
internal static void ResizeCascades() { if (m_cascadeShadowmapArray != RwTexId.NULL) { MyRwTextures.Destroy(m_cascadeShadowmapArray); } m_cascadeResolution = MyRender11.m_renderSettings.ShadowQuality.Resolution(); m_cascadeShadowmapArray = MyRwTextures.CreateShadowmapArray(m_cascadeResolution, m_cascadeResolution, m_cascadesNum, Format.R24G8_Typeless, Format.D24_UNorm_S8_UInt, Format.R24_UNorm_X8_Typeless, "cascades shadowmaps"); }
internal static void ResizeCascades() { if (m_cascadeShadowmapArray != RwTexId.NULL) { MyRwTextures.Destroy(m_cascadeShadowmapArray); MyRwTextures.Destroy(m_cascadeShadowmapBackup); } var cascadeResolution = MyRender11.m_renderSettings.ShadowQuality.ShadowCascadeResolution(); 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"); }
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; }