Can depth peeling be implemented without any shader?

Started by
1 comment, last by mmakrzem 10 years, 10 months ago

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

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.

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

This topic is closed to new replies.

Advertisement