瀏覽代碼

NIghtly + bug fixing

David Catuhe 9 年之前
父節點
當前提交
d09322c066

文件差異過大導致無法顯示
+ 8 - 8
dist/preview release/babylon.core.js


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


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


+ 7 - 8
dist/preview release/babylon.max.js

@@ -6483,7 +6483,7 @@ var BABYLON;
                 arrayBuffer = new Uint16Array(indices);
                 arrayBuffer = new Uint16Array(indices);
             }
             }
             this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, arrayBuffer, this._gl.STATIC_DRAW);
             this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, arrayBuffer, this._gl.STATIC_DRAW);
-            this._resetIndexBufferBinding();
+            //this._resetIndexBufferBinding();
             vbo.references = 1;
             vbo.references = 1;
             vbo.is32Bits = need32Bits;
             vbo.is32Bits = need32Bits;
             return vbo;
             return vbo;
@@ -7101,12 +7101,11 @@ var BABYLON;
             this._loadedTexturesCache.push(texture);
             this._loadedTexturesCache.push(texture);
             return texture;
             return texture;
         };
         };
-        Engine.prototype.createDynamicTexture = function (width, height, generateMipMaps, samplingMode, forceExponantOfTwo) {
-            if (forceExponantOfTwo === void 0) { forceExponantOfTwo = true; }
+        Engine.prototype.createDynamicTexture = function (width, height, generateMipMaps, samplingMode) {
             var texture = this._gl.createTexture();
             var texture = this._gl.createTexture();
             texture._baseWidth = width;
             texture._baseWidth = width;
             texture._baseHeight = height;
             texture._baseHeight = height;
-            if (forceExponantOfTwo) {
+            if (generateMipMaps) {
                 width = BABYLON.Tools.GetExponentOfTwo(width, this._caps.maxTextureSize);
                 width = BABYLON.Tools.GetExponentOfTwo(width, this._caps.maxTextureSize);
                 height = BABYLON.Tools.GetExponentOfTwo(height, this._caps.maxTextureSize);
                 height = BABYLON.Tools.GetExponentOfTwo(height, this._caps.maxTextureSize);
             }
             }
@@ -18248,7 +18247,7 @@ var BABYLON;
                         engine.drawUnIndexed(false, subMesh.verticesStart, subMesh.verticesCount, instancesCount);
                         engine.drawUnIndexed(false, subMesh.verticesStart, subMesh.verticesCount, instancesCount);
                     }
                     }
                     else {
                     else {
-                        engine.draw(false, 0, subMesh.linesIndexCount, instancesCount);
+                        engine.draw(false, 0, instancesCount > 0 ? subMesh.linesIndexCount / 2 : subMesh.linesIndexCount, instancesCount);
                     }
                     }
                     break;
                     break;
                 default:
                 default:
@@ -22391,7 +22390,7 @@ var BABYLON;
         };
         };
         DynamicTexture.prototype.clone = function () {
         DynamicTexture.prototype.clone = function () {
             var textureSize = this.getSize();
             var textureSize = this.getSize();
-            var newTexture = new DynamicTexture(this.name, textureSize.width, this.getScene(), this._generateMipMaps);
+            var newTexture = new DynamicTexture(this.name, textureSize, this.getScene(), this._generateMipMaps);
             // Base texture
             // Base texture
             newTexture.hasAlpha = this.hasAlpha;
             newTexture.hasAlpha = this.hasAlpha;
             newTexture.level = this.level;
             newTexture.level = this.level;
@@ -22469,7 +22468,7 @@ var BABYLON;
             this._lastUpdate = BABYLON.Tools.Now;
             this._lastUpdate = BABYLON.Tools.Now;
         }
         }
         VideoTexture.prototype._createTexture = function () {
         VideoTexture.prototype._createTexture = function () {
-            this._texture = this.getScene().getEngine().createDynamicTexture(this.video.videoWidth, this.video.videoHeight, this._generateMipMaps, this._samplingMode, false);
+            this._texture = this.getScene().getEngine().createDynamicTexture(this.video.videoWidth, this.video.videoHeight, this._generateMipMaps, this._samplingMode);
             this._texture.isReady = true;
             this._texture.isReady = true;
         };
         };
         VideoTexture.prototype.update = function () {
         VideoTexture.prototype.update = function () {
@@ -27718,7 +27717,7 @@ var BABYLON;
                 var boneName = this.bones[i].name;
                 var boneName = this.bones[i].name;
                 var sourceBone = boneDict[boneName];
                 var sourceBone = boneDict[boneName];
                 if (sourceBone) {
                 if (sourceBone) {
-                    ret = ret && this.bones[i].copyAnimationRange(sourceBone, name, frameOffset, rescaleAsRequired);
+                    ret = ret && this.bones[i].copyAnimationRange(sourceBone, name, frameOffset, rescaleAsRequired, skelDimensionsRatio);
                 }
                 }
                 else {
                 else {
                     BABYLON.Tools.Warn("copyAnimationRange: not same rig, missing source bone " + boneName);
                     BABYLON.Tools.Warn("copyAnimationRange: not same rig, missing source bone " + boneName);

文件差異過大導致無法顯示
+ 8 - 8
dist/preview release/babylon.noworker.js


+ 1 - 1
dist/preview release/what's new.md

@@ -83,4 +83,4 @@
     - `Engine.bindMultiBuffers` is now `Engine.bindBuffers` and strongly typed `{ [key: string]: VertexBuffer; }` of buffers ([benaadams](https://github.com/benaadams))
     - `Engine.bindMultiBuffers` is now `Engine.bindBuffers` and strongly typed `{ [key: string]: VertexBuffer; }` of buffers ([benaadams](https://github.com/benaadams))
     - `Engine.createDynamicVertexBuffer` takes vertices rather than capacity, creating and initalizing in one gpu instruction ([benaadams](https://github.com/benaadams)) 
     - `Engine.createDynamicVertexBuffer` takes vertices rather than capacity, creating and initalizing in one gpu instruction ([benaadams](https://github.com/benaadams)) 
     - Internally new `Engine.bindBuffer` is used rather than `gl.bindBuffer` which only binds when the bound buffer is changing ([benaadams](https://github.com/benaadams)) 
     - Internally new `Engine.bindBuffer` is used rather than `gl.bindBuffer` which only binds when the bound buffer is changing ([benaadams](https://github.com/benaadams)) 
-    - `DynamicTexture` no longer forces height/width to exponents of 2 if MIP maps are disabled and sampling mode is nearest  ([dahlbyk](https://github.com/dahlbyk))
+    - `DynamicTexture` no longer forces height/width to exponents of 2 if MIP maps are disabled ([dahlbyk](https://github.com/dahlbyk))

+ 1 - 1
src/Bones/babylon.skeleton.js

@@ -123,7 +123,7 @@ var BABYLON;
                 var boneName = this.bones[i].name;
                 var boneName = this.bones[i].name;
                 var sourceBone = boneDict[boneName];
                 var sourceBone = boneDict[boneName];
                 if (sourceBone) {
                 if (sourceBone) {
-                    ret = ret && this.bones[i].copyAnimationRange(sourceBone, name, frameOffset, rescaleAsRequired);
+                    ret = ret && this.bones[i].copyAnimationRange(sourceBone, name, frameOffset, rescaleAsRequired, skelDimensionsRatio);
                 }
                 }
                 else {
                 else {
                     BABYLON.Tools.Warn("copyAnimationRange: not same rig, missing source bone " + boneName);
                     BABYLON.Tools.Warn("copyAnimationRange: not same rig, missing source bone " + boneName);

+ 3 - 4
src/Materials/Textures/babylon.dynamicTexture.js

@@ -14,18 +14,17 @@ var BABYLON;
             this.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE;
             this.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE;
             this.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE;
             this.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE;
             this._generateMipMaps = generateMipMaps;
             this._generateMipMaps = generateMipMaps;
-            var forceExponentOfTwo = generateMipMaps || samplingMode !== BABYLON.Texture.NEAREST_SAMPLINGMODE;
             if (options.getContext) {
             if (options.getContext) {
                 this._canvas = options;
                 this._canvas = options;
-                this._texture = scene.getEngine().createDynamicTexture(options.width, options.height, generateMipMaps, samplingMode, forceExponentOfTwo);
+                this._texture = scene.getEngine().createDynamicTexture(options.width, options.height, generateMipMaps, samplingMode);
             }
             }
             else {
             else {
                 this._canvas = document.createElement("canvas");
                 this._canvas = document.createElement("canvas");
                 if (options.width) {
                 if (options.width) {
-                    this._texture = scene.getEngine().createDynamicTexture(options.width, options.height, generateMipMaps, samplingMode, forceExponentOfTwo);
+                    this._texture = scene.getEngine().createDynamicTexture(options.width, options.height, generateMipMaps, samplingMode);
                 }
                 }
                 else {
                 else {
-                    this._texture = scene.getEngine().createDynamicTexture(options, options, generateMipMaps, samplingMode, forceExponentOfTwo);
+                    this._texture = scene.getEngine().createDynamicTexture(options, options, generateMipMaps, samplingMode);
                 }
                 }
             }
             }
             var textureSize = this.getSize();
             var textureSize = this.getSize();

+ 3 - 5
src/Materials/Textures/babylon.dynamicTexture.ts

@@ -14,18 +14,16 @@
 
 
             this._generateMipMaps = generateMipMaps;
             this._generateMipMaps = generateMipMaps;
 
 
-            var forceExponentOfTwo = generateMipMaps || samplingMode !== Texture.NEAREST_SAMPLINGMODE;
-
             if (options.getContext) {
             if (options.getContext) {
                 this._canvas = options;
                 this._canvas = options;
-                this._texture = scene.getEngine().createDynamicTexture(options.width, options.height, generateMipMaps, samplingMode, forceExponentOfTwo);
+                this._texture = scene.getEngine().createDynamicTexture(options.width, options.height, generateMipMaps, samplingMode);
             } else {
             } else {
                 this._canvas = document.createElement("canvas");
                 this._canvas = document.createElement("canvas");
 
 
                 if (options.width) {
                 if (options.width) {
-                    this._texture = scene.getEngine().createDynamicTexture(options.width, options.height, generateMipMaps, samplingMode, forceExponentOfTwo);
+                    this._texture = scene.getEngine().createDynamicTexture(options.width, options.height, generateMipMaps, samplingMode);
                 } else {
                 } else {
-                    this._texture = scene.getEngine().createDynamicTexture(options, options, generateMipMaps, samplingMode, forceExponentOfTwo);
+                    this._texture = scene.getEngine().createDynamicTexture(options, options, generateMipMaps, samplingMode);
                 }
                 }
             }
             }
 
 

+ 1 - 1
src/Materials/Textures/babylon.videoTexture.js

@@ -61,7 +61,7 @@ var BABYLON;
             this._lastUpdate = BABYLON.Tools.Now;
             this._lastUpdate = BABYLON.Tools.Now;
         }
         }
         VideoTexture.prototype._createTexture = function () {
         VideoTexture.prototype._createTexture = function () {
-            this._texture = this.getScene().getEngine().createDynamicTexture(this.video.videoWidth, this.video.videoHeight, this._generateMipMaps, this._samplingMode, false);
+            this._texture = this.getScene().getEngine().createDynamicTexture(this.video.videoWidth, this.video.videoHeight, this._generateMipMaps, this._samplingMode);
             this._texture.isReady = true;
             this._texture.isReady = true;
         };
         };
         VideoTexture.prototype.update = function () {
         VideoTexture.prototype.update = function () {

+ 1 - 1
src/Materials/Textures/babylon.videoTexture.ts

@@ -60,7 +60,7 @@
         }
         }
 
 
         private _createTexture(): void {
         private _createTexture(): void {
-            this._texture = this.getScene().getEngine().createDynamicTexture(this.video.videoWidth, this.video.videoHeight, this._generateMipMaps, this._samplingMode, false);
+            this._texture = this.getScene().getEngine().createDynamicTexture(this.video.videoWidth, this.video.videoHeight, this._generateMipMaps, this._samplingMode);
             this._texture.isReady = true;
             this._texture.isReady = true;
         }
         }
 
 

+ 1 - 1
src/Mesh/babylon.mesh.js

@@ -781,7 +781,7 @@ var BABYLON;
                         engine.drawUnIndexed(false, subMesh.verticesStart, subMesh.verticesCount, instancesCount);
                         engine.drawUnIndexed(false, subMesh.verticesStart, subMesh.verticesCount, instancesCount);
                     }
                     }
                     else {
                     else {
-                        engine.draw(false, 0, subMesh.linesIndexCount, instancesCount);
+                        engine.draw(false, 0, instancesCount > 0 ? subMesh.linesIndexCount / 2 : subMesh.linesIndexCount, instancesCount);
                     }
                     }
                     break;
                     break;
                 default:
                 default:

+ 1 - 1
src/Mesh/babylon.mesh.ts

@@ -835,7 +835,7 @@
                     if (this._unIndexed) {
                     if (this._unIndexed) {
                         engine.drawUnIndexed(false, subMesh.verticesStart, subMesh.verticesCount, instancesCount);
                         engine.drawUnIndexed(false, subMesh.verticesStart, subMesh.verticesCount, instancesCount);
                     } else {
                     } else {
-                        engine.draw(false, 0, subMesh.linesIndexCount, instancesCount);
+                        engine.draw(false, 0, instancesCount > 0 ? subMesh.linesIndexCount / 2 : subMesh.linesIndexCount, instancesCount);
                     }
                     }
                     break;
                     break;
 
 

+ 1 - 1
src/Mesh/babylon.subMesh.ts

@@ -111,7 +111,7 @@
             this._renderingMesh.render(this, enableAlphaMode);
             this._renderingMesh.render(this, enableAlphaMode);
         }
         }
 
 
-        public getLinesIndexBuffer(indices: number[] | Int32Array, engine): WebGLBuffer {
+        public getLinesIndexBuffer(indices: number[] | Int32Array, engine: Engine): WebGLBuffer {
             if (!this._linesIndexBuffer) {
             if (!this._linesIndexBuffer) {
                 var linesIndices = [];
                 var linesIndices = [];
 
 

+ 3 - 4
src/babylon.engine.js

@@ -796,7 +796,7 @@ var BABYLON;
                 arrayBuffer = new Uint16Array(indices);
                 arrayBuffer = new Uint16Array(indices);
             }
             }
             this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, arrayBuffer, this._gl.STATIC_DRAW);
             this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, arrayBuffer, this._gl.STATIC_DRAW);
-            this._resetIndexBufferBinding();
+            //this._resetIndexBufferBinding();
             vbo.references = 1;
             vbo.references = 1;
             vbo.is32Bits = need32Bits;
             vbo.is32Bits = need32Bits;
             return vbo;
             return vbo;
@@ -1414,12 +1414,11 @@ var BABYLON;
             this._loadedTexturesCache.push(texture);
             this._loadedTexturesCache.push(texture);
             return texture;
             return texture;
         };
         };
-        Engine.prototype.createDynamicTexture = function (width, height, generateMipMaps, samplingMode, forceExponentOfTwo) {
-            if (forceExponentOfTwo === void 0) { forceExponentOfTwo = true; }
+        Engine.prototype.createDynamicTexture = function (width, height, generateMipMaps, samplingMode) {
             var texture = this._gl.createTexture();
             var texture = this._gl.createTexture();
             texture._baseWidth = width;
             texture._baseWidth = width;
             texture._baseHeight = height;
             texture._baseHeight = height;
-            if (forceExponentOfTwo) {
+            if (generateMipMaps) {
                 width = BABYLON.Tools.GetExponentOfTwo(width, this._caps.maxTextureSize);
                 width = BABYLON.Tools.GetExponentOfTwo(width, this._caps.maxTextureSize);
                 height = BABYLON.Tools.GetExponentOfTwo(height, this._caps.maxTextureSize);
                 height = BABYLON.Tools.GetExponentOfTwo(height, this._caps.maxTextureSize);
             }
             }

+ 3 - 3
src/babylon.engine.ts

@@ -969,7 +969,7 @@
             }
             }
 
 
             this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, arrayBuffer, this._gl.STATIC_DRAW);
             this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, arrayBuffer, this._gl.STATIC_DRAW);
-            this._resetIndexBufferBinding();
+            //this._resetIndexBufferBinding();
             vbo.references = 1;
             vbo.references = 1;
             vbo.is32Bits = need32Bits;
             vbo.is32Bits = need32Bits;
             return vbo;
             return vbo;
@@ -1726,12 +1726,12 @@
             return texture;
             return texture;
         }
         }
 
 
-        public createDynamicTexture(width: number, height: number, generateMipMaps: boolean, samplingMode: number, forceExponentOfTwo = true): WebGLTexture {
+        public createDynamicTexture(width: number, height: number, generateMipMaps: boolean, samplingMode: number): WebGLTexture {
             var texture = this._gl.createTexture();
             var texture = this._gl.createTexture();
             texture._baseWidth = width;
             texture._baseWidth = width;
             texture._baseHeight = height;
             texture._baseHeight = height;
 
 
-            if (forceExponentOfTwo) {
+            if (generateMipMaps) {
                 width = Tools.GetExponentOfTwo(width, this._caps.maxTextureSize);
                 width = Tools.GetExponentOfTwo(width, this._caps.maxTextureSize);
                 height = Tools.GetExponentOfTwo(height, this._caps.maxTextureSize);
                 height = Tools.GetExponentOfTwo(height, this._caps.maxTextureSize);
             }
             }