Skip to content

Commit

Permalink
[Fix] Adding early out for clustered lights to fix performance regres…
Browse files Browse the repository at this point in the history
…sion (#5088)

Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
  • Loading branch information
mvaligursky and Martin Valigursky committed Feb 22, 2023
1 parent 1872467 commit 2f2ccec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/scene/shader-lib/chunks/lit/frag/clusteredLight.js
Expand Up @@ -594,6 +594,10 @@ void addClusteredLights() {
// using a single channel texture with data in alpha channel
float lightIndex = texelFetch(clusterWorldTexture, ivec2(int(clusterU) + lightCellIndex, clusterV), 0).x;
if (lightIndex <= 0.0)
return;
evaluateClusterLight(lightIndex * 255.0);
}
Expand Down

0 comments on commit 2f2ccec

Please sign in to comment.