Original Post
Final edit: Managed to resolve the issue, apparently my depth calculation for the particles were wrong
Hello,
I am working on a deferred rendering engine on XNA, and I'm stuck on how to perform depth testing when it comes to combining transparent objects and particles on the final render target.
Right now, I render my opaque geometry on the GBuffer, whilst packing the linear depth into a ARGB surface.
What would be the ideal way to draw the transparent geometry on the scene? I thought of sampling the opaque depth, calculating the depth of the particle, and drawing or clipping depending on the sampled depth, but I couldn't make it work so far.
Thanks in advance!
Edit: what I'm trying to prevent (particles are behind the curtain in here)

spawner is in the center
Hello,
I am working on a deferred rendering engine on XNA, and I'm stuck on how to perform depth testing when it comes to combining transparent objects and particles on the final render target.
Right now, I render my opaque geometry on the GBuffer, whilst packing the linear depth into a ARGB surface.
What would be the ideal way to draw the transparent geometry on the scene? I thought of sampling the opaque depth, calculating the depth of the particle, and drawing or clipping depending on the sampled depth, but I couldn't make it work so far.
Thanks in advance!
Edit: what I'm trying to prevent (particles are behind the curtain in here)

spawner is in the center