Skip to content

Commit 202f61b

Browse files
authored
changing affectDynamic updates lighting (playcanvas#2894)
1 parent 4db1186 commit 202f61b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/framework/components/light/component.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ function _defineProps() {
432432
} else {
433433
this.light.mask &= ~MASK_DYNAMIC;
434434
}
435+
this.light.layersDirty();
435436
});
436437
_defineProperty("affectLightmapped", false, function (newValue, oldValue) {
437438
if (newValue) {

src/scene/light.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ class Light {
281281
}
282282
}
283283

284+
layersDirty() {
285+
this._scene.layers._dirtyLights = true;
286+
}
287+
284288
updateKey() {
285289
// Key definition:
286290
// Bit
@@ -315,7 +319,7 @@ class Light {
315319
}
316320

317321
if (key !== this.key && this._scene !== null) {
318-
this._scene.layers._dirtyLights = true;
322+
this.layersDirty();
319323
}
320324

321325
this.key = key;

0 commit comments

Comments
 (0)