Extensible 3D (X3D)
Part 1: Architecture and base components

24 Environmental effects component

--- X3D separator bar ---

cube 24.1 Introduction

24.1.1 Name

The name of this component is "EnvironmentalEffects". This name shall be used when referring to this component in the COMPONENT statement (see 7.2.3.4 Component statement).

24.1.2 Overview

This clause describes the Environmental Effects component of this part of ISO/IEC 19775. Nodes in this component support the creation of realistic environmental effects such as panoramic backgrounds and fog. Table 24.1 provides links to the major topics in this clause.

Table 24.1 — Topics in this clause

cube 24.2 Concepts

24.2.1 Backgrounds

Background nodes are used to specify a colour backdrop that simulates ground and sky, as well as a background texture, or panorama, that is placed behind all geometry in the scene and in front of the ground and sky. Background nodes are specified in the local coordinate system and are affected by the accumulated rotation of their ancestors as described below. X3D supports two kinds of background nodes: a simple background node that contains a set of url fields for specifying static image files that compose the backdrop (see 24.4.1, Background), and a complex background node containing arbitrary X3DTexture nodes that compose the backdrop (see 24.4.3, TextureBackground). Both types of background node descend from the base type X3DBackgroundNode. Applications should use the Background node for simplicity, and the TextureBackground node for more flexibility and additional features.

Background nodes are bindable nodes as described in 7.2.2, Bindable children nodes. There exists a Background stack, in which the top-most Background on the stack is the currently active Background. To move a Background to the top of the stack, a TRUE value is sent to the set_bind field. Once active, the Background is then bound to the browsers view. A FALSE value sent to set_bind removes the Background from the stack and unbinds it from the browser's view. .

The backdrop is conceptually a partial sphere (the ground) enclosed inside of a full sphere (the sky) in the local coordinate system with the viewer placed at the centre of the spheres. Both spheres have infinite radius and each is painted with concentric circles of interpolated colour perpendicular to the local Y-axis of the sphere. The Background node is subject to the accumulated rotations of its ancestors' transformations. Scaling and translation transformations are ignored. The sky sphere is always slightly farther away from the viewer than the ground partial sphere causing the ground to appear in front of the sky where they overlap.

The skyColor field specifies the colour of the sky at various angles on the sky sphere. The first value of the skyColor field specifies the colour of the sky at 0.0 radians representing the zenith (i.e., straight up from the viewer). The skyAngle field specifies the angles from the zenith in which concentric circles of colour appear. The zenith of the sphere is implicitly defined to be 0.0 radians, the natural horizon is at π/2 radians, and the nadir (i.e., straight down from the viewer) is at π radians. skyAngle is restricted to non-decreasing values in the range [0.0, π]. There shall be one more skyColor value than there are skyAngle values. The first colour value is the colour at the zenith, which is not specified in the skyAngle field. If the last skyAngle is less than pi, then the colour band between the last skyAngle and the nadir is clamped to the last skyColor. The sky colour is linearly interpolated between the specified skyColor values.

The groundColor field specifies the colour of the ground at the various angles on the ground partial sphere. The first value of the groundColor field specifies the colour of the ground at 0.0 radians representing the nadir (i.e., straight down from the user). The groundAngle field specifies the angles from the nadir that the concentric circles of colour appear. The nadir of the sphere is implicitly defined at 0.0 radians. groundAngle is restricted to non-decreasing values in the range [0.0, π/2]. There shall be one more groundColor value than there are groundAngle values. The first colour value is for the nadir which is not specified in the groundAngle field. If the last groundAngle is less than π/2, the region between the last groundAngle and the equator is non-existant. The ground colour is linearly interpolated between the specified groundColor values.

The back, bottom, front, left, right, and top fields specify a set of images that define a background panorama between the ground/sky backdrop and the scene's geometry. The panorama consists of six images, each of which is mapped onto a face of an infinitely large cube contained within the backdrop spheres and centred in the local coordinate system. The images are applied individually to each face of the cube. On the front, back, right, and left faces of the cube, when viewed from the origin looking down the negative Z-axis with the Y-axis as the view up direction, each image is mapped onto the corresponding face with the same orientation as if the image were displayed normally in 2D (back to back face, front to front face, left to left face, and right to right face). On the top face of the cube, when viewed from the origin looking along the +Y-axis with the +Z-axis as the view up direction, the top image is mapped onto the face with the same orientation as if the image were displayed normally in 2D. On the bottom face of the box, when viewed from the origin along the negative Y-axis with the negative Z-axis as the view up direction, the bottom image is mapped onto the face with the same orientation as if the image were displayed normally in 2D.

Figure 24.1 illustrates the Background node backdrop and background textures.

Alpha values in the panorama images (i.e., two or four component images) specify that the panorama is semi-transparent or transparent in regions, allowing the groundColor and skyColor to be visible.

See 18, Texturing component for a general description of texture maps.

Often, the bottom and top images will not be specified, to allow sky and ground to show. The other four images may depict surrounding mountains or other distant scenery.

 

Background node

Figure 24.1Background node

Panorama images may be one component (greyscale), two component (greyscale plus alpha), three component (full RGB colour), or four-component (full RGB colour plus alpha).

Ground colours, sky colours, and panoramic images do not translate with respect to the viewer, though they do rotate with respect to the viewer. That is, the viewer can never get any closer to the background, but can turn to examine all sides of the panorama cube, and can look up and down to see the concentric rings of ground and sky (if visible).

Background nodes are not affected by Fog nodes. Therefore, if a Background node is active (i.e., bound) while a Fog node is active, then the Background node will be displayed with no fogging effects. It is the author's responsibility to set the Background values to match the Fog values (e.g., ground colours fade to fog colour with distance and panorama images tinted with fog colour). Background nodes are not affected by light sources.

cube 24.3 Abstract types

24.3.1 X3DBackgroundNode

X3DBackgroundNode : X3DBindableNode { 
  SFBool   [in]     set_bind
  MFFloat  [in,out] groundAngle []      [0,π/2]
  MFColor  [in,out] groundColor []      [0,1]
  MFFloat  [in,out] skyAngle    []      [0,π]
  MFColor  [in,out] skyColor    0 0 0   [0,1]
  SFTime   [out]    bindTime
  SFBool   [out]    isBound
}

X3DBackgroundNode is the abstract type from which all backgrounds inherit. X3DBackgroundNode is a bindable node that when bound to defines the panoramic background for the scene. For complete information on backgrounds, see 24.2.1, Backgrounds.

cube 24.4 Node reference

24.4.1 Background

Background : X3DBackgroundNode {
  SFBool   [in]     set_bind
  MFFloat  [in,out] groundAngle []    [0,π/2]
  MFColor  [in,out] groundColor []    [0,1]
  MFString [in,out] backUrl     []    [urn]
  MFString [in,out] bottomUrl   []    [urn]
  MFString [in,out] frontUrl    []    [urn]
  MFString [in,out] leftUrl     []    [urn]
  MFString [in,out] rightUrl    []    [urn]
  MFString [in,out] topUrl      []    [urn]
  MFFloat  [in,out] skyAngle    []    [0,π]
  MFColor  [in,out] skyColor    0 0 0 [0,1]
  SFTime   [out]    bindTime
  SFBool   [out]    isBound
}

A background node that uses six static images to compose the backdrop. The common fields of the Background node are described in 24.2.1, Backgrounds. For the backUrl, bottomUrl, frontUrl, leftUrl, rightUrl, topUrl fields, browsers shall support the JPEG (see 2.[JPEG]) and PNG (see 2.[I15948]) image file formats, and in addition, may support any other image format (e.g., CGM) that can be rendered into a 2D image. Support for the GIF (see [GIF]) format is recommended (including transparency) . More detail on the url fields can be found in 9.2.1, URLs.

24.4.2 Fog

Fog : X3DBindableNode {
  SFBool   [in]     set_bind
  SFColor  [in,out] color           1 1 1    [0,1]
  SFString [in,out] fogType         "LINEAR" ["LINEAR"|"EXPONENTIAL"]
  SFFloat  [in,out] visibilityRange 0        [0,∞)
  SFTime   [out]    bindTime
  SFBool   [out]    isBound
}

The Fog node provides a way to simulate atmospheric effects by blending objects with the colour specified by the color field based on the distances of the various objects from the viewer. The distances are calculated in the coordinate space of the Fog node. The visibilityRange specifies the distance in metres (in the local coordinate system) at which objects are totally obscured by the fog. Objects located outside the visibilityRange from the viewer are drawn with a constant colour of color. Objects very close to the viewer are blended very little with the fog color. A visibilityRange of 0.0 disables the Fog node. The visibilityRange is affected by the scaling transformations of the Fog node's parents; translations and rotations have no affect on visibilityRange. Values of the visibilityRange field shall be in the range [0,∞).

Since Fog nodes are bindable children nodes (see 7.2.2, Bindable children nodes), a Fog node stack exists, in which the top-most Fog node on the stack is currently active. To push a Fog node onto the top of the stack, a TRUE value is sent to the set_bind field. Once active, the Fog node is bound to the browser view. A FALSE value sent to set_bind, pops the Fog node from the stack and unbinds it from the browser viewer. More details on the Fog node stack can be found in 7.2.2, Bindable children nodes.

The fogType field controls how much of the fog colour is blended with the object as a function of distance. If fogType is "LINEAR", the amount of blending is a linear function of the distance, resulting in a depth cueing effect. If fogType is "EXPONENTIAL," an exponential increase in blending is used, resulting in a more natural fog appearance.

The effect of fog on lighting calculations is described in 17, Lighting component.

24.4.3 TextureBackground

TextureBackground : X3DBackgroundNode {
  SFBool  [in]     set_bind
  MFFloat [in,out] groundAngle   []    [0,π/2]
  MFColor [in,out] groundColor   []    [0,1]
  SFNode  [in,out] backTexture   NULL  [X3DTextureNode]
  SFNode  [in,out] bottomTexture NULL  [X3DTextureNode]
  SFNode  [in,out] frontTexture  NULL  [X3DTextureNode]
  SFNode  [in,out] leftTexture   NULL  [X3DTextureNode]
  SFNode  [in,out] rightTexture  NULL  [X3DTextureNode]
  SFNode  [in,out] topTexture    NULL  [X3DTextureNode]
  MFFloat [in,out] skyAngle      []    [0,π]
  MFColor [in,out] skyColor      0 0 0 [0,1]
  MFFloat [in,out] transparency  0     [0,1]
  SFTime  [out]    bindTime
  SFBool  [out]    isBound
}

A background node that uses six individual texture nodes to compose the backdrop. Unlike the Background node, which only supports static image formats referenced by URL fields, the contents of the TextureBackground node can be arbitrary texture types, including ImageTexture, PixelTexture, MovieTexture and MultiTexture. The common fields of the TextureBackground node are described in 24.2.1, Backgrounds.

TextureBackground supports the creation of rich backgrounds with animation. It also allows the world author to attach LoadSensors to the node's texture fields to receive notification of when elements of the background are loaded.

TextureBackground supports transparency values, allowing for the scene to be overlaid on other elements in an application. A non-zero transparency value in the transparency field allows the underlying window of the containing application to show through, provided that there is a containing application and the browser is able to support composited display of the underlying window.

For the backTexture, bottomTexture, frontTexture, leftTexture, rightTexture, topTexture fields, browsers shall support any X3DTexture node types supported in the currently supported profile.

cube 24.5 Support levels

The Environmental Sensor component provides three levels of support as specified in Table 24.2. Level 1 is intended to support simple backgrounds for lightweight profiles. Level 2 provides additional environmental effects, including full background features, fog, and limited texture backgrounds. Level 3 provides full support for texture backgrounds.

Table 24.2Environmental effects component support levels

Level Prerequisites Nodes Support
1 Core 1; Time 1; Grouping 1
Background groundAngle and groundColor optionally supported. backURL, frontURL, leftURL, rightURL, topURL are optionally supported. skyAngle optionally supported. One skyColor.
X3DBackgroundNode (abstract) n/a
2 Core 1; Time 1; Grouping 1
All Level 1 Environmental Effects nodes All fields
Fog All fields
  TextureBackground All fields. ImageTexture and PixelTexture node types only supported in texture fields.
3 Core 1; Time 1; Grouping 1    
All Level 2 Environmental Effects nodes All fields
TextureBackground All fields. All texture node types supported in texture fields.

--- X3D separator bar ---