Cube texture mapping node. More...
#include <Inventor/nodes/SoTextureCubeMap.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
SoTextureCubeMap () | |
Static Public Member Functions | |
static SoType | getClassTypeId () |
Public Attributes | |
SoMFFilePathString | filenames |
SoSFImage | imagePosX |
SoSFImage | imagePosY |
SoSFImage | imagePosZ |
SoSFImage | imageNegX |
SoSFImage | imageNegY |
SoSFImage | imageNegZ |
SoSFEnum | wrapT |
SoSFEnum | wrapR |
SoSFNode | renderToTextureProperty |
SoSFFloat | HDRIExposure |
Cube map textures provide a new texture generation scheme for looking up textures from a set of six two-dimensional images representing the faces of a cube. The (s,t,r) texture coordinates are treated as a direction vector emanating from the center of a cube. At texture generation time, the interpolated per-fragment (s,t,r) selects one cube face two-dimensional image based on the largest magnitude coordinate (the major axis). A new (s,t) is calculated by dividing the two other coordinates (the minor axes values) by the major axis value, and the new (s,t) is used to lookup into the selected two-dimensional texture image face of the cube map.
Cube map textures are often used within shader programs to implement effects such as reflection or refraction.
There are three ways to send the texture to Open Inventor:
But in all cases, the images must be specified in the following order:
The SoTextureCoordinateReflectionMap node can be used to automatically generate appropriate texture coordinates for cube mapping.
If the texture image's width or height is not a power of 2, and the Non Power Of Two (NPOT) extension is available on your graphics board, by default Open Inventor will send the image to OpenGL without modification. See SoTexture2 for a complete discussion of this feature.
Transparency Texture images can contain transparency (alpha values less than 1) and modify the transparency of geometry in the scene. Also note that some image file formats, for example JPEG, do not support transparency information (alpha channel).
Limitations:
SoInput::addDirectoryFirst( "/ImageDirectory" ); static char *faceFile[6] = { "left.jpg", "bottom.jpg", "back.jpg", "right.jpg", "top.jpg", "front.jpg", }; SoTextureCubeMap* texture = new SoTextureCubeMap(); for (int i = 0; i < 6; i++) { texture->filenames.set1Value( i, SbString(faceFile[i]) ); } root->addChild( new SoTextureCoordinateReflectionMap() ) ; root->addChild( texture ); root->addChild( geometry );
filenames | "" |
imagePosX | 0 0 0 |
imageNegX | 0 0 0 |
imagePosY | 0 0 0 |
imageNegY | 0 0 0 |
imagePosZ | 0 0 0 |
imageNegZ | 0 0 0 |
wrapS | REPEAT |
wrapT | REPEAT |
wrapR | REPEAT |
enableCompressedTexture | FALSE |
model | MODULATE |
blendColor | 0 0 0 |
enableBorder | FALSE |
borderColor | 0 0 0 0 |
maxAnisotropy | 1.0 |
minFilter | AUTO |
magFilter | AUTO |
useAutoMipmap | FALSE |
internalFormat | AUTO_INTERNAL_FORMAT |
SoComplexity, SoExtTexture2, SoMaterial, SoTexture2, SoTexture2Transform, SoTextureCoordinate2, SoTextureCoordinateBinding, SoTextureCoordinateFunction, SoTextureCoordinateNormalMap, SoTextureCoordinateReflectionMap, SoTextureUnit
SoTextureCubeMap::SoTextureCubeMap | ( | ) |
Creates a texture node with default settings.
static SoType SoTextureCubeMap::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoTexture.
virtual SoType SoTextureCubeMap::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoTexture.
Names file(s) from which to read texture image(s).
The standard image file formats are supported. See SoRasterImageRW for the list. If the first file is an HDRI file, only this file is used since it has all 6 faces encoded. If the filename is not an absolute path name, the list of directories maintained by SoInput is searched. If the texture is not found in any of those directories, then the file is searched for relative to the directory from which the SoTextureCubeMap node was read. For example, if an SoTextureCubeMap node with a filename of "../tofu.rgb" is read from /usr/people/bob/models/food.iv, then /usr/people/bob/tofu.rgb will be read (assuming tofu.rgb isn't found in the directories maintained by SoInput).
Specifies an exposure factor when using an HDRI file.
1.0 by default.
Specifies an SoRenderToTextureProperty node containing a scene graph that will be rendered to create the texture image.
The scene is rendered into a Pbuffer and then directly bound or copied into texture memory. Null by default.
NOTE: field available since Open Inventor 6.0Indicates what to do when texture coordinates in the R (depth) direction lie outside the range 0-1.
Use enum SoTexture::Wrap. Default is REPEAT.
Indicates what to do when texture coordinates in the T (vertical) direction lie outside the range 0-1.
Use enum SoTexture::Wrap. Default is REPEAT.