소스 검색

Fixing an issue with flat shaded multimat meshes

David Catuhe 11 년 전
부모
커밋
95470694ae
5개의 변경된 파일19개의 추가작업 그리고 12개의 파일을 삭제
  1. 4 3
      Babylon/Loading/Plugins/babylon.babylonFileLoader.js
  2. 4 1
      Babylon/babylon.scene.js
  3. 4 1
      Babylon/babylon.scene.ts
  4. 2 2
      babylon.1.13-beta-debug.js
  5. 5 5
      babylon.1.13-beta.js

+ 4 - 3
Babylon/Loading/Plugins/babylon.babylonFileLoader.js

@@ -823,15 +823,16 @@ var BABYLON = BABYLON || {};
             }
         }
 
-        // Update
-        mesh.computeWorldMatrix(true);
-
         // Flat shading
         if (mesh._shouldGenerateFlatShading) {
             mesh.convertToFlatShadedMesh();
             delete mesh._shouldGenerateFlatShading;
         }
 
+        // Update
+        mesh.computeWorldMatrix(true);
+
+        // Octree
         if (scene._selectionOctree) {
             scene._selectionOctree.addMesh(mesh);
         }

+ 4 - 1
Babylon/babylon.scene.js

@@ -895,7 +895,7 @@
             }
 
             // Animations
-            var deltaTime = Math.max(1.0, Math.min(BABYLON.Tools.GetDeltaTime(), 1000.0));
+            var deltaTime = Math.max(Scene.MinDeltaTime, Math.min(BABYLON.Tools.GetDeltaTime(), Scene.MaxDeltaTime));
             this._animationRatio = deltaTime * (60.0 / 1000.0);
             this._animate();
 
@@ -1295,6 +1295,9 @@
         Scene.FOGMODE_EXP = 1;
         Scene.FOGMODE_EXP2 = 2;
         Scene.FOGMODE_LINEAR = 3;
+
+        Scene.MinDeltaTime = 1.0;
+        Scene.MaxDeltaTime = 1000.0;
         return Scene;
     })();
     BABYLON.Scene = Scene;

+ 4 - 1
Babylon/babylon.scene.ts

@@ -10,6 +10,9 @@
         public static FOGMODE_EXP2 = 2;
         public static FOGMODE_LINEAR = 3;
 
+        public static MinDeltaTime = 1.0;
+        public static MaxDeltaTime = 1000.0;
+
         // Members
         public autoClear = true;
         public clearColor = new BABYLON.Color3(0.2, 0.2, 0.3);
@@ -962,7 +965,7 @@
             }
 
             // Animations
-            var deltaTime = Math.max(1.0, Math.min(BABYLON.Tools.GetDeltaTime(), 1000.0));
+            var deltaTime = Math.max(Scene.MinDeltaTime, Math.min(BABYLON.Tools.GetDeltaTime(), Scene.MaxDeltaTime));
             this._animationRatio = deltaTime * (60.0 / 1000.0);
             this._animate();
 

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2 - 2
babylon.1.13-beta-debug.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 5 - 5
babylon.1.13-beta.js