Class SoEnvironment
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.misc.SoBase
-
- com.openinventor.inventor.fields.SoFieldContainer
-
- com.openinventor.inventor.nodes.SoNode
-
- com.openinventor.inventor.nodes.SoEnvironment
-
- All Implemented Interfaces:
SafeDisposable
public class SoEnvironment extends SoNode
Global environment node. This node describes global environmental attributes such as ambient lighting, light attenuation, ambient occlusion and fog.Ambient light (
ambientIntensity
andambientColor
) is the amount of global light impinging on each surface point when the lighting model is Phong (seeSoLightModel
). 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 (seeSoLight
). Seeattenuation
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. TheambientOcclusion
field controls this effect for shape nodes other thanSoVolumeRendering
and point sets. (although point sets can "generate" ambient occlusion).SoVolumeRendering
also supports ambient occlusion, but it must be enabled using anSoVolumeRenderingQuality
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 theSoEnvironment
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 thefogStart
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:
SoLight
,SoLightModel
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SoEnvironment.FogTypes
Type of fog.-
Nested 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
Fields Modifier and Type Field Description SoSFColor
ambientColor
RGB color of ambient lighting (for Phong lighting).SoSFFloat
ambientIntensity
Intensity of ambient light (for Phong lighting).SoSFBool
ambientOcclusion
If set to true, ambient occlusion is activated.SoSFFloat
ambientOcclusionIntensity
Intensity of ambient occlusion: the higher the value, the darker the scene.SoSFFloat
ambientOcclusionRadius
Specifies the radius of the "sphere" (in world space) beyond which the ambient occlusion has no more effect.SoSFVec3f
attenuation
Squared, linear, and constant light attenuation coefficients (in that order).SoSFColor
fogColor
Fog color.SoSFFloat
fogStart
Distance at which the linear fog HAZE starts to be applied.SoSFEnum<SoEnvironment.FogTypes>
fogType
Type of fog.SoSFFloat
fogVisibility
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 Constructor Description SoEnvironment()
Creates an environment node with default settings.
-
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 Detail
-
ambientIntensity
public final SoSFFloat ambientIntensity
Intensity of ambient light (for Phong lighting). Default is 0.2.
-
ambientColor
public final SoSFColor ambientColor
RGB color of ambient lighting (for Phong lighting). Default is 1, 1, 1.
-
attenuation
public final SoSFVec3f 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
public final SoSFBool 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
public final SoSFFloat 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
public final SoSFFloat 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
public final SoSFEnum<SoEnvironment.FogTypes> fogType
Type of fog. . Default is NONE.
-
fogColor
public final SoSFColor fogColor
Fog color. Default is 1, 1, 1.
-
fogStart
public final SoSFFloat 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
public final SoSFFloat 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.
-
-