Help with texture compression formats for WebGL

Hi, I have a problem im trying to solve, and I’d like some outside input.

We are trying to export this game for Web on a page called Poki.

The game must run on web desktop and on mobile desktop. The range of devices is as variable as you can imagine, people with potatoes as phones might play the game.

Because of this and many other facts, having good build size and RAM consumption is essential.

Here comes my problem: Texture compression. I’ve read about texture compression and Unity in their documentation and realized this: there is no reasonable compression method thats available for both Web Desktop and Mobile Desktop (only those like RGBA 16 bit and others that are too heavy for our targets).

Unity just recommends to “build for both platforms, one for mobile with ASTC and one for desktop with DXT”. Thats all fine, but our target platform (Poki) manages the distribution from their side and only accepts one single build. I can’t send two builds for different platforms.

The options I’ve thought out to solve this are:

  1. Use addressables (which I have never used) to get ASTC content in case of mobile or DXT content in case of desktop. However, I have my doubts on how does the Unity get this content? Is it through a CDN? Poki says that it rejects all external connections except for Multiplayer or data collection services. Sadly this means I can’t use a CDN… And if I get that locally, wouldn’t that mean that I would double the amount of textures and their sizes on the game?
  2. Target the least hurtful platform, in this case Mobile since, on average, it has way less resources and power than a desktop. Far from ideal, but might be my only choice?

Im reaching out for Poki to see how they manage these cases, thats the third hidden option.

I’d love some input on this problem and how you guys see it. Am I doomed?

Might. But you may not want to allow them to. You’ve got to set some minimum requirements, although this is not trivial on the Web since you don’t get all the device details there are libraries that can assist you in ensuring certain requirements are met.

You can host Addressables anywhere, including your own server or Unity’s CDN service.
Saying that I realized … I think you can actually ship your addressables within the build (eg in StreamingAssets) and then selectively load them based on to the platform. This would increase your submitted build size of course but if this does work it’s probably the best course of action.

There’s one option you missed but it’s not so attractive: you could use an uncompressed texture format that works on both platforms but one that is otherwise smaller than normal. Meaning a) 16 or 8 bit colors or b) crunch compressed or c) reduced texture dimensions or d) a combination of the beforementioned. Still you may be limited to a variant that works for both platforms.

1 Like