Jump to content
  • Advertisement
Sign in to follow this  
godmodder

Depth peeling stop criterium

This topic is 2439 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, everyone,

I would like to perform processing on every depth layer of an arbitrary scene. Therefore I need a stop criterium for the algorithm.
My first thought would be to perform an occlusion query (or queries) to check how many fragments the current depth layer contains. If this is lower than
a certain treshold the algorithm would stop.

I know, however, that occlusion queries cause a lot of stalls and a general decrease in performance. So is there perhaps a smarter/faster way to check how many
fragments were rendered?

Thank you for taking the time to reply,
Jeroen

Share this post


Link to post
Share on other sites
Advertisement
Actually I think you could try occlusion queries, they're not as slow as they seem to be. I don't know of any another way how to tell the exact number of fragments processed.

One another way might be to just approximate the number of fragments draw, but I'm not sure if that would suffice.

Share this post


Link to post
Share on other sites
If DirectX11 or OpenGL4 is an option you can do it by creating per-pixel linked lists in one pass and process the list in another pass.

The first fragment of an arbitrary screen pixel is part of layer 0 and the second is part of layer 1 and so on.

Share this post


Link to post
Share on other sites
I found another method which renders the geometry's depth complexity into a texture. Then this texture is downsampled with a max-kernel to 1 value which is the maximum scene depth complexity. To get this value back from the GPU a hack using an occlusion query is used, or it can be read back using the regular functions for that (don't know what is faster).

Anyway, in my app, I need to render small views (512 views of 64x64 size) of the scene. Problem is, I thought I could avoid the performance penalty for occlusion queries by performing other work while they complete. However, I found that just calling glBeginQuery() and glEndQuery() 512 times reduces my framerate to 7fps. Are these calls really meant to take this long? I thought only querying the actual result would cause a terrible slowdown.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!