Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Correctly handle VSM not being supported by clustered lighting #7184

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading