netpyoung / unity.webp

:art: WebP made easy for Unity3d
https://netpyoung.github.io/unity.webp/
MIT License
237 stars 28 forks source link

Fix upside down and performance issues all in one #24

Closed shunia closed 3 years ago

shunia commented 3 years ago

It's been a long time since I work with Unity and WebP, thanks for this library and it has helped a lot. And when I finally solved the issues I created, I thought I should give my solution back here. So I organized my code and create the pull request here.

This pr can not be merged, just for the library owners' information.

This pr can:

  1. Fix upside down problem: https://github.com/netpyoung/unity.webp/issues/18#issuecomment-598530681
  2. Fix performance issue (10x faster decoding): https://github.com/netpyoung/unity.webp/issues/21
  3. Offer render ability for further extending

And because I'm no longer working on Unity, and Unity just crashes my laptop when opening, this pr can not:

  1. Run!!! (I can not make the project run because when I open Unity and my laptop just crashes), so the codes may not able to passed the build;
  2. Be used directly: The actual loading logic should be implemented (WebPLoader.cs#32)
netpyoung commented 3 years ago

You found the way. good job and thank you pull request.