Skip to content

Commit bd35ecb

Browse files
mvaligurskyMartin Valigursky
andauthored
Fix to Lightmapper’s ambient baking when clustered lighting is enabled (#7433)
Co-authored-by: Martin Valigursky <[email protected]>
1 parent e547bbd commit bd35ecb

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

examples/src/examples/graphics/lights-baked-a-o.example.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// @config WEBGPU_DISABLED
21
import { data } from 'examples/observer';
32
import { deviceType, rootPath } from 'examples/utils';
43
import * as pc from 'playcanvas';

examples/src/examples/graphics/lights-baked.example.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// @config WEBGPU_DISABLED
21
import { deviceType, rootPath } from 'examples/utils';
32
import * as pc from 'playcanvas';
43

src/framework/lightmapper/bake-light.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ class BakeLight {
1919
// don't use cascades
2020
light.numCascades = 1;
2121

22-
if (this.scene.clusteredLightingEnabled) {
23-
// if clustered shadows are disabled, disable them on the light
24-
light.castShadows = light.bakeShadows && lightingParams.shadowsEnabled;
22+
// if clustered shadows are disabled, disable them on the light
23+
if (this.scene.clusteredLightingEnabled && !lightingParams.shadowsEnabled) {
24+
light.castShadows = false;
2525
}
2626

2727
// bounds for non-directional light

0 commit comments

Comments
 (0)