MrAntares / roBrowserLegacy

This is a continuation of the original robrowser. All credits to the original creators and the new ones :)
GNU General Public License v3.0
184 stars 118 forks source link

[Experimental] Fix depth calculation issues #371

Open waken22 opened 4 months ago

waken22 commented 4 months ago

This is a Experimental PR to try to improve the rendering to behave better in some scenarios where sprites were colliding with 3d models. It's not perfect, and is my attempt to improve it.

Do not merge until we're sure it doesn't make any additional issues.

Thanks to @Danil0v3s to provide the magic formula.

Danil0v3s commented 4 months ago

Could you provide some evidences?

waken22 commented 4 months ago

https://gyazo.com/6b1f8f326a2baff4aa510d251850c3e1 https://gyazo.com/f14a71574d751dbda3d9c60ee7f22f19 https://gyazo.com/4d2bf0952aa55f25b3b9474a3a8324bb Test1

As i said it's not perfect though: https://gyazo.com/f0f545fd65f752482f078333bf4c66c6 https://gyazo.com/9353ff82bbf99a173fbc0decb4668932

Danil0v3s commented 4 months ago

By the looks of it, it seems like the billboarding is still being applied to the vertical axis of the sprite 🤔

waken22 commented 4 months ago

By the looks of it, it seems like the billboarding is still being applied to the vertical axis of the sprite 🤔

Mmm removing the Y billboard make the sprite to start to distort... so i gave up and instead i used the formula to apply it to the Z.