Skip to content

Commit

Permalink
[Fix] Correctly handle VSM not being supported by cluseted lighting (#…
Browse files Browse the repository at this point in the history
…7184)

Co-authored-by: Martin Valigursky <[email protected]>
  • Loading branch information
2 people authored and slimbuck committed Dec 9, 2024
1 parent 29a8a0c commit a462235
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/scene/shader-lib/programs/lit-shader.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,6 @@ class LitShader {

const lightType = this.shaderPassInfo.lightType;
let shadowType = this.shaderPassInfo.shadowType;
const shadowInfo = shadowTypeInfo.get(shadowType);
Debug.assert(shadowInfo);
const isVsm = shadowInfo?.vsm ?? false;

// If not a directional light and using clustered, fall back to using PCF3x3 if shadow type isn't supported
if (lightType !== LIGHTTYPE_DIRECTIONAL && options.clusteredLightingEnabled) {
Expand All @@ -441,6 +438,10 @@ class LitShader {
}
}

const shadowInfo = shadowTypeInfo.get(shadowType);
Debug.assert(shadowInfo);
const isVsm = shadowInfo?.vsm ?? false;

let code = this._fsGetBeginCode();

if (shadowType === SHADOW_VSM_32F) {
Expand Down

0 comments on commit a462235

Please sign in to comment.