Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster transparency #4

Open
Inspirateur opened this issue Oct 18, 2024 · 0 comments
Open

Faster transparency #4

Inspirateur opened this issue Oct 18, 2024 · 0 comments

Comments

@Inspirateur
Copy link
Owner

Transparency is currently supported by manually iterating over the voxel buffer in the hidden face culling phase, using up an extra 300μs to produce a chunk mesh. We also got rid of the opacity mask which was used only to speed up the hidden face culling in the previous version.

We can implement a faster version that supports transparency by bringing back the opacity mask and by adding an extra transparency mask. We can then use leading/trailing zeroes trick to quickly iterate on the transparent bits and only check those bits in the voxel buffer.

This algorithm will perform about as fast as the original version if there are few transparent blocks in the chunk, saving us about 300μs !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant