Просмотр исходного кода

Engine texture support changes
- Make boundUniforms protected so it can be accessed by subclasses.
- Make _setTexture protected so it can be overridden by subclasses.
- Set _boundUniforms when a texture array is set.

Scott Ramsby 7 лет назад
Родитель
Сommit
8553483e1b
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      src/Engine/babylon.engine.ts

+ 4 - 2
src/Engine/babylon.engine.ts

@@ -6177,7 +6177,7 @@
             }
         }
 
-        private _boundUniforms: { [key: number]: WebGLUniformLocation } = {};
+        protected _boundUniforms: { [key: number]: WebGLUniformLocation } = {};
 
         /**
          * Binds an effect to the webGL context
@@ -6430,7 +6430,7 @@
             return this._gl.REPEAT;
         }
 
-        private _setTexture(channel: number, texture: Nullable<BaseTexture>, isPartOfTextureArray = false, depthStencilTexture = false): boolean {
+        protected _setTexture(channel: number, texture: Nullable<BaseTexture>, isPartOfTextureArray = false, depthStencilTexture = false): boolean {
             // Not ready?
             if (!texture) {
                 if (this._boundTexturesCache[channel] != null) {
@@ -6554,6 +6554,8 @@
                 return;
             }
 
+            this._boundUniforms[channel] = uniform;
+
             if (!this._textureUnits || this._textureUnits.length !== textures.length) {
                 this._textureUnits = new Int32Array(textures.length);
             }