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 {
  NONE,
  HAZE,
  FOG,
  SMOKE
}

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
SoSFFloat ambientOcclusionIntensity
SoSFFloat ambientOcclusionRadius
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 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:

No Ambient Occlusion Ambient Occlusion
AO_DTI_off.png
AO_DTI_on.png
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

ACTION BEHAVIOR

SEE ALSO

SoLight, SoLightModel

See related examples:

MedicalDTI


Member Enumeration Documentation

Type of fog.

Enumerator:
NONE 

No fog.

HAZE 

Linear increase in opacity with distance.

FOG 

Exponential increase in opacity.

SMOKE 

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 overridden field.

Reimplemented from SoNode.

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

Sets the state of the overridden 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.

Default is FALSE

Limitation:

  • Important performance penalty can be experienced on Intel HD and UHD Graphics integrated GPU
NOTE: field available since Open Inventor 10.2

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

NOTE: field available since Open Inventor 10.10

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.

NOTE: field available since Open Inventor 10.10

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 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/