Jump to content

  • Log In with Google      Sign In   
  • Create Account


Can depth peeling be implemented without any shader?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

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

#1 elect   Members   -  Reputation: 115

Like
0Likes
Like

Posted 10 June 2013 - 05:53 AM

I don't know shaders, but I have a basic idea of their concept.

 

I need to implement depth peeling and so I would like to know if first I should go deeper into the shader world or it could be implemented without shaders, just using smartly the glDepthFunc..

 



Sponsor:

#2 RobTheBloke   Crossbones+   -  Reputation: 2339

Like
0Likes
Like

Posted 10 June 2013 - 08:52 AM

Depth peeling needs to perform this test on each pixel:

if( pixel_depth < depth_buffer_value || pixel_depth > peeled_depth_value )
{
  discard;
}

 

With the old FF style rendering, you could only ever do a single depth query (i.e. glDepthFunc, GL_LEQUAL, GL_LESS, etc). The test you need for depth peeling has two depth queries per pixel, which means there isn't any way to shoehorn it into a single glDepthFunc param. You will need to do this in a shader.



#3 MarekKnows.com   Members   -  Reputation: 483

Like
0Likes
Like

Posted 20 June 2013 - 08:23 AM

You can grab sample code for Dual Depth peeling from Nvidia: http://developer.download.nvidia.com/SDK/10.5/opengl/screenshots/samples/dual_depth_peeling.html


---
Free C++, OpenGL, and Game Development Video Tutorials @
www.MarekKnows.com
Play my free games: Ghost Toast, Zing, Jewel Thief





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS