this.generateWebGLTexture = function (gl, preserveSource) {
...
// Loop through each mip level of compressed texture data provided and upload it to the given texture.
for (var i = 0; i < this.levels; ++i) {
// Determine how big this level of compressed texture data is in bytes.
var levelSize = textureLevelSize(this.internalFormat, width, height);
// Get a view of the bytes for this level of DXT data.
var dxtLevel = new Uint8Array(this.data.buffer, this.data.byteOffset + offset, levelSize);
// Upload!
gl.compressedTexImage2D(gl.TEXTURE_2D, i, this.internalFormat, width, height, 0, dxtLevel);
...
};
How can I get the correct compressed data from javascript?
Thanks!
Hi Dominic, I've decided to bind the 'gl.compressTexImage2D' function which was marked as
EJ_BIND_FUNCTION_NOT_IMPLEMENTED
, and this is my implement:I use pixi-compressed-textures to upload the compressed texture, it handled the mipmap already:
How can I get the correct compressed data from javascript? Thanks!