Benjamin Guignabert 8 jaren geleden
bovenliggende
commit
a98fccda9a
4 gewijzigde bestanden met toevoegingen van 13012 en 13009 verwijderingen
  1. 6502 6502
      dist/preview release/babylon.d.ts
  2. 6502 6502
      dist/preview release/babylon.module.d.ts
  3. 3 1
      index.html
  4. 5 4
      src/Materials/babylon.standardMaterial.ts

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


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


+ 3 - 1
index.html

@@ -58,7 +58,7 @@
 					var spheres = []
 					for (var i = 0; i < squareSize; i++) {
 						for (var j = 0; j < squareSize; j++) {
-							for (var k = 0; k < 3; k++) {
+							for (var k = 0; k < 4; k++) {
 								var sphere = BABYLON.Mesh.CreateSphere("sphere", 16, 0.5, scene);
 
 								// Move the sphere upward 1/2 its height
@@ -67,8 +67,10 @@
 								sphere.position.y = - squareSize / 4 + k / 2;
 								sphere.material = new BABYLON.StandardMaterial("test");
 								sphere.material.diffuseColor = new BABYLON.Color3(Math.random(), Math.random(), Math.random());
+								sphere.material.specularColor = new BABYLON.Color3(Math.random() < 0.8 ? 0 : 1, Math.random() < 0.8 ? 0 : 1, Math.random() < 0.8 ? 0 : 1);
 								sphere.material.emissiveColor = new BABYLON.Color3(0, 0, 0);
 								sphere.material.freeze();
+								sphere.freezeWorldMatrix();
 								spheres.push(sphere);
 							}
 						}

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

@@ -888,10 +888,6 @@ module BABYLON {
                 // Diffuse
                 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();
@@ -967,6 +963,11 @@ module BABYLON {
                     this._effect.setMatrix("view", scene.getViewMatrix());
                 }
 
+                // Lights
+                if (scene.lightsEnabled && !this.disableLighting) {
+                    MaterialHelper.BindLights(scene, mesh, this._effect, this._defines, this.maxSimultaneousLights);
+                }
+
                 // Fog
                 MaterialHelper.BindFogParameters(scene, mesh, this._effect);