#include <volume_rendering_volume_shader.h>
Public Member Functions | |
void | init () |
bool | front2back () const |
template<typename texture2d_pointer > | |
void | pre_render (texture2d_pointer &color_table) |
template<typename tile_type > | |
void | render (tile_type const &tile) |
void | post_render () |
The Volume Shader Class. This class implements a volume shader concept by using CRTP.
Any volume shader should be inherited from this class. As an example:
template<typename types> class SlabbingShader : public VolumeShader< SlabbingShader<types> >
or
template<typename types> class RayCastShader : public VolumeShader< RayCastShader<types> >
The interface is for instance used in the class TileRender.
bool OpenTissue::volume_rendering::VolumeShader< child_type >::front2back | ( | ) | const [inline] |
Front To Back Rendering.
Reimplemented in OpenTissue::volume_rendering::RayCastShader< math_types >, and OpenTissue::volume_rendering::SlabbingShader< math_types >.
void OpenTissue::volume_rendering::VolumeShader< child_type >::init | ( | ) | [inline] |
Initialization. This method should be used to initialize internal data. For instance setting up textures (for RTT) or frame buffer objects. It could also be used for compiling and loading GPU programs.
The method should be invoked after a render context have created.
Reimplemented in OpenTissue::volume_rendering::RayCastShader< math_types >, and OpenTissue::volume_rendering::SlabbingShader< math_types >.
void OpenTissue::volume_rendering::VolumeShader< child_type >::post_render | ( | ) | [inline] |
Post Render. This mehod is invoked after having rendered all tiles. It is usefull for cleaning up GL state or transfering rendering result to frame-buffer (for RTT).
Reimplemented in OpenTissue::volume_rendering::RayCastShader< math_types >, and OpenTissue::volume_rendering::SlabbingShader< math_types >.
void OpenTissue::volume_rendering::VolumeShader< child_type >::pre_render | ( | texture2d_pointer & | color_table | ) | [inline] |
Pre-Render. This method prepares the rendering. This is a good place to perform common computations that need to be done for all tiles.
For instance retrieving the model-view transformation, clearing textures (for RTT) or setting GL state.
Reimplemented in OpenTissue::volume_rendering::SlabbingShader< math_types >.
void OpenTissue::volume_rendering::VolumeShader< child_type >::render | ( | tile_type const & | tile | ) | [inline] |
Renders a single tile. Note that your shader is responsible for handling any Ping-Pong schemes inbetween tiles!
Reimplemented in OpenTissue::volume_rendering::RayCastShader< math_types >, and OpenTissue::volume_rendering::SlabbingShader< math_types >.