Ver código fonte

Allow to change the size of the shadow map size

Popov72 4 anos atrás
pai
commit
186a3cc473
1 arquivos alterados com 13 adições e 0 exclusões
  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.