David Catuhe 8 سال پیش
والد
کامیت
fe72fd0b59

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 17 - 17
dist/preview release/babylon.core.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 2448 - 2435
dist/preview release/babylon.d.ts


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 17 - 17
dist/preview release/babylon.js


+ 25 - 2
dist/preview release/babylon.max.js

@@ -14206,6 +14206,12 @@ var BABYLON;
             return BABYLON.Vector3.Zero();
         };
         /**
+         * Return the depth scale used for the shadow map.
+         */
+        PointLight.prototype.getDepthScale = function () {
+            return 30.0;
+        };
+        /**
          * Sets the passed matrix "matrix" as a left-handed perspective projection matrix with the following settings :
          * - fov = PI / 2
          * - aspect ratio : 1.0
@@ -14292,6 +14298,12 @@ var BABYLON;
             return this.transformedPosition ? this.transformedPosition : this.position;
         };
         /**
+         * Return the depth scale used for the shadow map.
+         */
+        SpotLight.prototype.getDepthScale = function () {
+            return 30.0;
+        };
+        /**
          * Sets the passed matrix "matrix" as perspective projection matrix for the shadows and the passed view matrix with the fov equal to the SpotLight angle and and aspect ratio of 1.0.
          * Returns the SpotLight.
          */
@@ -14538,6 +14550,12 @@ var BABYLON;
             return this.direction;
         };
         /**
+         * Return the depth scale used for the shadow map.
+         */
+        DirectionalLight.prototype.getDepthScale = function () {
+            return 30.0;
+        };
+        /**
          * Sets the passed matrix "matrix" as projection matrix for the shadows cast by the light according to the passed view matrix.
          * Returns the DirectionalLight.
          */
@@ -14688,7 +14706,6 @@ var BABYLON;
             this._blurBoxOffset = 0;
             this._bias = 0.00005;
             this._lightDirection = BABYLON.Vector3.Zero();
-            this._depthScale = 30.0;
             this.forceBackFacesOnly = false;
             this._darkness = 0;
             this._transparencyShadow = false;
@@ -14881,7 +14898,7 @@ var BABYLON;
         });
         Object.defineProperty(ShadowGenerator.prototype, "depthScale", {
             get: function () {
-                return this._depthScale;
+                return this._depthScale !== undefined ? this._depthScale : this._light.getDepthScale();
             },
             set: function (value) {
                 this._depthScale = value;
@@ -15170,6 +15187,12 @@ var BABYLON;
             else if (parsedShadowGenerator.useBlurExponentialShadowMap) {
                 shadowGenerator.useBlurExponentialShadowMap = true;
             }
+            else if (parsedShadowGenerator.useVarianceShadowMap) {
+                shadowGenerator.useExponentialShadowMap = true;
+            }
+            else if (parsedShadowGenerator.useBlurVarianceShadowMap) {
+                shadowGenerator.useBlurExponentialShadowMap = true;
+            }
             if (parsedShadowGenerator.blurScale) {
                 shadowGenerator.blurScale = parsedShadowGenerator.blurScale;
             }

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 2448 - 2435
dist/preview release/babylon.module.d.ts


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 17 - 17
dist/preview release/babylon.noworker.js


+ 2 - 2
src/Lights/Shadows/babylon.shadowGenerator.ts

@@ -34,7 +34,7 @@
         private _blurBoxOffset = 0;
         private _bias = 0.00005;
         private _lightDirection = Vector3.Zero();
-        private _depthScale = 30.0;
+        private _depthScale: number;
 
         public forceBackFacesOnly = false;
 
@@ -77,7 +77,7 @@
         }
 
         public get depthScale(): number {
-            return this._depthScale;
+            return this._depthScale !== undefined ? this._depthScale : this._light.getDepthScale();
         }
 
         public set depthScale(value: number) {

+ 7 - 0
src/Lights/babylon.directionalLight.ts

@@ -64,6 +64,13 @@ module BABYLON {
         }
 
         /**
+         * Return the depth scale used for the shadow map.
+         */
+        public getDepthScale(): number {
+            return 30.0;
+        }
+
+        /**
          * Sets the passed matrix "matrix" as projection matrix for the shadows cast by the light according to the passed view matrix.  
          * Returns the DirectionalLight.  
          */

+ 1 - 1
src/Lights/babylon.light.ts

@@ -13,7 +13,7 @@
 
         customProjectionMatrixBuilder: (viewMatrix: Matrix, renderList: Array<AbstractMesh>, result: Matrix) => void;
         setShadowProjectionMatrix(matrix: Matrix, viewMatrix: Matrix, renderList: Array<AbstractMesh>): void;
-        
+        getDepthScale(): number;
 
         needRefreshPerFrame(): boolean;
         needCube(): boolean;

+ 7 - 0
src/Lights/babylon.pointLight.ts

@@ -109,6 +109,13 @@
 
             return Vector3.Zero();
         }
+        
+        /**
+         * Return the depth scale used for the shadow map.
+         */
+        public getDepthScale(): number {
+            return 30.0;
+        }
 
         /**
          * Sets the passed matrix "matrix" as a left-handed perspective projection matrix with the following settings : 

+ 7 - 0
src/Lights/babylon.spotLight.ts

@@ -56,6 +56,13 @@
         }
 
         /**
+         * Return the depth scale used for the shadow map.
+         */
+        public getDepthScale(): number {
+            return 30.0;
+        }
+        
+        /**
          * Sets the passed matrix "matrix" as perspective projection matrix for the shadows and the passed view matrix with the fov equal to the SpotLight angle and and aspect ratio of 1.0.  
          * Returns the SpotLight.  
          */