RobertBeckebans / RBDOOM-3-BFG

Doom 3 BFG Edition source port with updated DX12 / Vulkan renderer and modern game engine features
https://www.moddb.com/mods/rbdoom-3-bfg
GNU General Public License v3.0
1.48k stars 253 forks source link

Optimize fog rendering by using the depth buffer #938

Open RobertBeckebans opened 4 weeks ago

RobertBeckebans commented 4 weeks ago

We can reconstruct the world space position per pixel using the depth buffer in the pixel shader and therefore don't need to render the geometry the fog light is interacting with. Just render the quad of the light scissor and run it like a deferred shading technique.