Is it possible for GUI Image to support compressed textures, i.e. basis?
Also, is there a way to basically convert a scene texture into a GUI image? (to preserve compression, i.e. not render to a renderTargetTexture as a png and use the result as a data url or whatever)
The GUI uses the 2D canvas context to draw stuff, so it’s up to the browser how the images get sent to the GPU.
To create a GUI image from a texture, you can create ImageData from a texture, from which you can create an ImageBitmap, which you can set as a new GUI image’s domImage:
No errors, but doesn’t load, though there is a warning: [.WebGL-0x7f9ca20b5000]GL ERROR :GL_INVALID_FRAMEBUFFER_OPERATION : glReadPixels: framebuffer incomplete
Which is same warning I see when I tried it in my project locally.
Anyone know if it’s possible to do this with basis textures? Maybe failing due to mipmaps or something?
GUI is using canvas 2d which does not support compressed textures the only way would be to use a canvas with babylon to load compressed texture, read them as uncompress and populate the gui with that but you d lose all the advantages of compressed in this case.
Planes could work, but I was using GUI for a part of the UI because was having issues with multi cam/active camera, and because GUI seems to fit it better (and it would make things really easy if I could load my basis sprites in GUI, as I don’t want to load giant pngs), but maybe I need to fix the multi cam issues. --But also because it’s awkward to position planes that are part of the UI, positioned along side of the GUI. Screenshot because that was probably confusing explanation: