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

Environmental Texturing Extension (Proposed)

Existing Component Name: xj3d_EnvironmentTexturing
--- X3D separator bar ---

cube 1. Introduction

1.2 Overview

The name of this component is "CubeMapTexturing". This name shall be used when referring to this component in the COMPONENT statement (see ISO FDIS 19775-1:200x 7.2.5.4 Component statement).

1.2 Overview

This clause describes the Environmental Texturing component of this part of ISO/IEC 19775. This includes how additional texturing effects are defined to produce environmental effects such as reflections from objects. Table 1 provides links to the major topics in this clause.

Table 1 — Topics

cube 2 Concepts

2.1 Overview

Environmental texturing incorporates the ability to provide cubic environmental texture mapping capabilities within X3D. Cubic environment maps provide the ability to provide reflection and specular highlighting in a simple way, typically in combination with automatic texture coordinate generation (see 18 Texturing Component). This component is typically combined with the multitexture abilities of the Texturing component to provide advanced visual effects.

Cubic environment maps ignore most of the normal texture settings - they don't have repeat fields, but they can be mipmapped. Also, the sources can be drawn from any 2D texture source - whether that be dynamically generated or provided from somewhere else such as images or pixel arrays.

2.2 Texture Map Formats

Cubic environment mapping nodes defined as part of this component use a collection of 2D texture maps to define each side of the cube. These may contain from one to four component colour values. The interpretation of the image shall follow the description in 18.2.1 Texture Map Formats.

All source images shall provide source data in square powers of two numbers of pixels. Each source image shall have identical sizes. Providing different sized images or rectangular images shall be an error. For example, it is not valid to define the front image as a 64x64 image and the left side image as 128x128 pixels.

2.3 Texture Map Image Formats

Texture nodes that require support for 2D images file formats shall follow the description defined in 18.2.2 Texture Map Image Formats.

2.4 Texture Coordinates

For each texture, the 3 dimensional texture coordinates (s,t,r) are treated as a direction vector from the local origin. Each texel drawn onto the geometry is treated as the texel in the environment map that is "seen" from this direction vector.

Texture Coordinates for using cubic environment mapped textures are almost always dynamically generated as this is far easier to handle for the content developer than providing explicit texture coordinates. It is recommended that an implementation shall also support a minimum of Level 2 Texturing Component capabilities (see 18.5 Texturing Component Support Levels) in addition to this component. Typically the CAMERASPACENORMAL or CAMERASPACEREFLECTIONVECTOR modes would be used.

If a user wishes to supply explicit texture coordinates, they shall use the TextureCoordinate3D node (see 3D Texturing)

2.5 Texture Orientation

Cubic environment maps define a single texture as consisting of 6 separate images, one for each side of a cube. This component defines the six sides as front, back, left, right, top and bottom. These sides shall be oriented as shown in Figure 1.

Environment map textures

Figure 1 — Illustration of mapping texture sides to the texture coordinate axes

cube 3 Abstract Types

3.1X3DEnvironmentTextureNode

X3DEnvironmentTextureNode : X3DTextureNode {
  SFNode [in,out] metadata NULL [X3DMetadataObject]
}

This abstract node type is the base type for all node types which specify cubic environment map sources for texture images.

cube 4 Node reference

4.1 ComposedCubeMapTexture

ComposedCubeMapTexture : X3DEnvironmentTextureNode {
  SFNode [in,out] metadata NULL [X3DMetadataObject]
  SFNode [in,out] front    NULL [X3DTexture2DNode]
  SFNode [in,out] back     NULL [X3DTexture2DNode]
  SFNode [in,out] left     NULL [X3DTexture2DNode]
  SFNode [in,out] right    NULL [X3DTexture2DNode]
  SFNode [in,out] top      NULL [X3DTexture2DNode]
  SFNode [in,out] bottom   NULL [X3DTexture2DNode]
}

The ComposedCubeMapTexture node defines a cubic environment map source as an explicit set of images drawn from individual 2D texture descriptions.

See 2 Concepts, for a general description of texture maps.

See 18 Texturing for a general description of the X3DTexture2DNode abstract type and interpretation of rendering for 2D images. When used as a source for cubic environment maps, the fields repeatS and repeatT fields shall be ignored.

4.2 GeneratedCubeMapTexture

GeneratedCubeMapTexture : X3DEnvironmentTextureNode {
  SFNode   [in,out] metadata    NULL      [X3DMetadataObject]
  SFNode   [in,out] sourceScene NULL      [X3DChildNode]
  SFString [in,out] update      "NONE"    ["NONE", "NEXT_FRAME_ONLY", "ALWAYS"]
  SFInt32  []       size        128       (0,∞)
}
The ComposedCubeMapTexture node defines a cubic environment map that sources it's data from internally generated images.

The texture takes it's viewpoint location as being the location of the geometry in world space. The source is any arbitrary geometry that applies there, but shall follow the usual rules about cyclic scene graphs etc. For example, having an object trying to render itself in the scene graph can cause infinite loops in the renderer implementation, so that is not permitted. The field of view shall be 90 degrees and aspect ratio of 1

The size field indicates the resolution of the generated images in number of pixels per side.

The update field allows the user to request a regeneration of the texture. Setting this field to "ALWAYS" will make the texture be rendered every frame. A value of "NONE" will stop rendering so that no further updates are performed - even if the contained scene graph changes. When the value is set to "NEXT_FRAME_ONLY" it is an instruction to render the texture at the end of this frame, and then don't render again. What this means is that the value is set this frame, and at the start of the next frame, the value will be automatically set back to "NONE" to indicate that the rendering has taken place already. Since this is a field change value, it will automatically generate an output event which may be routed.

4.3 ImageCubeMapTexture

ImageCubeMapTexture : X3DEnvironmentTextureNode, X3DUrlObject {
  SFNode   [in,out] metadata NULL [X3DMetadataObject]
  MFString [in,out] url      []
}

The ImageCubeMapTexture node defines a cubic environment map source as a single file format that contains multiple images, one for each side.

The texture is read from the URL specified by the url field. When the url field contains no values ([]), texturing is disabled. Browsers are not required to support any specific format. It is recommended that browsers support the Microsoft DDS file format. Details on the url field can be found in 9.2.1 URLs.

See 18.2 Concepts, for a general description of texture maps.

4.4 PixelCubeMapTexture

PixelCubeMapTexture : X3DEnvironmentTextureNode {
  SFNode  [in,out] metadata NULL [X3DMetadataObject]
  SFImage [in,out] front    0 0 0
  SFImage [in,out] back     0 0 0
  SFImage [in,out] left     0 0 0
  SFImage [in,out] right    0 0 0
  SFImage [in,out] top      0 0 0
  SFImage [in,out] bottom   0 0 0
}

The PixelCubeMapTexture node defines a cubic environment map source as an explicit set of images sourced from SFImage fields. Each image shall be defined as square, with each dimension 2n pixels long.

See 2 Concepts, for a general description of texture maps.

See 17 Lighting component for a description of how the texture values interact with the appearance of the geometry. 5.7 SFImage and MFImage describes the specification of an image.

cube 5 Support Levels

The Environment Texturing component defines three levels of support as specified in Table 2.

Table 2 — Environment Texturing component support levels

LevelPrequisitesNodes/FeaturesSupport
Level 1 Core 1
Grouping 1
Shape 1
Rendering 1
Texturing 1
X3DEnvironmentTextureNode n/a
ComposedCubeMapTexture All fields fully supported
PixelCubeMapTexture All fields fully supported
Level 2 Core 1
Grouping 1
Shape 1
Rendering 1
Texturing 1
ImageCubeMapTexture All fields fully supported
Level 3 Core 1
Grouping 1
Shape 1
Rendering 1
Texturing 1
GeneratedCubeMapTexture All fields fully supported
--- X3D separator bar ---
[ Xj3D Homepage | Xj3D @ Web3d | Screenshots | Dev docs | Dev Releases | Contributors | Getting Started ]
Last updated: $Date: 2004-09-16 16:36:50 $