• Advertisement
Sign in to follow this  

Can depth peeling be implemented without any shader?

This topic is 1674 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

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..

 

Share this post


Link to post
Share on other sites
Advertisement

Depth peeling needs to perform this test on each pixel:

[source]

if( pixel_depth < depth_buffer_value || pixel_depth > peeled_depth_value )

{

  discard;

}

[/source]

 

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.

Share this post


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

  • Advertisement