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

3D Texturing Component (Proposed)

Existing Component Name: xj3d_3D-Texturing
--- X3D separator bar ---

cube 1. Introduction

1.1 Name

The name of this component is "3D-Texturing". 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 3D Texturing component of this part of ISO/IEC 19775. This includes how 3D textures are specified and how they are positioned on the subject geometry. Table 1 provides links to the major topics in this clause.

Table 1 — Topics

cube 2 Concepts

2.1 Overview

This component provides additional texturing extensions to the basic capabilities defined in X3D. Many applications need to describe surface properties as data points in a volume of space, rather than a flat surface. These textures operate with 3 dimensions, and are typically known as Volumetric textures.

Volumetric textures are essential for advanced rendering effects such as fog and lighting, as well as industry-specific needs such as medical and CAD visualisation.

2.2 3D Texturing Concepts

3D texturing defines pixel colours based on a volume of space. An object that is being rendered on that 3D texture effectively cuts a volume out of the pixels provided by the texture.

3D image data can be provided in a number of ways, as well as being rendered on a variety of different hardware. The assumption of this specification is standard commodity hardware that presents 3D textures as a series of 2D slices of the volume that can then be interpolated and composited together to form a 3D volume of space. There is no assumption about the existance of true Voxel rendering hardware capability.

A typical way of defining a 3D volume of texture is to provide a number of 2D planes (images) of data that are ordered in a depth-wise manner. Figure 1 shows two base images that could be layered together, and the resulting volume of a 3D texture. In this example, the texture would have a dimension of n x m x 2.

Description of 3D texture

Figure 1 — Illustration of how two 2D images can form a 3D volume of texture

2.3 Texture Coordinate generation for Primitive Objects

Some geometry primitive types are not capable of having 3D texture coordinates set by the user, for example Box and Cone. For these cases, 3D textures coordinates automatically generated based on the following rules.

2.4 Texture map image formats

Node types specifying 3D texture maps may supply data with a number of color components between one and four. The valid types and interpretations of 3D Textures is identical to that for 2D texturing. The definition of texture formats is defined in 18.2.1 Texture Map Formats.

2.5 Texture coordinates

Textures described in 3 dimensions have a local coordinate system that is an extension of the 2D form. The S coordinate is upwards, the T coordinate is to the right and the R coordinate (depth) is away from the viewer. The origin is located in the bottom left corner, closest to the viewer.

cube 3 Abstract Types

3.1 X3DTexture3DNode

X3DTexture3DNode : X3DTextureNode {
  SFNode [in,out] metadata NULL [X3DMetadataObject]
  SFBool []       repeatS  FALSE
  SFBool []       repeatT  FALSE
  SFBool []       repeatR  FALSE
}

This abstract node type is the base type for all node types which specify 3D sources for texture images.

Note that the base node type diverges from the standard X3D textures by making the repeat modes FALSE, rather that TRUE. This is because 3D textures are almost never used in a repeated rendering mode, and that repeat mode for 3D textures can have some very odd rendering artifacts.

cube 4 Node reference

4.1 Composed3DTexture

Composed3DTexture : X3DTexture3DNode {
  SFNode [in,out] metadata NULL [X3DMetadataObject]
  SFBool []       repeatS  FALSE
  SFBool []       repeatT  FALSE
  SFBool []       repeatR  FALSE
  MFNode [in,out] texture  []   [X3DTexture2DNode]
}

The Composed3DTexture node defines a 3D image-based texture map as a composition of a collection of 2D texture sources at various depths and parameters controlling tiling repetition of the texture onto geometry.

The texture values are interpreted with the first image being at depth 0 and each following image representing an increasing depth value in the R direction. A user shall provide 2n source textures in this array. The individual source textures will ignore their repeat field values.

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 Image3DTexture

Image3DTexture : X3DTexture3DNode, X3DUrlObject {
  SFNode   [in,out] metadata NULL [X3DMetadataObject]
  MFString [in,out] url []
  SFBool   []       repeatS  FALSE
  SFBool   []       repeatT  FALSE
  SFBool   []       repeatR  FALSE
}

The Image3DTexture node defines a texture map by specifying a single image file that contains complete 3D data and general parameters for mapping to geometry.

The texture is read from the URL specified by the url field. When the url field contains no values ([]), texturing is disabled. Details on the url field can be found in 19775-1:200x 9.2.1 URLs. There are no required file formats to be supported. It is recommended that DICOM or the .vol format be supported.

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

4.3 Pixel3DTexture

Pixel3DTexture : X3DTexture3DNode {
  SFNode  [in,out] metadata NULL [X3DMetadataObject]
  MFInt32 [in,out] image    0 0 0 0
  SFBool  []       repeatS  FALSE
  SFBool  []       repeatT  FALSE
  SFBool  []       repeatR  FALSE
}

The Pixel3DTexture node defines a 3D image-based texture map as an explicit array of pixel values (image field) and parameters controlling tiling repetition of the texture onto geometry.

The image field describes the raw data to be used for this 3D texture. The first value of the array is the number of components to the image and must be a value between 0 and 4. The following three numbers are the size of the texture - width, height and depth respectively. The remaining values of the array are treated as the pixels for the image. There shall be at least width * height * depth number of pixel values provided. Each of the width, height and depth are required to be a power of 2.

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.

4.4 TextureCoordinate3D

TextureCoordinate3D : X3DTextureCoordinateNode {
  SFNode  [in,out] metadata NULL [X3DMetadataObject]
  MFVec3f [in,out] point    []   (-∞,∞)
}

The TextureCoordinate node is a geometry property node that specifies a set of 3D texture coordinates used by vertex-based geometry nodes (for example IndexedFaceSet and ElevationGrid) to map 3D textures to vertices.

Providing 3D texture coordinates to objects that only have 2D textures defined shall result in implementation dependent rendering.

4.5 TextureCoordinate4D

TextureCoordinate4D : X3DTextureCoordinateNode {
  SFNode  [in,out] metadata NULL [X3DMetadataObject]
  MFVec4f [in,out] point    []   (-∞,∞)
}

The TextureCoordinate node is a geometry property node that specifies a set of 4D (homogeneous) texture coordinates used by vertex-based geometry nodes (for example IndexedFaceSet and ElevationGrid) to map 3D textures to vertices.

Providing 4D texture coordinates to objects that only have 2D textures defined shall result in implementation dependent rendering.

4.6 TextureMatrixTransform

TextureMatrixTransform : X3DTextureTransformNode {
  SFNode     [in,out] metadata    NULL    [X3DMetadataObject]
  SFMatrix4f [in,out] matrix      1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1  (-∞,∞)
}

The matrix field defines a generalised, unfiltered 4x4 transformation matrix that can be used to modify the texture. Any set of values is permitted.

4.7 TextureTransform3D

TextureTransform3D : X3DTextureTransformNode {
  SFNode     [in,out] metadata    NULL    [X3DMetadataObject]
  SFVec3f    [in,out] center      0 0 0   (-∞,∞)
  SFRotation [in,out] rotation    0 0 1 0 (-∞,∞)
  SFVec3f    [in,out] scale       1 1 1   (-∞,∞)
  SFVec3f    [in,out] translation 0 0 0   (-∞,∞)
}

The TextureTransform node defines a 3D transformation that is applied to texture coordinates (see TextureCoordinate3D). This node affects the way textures coordinates are applied to the geometric surface. The transformation consists of (in order):

  1. a translation;
  2. a rotation about the centre point;
  3. a non-uniform scale about the centre point.

These parameters support changes to the size, orientation, and position of textures on shapes. Note that these operations appear reversed when viewed on the surface of geometry. For example, a scale value of (1 2 2) will scale the texture coordinates and have the net effect of shrinking the texture size by a factor of 2 (texture coordinates are twice as large and thus cause the texture to repeat) in the T and R dimensions and leave the S dimension unscaled. A translation of (0.5 0.0 0.0) translates the texture coordinates +.5 units along the S-axis and has the net effect of translating the texture -0.5 along the S-axis on the geometry's surface. A rotation of π/2 of the texture coordinates results in a -π/2 rotation of the texture on the geometry.

The center field specifies a translation offset in texture coordinate space about which the rotation and scale fields are applied. The scale field specifies a scaling factor in S, T and R of the texture coordinates about the center point. scale values shall be in the range (-∞,∞). The rotation field specifies a rotation in radians of the texture coordinates about the center point after the scale has been applied. A positive rotation value makes the texture coordinates rotate counterclockwise about the centre, thereby rotating the appearance of the texture itself clockwise. The translation field specifies a translation of the texture coordinates.

A 3D transform may be applied to 2D textures. The results are implementation dependent

cube 5 Support Levels

The 3D Texturing component defines two levels of support as specified in Table 2.

Table 2 — 3D Texturing component support levels

LevelPrequisitesNodes/FeaturesSupport
Level 1 Core 1
Grouping 1
Shape 1
Rendering 1
Texturing 1
X3DTexture3DNode n/a
TextureMatrixTransform All fields fully supported
TextureTransform3D All fields fully supported
TextureCoordinate3D All fields fully supported
TextureCoordinate4D All fields fully supported
Composed3DTexture All fields fully supported
Pixel3DTexture All fields fully supported
Level 2 Core 1
Grouping 1
Shape 1
Rendering 1
Texturing 1
Image3DTexture 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 $