|
| gl_transparent_renderer (bool front_to_back=true, float _depth_bias=0.001) |
| construct uninitialized depth peeler
|
|
bool | init (context &ctx) |
| checks for extensions and init depth peeler, return success
|
|
void | init_frame (context &ctx) |
| configure frame buffer and textures
|
|
int | render_transparent (context &ctx, int max_nr_layers, int tex_unit=-1) |
| perform transparent rendering by considering a maximum of the specified number of depth layers
|
|
void | destruct (context &ctx) |
| destruct the transparent renderer
|
|
void | invert_t (bool enable=true) |
| set the sign for the vertical texture coordinate. In case of some ATI-cards this needs to be enabled to avoid flipping intermediate textures. More...
|
|
void | set_back_to_front () |
| enable back to front mode
|
|
void | set_front_to_back () |
| enable front to back mode
|
|
bool | is_front_to_back () const |
| return whether the mode is front to back
|
|
void | set_depth_bias (float bias) |
| the depth bias is used as epsilon for the test against the second depth buffer and is initialized to 0.0005f
|
|
float | get_depth_bias () const |
| return the current depth bias
|
|
bool | is_initialized () const |
| check whether the depth peeler has been initialized, i.e. the init method has been called successfully before
|
|
void | copy_depth_buffer (context &ctx) |
| copies the current depth buffer to the second depth buffer, what is typically done before peeling a layer
|
|
void | begin_layer (context &ctx, int tex_unit=-1) |
| start to extract the next layer. Within begin_layer and end_layer the following OpenGL features are used: texture generation functions, 2D texturing and the alpha Test
|
|
unsigned int | end_layer (context &ctx) |
| finish the layer and return the number of drawn fragments in the layer. All OpenGL settings are restored. More...
|
|
OpenGL helper class to simplify transparent rendering. It is derived from a depth peeler whose functionality is used for the visibility sorting according to the approach described in the "order independent transparency" paper of Cass Everit. Call the init method after your OpenGL context has been created. Transparent rendering is done such that the rendered objects are blended over the rendered scene in the current color and depth buffer. Rendering of transparent objects should be done in the finish_frame method of a drawable. A sample implementation looks like this: