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

Investigate using ARB_fragment_shader_interlock extension for volumetric fog #817

Open
IntegratedQuantum opened this issue Dec 6, 2024 · 2 comments
Labels
enhancement a new feature or improvement experimental a feature or idea that will require lots of experimentation graphics
Milestone

Comments

@IntegratedQuantum
Copy link
Member

This extension seems to be widely available on intel and nvidia hardware. (sadly no support on AMD)
There are some potential performance improvements from this (it would allow using an f11/f10 framebuffer), which could be especially helpful on the (generally weak) intel iGPUs. Furthermore it would also allow some visual improvements (support for denser fogs, less graphical glitches and maybe even lighting)

@IntegratedQuantum IntegratedQuantum added enhancement a new feature or improvement experimental a feature or idea that will require lots of experimentation optimization a performance problem that should be addressed or an optimization idea graphics labels Dec 6, 2024
@IntegratedQuantum IntegratedQuantum added this to the Long-Term Goals milestone Dec 6, 2024
@IntegratedQuantum
Copy link
Member Author

I implemented a prototype in the impossible_fog branch.
Functionally it works well and fixes the annoying problems of volumetric fog:

  • no more artifacts when looking at the fog backface (this also fixes the blooming pixel errors)
  • no more artifacts when the fog strength or fog distance get too large

I still need to check the performance impact and try out lighting.

@IntegratedQuantum
Copy link
Member Author

I have investigated the performance impact of this, and while the f11/f10 framebuffer does increase performance by ~600 µs on my intel iGPU test device, it is weight up by the ~500 µs cost of copying the depth buffer.
Additionally there is an ~5-10% performance improvement in the transparent rendering step. However this does not matter much in the grand scheme of things.

Because it makes only such a small difference, I have decided that ti's not worth the extra code complexity for now. Maybe in the future, once more devices (most importantly AMD) were to support this extension, it might be worth another look, due to fixing some of the visual issues/limitations of fog.

@IntegratedQuantum IntegratedQuantum removed the optimization a performance problem that should be addressed or an optimization idea label Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement a new feature or improvement experimental a feature or idea that will require lots of experimentation graphics
Projects
None yet
Development

No branches or pull requests

1 participant