Environmental effects component

This component defines special rendering effects. Background defines the sky colors and textures. Fog and LocalFog simulate natural fog.

See also X3D specification of the Environmental effects component.

This component defines nodes that change the environment ("how all the scene content looks"). In particular it deals with fog and background features.

Moreover, see also Castle Game Engine (and view3dscene) extensions related to environment effects.

Supported nodes:

  • Background (API reference)

    Display a 3D background (visible around the scene content) using a textured cube (skybox) around, or a gradient of colors.

  • TextureBackground (API reference)

    Similar to Background but allows to specify each skybox side as a texture node. This allows e.g. using MovieTexture to animate the background like a movie.

  • Fog (API reference)

    Specifies global fog, making objects that are more distant blend to a constant fog color.

  • LocalFog (API reference)

    Similar to Fog, but the effect is limited to a group of X3D shapes.

  • FogCoordinate (API reference)

    Can be used within various geometry nodes, like IndexedFaceSet, to provide explicit fog densities for each point (instead of calculating fog density based on the distance to observer). This allows for various for effects, e.g. a fog may be concentrated at some 3D position (regardless of the observer).

    Note that depths (in FogCoordinate.depth) are sensible only in the [0, 1] range (like allowed by the specification), and are not affected by the Fog.visibilityRange (also following the spec). Effectively, this means that FogCoordinate.depth does not substitute the mere distance to the eye in the fog equation. Instead, it specifies directly the fog intensity. I understand that this is the intention of the spec, although the wording is clumsy (not saying directly what "implicit depth" is — fog input distance or fog output intensity).