SoGVRPointLight

InventorModule
author MeVis Medical Solutions AG
package MeVisLab/Standard
dll SoGVR
definition soGVR.def
see also SoGVRVolumeRenderer
inherits from SoGVRShaderParameterPosition
keywords shader, pipeline

Purpose

The SoGVRPointLight adds a point light to the SoGVRVolumeRenderer. The light has a diffuse and specular intensity and uses the material properties (specularity etc.) as specified in the volume renderer. It supports different attenuation modes to model how far the light reaches, which is turned off by default.

Usage

Any number of SoGVRPointLight modules can be placed in front of a SoGVRVolumeRenderer. Note that each light needs to have a unique Name in the same Inventor scene, so you should name the lights according to their role, e.g. headlight or highlight1.

The attenuation mode can be used to either highlight just a specific region, or to improve depth perception by adding attenuation to a headlight, e.g. for endoscopic rendering.

The light Position can be specified in world coordinates (to highlight special features of a dataset) or in eye/camera coordinates to attach the light to the camera (for a headlight).

Details

Examples showing the same point light for the different attenuation modes, the light position is shown as a sphere.

Attenuation off:

../../../Modules/Inventor/SoGVR/mhelp/Images/PointLightNoAttenuation.png

Linear/Quadratic attenuation:

../../../Modules/Inventor/SoGVR/mhelp/Images/PointLightLinearQuadraticAttenuation.png

Spherical attenuation:

../../../Modules/Inventor/SoGVR/mhelp/Images/PointLightSpericalAttenuation.png

Windows

Default Panel

../../../Modules/Inventor/SoGVR/mhelp/Images/Screenshots/SoGVRPointLight._default.png

Output Fields

self

name: self, type: SoNode

a node that should be placed in front of a SoGVRVolumeRenderer.

see also SoGVRShaderParameterPosition.self

Parameter Fields

Visible Fields

Enabled

name: enabled, type: Bool, default: TRUE

Enables the light.

see also SoGVRShaderParameterPosition.enabled

Name

name: name, type: String, default: pointLight1

Specifies the name of the light, the name needs to be unique in the same Inventor scene.

see also SoGVRShaderParameterPosition.name

Coordinate System

name: coordinateSystem, type: Enum, default: WorldCoordinates

Defines the coordinate system in which the light Position is specified.

see also SoGVRShaderParameterPosition.coordinateSystem

Position

name: position, type: Vector3, default: 0 0 1

Specifies the light position.

see also SoGVRShaderParameterPosition.position

Color

name: color, type: Color, default: 1 1 1

Specifies the light color.

Diffuse Intensity

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

Specifies the diffuse intensity of the light.

Specular Intensity

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

Specifies the specular intensity of the light.

Use For First Hit

name: useForFirstHit, type: Bool, default: FALSE

Attenuation Mode

name: attenuationMode, type: Enum, default: ATTENUATION_OFF

Specifies how the light intensity is attenuated by the distance to the light position.

Values:

Title Name Description
Off ATTENUATION_OFF No attenuation.
Linear Quadratic ATTENUATION_LINEAR_QUADRATIC

A mix of linear and quadratic attenuation, specified by Percentage and Half Intensity Distance.

linearFactor = (attenuationPercentage<50.f) ? attenuationPercentage/50 : (100-attenuationPercentage)/50; quadraticFactor = (attenuationPercentage<50.f) ? 0 : 1. - linearFactor

linearAttenuation = attenuationHalfIntensityDistance / (attenuationHalfIntensityDistance + linearFactor * distanceToLight)

quadraticAttenuation = attenuationHalfIntensityDistance2 / (attenuationHalfIntensityDistance2 + quadraticFactor * distanceToLight)

attenuation = linearAttenuation * quadraticAttenuation

Spherical ATTENUATION_SPHERICAL

A spherical attenuation, specified by Full Intensity Distance and Zero Intensity Distance:

attenuation = 1. - smoothstep(attenuationFullIntensityDistance, attenuationZeroIntensityDistance, distanceToLight)

Percentage

name: attenuationPercentage, type: Float, default: 50, minimum: 0, maximum: 100

Defines the percentage of attenuation in linear/quadratic mode.

Percentage Description
0% No attenuation
0% - 50% 0 to 100% linear attenuation
50% full linear attenuation
50%-100% mixes linear attenuation with quadratic attenuation
100% full quadratic attenuation

Half Intensity Distance

name: attenuationHalfIntensityDistance, type: Float, default: 20, minimum: 0

Defines the approximate distance in mm at which the light has half its intensity. (Only if Attenuation Mode is set to “Linear Quadratic” attenuation.

Full Intensity Distance

name: attenuationFullIntensityDistance, type: Float, default: 20, minimum: 0

Defines the distance in mm up to which the light keeps its full intensity. (Only if Attenuation Mode is set to “Spherical” attenuation.

Zero Intensity Distance

name: attenuationZeroIntensityDistance, type: Float, default: 40, minimum: 0

Defines the distance in mm up to which the light falls off to zero, using hermite interpolation. (Only if Attenuation Mode is set to “Spherical” attenuation.