5#include "gl/lib_begin.h"
18 enum class VolumeIntegrationQuality {
38 enum class VolumeCompositingMode {
39 kMaximumIntensityProjection = 0,
67 float picking_opacity_threshold = 0.03f;
154 void init_noise_texture(
context& ctx);
157 bool init(
context& ctx)
override;
159 void clear (
const context& ctx)
override;
161 bool set_volume_texture(
texture* tex);
163 bool set_transfer_function_texture(
texture* tex);
165 bool set_gradient_texture(
texture* tex);
167 bool set_depth_texture(
texture* tex);
169 void set_bounding_box(
const box3& bbox);
171 void transform_to_bounding_box(
bool flag);
173 void set_noise_offset(
const vec2& offset);
175 bool enable(
context& ctx)
override;
177 bool validate_attributes(
const context& ctx)
const override;
179 bool disable(
context& ctx)
override;
181 void draw(
context& ctx,
size_t start,
size_t count,
182 bool use_strips =
false,
bool use_adjacency =
false, uint32_t strip_restart_index = -1)
override;
187#include <cgv/config/lib_end.h>
attribute array manager used to upload arrays to gpu
base class for all drawables, which is independent of the used rendering API.
renderer()
construct and init attribute tracking flags
Stores preprocessor options used for conditionally compiling shader programs.
the texture class encapsulates all functionality independent of the rendering api.
renderer that supports point splatting
texture * gradient_texture
the 3D texture containing vector gradients used for lighting normal calculation
render_style * create_render_style() const override
create and return the default render style
texture * depth_texture
a 2D texture from a frame buffer depth buffer used to combine volume rendering with opaque geometry
texture * transfer_function_texture
the 2D transfer function texture used for classification of the volume values
bool apply_bounding_box_transformation
whether to translate and scale the volume to the given bounding box during rendering
vec2 noise_offset
offset applied to the noise texture (can be used in conjunction with temporal anti aliasing)
std::string get_default_prog_name() const override
return the default shader program name
texture * volume_texture
the 3D texture used for rendering
texture noise_texture
a 2D texture containing random noise used to offset ray start positions in order to reduce ring artif...
box3 bounding_box
the bounding box of the volume in scene units
namespace for api independent GPU programming
@ kAlphaThreshold
based on volume value (volume >= isovalue)
@ kCubic
default built-in trilinear interpolation
@ kSmoothed
only the closest voxel is sampled
@ kLinear
modification of the built-in trilinear interpolation to prevent triangular artifacts (results look bl...
volume_renderer & ref_volume_renderer(context &ctx, int ref_count_change)
reference to a singleton volume renderer that is shared among drawables
@ kTransparent
opaque slice; volume integration will stop when hit
this header is dependency free
cgv::media::axis_aligned_box< float, 3 > box3
declare type of 3d single precision floating point axis-aligned boxes
cgv::media::color< float, cgv::media::RGB > rgb
declare rgb color type with 32 bit components
cgv::math::fvec< float, 2 > vec2
declare type of 2d single precision floating point vectors
cgv::math::fvec< float, 3 > vec3
declare type of 3d single precision floating point vectors
base class for all render styles
bool light_local_to_eye
whether the light is local to the eye position (moves with the eye) or is static to the scene
bool enable_noise_offset
whether to use the noise texture to offset ray start positions in order to reduce sampling artifacts
bool enable_lighting
whether to enable lighting
bool show_volume
whether to show direct volume
float specular_strength
material specular component strength
float ambient_strength
light ambient component strength
VolumeIsosurfaceMode isosurface_mode
mode of a single supported isosurface
rgb isosurface_color
the default constant isosurface color
bool enable_depth_test
whether to enable depth testing by reading depth from a texture to allow geometry intersecting the vo...
float isovalue
the value used to check for an isosurface
float gradient_lambda
influence scale for gradient-based opacity modulation
VolumeSliceMode slice_mode
mode of slice rendering
bool isosurface_color_from_transfer_function
whether to color the isosurface based on the transfer function
float scale_adjustment_factor
the coefficient used to adjust sample opacity based on volume scaling (useful range between 50 and 50...
VolumeInterpolationMode interpolation_mode
the interpolation method used (supplied volume texture should be set to GL_LINEAR)
float slice_opacity
in case of transparent mode, slice opacity
VolumeIntegrationQuality integration_quality
quality measure for the number of steps used during ray marching
float specular_color_mix
material specular color mix factor (0 = color from transfer function, 1 = pure white)
vec3 light_direction
the direction of the directional light
float roughness
material roughness (inversely proportional to specular shininess)
bool use_gradient_texture
whether to use a supplied gradient texture or compute gradients on the fly via central differences (d...
VolumeCompositingMode compositing_mode
the compositing mode used
int slice_axis
coordinate axis orthogonal to which slice is rendered
float diffuse_strength
material diffuse component strength
bool enable_gradient_modulation
whether to enable modulating the volume opacity by the gradient magnitude
box3 clip_box
a bounding box used to define a subspace of the volume to be visualized
float slice_coordinate
coordinate value along axis defining slice in range [0,1]