This component defines nodes for using 3D textures. 3D textures often allow a simple coordinate mapping, and enable a variety of graphic effects, particularly since they may be utilized by Programmable shaders component shaders. 3D textures may be loaded from image files or inlined in the VRML/X3D file. 3D texture coordinates may be specified explicitly or automatically generated, and they may be transformed.
Supported nodes:
TextureTransformMatrix3D
(Pascal API: TTextureTransformMatrix3DNode
),
TextureTransform3D
(Pascal API: TTextureTransform3DNode
),
TextureCoordinate3D
(Pascal API: TTextureCoordinate3DNode
),
TextureCoordinate4D
(Pascal API: TTextureCoordinate4DNode
),
ImageTexture3D
(Pascal API: TImageTexture3DNode
),
ComposedTexture3D
(Pascal API: TComposedTexture3DNode
),
PixelTexture3D
(Pascal API: TPixelTexture3DNode
)
3D textures, coordinates for 3D textures, transforming coordinates for 3D textures — all supported.
Note that 3D and 4D (homogeneous) coordinates, and transformations in 3D space / by 4x4 matrix, may be used to transform 2D textures as well. In case of 2D textures, the 3rd component is just ignored and the 4th is normal divisor (as usual for homogeneous coordinates).
DDS and KTX file formats
to specify 3D (volume)
textures are supported by ImageTexture3D
.
Note that PixelTexture3D
with RGBA values has a
problematic behavior because it uses MFInt32
field for colors.
When you encode RGBA colors (following SFImage
specification),
the most significant byte of Int32 may have to be non-zero,
which means that you will have to write negative values
inside PixelTexture3D.image
. (Of course we handle it correctly,
I'm just signalling there's a strangeness here. For normal
SFImage
fields this problem doesn't exist because our lexer
can actually understand integer values outside of int32 range, so when parsing
SFImage this is handled Ok, without going through int32.)
Automatic 3D texture coord generation for primitives (Box
,
Sphere
, Cone
, Cylinder
) is done
(according to X3D spec, 33.2.4 Texture coordinate generation for primitive objects).