#include <Compositing.h>
Inheritance diagram for VolVis::VolumeRendering::Compositing:
Public Member Functions | |
Compositing (Raycasting *raycasting) | |
void | enableDepthCueing (bool enable) |
void | enablePhong (bool enable) |
void | render () |
void | setDepthCueing (double k1, double k2) |
void | setStochasticJittering (double factor) |
VolVis::VolumeRendering::Compositing::Compositing | ( | Raycasting * | raycasting | ) |
Constructor. Binds the raycasting object and loads the needed shaders.
raycasting | this implements the raycasting algorithm |
void VolVis::VolumeRendering::Compositing::enableDepthCueing | ( | bool | enable | ) |
Depth cueing attenuates the color and alpha according to the distance of a voxel to the image plane.
enable | if true, depth cueing is enabled, otherwise it is disabled |
void VolVis::VolumeRendering::Compositing::enablePhong | ( | bool | enable | ) |
The phong reflection model can be applied for a compositing rendering, which enforces the three dimensional appearance. The parameters (light source, reflection parameters) are stored in the Raycasting object.
enable | if true, the phong reflection model is applied, otherwise the volume is drawn flat. |
void VolVis::VolumeRendering::Compositing::render | ( | ) | [virtual] |
Updates shader parameters and renders an image plane. Raycasting is done within a shader.
Implements VolVis::VolumeRendering::Rendering.
void VolVis::VolumeRendering::Compositing::setDepthCueing | ( | double | k1, | |
double | k2 | |||
) |
Defines the parameters for depth cueing. Depth cueing is calculated with 1.0/(k1 + k2*distance).
k1 | part of depth cueing which is independent from distance | |
k2 | part of depth cueing which depends on the distance to the image plane |
void VolVis::VolumeRendering::Compositing::setStochasticJittering | ( | double | factor | ) |
Stochastic jittering adds a little offset from a noise texture to each ray. This can enhance the visual appearance by avoiding woodgrain artifacts.
factor | a value between 0 and 1. With a value of zero the jittering is disabled. |