GVRAmbientOcclusion¶
- MacroModule¶
author
package
definition
keywords
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 entire 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 the example network for a typical usage.
Details¶
A segmented brain rendered with ambient occlusion (without diffuse/specular light):
Input Fields¶
nodeIn0¶
- name: nodeIn0, type: SoNode¶
Output Fields¶
nodeOut0¶
- name: nodeOut0, type: SoNode¶
Parameter Fields¶
Field Index¶
|
|
|
|
|
|
|
|
Visible Fields¶
Use Half Resolution¶
- name: useHalfResolution, type: Bool, default: FALSE¶
If checked, the module 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¶
Sets the initial offset of each ambient occlusion ray from the center of each voxel.
Steps¶
- name: steps, type: Integer, default: 16, minimum: 1¶
Sets the number of sample steps for each ray. A larger value generates occlusion from voxels that are farther away.
Directions¶
- name: directions, type: Enum, default: 18¶
Defines 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¶
Sets a factor that weights the occlusion contribution of each ray by the dot product of the gradient and the direction.
A value of 1.0 means full dependence on the gradient, and a value of 0.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¶
Sets a factor that fades the ambient occlusion up to the given distance (in millimeters) to all clip planes.
Blend Factor¶
- name: blendFactor, type: Float, default: 1, minimum: 0, maximum: 1¶
Sets the blend factor that is used to apply the AO term to the final image (1.0 means full AO, 0.0 means no AO).
Regenerate¶
- name: regenerate, type: Trigger¶
When pressed, the ambient occlusion volumes are regenerated.