David Catuhe 9 năm trước cách đây
mục cha
commit
e1dc9a16a1

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 24 - 24
dist/preview release/babylon.core.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 3418 - 3396
dist/preview release/babylon.d.ts


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 39 - 39
dist/preview release/babylon.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 101 - 5
dist/preview release/babylon.max.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 38 - 38
dist/preview release/babylon.noworker.js


+ 1 - 0
src/Canvas2d/babylon.prim2dBase.js

@@ -1832,6 +1832,7 @@ var BABYLON;
                 }
                 this._opacity = value;
                 this._updateRenderMode();
+                this._setFlags(BABYLON.SmartPropertyPrim.flagActualOpacityDirty);
                 this._spreadActualOpacityChanged();
             },
             enumerable: true,

+ 1 - 0
src/Canvas2d/babylon.sprite2d.js

@@ -201,6 +201,7 @@ var BABYLON;
                 else {
                     texture.onLoadObservable.add(function () {
                         _this.size = texture.getSize();
+                        _this._positioningDirty();
                     });
                 }
             }

+ 1 - 0
src/Materials/Textures/babylon.colorGradingTexture.js

@@ -199,6 +199,7 @@ var BABYLON;
             var serializationObject = {};
             serializationObject.name = this.name;
             serializationObject.level = this.level;
+            serializationObject.customType = "BABYLON.ColorGradingTexture";
             return serializationObject;
         };
         /**

+ 1 - 0
src/Materials/Textures/babylon.hdrCubeTexture.js

@@ -323,6 +323,7 @@ var BABYLON;
             serializationObject.generateHarmonics = this._generateHarmonics;
             serializationObject.usePMREMGenerator = this._usePMREMGenerator;
             serializationObject.isBABYLONPreprocessed = this._isBABYLONPreprocessed;
+            serializationObject.customType = "BABYLON.HDRCubeTexture";
             return serializationObject;
         };
         /**

+ 5 - 1
src/Materials/Textures/babylon.texture.js

@@ -213,7 +213,11 @@ var BABYLON;
                 return null;
             }
             var texture = BABYLON.SerializationHelper.Parse(function () {
-                if (parsedTexture.mirrorPlane) {
+                if (parsedTexture.customType) {
+                    var customTexture = BABYLON.Tools.Instantiate(parsedTexture.customType);
+                    return customTexture.Parse(parsedTexture, scene, rootUrl);
+                }
+                else if (parsedTexture.mirrorPlane) {
                     var mirrorTexture = new BABYLON.MirrorTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene);
                     mirrorTexture._waitingRenderList = parsedTexture.renderList;
                     mirrorTexture.mirrorPlane = BABYLON.Plane.FromArray(parsedTexture.mirrorPlane);

+ 40 - 0
src/Materials/babylon.effect.js

@@ -408,6 +408,46 @@ var BABYLON;
             }
             return changed;
         };
+        Effect.prototype.setIntArray = function (uniformName, array) {
+            this._valueCache[uniformName] = null;
+            this._engine.setIntArray(this.getUniform(uniformName), array);
+            return this;
+        };
+        Effect.prototype.setIntArray2 = function (uniformName, array) {
+            this._valueCache[uniformName] = null;
+            this._engine.setIntArray2(this.getUniform(uniformName), array);
+            return this;
+        };
+        Effect.prototype.setIntArray3 = function (uniformName, array) {
+            this._valueCache[uniformName] = null;
+            this._engine.setIntArray3(this.getUniform(uniformName), array);
+            return this;
+        };
+        Effect.prototype.setIntArray4 = function (uniformName, array) {
+            this._valueCache[uniformName] = null;
+            this._engine.setIntArray4(this.getUniform(uniformName), array);
+            return this;
+        };
+        Effect.prototype.setFloatArray = function (uniformName, array) {
+            this._valueCache[uniformName] = null;
+            this._engine.setFloatArray(this.getUniform(uniformName), array);
+            return this;
+        };
+        Effect.prototype.setFloatArray2 = function (uniformName, array) {
+            this._valueCache[uniformName] = null;
+            this._engine.setFloatArray2(this.getUniform(uniformName), array);
+            return this;
+        };
+        Effect.prototype.setFloatArray3 = function (uniformName, array) {
+            this._valueCache[uniformName] = null;
+            this._engine.setFloatArray3(this.getUniform(uniformName), array);
+            return this;
+        };
+        Effect.prototype.setFloatArray4 = function (uniformName, array) {
+            this._valueCache[uniformName] = null;
+            this._engine.setFloatArray4(this.getUniform(uniformName), array);
+            return this;
+        };
         Effect.prototype.setArray = function (uniformName, array) {
             this._valueCache[uniformName] = null;
             this._engine.setArray(this.getUniform(uniformName), array);

+ 1 - 1
src/Tools/babylon.dynamicFloatArray.js

@@ -226,7 +226,7 @@ var BABYLON;
                 var newCount = Math.min(this.totalElementCount, count * 2);
                 this._sortTable = new Array(newCount);
             }
-            if (!this._sortTable || this._sortTable.length !== count) {
+            if (!this._sortedTable || this._sortedTable.length !== count) {
                 this._sortedTable = new Array(count);
             }
             // Because, you know...

+ 4 - 2
src/Tools/babylon.sceneSerializer.js

@@ -289,8 +289,10 @@ var BABYLON;
             serializationObject.shadowGenerators = [];
             for (index = 0; index < scene.lights.length; index++) {
                 light = scene.lights[index];
-                if (light.getShadowGenerator()) {
-                    serializationObject.shadowGenerators.push(light.getShadowGenerator().serialize());
+                var shadowGenerator = light.getShadowGenerator();
+                // Only support serialization for official generator so far.
+                if (shadowGenerator && shadowGenerator instanceof BABYLON.ShadowGenerator) {
+                    serializationObject.shadowGenerators.push(shadowGenerator.serialize());
                 }
             }
             // Action Manager

+ 46 - 0
src/babylon.engine.js

@@ -1136,6 +1136,46 @@ var BABYLON;
                 effect.onBind(effect);
             }
         };
+        Engine.prototype.setIntArray = function (uniform, array) {
+            if (!uniform)
+                return;
+            this._gl.uniform1iv(uniform, array);
+        };
+        Engine.prototype.setIntArray2 = function (uniform, array) {
+            if (!uniform || array.length % 2 !== 0)
+                return;
+            this._gl.uniform2iv(uniform, array);
+        };
+        Engine.prototype.setIntArray3 = function (uniform, array) {
+            if (!uniform || array.length % 3 !== 0)
+                return;
+            this._gl.uniform3iv(uniform, array);
+        };
+        Engine.prototype.setIntArray4 = function (uniform, array) {
+            if (!uniform || array.length % 4 !== 0)
+                return;
+            this._gl.uniform4iv(uniform, array);
+        };
+        Engine.prototype.setFloatArray = function (uniform, array) {
+            if (!uniform)
+                return;
+            this._gl.uniform1fv(uniform, array);
+        };
+        Engine.prototype.setFloatArray2 = function (uniform, array) {
+            if (!uniform || array.length % 2 !== 0)
+                return;
+            this._gl.uniform2fv(uniform, array);
+        };
+        Engine.prototype.setFloatArray3 = function (uniform, array) {
+            if (!uniform || array.length % 3 !== 0)
+                return;
+            this._gl.uniform3fv(uniform, array);
+        };
+        Engine.prototype.setFloatArray4 = function (uniform, array) {
+            if (!uniform || array.length % 4 !== 0)
+                return;
+            this._gl.uniform4fv(uniform, array);
+        };
         Engine.prototype.setArray = function (uniform, array) {
             if (!uniform)
                 return;
@@ -2177,6 +2217,12 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Engine.prototype.attachContextLostEvent = function (callback) {
+            this._renderingCanvas.addEventListener("webglcontextlost", callback, false);
+        };
+        Engine.prototype.attachContextRestoredEvent = function (callback) {
+            this._renderingCanvas.addEventListener("webglcontextrestored", callback, false);
+        };
         // FPS
         Engine.prototype.getFps = function () {
             return this.fps;