by phantombeta » Fri Aug 02, 2019 3:16 am
It was turned down because portals have to be "sealed", or things will draw where they shouldn't. But turns out, if you think about it for a moment, it's actually not that hard to figure out a way to get a clean depth buffer for shaders.
Basically, the simplest way to deal with this is have the depth buffer for PP shaders just be an extra texture. You render the geometry to it in the world rendering pass in addition to the normal colour buffer, and just draw the depth value to it.
However, you don't draw the "sealing" to it, so this depth texture remains "unsealed", while the actual depth buffer gets sealed, so that it doesn't render things where it shouldn't.
The drawbacks of this method are (very slightly) higher VRAM usage and possibly very slightly more work for the GPU (but not really that much), but it's certainly not that bad of a price to pay to have a proper depth buffer for shaders.
This would also actually allow SSAO to be done normally, too, so it'll be able to happen for all portals with recursive ones instead of having to be limited to a certain number.
It was turned down because portals have to be "sealed", or things will draw where they shouldn't. But turns out, if you think about it for a moment, it's actually not that hard to figure out a way to get a clean depth buffer for shaders.
Basically, the simplest way to deal with this is have the depth buffer for PP shaders just be an extra texture. You render the geometry to it in the world rendering pass in addition to the normal colour buffer, and just draw the depth value to it.
However, you don't draw the "sealing" to it, so this depth texture remains "unsealed", while the actual depth buffer gets sealed, so that it doesn't render things where it shouldn't.
The drawbacks of this method are (very slightly) higher VRAM usage and possibly very slightly more work for the GPU (but not really that much), but it's certainly not that bad of a price to pay to have a proper depth buffer for shaders.
This would also actually allow SSAO to be done normally, too, so it'll be able to happen for all portals with recursive ones instead of having to be limited to a certain number.