BabylonJS / BabylonToolkit

Home of the community maintained Unity & Unreal exporters for Babylon.js
173 stars 46 forks source link

Support WEBP for textures #65

Closed nicolasayotte closed 4 months ago

nicolasayotte commented 1 year ago

WEBP offers full transparency support (32-bit) and is very space efficient as compared to PNG.

nicolasayotte commented 1 year ago

But, I mean, only if you think 80-95% smaller file size matter in web.

image

MackeyK24 commented 1 year ago

I dont know how to encode webp textures... is there a C# WEBP encoder I can use from Unity ?

nicolasayotte commented 8 months ago

https://developers.google.com/speed/webp/faq#how_do_i_use_libwebp_with_c

Google explains it

MackeyK24 commented 8 months ago

I am going to look into this... You should contact me via email: MackeyK24@gmail.com

Lets make sure your running the newer builds

MackeyK24 commented 4 months ago

Yo @nicolasayotte Finally Done... Latest Babylon Toolkit: 7.3.2 build support WEBP

Screenshot 2024-04-24 at 2 44 03 PM

MackeyK24 commented 4 months ago

WEBP works for BULLET AND HAVOK builds

nicolasayotte commented 4 months ago

WEBP works for BULLET AND HAVOK builds

Nice!! Will test and come back to you

MackeyK24 commented 4 months ago

Shit, I forgot to upload the new builds... So re-download to get the latest WEBP update.

Which I love now, I use the WEBP options all the time...

Note: Lightmaps, heightmaps and splatmaps are still exported as lossless png to main pixel precision

I default color maps to -q90 and normal maps to -q10

On Thu, Apr 25, 2024 at 12:09 AM Nicolas Ayotte @.***> wrote:

WEBP works for BULLET AND HAVOK builds

Nice!! Will test and come back to you

— Reply to this email directly, view it on GitHub https://github.com/BabylonJS/UnityExporter/issues/65#issuecomment-2076832181, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGH7J6B7DPVY5GYVXF7TVDY7DI6NAVCNFSM6AAAAAA3Z57VN2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZWHAZTEMJYGE . You are receiving this because you modified the open/close state.Message ID: @.***>

MackeyK24 commented 4 months ago

Yo @nicolasayotte

Checkout the built in compression support for webp compressed textures and gzipped gltf scene files

https://forum.babylonjs.com/t/compressed-interactive-unity-gltf-content/50105

Here is a demo playground using full compression where its possible. Lightmaps, heightmaps and splatmaps still use lossless png to main the pixel precision needed for hdr lighting and terrain texture blending

https://playground.babylonjs.com/index.html?UnityToolkit#3T5CUF