Ver código fonte

function name resolved.

Bug fixed for texture projection and name fixed.
lostink 7 anos atrás
pai
commit
d05773426a

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

@@ -385,7 +385,7 @@ module BABYLON {
             return b.renderPriority - a.renderPriority;
         }
         // Projection texture, if needed
-        protected computeTextureMatrix(): void{
+        protected _computeTextureMatrix(): void{
             //Leave out for different light type
         }
         protected _light_far  :number;
@@ -401,7 +401,7 @@ module BABYLON {
          */
         public set light_far(value: number) {
             this._light_far = value;
-            this.computeTextureMatrix();
+            this._computeTextureMatrix();
         }
 
         protected _light_near :number;
@@ -417,7 +417,7 @@ module BABYLON {
          */
         public set light_near(value: number) {
             this._light_near = value;
-            this.computeTextureMatrix();
+            this._computeTextureMatrix();
         }
 
         @serializeAsTexture("projectedLightTexture")
@@ -433,9 +433,9 @@ module BABYLON {
         */
         public set projectedLightTexture(value: Nullable<BaseTexture>) {
             this._projectedLightTexture = value;
-            this.light_far = 1000.0;
-            this.light_near = 1e-7;
-            this.computeTextureMatrix();
+            this._light_far = 1000.0;
+            this._light_near = 1e-6;
+            this._computeTextureMatrix();
         }
         /**
          * Disposes the light.  

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

@@ -20,7 +20,7 @@
         /**
          * Main function for light texture projection matrix computing.
          */
-        public computeTextureMatrix(): void{    
+        protected _computeTextureMatrix(): void{    
 
             var viewLightMatrix = Matrix.Zero();
             Matrix.LookAtLHToRef(this.position, this.position.add(this.direction), Vector3.Up(), viewLightMatrix);

+ 5 - 2
src/Materials/babylon.materialHelper.ts

@@ -206,7 +206,7 @@ module BABYLON {
                         defines["LIGHTMAPEXCLUDED" + lightIndex] = false;
                         defines["LIGHTMAPNOSPECULAR" + lightIndex] = false;
                     }
-
+
                     //Projection texture
                     if (light.projectedLightTexture){
                         defines["PROJECTEDLIGHTTEXTURE" + lightIndex] = true;
@@ -290,9 +290,12 @@ module BABYLON {
                     uniformBuffersList.push("Light" + lightIndex);
                 }
 
-                samplersList.push("shadowSampler" + lightIndex);
+                samplersList.push("shadowSampler" + lightIndex);
                 if (defines["PROJECTEDLIGHTTEXTURE" + lightIndex]){
                     samplersList.push("projectionLightSampler" + lightIndex,);
+                    uniformsList.push(
+                        "textureProjectionMatrix" + lightIndex,
+                    );
                 }
             }