Class SoEnvironment
- All Implemented Interfaces:
SafeDisposable
Ambient light (ambientIntensity
and ambientColor
) is the amount of global light impinging on each surface point when the lighting model is Phong (see SoLightModel
). The ambient light values effectively specify a minimum brightness for all shapes. Even if no light source is directly shining on a surface, the ambient component will light up the surface a little bit to prevent it from being pure black.
Light attenuation (attenuation
) is the loss of light intensity over distance. The greater the distance from the light source, the lower the intensity. Attenuation affects all subsequent Point and Spot lights in a scene (see SoLight
). See attenuation
field for more details.
Ambient occlusion (ambientOcclusion
) is a rendering effect that simulates how much of the global ambient light can reach different parts of a shape. Parts that are less exposed to the ambient light, i.e. more occluded, will appear darker. This effect is very useful to better discern the shapes of objects. The ambientOcclusion
field controls this effect for shape nodes other than SoVolumeRendering
and point sets. (although point sets can "generate" ambient occlusion). SoVolumeRendering
also supports ambient occlusion, but it must be enabled using an SoVolumeRenderingQuality
node.
Ambient occlusion limitations:
- Important performance penalty can be experienced on Intel HD and UHD Graphics integrated GPU
No Ambient Occlusion | Ambient Occlusion |
![]() | ![]() |
Example with a lineset extracted from a DTI |
Fog has one of four types, each of which blends each surface point with the specified fog color (usually set equal to the rendering window background color). Each type interprets the fogVisibility
field to be the distance at which fog totally obscures objects. A fogVisibility value of 0 (the default) causes the SoEnvironment
node to set up fog so that the visibility is the distance to the far clipping plane of the current camera. Using a fog of type HAZE results in a linear fog between the fogStart
value and the fogVisibility value.
File format/default:
Environment {
ambientIntensity | 0.2 |
ambientColor | 1 1 1 |
attenuation | 0 0 1 |
ambientOcclusion | false |
ambientOcclusionIntensity | 1.0 |
ambientOcclusionRadius | 4.0 |
fogType | NONE |
fogColor | 1 1 1 |
fogStart | 0 |
fogVisibility | 0 |
Action behavior:
SoGLRenderAction
Sets the current environment parameters to those specified with this node. Successive geometries will be rendered using this environment. Sets: SoEnvironmentElement
, SoLightAttenuationElement
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
SoNode.RenderModes
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal SoSFColor
RGB color of ambient lighting (for Phong lighting).final SoSFFloat
Intensity of ambient light (for Phong lighting).final SoSFBool
If set to true, ambient occlusion is activated.final SoSFFloat
Intensity of ambient occlusion: the higher the value, the darker the scene.final SoSFFloat
Specifies the radius of the "sphere" (in world space) beyond which the ambient occlusion has no more effect.final SoSFVec3f
Squared, linear, and constant light attenuation coefficients (in that order).final SoSFColor
Fog color.final SoSFFloat
Distance at which the linear fog HAZE starts to be applied.final SoSFEnum
<SoEnvironment.FogTypes> Type of fog.final SoSFFloat
Fog visibility distance, which is the distance at which fog totally obscures objects.Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
Field Details
-
ambientIntensity
Intensity of ambient light (for Phong lighting). Default is 0.2. -
ambientColor
RGB color of ambient lighting (for Phong lighting). Default is 1, 1, 1. -
attenuation
Squared, linear, and constant light attenuation coefficients (in that order). Default is 0, 0, 1. So, by default, no attenuation is applied.Attenuation only applies to Point and Spot lights. In the physical world attenuation is proportional to 1/d^2, where 'd' is the distance from the surface to the light source. However, this function causes the light to decrease very rapidly, so linear and constant coefficients can also be specified. The attenuation factor applied to the light is 1 / (c0*d^2 + c1*d + c2).
-
ambientOcclusion
If set to true, ambient occlusion is activated. Default is falseLimitation:
- Important performance penalty can be experienced on Intel HD and UHD Graphics integrated GPU
- Since:
- Open Inventor 10.2
-
ambientOcclusionIntensity
Intensity of ambient occlusion: the higher the value, the darker the scene. Default is 1.0.Note: This field is "global", which means that if you have multiple instances of
SoEnvironment
node, any change in the intensity field of one instance will automatically be applied to the intensity field of the other instances. As a result, the intensity of the ambient occlusion is the same for the whole scene- Since:
- Open Inventor 10.10
-
ambientOcclusionRadius
Specifies the radius of the "sphere" (in world space) beyond which the ambient occlusion has no more effect. Default is 4.0.Note: This field is "global", which means that if you have multiple instances of
SoEnvironment
node, any change in the radius field of one instance will automatically be applied to the radius field of the other instances. As a result, the radius of the ambient occlusion is the same for the whole scene.- Since:
- Open Inventor 10.10
-
fogType
Type of fog. . Default is NONE. -
fogColor
Fog color. Default is 1, 1, 1. -
fogStart
Distance at which the linear fog HAZE starts to be applied. Default is 0. Between fogStart and fogVisibility, the HAZE fog is linear, and beyond the fogVisibility distance, the fog totally obscures objects. This field has no effect on other types of fog. -
fogVisibility
Fog visibility distance, which is the distance at which fog totally obscures objects. Default is 0. A value of 0 (the default) causes theSoEnvironment
node to set up fog so that the visibility is the distance to the far clipping plane of the current camera.
-
-
Constructor Details
-
SoEnvironment
public SoEnvironment()Creates an environment node with default settings.
-