Quellcode durchsuchen

updated standardmaterial

Benjamin Guignabert vor 8 Jahren
Ursprung
Commit
5b8cafbd9f
4 geänderte Dateien mit 10950 neuen und 10949 gelöschten Zeilen
  1. 5472 5472
      dist/preview release/babylon.d.ts
  2. 5472 5472
      dist/preview release/babylon.module.d.ts
  3. 1 0
      index.html
  4. 5 5
      src/Materials/babylon.standardMaterial.ts

Datei-Diff unterdrückt, da er zu groß ist
+ 5472 - 5472
dist/preview release/babylon.d.ts


Datei-Diff unterdrückt, da er zu groß ist
+ 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++;
 							});
 

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

@@ -887,6 +887,11 @@ 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();
@@ -957,11 +962,6 @@ module BABYLON {
                 this._effect.setVector3("vEyePosition", scene._mirroredCameraPosition ? scene._mirroredCameraPosition : scene.activeCamera.position);
                 this._effect.setColor3("vAmbientColor", this._globalAmbientColor);
 
-                // Lights
-                if (scene.lightsEnabled && !this.disableLighting) {
-                    MaterialHelper.BindLights(scene, mesh, this._effect, this._defines, this.maxSimultaneousLights);
-                }
-
                 // View
                 if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== Scene.FOGMODE_NONE || this.reflectionTexture || this.refractionTexture) {
                     this._effect.setMatrix("view", scene.getViewMatrix());