Skip to content

Commit 4038687

Browse files
committed
Fix shadow quality change
1 parent 382f00b commit 4038687

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

extensions/reviewed/SpotLight3D.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,18 @@
444444
" size = 1024;",
445445
" break;",
446446
" }",
447-
" this.spotLight.shadow.mapSize.width = size;",
448-
" this.spotLight.shadow.mapSize.height = size;",
447+
" const shadow = this.spotLight.shadow;",
448+
" const mapSize = shadow.mapSize;",
449+
" if (mapSize.width !== size) {",
450+
" mapSize.set(size, size);",
451+
"",
452+
" // Force the recreation of the shadow map texture:",
453+
" if (shadow.map) {",
454+
" shadow.map.dispose();",
455+
" shadow.map = null;",
456+
" }",
457+
" shadow.needsUpdate = true;",
458+
" }",
449459
" }",
450460
"",
451461
" /**",
@@ -669,8 +679,6 @@
669679
"//@ts-ignore",
670680
"const object = objects[0];",
671681
"",
672-
"// Here runtimeScene is the gdjs.CustomRuntimeObjectInstanceContainer inside the custom object.",
673-
"const gameScene = object.getRuntimeScene();",
674682
"const game = runtimeScene.getGame();",
675683
"",
676684
"// This is a hack that may break in future releases.",

0 commit comments

Comments
 (0)