Selaa lähdekoodia

Allow to change the size of the shadow map size

Popov72 4 vuotta sitten
vanhempi
commit
186a3cc473
1 muutettua tiedostoa jossa 13 lisäystä ja 0 poistoa
  1. 13 0
      src/Lights/Shadows/shadowGenerator.ts

+ 13 - 0
src/Lights/Shadows/shadowGenerator.ts

@@ -808,6 +808,19 @@ export class ShadowGenerator implements IShadowGenerator {
     }
 
     /**
+     * Gets or sets the size of the texture what stores the shadows
+     */
+    public get mapSize(): number {
+        return this._mapSize;
+    }
+
+    public set mapSize(size: number) {
+        this._mapSize = size;
+        this._light._markMeshesAsLightDirty();
+        this.recreateShadowMap();
+    }
+
+    /**
      * Creates a ShadowGenerator object.
      * A ShadowGenerator is the required tool to use the shadows.
      * Each light casting shadows needs to use its own ShadowGenerator.