Skip to content

Commit

Permalink
Merge branch 'main_v1' into release-1.74
Browse files Browse the repository at this point in the history
  • Loading branch information
marklundin committed Sep 17, 2024
2 parents f7fa3ef + f268583 commit 794058f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion examples/src/examples/graphics/lights-baked.example.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ for (let i = 0; i < 40; i++) {
const ground = new pc.Entity();
ground.addComponent('render', {
castShadows: false,
castShadowsLightmap: false,
lightmapped: true,
type: 'plane',
material: material
Expand Down
2 changes: 1 addition & 1 deletion src/framework/lightmapper/bake-light.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class BakeLight {

if (this.scene.clusteredLightingEnabled) {
// if clustered shadows are disabled, disable them on the light
light.castShadows = light.castShadows && lightingParams.shadowsEnabled;
light.castShadows = light.bakeShadows && lightingParams.shadowsEnabled;
}

// bounds for non-directional light
Expand Down
4 changes: 4 additions & 0 deletions src/scene/light.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,10 @@ class Light {
return this._castShadows && this._mask !== MASK_BAKE && this._mask !== 0;
}

get bakeShadows() {
return this._castShadows && this._mask === MASK_BAKE;
}

set shadowResolution(value) {
if (this._shadowResolution !== value) {
if (this._type === LIGHTTYPE_OMNI) {
Expand Down

0 comments on commit 794058f

Please sign in to comment.