Page 1 of 1

Unity - Is there any way to change the default texture provider?

Posted: 08 Dec 2017, 05:21
by horeaper
My group uses WebP for 2D UI resources (since on 90% quality it's a lot smaller than PNG and offers great image quality), so I want to bypass the buildin texture loader, and provide a custom one .
I've been digging the Noesis source in unity for a while, but still havn't get my head around it. Looks like a lot work are involved if I want to replace NoesisTextureProvider. :shock:

Re: Unity - Is there any way to change the default texture provider?

Posted: 08 Dec 2017, 16:49
by jsantos
You probably don't want to follow that route. Our texture provider implementation in Unity just uses the textures generated by Unity. So, I would wait for Unity to support WebP although I am not sure it makes sense because Unity doesn't use native image formats in its projects. Depending on the platform, it uses internally DXT, crunch... what ever GPU friendly format. So, I don't see any real advantages in using WebP.

Re: Unity - Is there any way to change the default texture provider?

Posted: 09 Dec 2017, 09:03
by horeaper
Our game (which is an UI heavy game) contains tens of thousands 2D image resources. Storing them in WebP could help reducing the generated package size by A LOT.
Currently out approach are "Load from Resource -> Decode using WebP library -> BitmapSource.Create() -> Set to Image.Source", all done by code. Which is extremely inconvenient. I can't help but wonder if there is another way around.

Re: Unity - Is there any way to change the default texture provider?

Posted: 11 Dec 2017, 12:29
by jsantos
Effectively that's inconvenient because you are creating uncompressed textures for the GPU. But I don't see a clear solution till Unity support this new format. Did you compare the storage versus the new crunch format in Unity? That format is extremely efficient for both storage and for GPU compression on the fly.

Re: Unity - Is there any way to change the default texture provider?

Posted: 12 Dec 2017, 08:27
by horeaper
The crunch requires DXT/ETC which losts too much detail for 2D UI elements, and it's unacceptable for us. I think we have to keep doing our way until Unity supports some form of loseless, or near lossless RGBA compression (like the 90% quality WebP we are using). But according to one blog's comment, there are no ETA yet :(

Re: Unity - Is there any way to change the default texture provider?

Posted: 13 Dec 2017, 01:24
by jsantos
I see, sorry for not providing a better solution... Thanks for your feedback!