Skip to content

Commit

Permalink
#5893: Don't even consider invisible materials in the collect surface…
Browse files Browse the repository at this point in the history
…s phase
  • Loading branch information
codereader committed Jan 28, 2022
1 parent 30edbc6 commit 652a314
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions radiantcore/rendersystem/backend/LightInteractions.cpp
Expand Up @@ -70,6 +70,9 @@ void LightInteractions::collectSurfaces(const std::set<IRenderEntityPtr>& entiti
// Skip empty surfaces
if (surface->getIndices().empty()) return;

// Don't collect invisible shaders
if (!shader->isVisible()) return;

auto glShader = static_cast<OpenGLShader*>(shader.get());

// We only consider materials designated for camera rendering
Expand Down Expand Up @@ -101,8 +104,6 @@ void LightInteractions::fillDepthBuffer(OpenGLState& state, RenderStateFlags glo
auto shader = pair.first;
auto& surfaceList = pair.second;

if (!shader->isVisible()) continue;

// Skip translucent materials
if (shader->getMaterial()->getCoverage() == Material::MC_TRANSLUCENT) continue;

Expand Down

0 comments on commit 652a314

Please sign in to comment.