Extensible 3D (X3D)
Part 1: Architecture and base components
34 Cube map environmental texturing component
The name of this component is "CubeMapTexturing". This name shall be used when referring to this component in the COMPONENT statement (see 7.2.5.4 COMPONENT statement).
Cube map environmental texturing provides cubic environmental texture mapping capabilities within X3D. Cubic environment maps support reflection and specular highlighting in a simple way, often in combination with automatic texture coordinate generation (see 18.2.3 Texture coordinates). This component may be combined with the multitexture abilities of the Texturing component (see 18.2.4 Multitexturing) to provide advanced visual effects.
Cubic environment maps ignore most of the normal texture settings (e.g., there are no repeat fields) but they can be mipmapped. The sources can be drawn from any 2D texture source whether dynamically generated or provided from somewhere else as images or pixel arrays.
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 be square and provide source data in powers of two numbers of pixels. Source images in a cubic environment map shall have identical sizes. Providing differently sized images or rectangular images shall be an error.
EXAMPLE It is not valid to define the front image as a 64×64 image and the left side image as 128×128 pixels.
Texture nodes that require support for 2D images file formats shall follow the description defined in 18.2.2 Texture map image formats.
For each texture, the three-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 usually 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 Support levels) in addition to this component. Typically, the CAMERASPACENORMAL or CAMERASPACEREFLECTIONVECTOR modes would be used.
If an author wishes to supply explicit texture coordinates, they shall use the TextureCoordinate3D node (see 3D Texturing)
Cubic environment maps define a single texture as consisting of six 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 34.1.
X3DEnvironmentTextureNode : X3DTextureNode { SFNode [in,out] metadata NULL [X3DMetadataObject] }
This abstract node type is the base type for all node types that specify cubic environment map sources for texture images.
ComposedCubeMapTexture : X3DEnvironmentTextureNode { SFNode [in,out] back NULL [X3DTexture2DNode] SFNode [in,out] bottom NULL [X3DTexture2DNode] SFNode [in,out] front NULL [X3DTexture2DNode] SFNode [in,out] left NULL [X3DTexture2DNode] SFNode [in,out] metadata NULL [X3DMetadataObject] SFNode [in,out] right NULL [X3DTexture2DNode] SFNode [in,out] top NULL [X3DTexture2DNode] }
The ComposedCubeMapTexture node defines a cubic environment map source as an explicit set of images drawn from individual 2D texture nodes.
See 34.2 Concepts for a general description of texture maps.
See 18 Texturing component 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.
GeneratedCubeMapTexture : X3DEnvironmentTextureNode { SFNode [in,out] metadata NULL [X3DMetadataObject] SFString [in,out] update "NONE" ["NONE", "NEXT_FRAME_ONLY", "ALWAYS"] SFInt32 [] size 128 (0,∞) }The ComposedCubeMapTexture node defines a cubic environment map that sources its data from internally generated images, rendered from a virtual situated perspective in the scene.
The viewpoint of the generated texture is based on the location and orientation of the associated geometry in world space.
NOTE An object trying to render itself in the scene graph can cause infinite loops in the renderer implementation and is thus not permitted.
The field of view shall be 90 degrees with an aspect ratio of 1: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 cause the texture to 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 not render it again. In this case, the update frame indicator is set to this frame; at the start of the next frame, the update value shall be automatically set back to "NONE" to indicate that the rendering has already taken place. Since this is a change of value for the update field, an output event is automatically generated.
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. The url field is defined in 9.2.1 URLs. Browsers are not required to support any specific cube map environment texture format. It is recommended that browsers support the Microsoft DDS cube map environment texture file format (see [DDS]).
See 18.2 Concepts for a general description of texture maps.
The Cube map environmental texturing component defines three levels of support as specified in Table 34.2.
Table 34.2 — Cube map environmental texturing component support levels
Level | Prequisites | Nodes/Features | Support |
---|---|---|---|
1 | Core 1 Grouping 1 Shape 1 Rendering 1 Texturing 1 |
||
X3DEnvironmentTextureNode | n/a | ||
ComposedCubeMapTexture | All fields fully supported | ||
2 | Core 1 Grouping 1 Shape 1 Rendering 1 Texturing 1 |
||
ImageCubeMapTexture | All fields fully supported | ||
3 | Core 1 Grouping 1 Shape 1 Rendering 1 Texturing 1 |
||
GeneratedCubeMapTexture | All fields fully supported |