cgv
Loading...
Searching...
No Matches
volume_renderer.cxx
1#include "volume_renderer.h"
2#include <random>
3#include <cgv/math/ftransform.h>
4#include <cgv_gl/gl/gl.h>
5#include <cgv_gl/gl/gl_tools.h>
6
7namespace cgv {
8 namespace render {
9 volume_renderer& ref_volume_renderer(context& ctx, int ref_count_change)
10 {
11 static int ref_count = 0;
12 static volume_renderer r;
13 /*if (ref_count == 0) {
14 r.init(ctx);
15 }*/
16 r.manage_singleton(ctx, "volume_renderer", ref_count, ref_count_change);
17 /*if (ref_count < 1)
18 r.clear(ctx);*/
19 return r;
20 }
21
26
28 {
29 integration_quality = IQ_128;
31 interpolation_mode = IP_LINEAR;
32 enable_depth_test = true;
33
34 compositing_mode = CM_BLEND;
35
37
38 enable_lighting = false;
39 light_local_to_eye = true;
41 light_direction = normalize(vec3(-1.0f, 1.0f, 1.0f));
42 ambient_strength = 0.3f;
43 diffuse_strength = 0.8f;
44 specular_strength = 0.4f;
45 roughness = 0.3f;
46 specular_color_mix = 0.0f;
47
49 gradient_lambda = 0.0f;
50
51 isosurface_mode = IM_NONE;
52 isovalue = 0.5f;
53 isosurface_color = rgb(0.7f);
55
56 slice_mode = SM_DISABLED;
57 slice_axis = 2;
58 slice_coordinate = 0.5f;
59 slice_opacity = 0.5f;
60
61 clip_box = box3(vec3(0.0f), vec3(1.0f));
62 }
63
64 volume_renderer::volume_renderer() : noise_texture("uint8[R]")
65 {
66 volume_texture = nullptr;
68 gradient_texture = nullptr;
69 depth_texture = nullptr;
70
73 noise_texture.set_wrap_s(TW_REPEAT);
74 noise_texture.set_wrap_t(TW_REPEAT);
75
76 bounding_box = box3(vec3(0.0f), vec3(1.0f));
78
79 noise_offset = vec2(0.0f);
80 }
81
83 {
86
87 unsigned size = 64;
88 std::vector<uint8_t> noise_data(size*size);
89
90 std::default_random_engine rng(42);
91 std::uniform_int_distribution<unsigned> dist(0u, 255u);
92
93 for(size_t i = 0; i < noise_data.size(); ++i)
94 noise_data[i] = static_cast<uint8_t>(dist(rng));
95
97 noise_texture.create(ctx, dv, 0);
98 }
99
101 {
102 // validate set attributes
103 const volume_render_style& vrs = get_style<volume_render_style>();
104 bool res = renderer::validate_attributes(ctx);
105 res = res && (volume_texture != nullptr);
106 return res;
107 }
109 {
110 return prog.build_program(ctx, "volume.glpr", true, defines);
111 }
113 {
114 const volume_render_style& vrs = get_style<volume_render_style>();
115
116 shader_code::set_define(defines, "NUM_STEPS", vrs.integration_quality, volume_render_style::IQ_128);
117 shader_code::set_define(defines, "INTERPOLATION_MODE", vrs.interpolation_mode, volume_render_style::IP_LINEAR);
118 shader_code::set_define(defines, "ENABLE_NOISE_OFFSET", vrs.enable_noise_offset, true);
119 shader_code::set_define(defines, "ENABLE_LIGHTING", vrs.enable_lighting, false);
120 shader_code::set_define(defines, "USE_GRADIENT_TEXTURE", vrs.use_gradient_texture, false);
121 shader_code::set_define(defines, "ENABLE_GRADIENT_MODULATION", vrs.enable_gradient_modulation, false);
122 shader_code::set_define(defines, "ENABLE_DEPTH_TEST", vrs.enable_depth_test, false);
123
124 shader_code::set_define(defines, "ISOSURFACE_MODE", vrs.isosurface_mode, volume_render_style::IM_NONE);
125 shader_code::set_define(defines, "ISOSURFACE_COLOR_MODE", vrs.isosurface_color_from_transfer_function, false);
126
127 shader_code::set_define(defines, "SLICE_MODE", vrs.slice_mode, volume_render_style::SM_DISABLED);
128
129 shader_code::set_define(defines, "COMPOSITING_MODE", vrs.compositing_mode, volume_render_style::CM_BLEND);
131 shader_code::set_define(defines, "TRANSFER_FUNCTION_SAMPLER_DIMENSIONS", transfer_function_texture->get_nr_dimensions(), 1u);
132 }
134 {
135 bool res = renderer::init(ctx);
136 res = res && position_aam.init(ctx);
137 enable_attribute_array_manager(ctx, position_aam);
138
139 // use a single optimized triangle strip to define a cube
140 std::vector<vec3> positions = {
141 vec3(-0.5f, +0.5f, -0.5f),
142 vec3(+0.5f, +0.5f, -0.5f),
143 vec3(-0.5f, -0.5f, -0.5f),
144 vec3(+0.5f, -0.5f, -0.5f),
145 vec3(+0.5f, -0.5f, +0.5f),
146 vec3(+0.5f, +0.5f, -0.5f),
147 vec3(+0.5f, +0.5f, +0.5f),
148 vec3(-0.5f, +0.5f, -0.5f),
149 vec3(-0.5f, +0.5f, +0.5f),
150 vec3(-0.5f, -0.5f, -0.5f),
151 vec3(-0.5f, -0.5f, +0.5f),
152 vec3(+0.5f, -0.5f, +0.5f),
153 vec3(-0.5f, +0.5f, +0.5f),
154 vec3(+0.5f, +0.5f, +0.5f)
155 };
156 set_position_array(ctx, positions);
157
160
161 return res;
162 }
163 void volume_renderer::clear (const context& ctx) {
164 disable_attribute_array_manager(ctx, position_aam);
165 position_aam.destruct(ctx);
167 renderer::clear(ctx); // perform upstream actions
168 }
169
171 if(!tex || tex->get_nr_dimensions() != 3)
172 return false;
173 volume_texture = tex;
174 return true;
175 }
176
178 if(!tex || tex->get_nr_dimensions() > 2)
179 return false;
181 return true;
182 }
183
185 if(!tex || tex->get_nr_dimensions() != 3)
186 return false;
187 gradient_texture = tex;
188 return true;
189 }
190
192 if(!tex || tex->get_nr_dimensions() != 2)
193 return false;
194 depth_texture = tex;
195 return true;
196 }
197
198 void volume_renderer::set_bounding_box(const box3& bbox)
199 {
200 bounding_box = bbox;
201 }
202
203 void volume_renderer::transform_to_bounding_box(bool flag)
204 {
206 }
207
208 void volume_renderer::set_noise_offset(const vec2& offset)
209 {
210 noise_offset = offset;
211 }
212
214 const volume_render_style& vrs = get_style<volume_render_style>();
215 if(!renderer::enable(ctx))
216 return false;
217 int vp[4];
218 glGetIntegerv(GL_VIEWPORT, vp);
219 ref_prog().set_uniform(ctx, "viewport_dims", vec2(float(vp[2] - vp[0]), float(vp[3] - vp[1])));
220 ref_prog().set_uniform(ctx, "noise_offset", noise_offset);
221
222 ref_prog().set_uniform(ctx, "scale_adjustment_factor", vrs.scale_adjustment_factor);
223
224 ref_prog().set_uniform(ctx, "light_local_to_eye", vrs.light_local_to_eye);
225 ref_prog().set_uniform(ctx, "light_direction", normalize(vrs.light_direction));
226 float specular_exponent = cgv::math::lerp(128.0f, 1.0f, cgv::math::clamp(vrs.roughness, 0.0f, 1.0f));
227 ref_prog().set_uniform(ctx, "ambient_strength", vrs.ambient_strength);
228 ref_prog().set_uniform(ctx, "diffuse_strength", vrs.diffuse_strength);
229 ref_prog().set_uniform(ctx, "specular_strength", vrs.specular_strength);
230 ref_prog().set_uniform(ctx, "specular_exponent", specular_exponent);
231 ref_prog().set_uniform(ctx, "specular_color_mix", vrs.specular_color_mix);
232
233 ref_prog().set_uniform(ctx, "gradient_lambda", std::max(vrs.gradient_lambda, 0.001f));
234
235 ref_prog().set_uniform(ctx, "isovalue", vrs.isovalue);
236 ref_prog().set_uniform(ctx, "isosurface_color", vrs.isosurface_color);
237
238 ref_prog().set_uniform(ctx, "slice_axis", vrs.slice_axis);
239 ref_prog().set_uniform(ctx, "slice_coordinate", vrs.slice_coordinate);
240 ref_prog().set_uniform(ctx, "slice_opacity", vrs.slice_opacity);
241
242 ref_prog().set_uniform(ctx, "clip_box_min", vrs.clip_box.get_min_pnt());
243
244 ref_prog().set_uniform(ctx, "clip_box_max", vrs.clip_box.get_max_pnt());
245
247 ctx.disable_depth_test();
248 ctx.push_blend_state();
249 ctx.enable_blending();
251 ctx.push_cull_state();
252 ctx.set_cull_state(CM_FRONTFACE);
253
256 noise_texture.enable(ctx, 2);
259 return true;
260 }
277 void volume_renderer::draw(context& ctx, size_t start, size_t count, bool use_strips, bool use_adjacency, uint32_t strip_restart_index)
278 {
280
282 const volume_render_style& vrs = get_style<volume_render_style>();
283 cgv::box3 clipped_box(
286 );
287 ctx.mul_modelview_matrix(cgv::math::translate4(clipped_box.get_center()));
288 ctx.mul_modelview_matrix(cgv::math::scale4(clipped_box.get_extent()));
289 }
290
291 glDrawArrays(GL_TRIANGLE_STRIP, 0, (GLsizei)14);
292
294 }
295 }
296}
297
298#include <cgv/gui/provider.h>
299
300namespace cgv {
301 namespace gui {
302
305 bool create(provider* p, const std::string& label,
306 void* value_ptr, const std::string& value_type,
307 const std::string& gui_type, const std::string& options, bool*) {
309 return false;
310 cgv::render::volume_render_style* vrs_ptr = reinterpret_cast<cgv::render::volume_render_style*>(value_ptr);
311 cgv::base::base* b = dynamic_cast<cgv::base::base*>(p);
312
313 p->add_member_control(b, "Quality", vrs_ptr->integration_quality, "dropdown", "w=114;enums='8=8,16=16,32=32,64=64,128=128,256=256,512=512,1024=1024,2048=2048,4096=4096'", " ");
314 p->add_member_control(b, "Use Noise", vrs_ptr->enable_noise_offset, "check", "w=74");
315 p->add_member_control(b, "Interpolation", vrs_ptr->interpolation_mode, "dropdown", "enums=Nearest,Smoothed,Linear,Cubic");
316
317 p->add_member_control(b, "Depth Test", vrs_ptr->enable_depth_test, "check");
318
319 p->add_member_control(b, "Compositing Mode", vrs_ptr->compositing_mode, "dropdown", "enums='Maximum Intensity Projection, Average, Blend'");
320
321 p->add_member_control(b, "Scale Adjustment", vrs_ptr->scale_adjustment_factor, "value_slider", "min=0.0;step=0.001;max=1000.0;log=true;ticks=true");
322
323 if(p->begin_tree_node("Lighting", vrs_ptr->enable_lighting, false)) {
324 p->align("/a");
325 p->add_member_control(b, "Enable", vrs_ptr->enable_lighting, "check", "w=88", " ");
326 p->add_member_control(b, "Local to Eye", vrs_ptr->light_local_to_eye, "check", "w=100");
327 p->add_member_control(b, "Normals from Gradient Texture", vrs_ptr->use_gradient_texture, "check");
328 p->add_member_control(b, "Direction", vrs_ptr->light_direction[0], "value", "w=58;min=-1;max=1", " ");
329 p->add_member_control(b, "", vrs_ptr->light_direction[1], "value", "w=58;min=-1;max=1", " ");
330 p->add_member_control(b, "", vrs_ptr->light_direction[2], "value", "w=58;min=-1;max=1");
331 p->add_member_control(b, "", vrs_ptr->light_direction[0], "slider", "w=58;min=-1;max=1;step=0.0001;ticks=true", " ");
332 p->add_member_control(b, "", vrs_ptr->light_direction[1], "slider", "w=58;min=-1;max=1;step=0.0001;ticks=true", " ");
333 p->add_member_control(b, "", vrs_ptr->light_direction[2], "slider", "w=58;min=-1;max=1;step=0.0001;ticks=true");
334
335 p->add_decorator("Light Parameters", "heading", "level=3");
336 p->add_member_control(b, "Ambient", vrs_ptr->ambient_strength, "value_slider", "min=0;max=1;step=0.001;ticks=true");
337 p->add_member_control(b, "Diffuse", vrs_ptr->diffuse_strength, "value_slider", "min=0;max=1;step=0.001;ticks=true");
338 p->add_member_control(b, "Specular", vrs_ptr->specular_strength, "value_slider", "min=0;max=1;step=0.001;ticks=true");
339 p->add_member_control(b, "Roughness", vrs_ptr->roughness, "value_slider", "min=0;max=1;step=0.001;ticks=true");
340 p->add_member_control(b, "Specular Color", vrs_ptr->specular_color_mix, "value_slider", "min=0;max=1;step=0.001;ticks=true");
341 p->align("/b");
342 p->end_tree_node(vrs_ptr->enable_lighting);
343 }
344
345 if(p->begin_tree_node("Gradient Modulation", vrs_ptr->enable_gradient_modulation, false)) {
346 p->align("\a");
347 p->add_member_control(b, "Enable", vrs_ptr->enable_gradient_modulation, "check");
348 p->add_member_control(b, "Lambda", vrs_ptr->gradient_lambda, "value_slider", "min=0.001;max=10;step=0.001;ticks=true;log=true");
349 p->align("\b");
351 }
352 if (p->begin_tree_node("Orthogonal Slicing", vrs_ptr->slice_mode, false)) {
353 p->align("\a");
354 p->add_member_control(b, "Mode", vrs_ptr->slice_mode, "dropdown", "enums='Disabled,Opaque,Transparent'");
355 p->add_member_control(b, "Axis", vrs_ptr->slice_axis, "value_slider", "min=0;max=2;ticks=true");
356 p->add_member_control(b, "Coordinate", vrs_ptr->slice_coordinate, "value_slider", "min=0;max=1;ticks=true");
357 p->add_member_control(b, "Opacity", vrs_ptr->slice_opacity, "value_slider", "min=0;max=1;ticks=true");
358 p->align("\b");
359 p->end_tree_node(vrs_ptr->slice_mode);
360 }
361
362 if(p->begin_tree_node("Isosurface (Blend only)", vrs_ptr->isosurface_mode, false)) {
363 p->align("\a");
364 p->add_member_control(b, "", vrs_ptr->isosurface_mode, "dropdown", "enums='Disabled,Isovalue,Alpha Threshold'");
365
366 p->add_member_control(b, "Value", vrs_ptr->isovalue, "value_slider", "min=0.0;max=1.0;step=0.001;ticks=true");
367 p->add_member_control(b, "Color", vrs_ptr->isosurface_color, "", "w=42", " ");
368 p->add_member_control(b, "From Transfer Function", vrs_ptr->isosurface_color_from_transfer_function, "check", "w=146");
369 p->align("\b");
370 p->end_tree_node(vrs_ptr->isosurface_mode);
371 }
372
373 if(p->begin_tree_node("Clip Box", vrs_ptr->clip_box, false)) {
374 p->align("\a");
375 p->add_gui("Clipping Box", vrs_ptr->clip_box, "",
376 "options='w=100;min=0;max=1;step=0.01;ticks=true;align=\"BL\"';align_col=' '");
377 p->align("\b");
378 p->end_tree_node(vrs_ptr->clip_box);
379 }
380
381 return true;
382 }
383 };
384
385#include "gl/lib_begin.h"
386
387 CGV_API cgv::gui::gui_creator_registration<volume_render_style_gui_creator> volume_rs_gc_reg("volume_render_style_gui_creator");
388
389 }
390}
base class for all classes that can be registered with support for dynamic properties (see also secti...
Definition base.h:75
A data_format describes a multidimensional data block of data entries.
Definition data_format.h:17
unsigned get_nr_dimensions() const
return the number of dimensions of the data set
the data view gives access to a data array of one, two, three or four dimensions.
Definition data_view.h:153
helper template for registration of gui creators
Definition gui_creator.h:32
derive from this class to provide a gui to the current viewer
Definition provider.h:64
bool add_gui(const std::string &label, T &value, const std::string &gui_type="", const std::string &options="")
Add a composed gui of the given gui_type for the given value.
Definition provider.h:247
cgv::base::base_ptr add_decorator(const std::string &label, const std::string &decorator_type, const std::string &options="", const std::string &align="\n")
add a newly created decorator to the group
Definition provider.cxx:168
void align(const std::string &_align)
send pure alignment information
Definition provider.cxx:36
bool begin_tree_node(const std::string &label, const T &value, bool initial_visibility=false, const std::string &options="", gui_group_ptr ggp=gui_group_ptr())
Begin a sub tree of a tree structured gui.
Definition provider.h:212
data::ref_ptr< control< T > > add_member_control(cgv::base::base *base_ptr, const std::string &label, T &value, const std::string &gui_type="", const std::string &options="", const std::string &align="\n")
add control with callback to cgv::base::on_set method on cgv::gui::control::value_change
Definition provider.h:137
void end_tree_node(const T &value)
template specialization that allows to specify value reference plus node_instance by using the result...
Definition provider.h:222
fpnt_type get_center() const
return the center of the box
fvec_type get_extent() const
return a vector with the extents in the different dimensions
const fpnt_type & get_max_pnt() const
return a const reference to corner 7
const fpnt_type & get_min_pnt() const
return a const reference to corner 0
base class for all drawables, which is independent of the used rendering API.
Definition context.h:621
void set_blend_func_back_to_front()
set the default blend function for back to front blending
Definition context.cxx:1752
virtual void mul_modelview_matrix(const dmat4 &MV)
multiply given matrix from right to current modelview matrix
Definition context.cxx:1808
void push_depth_test_state()
push a copy of the current depth test state onto the stack saved attributes: depth test enablement,...
Definition context.cxx:1669
void push_blend_state()
push a copy of the current blend state onto the stack saved attributes: blend enablement,...
Definition context.cxx:1716
virtual void disable_depth_test()
disable the depth test
Definition context.cxx:1695
void pop_blend_state()
pop the top of the current culling state from the stack
Definition context.cxx:1720
void pop_depth_test_state()
pop the top of the current depth test state from the stack
Definition context.cxx:1673
void push_cull_state()
push a copy of the current culling state onto the stack saved attributes: cull face enablement,...
Definition context.cxx:1699
virtual void set_cull_state(CullingMode culling_mode)
set the culling state
Definition context.cxx:1712
virtual void enable_blending()
enable blending
Definition context.cxx:1756
void pop_cull_state()
pop the top of the current culling state from the stack
Definition context.cxx:1703
void pop_modelview_matrix()
see push_V for an explanation
Definition context.cxx:1814
void push_modelview_matrix()
push the current viewing matrix onto a matrix stack for viewing matrices.
Definition context.cxx:1802
virtual bool is_created() const
return whether component has been created
Definition context.cxx:2046
void manage_singleton(context &ctx, const std::string &renderer_name, int &ref_count, int ref_count_change)
used by derived classes to manage singletons
Definition renderer.cxx:23
virtual bool enable(context &ctx)
enables renderer
Definition renderer.cxx:203
virtual bool init(context &ctx)
call init() once before using renderer
Definition renderer.cxx:173
shader_program & ref_prog()
derived renderer classes have access to shader program
Definition renderer.h:75
virtual void enable_attribute_array_manager(const context &ctx, attribute_array_manager &aam)
call this before setting attribute arrays to manage attribute array in given manager
Definition renderer.cxx:54
virtual void clear(const context &ctx)
the clear function destructs the shader program
Definition renderer.cxx:349
virtual void disable_attribute_array_manager(const context &ctx, attribute_array_manager &aam)
call this after last render/draw call to ensure that no other users of renderer change attribute arra...
Definition renderer.cxx:63
void set_position_array(const context &ctx, const std::vector< T > &positions)
templated method to set the position attribute from a vector of positions of type T
Definition renderer.h:176
virtual bool validate_attributes(const context &ctx) const
call to validate, whether essential position attribute is defined
Definition renderer.cxx:130
virtual bool disable(context &ctx)
disable renderer
Definition renderer.cxx:229
a shader program combines several shader code fragments to a complete definition of the shading pipel...
bool set_uniform(const context &ctx, const std::string &name, const T &value, bool generate_error=false)
Set the value of a uniform by name, where the type can be any of int, unsigned, float,...
bool build_program(const context &ctx, const std::string &file_name, bool show_error=false, const shader_define_map &defines=shader_define_map())
successively calls create, attach_program and link.
the texture class encapsulates all functionality independent of the rendering api.
Definition texture.h:15
void set_mag_filter(TextureFilter _mag_filter)
set the magnification filter
Definition texture.cxx:138
bool create(const context &ctx, TextureType _tt=TT_UNDEF, unsigned width=-1, unsigned height=-1, unsigned depth=-1)
create the texture of dimension and resolution specified in the data format base class.
Definition texture.cxx:208
bool disable(const context &ctx)
disable texture and restore state from before last enable call
Definition texture.cxx:756
bool enable(const context &ctx, int tex_unit=-1)
enable this texture in the given texture unit, -1 corresponds to the current unit.
Definition texture.cxx:745
void set_wrap_t(TextureWrap _wrap_t)
set the texture wrap behaviour in t direction
Definition texture.cxx:83
bool destruct(const context &ctx)
destruct the texture and free texture memory and handle
Definition texture.cxx:730
void set_wrap_s(TextureWrap _wrap_s)
set the texture wrap behaviour in s direction
Definition texture.cxx:77
void set_min_filter(TextureFilter _min_filter, float _anisotropy=2.0f)
set the minification filters, if minification is set to TF_ANISOTROP, the second floating point param...
Definition texture.cxx:120
renderer that supports point splatting
texture * gradient_texture
the 3D texture containing vector gradients used for lighting normal calculation
bool build_shader_program(context &ctx, shader_program &prog, const shader_define_map &defines)
build volume program
bool validate_attributes(const context &ctx) const
call to validate, whether essential position attribute is defined
void draw(context &ctx, size_t start, size_t count, bool use_strips=false, bool use_adjacency=false, uint32_t strip_restart_index=-1)
Draw a range of vertices or indexed elements.
void update_defines(shader_define_map &defines)
update shader defines based on render style
bool set_gradient_texture(texture *tex)
sets the gradient texture used for lighting
bool enable(context &ctx)
enables renderer
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
void init_noise_texture(context &ctx)
initializes the noise texture with random values
bool apply_bounding_box_transformation
whether to translate and scale the volume to the given bounding box during rendering
bool set_transfer_function_texture(texture *tex)
sets the transfer function used for classification; must be 1D or 2D (as loaded from an image)
virtual void clear(const context &ctx)
clean up
vec2 noise_offset
offset applied to the noise texture (can be used in conjunction with temporal anti aliasing)
bool set_volume_texture(texture *tex)
sets the 3D volume texture containing scalar values (density or other measured quantities)
render_style * create_render_style() const
overload to allow instantiation of volume_renderer
bool set_depth_texture(texture *tex)
sets the depth texture needed for rendering with additional opaque geometry
texture * volume_texture
the 3D texture used for rendering
bool init(context &ctx)
construct shader programs and return whether this was successful, call inside of init method of drawa...
bool disable(context &ctx)
disable renderer
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
volume_renderer()
initializes position_is_center to true
@ CF_R
undefinded format with no component
std::map< std::string, std::string > shader_define_map
typedef for shader define map data structure
Definition shader_code.h:52
volume_renderer & ref_volume_renderer(context &ctx, int ref_count_change)
reference to a singleton volume renderer that is shared among drawables
@ TI_UINT8
signed integer stored in 64 bits
Definition type_id.h:23
the cgv namespace
Definition print.h:11
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
Definition color.h:853
cgv::math::fvec< float, 2 > vec2
declare type of 2d single precision floating point vectors
Definition fvec.h:667
cgv::math::fvec< float, 3 > vec3
declare type of 3d single precision floating point vectors
Definition fvec.h:669
interface for gui creators
Definition gui_creator.h:14
bool create(provider *p, const std::string &label, void *value_ptr, const std::string &value_type, const std::string &gui_type, const std::string &options, bool *)
attempt to create a gui and return whether this was successful
base class for all render styles
Definition renderer.h:16
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
float specular_strength
material specular component strength
float ambient_strength
light ambient component strength
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
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...
float slice_opacity
in case of transparent mode, slice opacity
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
volume_render_style()
construct with default values
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...
int slice_axis
coordinate axis orthogonal to which slice is rendered
@ IP_LINEAR
modification of the built-in trilinear interpolation to prevent triangular artifacts (results look bl...
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]
traits class with a static function get_name() of type const char* that returns the type name of the ...
Definition type_name.h:54