Unity A question about Unity

cooperdk

Engaged Member
Jul 23, 2017
3,375
4,885
Polywog replied, but Unity supports whatever the plugin you install does, if it doesn't natively.
My question is though: why would you want to use images optimized for websites in Unity???
 

Tompte

Member
Dec 22, 2017
214
152
Short answer: No.

Long answer:
Unity will convert assets you give it into a known format that the graphics hardware can accept. So even while Unity supports JPEGs, your graphics hardware doesn't. Everything gets automatically converted by Unity on import.

Unity can't import webp out of the box because it's frankly not a commonly used format in game development. PNGs are preferred because they check all the boxes while being supported by all major graphic applications and are generally easy to work with.

Technically you can always load whatever file you want and fill in the pixel data manually in a script, but it's a royal pain and it's better to look for existing solutions like the one posted above. However, to cooperdk's point, it's a bit of a detour approach. The most performant solution is the one where all assets are pre-baked by Unity.
 
Last edited:
  • Like
Reactions: cooperdk