So, you want the particles to be depth-tested and written to the depth buffer during the particle pass, but have the SSAO pass run as if they weren't written? Something like this springs to mind:
Create a second depth buffer. Before the particle pass copy the first to it, then set it as active. Then run particles with depth testing and writing both enabled. Then switch back to using the first for the SSAO pass.
I have to admit that I have no idea whatsoever how well (or not so well) this would run. Copying the first depth buffer to the second gives me the horrors, but the alternative is to write out a second copy of depth during the regular rendering passes, which may well be worse.
It may alternatively be possible to do something with the stencil buffer, but that might not work so well if you're already using it for something else.
Show differencesHistory of post edits
#1mhagain
Posted 19 September 2012 - 06:31 PM
So, you want the particles to be depth-tested and written to the depth buffer during the particle pass, but have the SSAO pass run as if they weren't written? Something like this springs to mind:
Create a second depth buffer. Before the particle pass copy the first to it, then set it as active. Then run particles with depth testing and writing both enabled. Then switch back to the first for the SSAO pass.
I have to admit that I have no idea whatsoever how well (or not so well) this would run. Copying the first depth buffer to the second gives me the horrors, but the alternative is to write out a second copy of depth during the regular rendering passes, which may well be worse.
It may alternatively be possible to do something with the stencil buffer, but that might not work so well if you're already using it for something else.
Create a second depth buffer. Before the particle pass copy the first to it, then set it as active. Then run particles with depth testing and writing both enabled. Then switch back to the first for the SSAO pass.
I have to admit that I have no idea whatsoever how well (or not so well) this would run. Copying the first depth buffer to the second gives me the horrors, but the alternative is to write out a second copy of depth during the regular rendering passes, which may well be worse.
It may alternatively be possible to do something with the stencil buffer, but that might not work so well if you're already using it for something else.