-
Notifications
You must be signed in to change notification settings - Fork 163
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
Particles rendered in front of laser bitmaps #1335
Comments
No, this has nothing to do with the position or depth buffer. Quite simply, there's no sorting of batched effects being done. Particles rendered additively (stuff without alpha channel) turn out fine because they're order-independent. But then you start running into problems with alpha-minus-one blending (stuff with alpha channel). Unless we sort and render particles one by one (which would kill our frame rate because that would end up breaking the batches), we probably can't fix this very easily. |
Indeed, after thinking about it a bit more I realized that using the position or depth buffer doesn't work here. I guess this is just an issue with how our alpha blending works. I read about order independent blending but that would probably change how particles look like and break other stuff as well. Should we keep this issue open? It's not really necessary anymore since you determined that opaque particle simply don't work with the FSO rendering engine. One possible solution could be to render those particles with additive or multiplicative blending but I don't know if and how well that would work. |
Order independent blending might be actually a valid solution for this. Probably linked-lists fragments. But that's going to require a compute shader and shader atomics. I've also looked into weighted blended order independent transparency but that ends up producing the same results as this issue when opacity is 1.0. |
Are compute shaders a problem? Sure, we would have to have a fallback for hardware that doesn't support them but we already have a code path that does this so the feature could be enabled whenever support for compute shaders is detected. |
@AxemP reported this on IRC.
Opaque particle effects obscure laser bitmaps even though those bitmaps are located in front of them in the world. This is caused by how the particle shader uses the position or depth buffer for determining the soft-particle intensity. Since laser bitmaps are not rendered into either of those buffers, the particle shader doesn't know that there is a bitmap there and renders the particle bitmap on top of the laser bitmap.
Test mod provided by @AxemP: https://drive.google.com/open?id=0B_q0tkX7VcSaZXZHQ0w4bDZsLTg
The text was updated successfully, but these errors were encountered: