浏览代码

better naming for boundtextures in engine

David Catuhe 7 年之前
父节点
当前提交
d051b04505

文件差异内容过多而无法显示
+ 643 - 643
Playground/babylon.d.txt


文件差异内容过多而无法显示
+ 511 - 511
dist/preview release/babylon.d.ts


文件差异内容过多而无法显示
+ 3 - 3
dist/preview release/babylon.js


+ 9 - 9
dist/preview release/babylon.max.js

@@ -8014,7 +8014,7 @@ var BABYLON;
             this._alphaMode = Engine.ALPHA_DISABLE;
             this._alphaMode = Engine.ALPHA_DISABLE;
             // Cache
             // Cache
             this._internalTexturesCache = new Array();
             this._internalTexturesCache = new Array();
-            this._activeTexturesCache = {};
+            this._boundTexturesCache = {};
             this._compiledEffects = {};
             this._compiledEffects = {};
             this._vertexAttribArraysEnabled = [];
             this._vertexAttribArraysEnabled = [];
             this._uintIndicesCurrentlySet = false;
             this._uintIndicesCurrentlySet = false;
@@ -8872,8 +8872,8 @@ var BABYLON;
             }
             }
         };
         };
         Engine.prototype.resetTextureCache = function () {
         Engine.prototype.resetTextureCache = function () {
-            for (var key in this._activeTexturesCache) {
-                this._activeTexturesCache[key] = null;
+            for (var key in this._boundTexturesCache) {
+                this._boundTexturesCache[key] = null;
             }
             }
         };
         };
         Engine.prototype.isDeterministicLockStep = function () {
         Engine.prototype.isDeterministicLockStep = function () {
@@ -11518,9 +11518,9 @@ var BABYLON;
             }
             }
         };
         };
         Engine.prototype._bindTextureDirectly = function (target, texture) {
         Engine.prototype._bindTextureDirectly = function (target, texture) {
-            if (this._activeTexturesCache[this._activeTextureChannel] !== texture) {
+            if (this._boundTexturesCache[this._activeTextureChannel] !== texture) {
                 this._gl.bindTexture(target, texture ? texture._webGLTexture : null);
                 this._gl.bindTexture(target, texture ? texture._webGLTexture : null);
-                this._activeTexturesCache[this._activeTextureChannel] = texture;
+                this._boundTexturesCache[this._activeTextureChannel] = texture;
             }
             }
         };
         };
         Engine.prototype._bindTexture = function (channel, texture) {
         Engine.prototype._bindTexture = function (channel, texture) {
@@ -11554,7 +11554,7 @@ var BABYLON;
         Engine.prototype._setTexture = function (channel, texture) {
         Engine.prototype._setTexture = function (channel, texture) {
             // Not ready?
             // Not ready?
             if (!texture) {
             if (!texture) {
-                if (this._activeTexturesCache[channel] != null) {
+                if (this._boundTexturesCache[channel] != null) {
                     this.activateTextureChannel(this._gl.TEXTURE0 + channel);
                     this.activateTextureChannel(this._gl.TEXTURE0 + channel);
                     this._bindTextureDirectly(this._gl.TEXTURE_2D, null);
                     this._bindTextureDirectly(this._gl.TEXTURE_2D, null);
                     this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);
                     this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);
@@ -11591,7 +11591,7 @@ var BABYLON;
             if (!alreadyActivated) {
             if (!alreadyActivated) {
                 this.activateTextureChannel(this._gl.TEXTURE0 + channel);
                 this.activateTextureChannel(this._gl.TEXTURE0 + channel);
             }
             }
-            if (this._activeTexturesCache[this._activeTextureChannel] === internalTexture) {
+            if (this._boundTexturesCache[this._activeTextureChannel] === internalTexture) {
                 return false;
                 return false;
             }
             }
             if (internalTexture && internalTexture.is3D) {
             if (internalTexture && internalTexture.is3D) {
@@ -77128,8 +77128,8 @@ var BABYLON;
         NullEngine.prototype.updateDynamicVertexBuffer = function (vertexBuffer, vertices, offset, count) {
         NullEngine.prototype.updateDynamicVertexBuffer = function (vertexBuffer, vertices, offset, count) {
         };
         };
         NullEngine.prototype._bindTextureDirectly = function (target, texture) {
         NullEngine.prototype._bindTextureDirectly = function (target, texture) {
-            if (this._activeTexturesCache[this._activeTextureChannel] !== texture) {
-                this._activeTexturesCache[this._activeTextureChannel] = texture;
+            if (this._boundTexturesCache[this._activeTextureChannel] !== texture) {
+                this._boundTexturesCache[this._activeTextureChannel] = texture;
             }
             }
         };
         };
         NullEngine.prototype._bindTexture = function (channel, texture) {
         NullEngine.prototype._bindTexture = function (channel, texture) {

文件差异内容过多而无法显示
+ 3 - 3
dist/preview release/babylon.worker.js


文件差异内容过多而无法显示
+ 2700 - 2700
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


文件差异内容过多而无法显示
+ 2 - 2
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 7 - 7
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -8014,7 +8014,7 @@ var BABYLON;
             this._alphaMode = Engine.ALPHA_DISABLE;
             this._alphaMode = Engine.ALPHA_DISABLE;
             // Cache
             // Cache
             this._internalTexturesCache = new Array();
             this._internalTexturesCache = new Array();
-            this._activeTexturesCache = {};
+            this._boundTexturesCache = {};
             this._compiledEffects = {};
             this._compiledEffects = {};
             this._vertexAttribArraysEnabled = [];
             this._vertexAttribArraysEnabled = [];
             this._uintIndicesCurrentlySet = false;
             this._uintIndicesCurrentlySet = false;
@@ -8872,8 +8872,8 @@ var BABYLON;
             }
             }
         };
         };
         Engine.prototype.resetTextureCache = function () {
         Engine.prototype.resetTextureCache = function () {
-            for (var key in this._activeTexturesCache) {
-                this._activeTexturesCache[key] = null;
+            for (var key in this._boundTexturesCache) {
+                this._boundTexturesCache[key] = null;
             }
             }
         };
         };
         Engine.prototype.isDeterministicLockStep = function () {
         Engine.prototype.isDeterministicLockStep = function () {
@@ -11518,9 +11518,9 @@ var BABYLON;
             }
             }
         };
         };
         Engine.prototype._bindTextureDirectly = function (target, texture) {
         Engine.prototype._bindTextureDirectly = function (target, texture) {
-            if (this._activeTexturesCache[this._activeTextureChannel] !== texture) {
+            if (this._boundTexturesCache[this._activeTextureChannel] !== texture) {
                 this._gl.bindTexture(target, texture ? texture._webGLTexture : null);
                 this._gl.bindTexture(target, texture ? texture._webGLTexture : null);
-                this._activeTexturesCache[this._activeTextureChannel] = texture;
+                this._boundTexturesCache[this._activeTextureChannel] = texture;
             }
             }
         };
         };
         Engine.prototype._bindTexture = function (channel, texture) {
         Engine.prototype._bindTexture = function (channel, texture) {
@@ -11554,7 +11554,7 @@ var BABYLON;
         Engine.prototype._setTexture = function (channel, texture) {
         Engine.prototype._setTexture = function (channel, texture) {
             // Not ready?
             // Not ready?
             if (!texture) {
             if (!texture) {
-                if (this._activeTexturesCache[channel] != null) {
+                if (this._boundTexturesCache[channel] != null) {
                     this.activateTextureChannel(this._gl.TEXTURE0 + channel);
                     this.activateTextureChannel(this._gl.TEXTURE0 + channel);
                     this._bindTextureDirectly(this._gl.TEXTURE_2D, null);
                     this._bindTextureDirectly(this._gl.TEXTURE_2D, null);
                     this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);
                     this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);
@@ -11591,7 +11591,7 @@ var BABYLON;
             if (!alreadyActivated) {
             if (!alreadyActivated) {
                 this.activateTextureChannel(this._gl.TEXTURE0 + channel);
                 this.activateTextureChannel(this._gl.TEXTURE0 + channel);
             }
             }
-            if (this._activeTexturesCache[this._activeTextureChannel] === internalTexture) {
+            if (this._boundTexturesCache[this._activeTextureChannel] === internalTexture) {
                 return false;
                 return false;
             }
             }
             if (internalTexture && internalTexture.is3D) {
             if (internalTexture && internalTexture.is3D) {

+ 7 - 7
src/Engine/babylon.engine.ts

@@ -749,7 +749,7 @@
         // Cache
         // Cache
         private _internalTexturesCache = new Array<InternalTexture>();
         private _internalTexturesCache = new Array<InternalTexture>();
         protected _activeTextureChannel: number;
         protected _activeTextureChannel: number;
-        protected _activeTexturesCache: { [key: string]: Nullable<WebGLTexture> } = {};
+        protected _boundTexturesCache: { [key: string]: Nullable<InternalTexture> } = {};
         protected _currentEffect: Nullable<Effect>;
         protected _currentEffect: Nullable<Effect>;
         protected _currentProgram: Nullable<WebGLProgram>;
         protected _currentProgram: Nullable<WebGLProgram>;
         private _compiledEffects: { [key: string]: Effect } = {}
         private _compiledEffects: { [key: string]: Effect } = {}
@@ -1302,8 +1302,8 @@
         }
         }
 
 
         public resetTextureCache() {
         public resetTextureCache() {
-            for (var key in this._activeTexturesCache) {
-                this._activeTexturesCache[key] = null;
+            for (var key in this._boundTexturesCache) {
+                this._boundTexturesCache[key] = null;
             }
             }
         }
         }
 
 
@@ -4530,9 +4530,9 @@
         }
         }
 
 
         public _bindTextureDirectly(target: number, texture: Nullable<InternalTexture>): void {
         public _bindTextureDirectly(target: number, texture: Nullable<InternalTexture>): void {
-            if (this._activeTexturesCache[this._activeTextureChannel] !== texture) {
+            if (this._boundTexturesCache[this._activeTextureChannel] !== texture) {
                 this._gl.bindTexture(target, texture ? texture._webGLTexture : null);
                 this._gl.bindTexture(target, texture ? texture._webGLTexture : null);
-                this._activeTexturesCache[this._activeTextureChannel] = texture;
+                this._boundTexturesCache[this._activeTextureChannel] = texture;
             }
             }
         }
         }
 
 
@@ -4573,7 +4573,7 @@
         private _setTexture(channel: number, texture: Nullable<BaseTexture>): boolean {
         private _setTexture(channel: number, texture: Nullable<BaseTexture>): boolean {
             // Not ready?
             // Not ready?
             if (!texture) {
             if (!texture) {
-                if (this._activeTexturesCache[channel] != null) {
+                if (this._boundTexturesCache[channel] != null) {
                     this.activateTextureChannel(this._gl.TEXTURE0 + channel);
                     this.activateTextureChannel(this._gl.TEXTURE0 + channel);
                     this._bindTextureDirectly(this._gl.TEXTURE_2D, null);
                     this._bindTextureDirectly(this._gl.TEXTURE_2D, null);
                     this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);
                     this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);
@@ -4613,7 +4613,7 @@
                 this.activateTextureChannel(this._gl.TEXTURE0 + channel);
                 this.activateTextureChannel(this._gl.TEXTURE0 + channel);
             }
             }
 
 
-            if (this._activeTexturesCache[this._activeTextureChannel] === internalTexture) {
+            if (this._boundTexturesCache[this._activeTextureChannel] === internalTexture) {
                 return false;
                 return false;
             }
             }
 
 

+ 2 - 2
src/Engine/babylon.nullEngine.ts

@@ -368,8 +368,8 @@
         }
         }
 
 
         public _bindTextureDirectly(target: number, texture: InternalTexture): void {
         public _bindTextureDirectly(target: number, texture: InternalTexture): void {
-            if (this._activeTexturesCache[this._activeTextureChannel] !== texture) {
-                this._activeTexturesCache[this._activeTextureChannel] = texture;
+            if (this._boundTexturesCache[this._activeTextureChannel] !== texture) {
+                this._boundTexturesCache[this._activeTextureChannel] = texture;
             }
             }
         }
         }