فهرست منبع

Fixing an issue with flat shaded multimat meshes

David Catuhe 11 سال پیش
والد
کامیت
95470694ae

+ 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