Support for compressed texture formats#240
Conversation
greggman
left a comment
There was a problem hiding this comment.
Thank you for the PR.
Are you actually using this?
-
createTexture(gl, { src, width, height, internalFormat })This version would work. Do we care about other versions?
For example, the non-compressed version will try to guess
the width and/or height. Maybe that's not useful for compressed
textures though. If we did want to do it, the code doing
the guessing needs to take block sizes into account.If not, should we error if it's compressed and you don't
pass in width and height? -
options.compressedIs this needed? It seems like you could have an internal function,
isCompressedInternalFormatthat you can call to decide
whether or not to callcompressedTexImage2D. -
can you add some tests?
At least WebGL2 requires a few compressed formats to work
so would be good to pick 1 or 2 and add a test that it works.
- Optimize the calling parameters of `compressedTexImage2D` - add `test compressed texture format`
|
Thanks for your reminder. The previous code application is often narrow.
|
|
I merged it. Thanks again for the PR. I made several changes. See 8f53aa8 and 0128db9 Note: I got rid of the compressed option like I suggested. Internally there's a Normally in twgl you upload level 0 and it auto geneartes mipmaps if possible. Of course it can't do this for compressed textures. For both compressed and uncompressed textures, you can only set mip level > 0 using |
compressedpropertyEXT_texture_compression_bptcandEXT_texture_compression_rgtc