Sfoglia il codice sorgente

updated standardmaterial

Benjamin Guignabert 8 anni fa
parent
commit
5b8cafbd9f

File diff suppressed because it is too large
+ 5472 - 5472
dist/preview release/babylon.d.ts


File diff suppressed because it is too large
+ 5472 - 5472
dist/preview release/babylon.module.d.ts


+ 1 - 0
index.html

@@ -84,6 +84,7 @@
 									// }
 									// }
 									
 									
 								}
 								}
+								light.direction = new BABYLON.Vector3(Math.cos(t / 30), 1, Math.sin(t / 30));
 									t++;
 									t++;
 							});
 							});
 
 

+ 5 - 5
src/Materials/babylon.standardMaterial.ts

@@ -887,6 +887,11 @@ module BABYLON {
 
 
                 // Diffuse
                 // Diffuse
                 this._uniformBuffer.updateColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility);
                 this._uniformBuffer.updateColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility);
+
+                // Lights
+                if (scene.lightsEnabled && !this.disableLighting) {
+                    MaterialHelper.BindLights(scene, mesh, this._effect, this._defines, this.maxSimultaneousLights);
+                }
             }
             }
             
             
             this._uniformBuffer.update();
             this._uniformBuffer.update();
@@ -957,11 +962,6 @@ module BABYLON {
                 this._effect.setVector3("vEyePosition", scene._mirroredCameraPosition ? scene._mirroredCameraPosition : scene.activeCamera.position);
                 this._effect.setVector3("vEyePosition", scene._mirroredCameraPosition ? scene._mirroredCameraPosition : scene.activeCamera.position);
                 this._effect.setColor3("vAmbientColor", this._globalAmbientColor);
                 this._effect.setColor3("vAmbientColor", this._globalAmbientColor);
 
 
-                // Lights
-                if (scene.lightsEnabled && !this.disableLighting) {
-                    MaterialHelper.BindLights(scene, mesh, this._effect, this._defines, this.maxSimultaneousLights);
-                }
-
                 // View
                 // View
                 if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== Scene.FOGMODE_NONE || this.reflectionTexture || this.refractionTexture) {
                 if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== Scene.FOGMODE_NONE || this.reflectionTexture || this.refractionTexture) {
                     this._effect.setMatrix("view", scene.getViewMatrix());
                     this._effect.setMatrix("view", scene.getViewMatrix());