瀏覽代碼

light are now static by default

Benjamin Guignabert 8 年之前
父節點
當前提交
92827d009d
共有 4 個文件被更改,包括 12839 次插入12839 次删除
  1. 6415 6415
      dist/preview release/babylon.d.ts
  2. 6415 6415
      dist/preview release/babylon.module.d.ts
  3. 8 8
      index.html
  4. 1 1
      src/Lights/babylon.light.ts

文件差異過大導致無法顯示
+ 6415 - 6415
dist/preview release/babylon.d.ts


文件差異過大導致無法顯示
+ 6415 - 6415
dist/preview release/babylon.module.d.ts


+ 8 - 8
index.html

@@ -58,25 +58,25 @@
 					var spheres = []
 					for (var i = 0; i < squareSize; i++) {
 						for (var j = 0; j < squareSize; j++) {
-							for (var k = 0; k < 5; k++) {
+							for (var k = 0; k < 3; k++) {
 								var sphere = BABYLON.Mesh.CreateSphere("sphere", 4, 0.5, scene);
 
 								// Move the sphere upward 1/2 its height
 								sphere.position.z = - squareSize / 4 + j / 2;
 								sphere.position.x = - squareSize / 4 + i / 2;
 								sphere.position.y = - squareSize / 4 + k / 2;
-								if (j === 0) {
 									sphere.material = new BABYLON.StandardMaterial("test");
-									// sphere.material.diffuseTexture = new BABYLON.Texture("test.jpeg", scene);
-									// sphere.material.bumpTexture = new BABYLON.Texture("test.jpeg", scene);
+									if (Math.random() > 0.2) {
+										sphere.material.diffuseTexture = new BABYLON.Texture("test.jpeg", scene);
+									}
+									if (Math.random() > 0.2) {
+										sphere.material.bumpTexture = new BABYLON.Texture("test.jpeg", scene);
+									}
 									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();
-								}
-								else {
-									sphere.material = spheres[0].material;
-								}
+
 								sphere.freezeWorldMatrix();
 								spheres.push(sphere);
 							}

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

@@ -145,7 +145,7 @@
         constructor(name: string, scene: Scene) {
             super(name, scene);
             this.getScene().addLight(this);
-            this._uniformBuffer = new UniformBuffer(scene.getEngine(), null, true);
+            this._uniformBuffer = new UniformBuffer(scene.getEngine());
             this._buildUniformLayout();
 
             this.includedOnlyMeshes = new Array<AbstractMesh>();