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

Write to depth buffer in alpha mask mode #305

Merged
merged 1 commit into from
Mar 19, 2024
Merged

Conversation

djeedai
Copy link
Owner

@djeedai djeedai commented Mar 19, 2024

When rendering particles in alpha mask mode, there's no transparency involved; each fragment is either fully opaque or fully transparent. Therefore we can use the depth buffer, and don't need some fancy order independent transparency rendering or distance based sorting (which are not implemented).

This change enables depth writing when rendering particles through the AlphaMask3d render pass. This prevents particles from flickering, as visible in the billboard.rs example.

Partially fixes #183 (for non-transparent effects)

When rendering particles in alpha mask mode, there's no transparency
involved; each fragment is either fully opaque or fully transparent.
Therefore we can use the depth buffer, and don't need some fancy order
independent transparency rendering or distance based sorting (which are
not implemented).

This change enables depth writing when rendering particles through the
`AlphaMask3d` render pass. This prevents particles from flickering, as
visible in the `billboard.rs` example.

Partially fixes #183 (for non-transparent effects)
@djeedai djeedai added C - bug Something isn't working A - internal Internal change on a core system labels Mar 19, 2024
@djeedai
Copy link
Owner Author

djeedai commented Mar 19, 2024

Before:

alpha_write_no_depth

After:

alpha_write_depth

@djeedai djeedai merged commit 6367dc6 into main Mar 19, 2024
12 of 13 checks passed
@djeedai djeedai deleted the u/alpha-mask-depth-write branch March 19, 2024 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A - internal Internal change on a core system C - bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Particles flickering
1 participant