|
@@ -214,6 +214,7 @@
|
|
|
generateStencilBuffer?: boolean;
|
|
|
type?: number;
|
|
|
samplingMode?: number;
|
|
|
+ format?: number;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -3883,12 +3884,14 @@
|
|
|
fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && options.generateStencilBuffer;
|
|
|
fullOptions.type = options.type === undefined ? Engine.TEXTURETYPE_UNSIGNED_INT : options.type;
|
|
|
fullOptions.samplingMode = options.samplingMode === undefined ? Texture.TRILINEAR_SAMPLINGMODE : options.samplingMode;
|
|
|
+ fullOptions.format = options.format === undefined ? Engine.TEXTUREFORMAT_RGBA : options.format;
|
|
|
} else {
|
|
|
fullOptions.generateMipMaps = <boolean>options;
|
|
|
fullOptions.generateDepthBuffer = true;
|
|
|
fullOptions.generateStencilBuffer = false;
|
|
|
fullOptions.type = Engine.TEXTURETYPE_UNSIGNED_INT;
|
|
|
fullOptions.samplingMode = Texture.TRILINEAR_SAMPLINGMODE;
|
|
|
+ fullOptions.format = Engine.TEXTUREFORMAT_RGBA;
|
|
|
}
|
|
|
|
|
|
if (fullOptions.type === Engine.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {
|
|
@@ -3919,7 +3922,7 @@
|
|
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
|
|
|
|
- gl.texImage2D(gl.TEXTURE_2D, 0, this._getRGBABufferInternalSizedFormat(fullOptions.type), width, height, 0, gl.RGBA, this._getWebGLTextureType(fullOptions.type), null);
|
|
|
+ gl.texImage2D(gl.TEXTURE_2D, 0, this._getRGBABufferInternalSizedFormat(fullOptions.type), width, height, 0, this._getInternalFormat(fullOptions.format), this._getWebGLTextureType(fullOptions.type), null);
|
|
|
|
|
|
// Create the framebuffer
|
|
|
var framebuffer = gl.createFramebuffer();
|
|
@@ -4302,6 +4305,7 @@
|
|
|
generateStencilBuffer: false,
|
|
|
type: Engine.TEXTURETYPE_UNSIGNED_INT,
|
|
|
samplingMode: Texture.TRILINEAR_SAMPLINGMODE,
|
|
|
+ format: Engine.TEXTUREFORMAT_RGBA,
|
|
|
...options
|
|
|
};
|
|
|
fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && fullOptions.generateStencilBuffer;
|
|
@@ -4332,7 +4336,7 @@
|
|
|
gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
|
|
|
|
for (var face = 0; face < 6; face++) {
|
|
|
- gl.texImage2D((gl.TEXTURE_CUBE_MAP_POSITIVE_X + face), 0, this._getRGBABufferInternalSizedFormat(fullOptions.type), size, size, 0, gl.RGBA, this._getWebGLTextureType(fullOptions.type), null);
|
|
|
+ gl.texImage2D((gl.TEXTURE_CUBE_MAP_POSITIVE_X + face), 0, this._getRGBABufferInternalSizedFormat(fullOptions.type), size, size, 0, this._getInternalFormat(fullOptions.format), this._getWebGLTextureType(fullOptions.type), null);
|
|
|
}
|
|
|
|
|
|
// Create the framebuffer
|