public class SoEnvironment extends SoNode
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
. SoVolumeRendering
also supports ambient occlusion, but it must be enabled using an SoVolumeRenderingQuality
node.
Limitation: Currently ambient occlusion is only applied to line geometry, specifically SoLineSet
and SoIndexedLineSet
.
No Ambient Occlusion | Ambient Occlusion |
Example with a lineset extracted from a |
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 |
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:
Modifier and Type | Class and Description |
---|---|
static class |
SoEnvironment.FogTypes
Type of fog.
|
SoNode.RenderModes
Inventor.ConstructorCommand
Modifier and Type | Field and 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 (for shapes other than
SoVolumeRender ). |
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.
|
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoEnvironment()
Creates an environment node with default settings.
|
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
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
getNativeResourceHandle
public final SoSFFloat ambientIntensity
public final SoSFColor ambientColor
public final SoSFVec3f attenuation
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).
public final SoSFBool ambientOcclusion
SoVolumeRender
).
Default is false.
Limitation: Currently ambient occlusion is only applied to line geometry, specifically SoLineSet
and SoIndexedLineSet
.
public final SoSFEnum<SoEnvironment.FogTypes> fogType
public final SoSFColor fogColor
public final SoSFFloat fogStart
public final SoSFFloat fogVisibility
SoEnvironment
node to set up fog so that the visibility is the distance to the far clipping plane of the current camera.Generated on July 31, 2019, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com