PDA

View Full Version : Multiple depth targets



zed
06-25-2008, 12:49 PM
Im wanting to write the depth into 2 targets at once
#A normal + #B quarter sized

now this is not possible at present is it?

also i cant Blit from the fullsize to quarter size since blit doesnt except different sized targets with depth.

so what can I do? (aside from physically rendering the geometry twice that is)

cheers zed

Ilian Dinev
06-25-2008, 01:25 PM
Render to an FBO with a depth-texture attached. Do whatever you want with the depth-texture afterwards: resizing, filtering, using as a parameter for a post-process filter like SSAO. And you can use gl_FragDepth to do tricks.

zed
06-25-2008, 02:17 PM
cheers Ilian but wont you end up with errors due to the averaging of the non linear depth values? or is this visually not that jarring?

perhaps u can convert the z value to real value (do the resize) and then recreate the z value again

Ilian Dinev
06-25-2008, 03:00 PM
Yes, it'll create artifacts, but in recent games developers often decide to render particles in half-resolution, as an optimization - that doesn't create too noticeable problems.
Though, I do not know whether they reconstruct the Z value when resizing.

innuendo
06-27-2008, 03:41 AM
Render to an FBO with a depth-texture attached. Do whatever you want with the depth-texture afterwards: resizing, filtering, using as a parameter for a post-process filter like SSAO. And you can use gl_FragDepth to do tricks.


I am not belive that using gl_FragDepth is a good idea.
What's wrong with using one MRT as eyePosition ?

zed
06-28-2008, 07:47 PM
Yes, it'll create artifacts, but in recent games developers often decide to render particles in half-resolution, as an optimization - that doesn't create too noticeable problems.
Though, I do not know whether they reconstruct the Z value when resizing.
i think u mean quarter resolution ie 1/2 x 1/2
yes this is part of the reason i wanted it for, the artifacts were't really noticable (though didnt look to closely)
the particles though did look quite a lot worse,
and as its not 4x quicker since u have to first lay down depth + also render the final particle texture blended upscaled over the whole framebuffer ive decided not to do it. (in fact often it will make the whole rendering slower, unless u just enabled it for frames where theres lotsa particles onscreen)
a better method is just to fade out the particles when they become to large on the screen

ScottManDeath
06-28-2008, 10:59 PM
There is a GPU gems 3 article about something like this. It talks about how to treat the artifacts.

Dark Photon
06-30-2008, 06:02 AM
There is a GPU gems 3 article about something like this. It talks about how to treat the artifacts.
Chapter 23: High-Speed, Off-Screen Particles, IIRC.

knackered
06-30-2008, 07:04 AM
have you got asperger's syndrome, dark photon? being able to call to mind a chapter number is very...special.

Dark Photon
06-30-2008, 01:04 PM
have you got asperger's syndrome, dark photon? being able to call to mind a chapter number is very...special.
Man, I wish. Sadly I'm just a googlemaniac that remembered a fragment of the title.

knackered
06-30-2008, 03:08 PM
must be just me then - except I can only remember beer mats manufactured between march 1953 and november 1958. Now you tell me what use is that?