ImFusion SDK 4.3
GlVolumeRendererGlobalIllum Class Reference

#include <ImFusion/GL/GlVolumeRendererGlobalIllum.h>

GlVolumeRenderer that supports global illumination in terms of shadows and local ambient occlusion. More...

+ Inheritance diagram for GlVolumeRendererGlobalIllum:

Detailed Description

GlVolumeRenderer that supports global illumination in terms of shadows and local ambient occlusion.

Using this renderer will provide an improved visual appearance by showing shadows in regions that are occluded by its surroundings. This improves depth perception and yields a generally more realistic rendering outcome.

The current implementation does support rendering multiple volumes at the same time, as well as masks. However, this renderer currently does not support displaying deformations.

This renderer requires OpenGL 4.3 hardware.

See also
ImageView3D, GlVolumeView Hernell et al.: "Local ambient occlusion in direct volume rendering.", IEEE TVCG 16.4 (2010) Sunden et al.: "Efficient volume illumination with multiple light sources through selective light updates." IEEE PacificVis 2015

Classes

struct  ShadingParameters
 Structure encapsulating a Phong shading configuration. More...
 

Public Types

enum class  ChromaDepthMode { Off , UltrasoundOnly , On }
 Options when to apply gradient-free chroma-depth shading, which tints voxels depending on the local distance to the camera. More...
 

Public Member Functions

 GlVolumeRendererGlobalIllum ()
 Create the renderer, may throw if the local hardware does not support OpenGL 4.3.
 
ShadingParameters shadingParameters () const
 Returns the Phong shading parameters.
 
void setShadingParameters (ShadingParameters value)
 Sets the Phong shading parameters.
 
bool isShadowingEnabled () const
 Returns the flag whether to enable shadowing.
 
void setShadowingEnabled (bool value)
 Sets the flag whether to enable shadowing.
 
ChromaDepthMode chromaDepthMode () const
 Returns when to apply gradient-free chroma-depth shading.
 
void setChromaDepthMode (ChromaDepthMode value)
 Sets when to apply gradient-free chroma-depth shading.
 
std::string name () const override
 Returns the name for identification/GUI usage of this volume renderer.
 
void render (const GL::ViewState &viewState, const RenderTextures &renderTextures) override
 Renders the data in the given configuration.
 
SharedImageSetimageData () const override
 Returns the first SharedImageSet that is rendered by this GlVolumeRenderer.
 
bool supportsOITIntegration () const override
 Returns whether this renderer supports the order-independent integration of semi-transparent scene geometry.
 
bool supportsDeformations () const override
 Returns whether this renderer supports showing Deformations attached to images.
 
vec3 center () const override
 Returns the center in world coordinates of the first shown data.
 
void setLod (bool value) override
 Sets the flag whether low LOD mode is enabled (half output render size, half sampling rate).
 
void configuration (Properties *p) const override
 Serialize the current object configuration into the given Properties object.
 
void configure (const Properties *p) override
 Configure this object instance by de-serializing the given Properties.
 
- Public Member Functions inherited from GlVolumeRenderer
virtual void setData (const std::vector< std::pair< const SharedImageSet *, const DisplayOptions3d * > > &data)
 Sets the data to render paired with the display options to use.
 
std::vector< std::pair< const SharedImageSet *, const DisplayOptions3d * > > data () const
 Return the list of shown data paired with the DisplayOptions to use.
 
virtual bool dirty () const
 Returns whether the scene is dirty (i.e. re-rendering is required).
 
bool showsDeformations () const
 Returns the flag whether to evaluate deformation fields of volumes during rendering if supported.
 
void setShowDeformations (bool value)
 Sets the flag whether to evaluate deformation fields of volumes during rendering if supported.
 
bool lod () const
 Returns the flag whether low LOD mode is enabled (half output render size, half sampling rate).
 
float samplesPerVoxel () const
 Returns the number of ray casting samples to use per smallest voxel length.
 
void setSamplesPerVoxel (float value)
 Sets the number of ray casting samples to use per smallest voxel length.
 
void setClipPlane (std::optional< Geometry::Plane > clipPlane)
 Sets an optional clip plane so that parts on the back (opposite the direction of the normal vector) are clipped.
 
void setMaxVolumesToDisplay (int value)
 Sets the maximum number of volumes to display.
 
- Public Member Functions inherited from SignalReceiver
 SignalReceiver ()=default
 Default constructor.
 
 SignalReceiver (const SignalReceiver &other)
 Copy constructor, does not copy any existing signal connections from other.
 
SignalReceiveroperator= (SignalReceiver rhs)
 Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs.
 
virtual ~SignalReceiver ()
 Virtual destructor disconnects from all connected signals.
 
- Public Member Functions inherited from Configurable
virtual void configureDefaults ()
 Retrieve the properties of this object, replaces values with their defaults and sets it again.
 
void registerParameter (ParameterBase *param)
 Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration().
 
void unregisterParameter (const ParameterBase *param)
 Remove the given Parameter or SubProperty from the list of registered parameters.
 
 Configurable (const Configurable &rhs)
 
 Configurable (Configurable &&rhs) noexcept
 
Configurableoperator= (const Configurable &)
 
Configurableoperator= (Configurable &&) noexcept
 

Additional Inherited Members

- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 
- Protected Member Functions inherited from GlVolumeRenderer
virtual void onTransformationChanged (const Data *sis)
 Called when the transformation of one of the rendered images has changed.
 
void onDeformationEvent (const DeformationEvent &event)
 Called when a Deformation object attached to the SharedImage has changed its state.
 
- Protected Member Functions inherited from SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.
 
- Protected Attributes inherited from GlVolumeRenderer
std::vector< std::pair< const SharedImageSet *, const DisplayOptions3d * > > m_currentData
 
std::vector< std::shared_ptr< SignalConnection > > m_temporarySlots
 signal connections created for the set of currently shown images
 
std::unique_ptr< GL::Framebufferm_fbo
 FBO used during rendering.
 
bool m_dirty = true
 
bool m_showDeformations = false
 Flag whether to evaluate deformation fields of volumes if supported.
 
bool m_lod = false
 Flag whether low LOD mode is enabled (half output render size, half sampling rate)
 
float m_samplesPerVoxel = 1.f
 Ray casting samples per smallest voxel length.
 
std::optional< Geometry::Planem_clipPlane
 Optional clipping plane to use during rendering.
 
int m_maxVolumesToDisplay = 4
 Maximum number of volumes to display.
 
- Protected Attributes inherited from Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 

Member Enumeration Documentation

◆ ChromaDepthMode

enum class ChromaDepthMode
strong

Options when to apply gradient-free chroma-depth shading, which tints voxels depending on the local distance to the camera.

This mode is mainly intended for image data with low signal-to-noise ratio such as Ultrasound since it does not rely on local gradients.

Enumerator
Off 

Do not use chroma-depth rendering mode for any image.

UltrasoundOnly 

Use chroma-depth rendering mode for images with Modality::ULTRASOUND only.

On 

Use chroma-depth rendering mode for all images.

Member Function Documentation

◆ name()

std::string name ( ) const
overridevirtual

Returns the name for identification/GUI usage of this volume renderer.

Implements GlVolumeRenderer.

◆ render()

void render ( const GL::ViewState & viewState,
const RenderTextures & renderTextures )
overridevirtual

Renders the data in the given configuration.

Parameters
viewStateOpenGL state describing projection and model-view matrix to use for rendering
renderTexturesStruct holding all the render textures to use
Note
The dimensions of all provided textures must be equivalent.

Implements GlVolumeRenderer.

◆ imageData()

SharedImageSet * imageData ( ) const
overridevirtual

Returns the first SharedImageSet that is rendered by this GlVolumeRenderer.

Note
This is merely a low-level convenience function. Please use GlVolumeRenderer::data() or ImageView3D::visibleData() on the parent view in order to get all shown data.

Implements GlVolumeRenderer.

◆ supportsOITIntegration()

bool supportsOITIntegration ( ) const
overridevirtual

Returns whether this renderer supports the order-independent integration of semi-transparent scene geometry.

This flag is queried by GlVolumeView to determine whether blending OIT fragments is performed by the volume renderer (return true) or whether it should be done by the GlVolumeView prior to letting the GlVolumeRenderer render (return false). The default implementation returns false.

See also
GlOrderIndependentTransparency

Reimplemented from GlVolumeRenderer.

◆ supportsDeformations()

bool supportsDeformations ( ) const
overridevirtual

Returns whether this renderer supports showing Deformations attached to images.

The default implementation returns false.

See also
setShowDeformations()

Reimplemented from GlVolumeRenderer.

◆ center()

vec3 center ( ) const
overridevirtual

Returns the center in world coordinates of the first shown data.

Implements GlVolumeRenderer.

◆ setLod()

void setLod ( bool value)
overridevirtual

Sets the flag whether low LOD mode is enabled (half output render size, half sampling rate).

Reimplemented from GlVolumeRenderer.

◆ configuration()

void configuration ( Properties * p) const
overridevirtual

Serialize the current object configuration into the given Properties object.

The default implementation will do so automatically for all registered Parameter and SubProperty instances.

See also
configure() for the inverse functionality

Reimplemented from GlVolumeRenderer.

◆ configure()

void configure ( const Properties * p)
overridevirtual

Configure this object instance by de-serializing the given Properties.

The default implementation will do so automatically for all registered Parameter and SubProperty instances.

See also
configuration() for the inverse functionality

Reimplemented from GlVolumeRenderer.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close