Compress textures at run time

I am loading models from URL in my scene, where people can upload their own models and see them live in a gallery environment, the main issue is of the textures, I want to compress the textures using basis after downloading the models from the URL to reduce the VRAM.

is there any possibility I can do this?

Another solution to this would be to downsize the textures using this

In theory this can be done, as compressor can be compiled to wasm module and used on web. I’m not sure about the performance of this, but perhaps see more here:

1 Like

I’m not sure if you can do this with the current included runtime library of Basis but in theory, you could run the compression on a JPG to create a .basis file in the browser. However, this does take time to compress pending on the user’s machine.

Where are users uploading the models to? You probably want to compress the textures on upload if possible.

1 Like

They are uploading to a server, yes on upload it’s better to compress then.

1 Like

Resizing the images on the client-side helps to reduce the VRAM, here is a demo I made to resize at the client-side, any suggestions are welcome to optimize the way I do it :slight_smile:
https://playcanvas.com/editor/scene/1134102

1 Like