GVRAmbientOcclusion

MacroModule
author MeVis Medical Solutions AG
package MeVisLab/Standard
definition GVRAmbientOcclusion.def
keywords shadow

Purpose

The GVRAmbientOcclusion module adds support for local ambient occlusion to the SoGVRVolumeRenderer. It generates a 3D ambient occlusion volume and requires the SoGVRRayCastSettings module to be used, since the ambient occlusion generation requires access to the whole volume.

The ambient occlusion volume is regenerated whenever the LUTs of the GVR change, but you can trigger a manual update using the Regenerate field.

Usage

See example network for a typical usage.

Details

A segmented brain rendered with ambient occlusion (without diffuse/specular light):

../../../Modules/Macros/GVR/mhelp/Images/AmbientOcclusion.png

Input Fields

nodeIn0

name: nodeIn0, type: SoNode

Output Fields

nodeOut0

name: nodeOut0, type: SoNode

Parameter Fields

Field Index

Blend Factor: Float
Clip Plane Fade: Float
Directions: Enum
Gradient Weight: Float
Offset: Float
Regenerate: Trigger
Steps: Integer
Use Half Resolution: Bool

Visible Fields

Use Half Resolution

name: useHalfResolution, type: Bool, default: FALSE

Uses half the resolution for the ambient occlusion volume, which is a trade-off between quality and memory consumption/update speed.

Offset

name: offset, type: Float, default: 2, minimum: 1

The initial offset of each AO ray from the center of each voxel.

Steps

name: steps, type: Integer, default: 16, minimum: 1

The number of sample steps for each ray (bigger value generate occlusion from voxels that are farther away)

Directions

name: directions, type: Enum, default: 18

The number of ray directions to sample for each voxel.

Values:

Title Name
6 6
18 18

Gradient Weight

name: gradientWeight, type: Float, default: 0.5, minimum: 0, maximum: 1

Weights the occlusion contribution of each ray by the dot product of the gradient and the direction. A value of 1. means full dependence on the gradient and a value of 0. means no gradient influence.

Implementation::
float weight = mix(1., max(0, dot(-gradient, ray_direction)), ambientOcclusionGradientWeight);

Clip Plane Fade

name: clipPlaneFade, type: Float, default: 10, minimum: 0

Fades the AO up to the given distance (in mm) to all clip planes.

Blend Factor

name: blendFactor, type: Float, default: 1, minimum: 0, maximum: 1

Defines the blend factor that is used to apply the AO term to the final image (1. means full AO, 0. means no AO).

Regenerate

name: regenerate, type: Trigger

Regenerate the ambient occlusion volumes.