PDA

View Full Version : Depth-based screen-space effects and multisampling



Jackis
06-03-2008, 04:42 AM
Hello!

I would like to know, how do you concern with edge problems, appearing when you get back screen depth texture and use it after in some calculations (like transparency, volumetric fog or smth like that).

The problem's nature is evident - texture we got looses information about individual fragments/samples, coveraged by pixel. So, we may got huge discontinuity in our screen-space function we're applying with above mentioned depth texture.

The solution we've been used up to now - is to disable multisampling, render to FBO with 2x sizes, and minify back to match the screen. But this surely has disadvantages - the most important growing fill-rate. So, better solutions are desired.

Any comments are very much appreciated!

Dark Photon
06-03-2008, 05:37 AM
I would like to know, how do you concern with edge problems, appearing when you get back screen depth texture and use it after in some calculations (like transparency, volumetric fog or smth like that).

The problem's nature is evident - texture we got looses information about individual fragments/samples, coveraged by pixel. So, we may got huge discontinuity in our screen-space function we're applying with above mentioned depth texture.

The GPU Gems 3 "High-Speed Off Screen Particles" approach seems to work pretty well for fog/smoke/fuzzy effects. Basically, use low-res particles for the bulk of the scene, but around edge discontinuities use the full-res. Mask between these using stencil.

However, this doesn't really address your base question, which is how to fully take advantage of an MSAA depth buffer. You might look at the Acquiring Depth and Downsampling Depth sections in that article for some ideas.

Jackis
06-03-2008, 09:35 AM
Dark Photon,

thank you, I will have a look there.

Actually, we have no problems with particles. Main problems are with effects like full-screen fog calculation (atmospheric scattering, underwater rendering and so on).

Ingrater
06-03-2008, 04:02 PM
GPU Gems 2 features an article about defferend shading in STALKER. They solved the issue with an edge detection filter to achive anti aliasing. Mabye thats what your searching for. (The article has been released on the nvidia developer page for free)

Dark Photon
06-04-2008, 08:34 PM
They solved the issue with an edge detection filter to achive anti aliasing.
The GPU Gems 3 article describes something similar. IIRC using a Sobel filter on the depth texture to find edges and seed the stencil mask, then just render high-res there.

Brolingstanz
06-05-2008, 06:15 AM
FWIW, the only hardware that I know of that is capable of a true multisample depth resolve (manual or otherwise) is the ATI HD3000, but afaik that's DX 10.1 only.

We'll surely see this capability across the board in Mount Evans or thereabouts.