Add ViewFlags::Sky for conditional sky/skybox rendering

This commit is contained in:
Wojtek Figat
2023-01-31 15:58:02 +01:00
parent b93e97dd76
commit a0c6add732
8 changed files with 19 additions and 11 deletions

View File

@@ -81,7 +81,7 @@ void Sky::InitConfig(AtmosphericFogData& config) const
void Sky::Draw(RenderContext& renderContext)
{
if (HasContentLoaded())
if (HasContentLoaded() && EnumHasAnyFlags(renderContext.View.Flags, ViewFlags::Sky))
{
// Ensure to have pipeline state cache created
if (_psSky == nullptr || _psFog == nullptr)

View File

@@ -40,7 +40,7 @@ void Skybox::Draw(RenderContext& renderContext)
setupProxy();
isReady = _proxyMaterial && _proxyMaterial->IsReady();
}
if (isReady)
if (isReady && EnumHasAnyFlags(renderContext.View.Flags, ViewFlags::Sky))
{
renderContext.List->Sky = this;
}