Jump to content

  • Log In with Google      Sign In   
  • Create Account

Nearest-Depth Upsampling

  • You cannot reply to this topic
2 replies to this topic

#1 Vylsain   Members   -  Reputation: 122


Posted 02 June 2014 - 10:57 AM

Hello everyone.
I'm looking for ways to optimize my particle rendering system.
I implemented low resolution off screen particles explained in this article : 
 The basic concept is to render the particles in a downsized framebuffer and compose the resulting color texture with the main scene color texture.
Myy pipeline looks like this :
| Main Scene |----depth texture--->|  Low Res Particles |----color texture---->| Composition
The depth test is done in the low res particle rendering pass by comparing the scene depth sampled in the input texture with the current fragment depth.
This technique inevitably creates blocky artifacts where opaque geometry is in front of the particles.
I am now looking for a way to get rid of these artifacts. I found an Nvidia's article explaining a technique called "Nearest-Depth Upsampling" that seems really efficient:
But I don't understand this method... English is not my native language so I guess it doesn't help but I can't figure out what those sentences mean :




The nearest-depth upsampling filter fetches the 2x2 low-resolution depths in the bilinear footprint of the current full-resolution pixel and compares these 4 depths

with the full-resolution depth of the current pixel. Then the filter computes which of these four low-resolution depths is nearest to the full-resolution depth and
returns the corresponding low-resolution color for that sample. The nearest-depth filter can reconstruct high-quality edges if the resolution of the low-resolution rendering pass is high enough to capture the opaque-geometry features.



Can someone explain it to me in other words or with more details ?
Thank you.


#2 MJP   Moderators   -  Reputation: 10235


Posted 03 June 2014 - 04:08 PM

Nvidia has sample code that you can download from here, which includes the shader code for the nearest-depth upsample.


They used to have links for downloading individual samples, but unfortunately it now looks like you have to download all of them.

#3 Vylsain   Members   -  Reputation: 122


Posted 05 June 2014 - 01:40 AM

Thank you MJP.


I'm not familiar with Direct3D but I'll study this code.