stackotter / delta-client

An open source Minecraft Java Edition client built for speed.
https://deltaclient.app
GNU General Public License v3.0
313 stars 33 forks source link

Order independent transparency + (mesh building & caching optimisation) + fix bubble columns #164

Closed stackotter closed 1 year ago

stackotter commented 1 year ago

Description

Order independent transparency is a game changer in terms of renderer performance. It looks very similar to fully correct transparency rendering in most cases, and it's a lot faster (especially on heavily CPU bottlenecked systems).

The mesh building optimisation was a pretty easy one. I essentially just replaced all use of Set<Direction> with a custom bitset-based implementation of a set called DirectionSet. This gave a 44% improvement in chunk mesh generation speed in my simple benchmark.

The caching optimisation was the product of a binary caching experiment I was working on out of interest. It turns out that my method is actually 22x faster than Protobuf at caching the BlockModelPalette, and it's a lot more maintainable (Protobuf-based caching is horrible for flexibility and maintainability). I ended up implementing my custom binary caching method for BlockRegistry, TexturePalette, FontPalette, and ItemModelPalette. Overall this made Delta Client start up times around 4x faster (200ms, or 160ms if the cache files are cached in memory from a recent launch).

The bubble columns issue was happening because Delta Client didn't realise they were a fluid so they just rendered as air. Pretty easy to fix with a little hardcoding (required because Pixlyzer doesn't have enough information to derive the fact that bubble columns are just fancy water).

ninjadev64 commented 1 year ago

:tada: