SoEnvironment Class Reference
[Lights & colors]

Global environment node. More...

#include <Inventor/nodes/SoEnvironment.h>

Inheritance diagram for SoEnvironment:
SoNode SoFieldContainer SoBase SoRefCounter SoTypedObject

List of all members.

Public Types

enum  FogType {

Public Member Functions

virtual SoType getTypeId () const
 SoEnvironment ()
virtual void setOverride (const SbBool state)
virtual SbBool isOverride () const

Static Public Member Functions

static SoType getClassTypeId ()

Public Attributes

SoSFFloat ambientIntensity
SoSFColor ambientColor
SoSFVec3f attenuation
SoSFBool ambientOcclusion
SoSFEnum fogType
SoSFColor fogColor
SoSFFloat fogStart
SoSFFloat fogVisibility

Detailed Description

Global environment node.

This node describes global environmental attributes such as ambient lighting, light attenuation, ambient occlusion, and fog.

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.
Ambient occlusion limitations:

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.




SoLight, SoLightModel

See related examples:


Member Enumeration Documentation

Type of fog.


No fog.


Linear increase in opacity with distance.


Exponential increase in opacity.


Exponential squared increase in opacity.

Constructor & Destructor Documentation

SoEnvironment::SoEnvironment (  ) 

Creates an environment node with default settings.

Member Function Documentation

static SoType SoEnvironment::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoNode.

virtual SoType SoEnvironment::getTypeId (  )  const [virtual]

Returns the type identifier for this specific instance.

Reimplemented from SoNode.

virtual SbBool SoEnvironment::isOverride (  )  const [inline, virtual]

Returns the state of the override field.

Reimplemented from SoNode.

virtual void SoEnvironment::setOverride ( const SbBool  state  )  [inline, virtual]

Set the state of the override field.

see SoNode::setOverride doc.

Reimplemented from SoNode.

Member Data Documentation

RGB color of ambient lighting (for Phong lighting).

Default is 1, 1, 1.

Intensity of ambient light (for Phong lighting).

Default is 0.2.

If set to TRUE, ambient occlusion is activated (for shapes other than SoVolumeRender).

Default is FALSE. Limitation:

  • Currently ambient occlusion is only applied to line geometry, specifically SoLineSet and SoIndexedLineSet.
  • Important performance penalty can be experienced on Intel HD and UHD Graphics integrated GPU
NOTE: field available since Open Inventor 10.2 If set to TRUE, ambient occlusion is activated. Default is FALSE. Note : The ambient occlusion only affects the line shape rendering.

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).

Fog color.

Default is 1, 1, 1.

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.

Type of fog.

Use enum FogType. Default is NONE.

Fog visibility distance, which is the distance at which fog totally obscures objects.

Default is 0. A 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.

The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 6 Sep 2021
Copyright © Thermo Fisher Scientific All rights reserved.