I’ve been experimenting with texture profiles for web build and wanted to get some feedback.
Previously I was just using the default built-in texture profile, but recently I switched to a custom setup (see screenshot). After doing that, I noticed in the Defold Resource Profiler that my peak total resource usage dropped quite a lot, from around ~160MB to ~50MB.
I’ve already read the docs about texture profiles, but I feel like I still don’t fully understand the practical trade-offs.
From what I understand, using compression might involve things like texture quality loss or runtime decompression, but I’m not really sure how significant those are in practice.
So I’m wondering: what are the actual downsides of this setup? Are there noticeable trade-offs in visual quality, performance, or loading time that I should watch out for?
Also, I have a question about HTML5 builds. When setting the Heap Size, should I base it on the peak “Total Resource” I see in the Resource Profiler while the game is running? Or is there something else I should consider when deciding the heap size?
We mainly use Basis Universal as a platform/GPU agnostic compression format. It decompresses at runtime into a format suitable for the target device.
The size of the compressed texture is obviously smaller than an uncompressed image. How much smaller depends on compression settings.
Compression is usually lossy, which means that visual quality will be affected. Depending on settings and image the visual difference may be very small or very noticeable.
You pay a runtime CPU cost of transcoding from Basis to the target format supported by the GPU. This work is done on a thread and should not be noticeable as visual stutter, although on html5 you generally don’t have any threads and decompression will happen on the main thread which will lead to long frame times during transcoding.
Another option is to compress to a specific target format, for instance ASTC, which can be used without any runtime transcoding, since the texture is compressed in a format which the GPU can use.
The drawback is that your game won’t run unless th GPU supports the format.
The third option is to not compress textures at all.
The size of your build will grow, but you will not pay a CPU cost of transcoding the images. It might also be the case that the uncompressed texture will still compress rather well at least when downloaded gzipped in an html5 build or when compressed in an APK or IPA.