Abstract base class for texture mapping nodes. More...
#include <Inventor/nodes/SoTexture.h>
Abstract base class for texture mapping nodes.
This is the abstract base class for all texture image nodes. It defines the common methods and fields that all texture image nodes have. When a texture image node is encountered during traversal, the associated image and parameters are applied to the current texture unit (see SoTextureUnit) and used to apply the texture to subsequent shapes.
Open Inventor provides multiple texture image nodes optimized for different purposes, including:
Applications may use the isSupported() method to check if the graphics hardware supports a specific texture mapping feature.
SoComplexity, SoExtTexture2, SoIndexedTexture2, SoMaterial, SoTexture2, SoTexture2Transform, SoTexture3, SoTextureCombiner, SoTextureCoordinate2, SoTextureCoordinateBinding, SoTextureCoordinateFunction, SoTextureCubeMap, SoTextureUnit
enum SoTexture::FileType |
enum SoTexture::Filter |
Specifies the OpenGL filtering method for minification and magnification.
AUTO is the default value. In this case Open Inventor automatically selects the filtering method depending on SoComplexity::textureQuality.
Texture internal storage format.
AUTO_INTERNAL_FORMAT (equivalent to RGB_FORMAT) by default.
AUTO_INTERNAL_FORMAT |
Default. |
ALPHA_FORMAT |
ALPHA_FORMAT. |
ALPHA4 |
ALPHA4.
|
ALPHA8 |
ALPHA8. |
ALPHA12 |
ALPHA12. |
ALPHA16 |
ALPHA16. |
LUMINANCE_FORMAT |
LUMINANCE_FORMAT. |
LUMINANCE4 |
LUMINANCE4.
|
LUMINANCE8 |
LUMINANCE8. |
LUMINANCE12 |
LUMINANCE12. |
LUMINANCE16 |
LUMINANCE16. |
LUMINANCE_ALPHA |
LUMINANCE_ALPHA. |
LUMINANCE4_ALPHA4 |
LUMINANCE4_ALPHA4. |
LUMINANCE6_ALPHA2 |
LUMINANCE6_ALPHA2. |
LUMINANCE8_ALPHA8 |
LUMINANCE8_ALPHA8. |
LUMINANCE12_ALPHA4 |
LUMINANCE12_ALPHA4. |
LUMINANCE12_ALPHA12 |
LUMINANCE12_ALPHA12. |
LUMINANCE16_ALPHA16 |
LUMINANCE16_ALPHA16. |
INTENSITY_FORMAT |
INTENSITY_FORMAT. |
INTENSITY4 |
INTENSITY4.
|
INTENSITY8 |
INTENSITY8. |
INTENSITY12 |
INTENSITY12. |
INTENSITY16 |
INTENSITY16. |
R3_G3_B2 |
R3_G3_B2. |
RGB_FORMAT |
RGB_FORMAT. |
RGB4 |
RGB4. |
RGB5 |
RGB5. |
RG8 |
RG8. |
RGB8 |
RGB8. |
RGB10 |
RGB10. |
RGB12 |
RGB12. |
RGB16 |
RGB16. |
RGBA_FORMAT |
RGBA_FORMAT. |
RGBA2 |
RGBA2. |
RGBA4 |
RGBA4. |
RGB5_ALPHA1 |
RGB5_ALPHA1. |
RGBA8 |
RGBA8. |
RGB10_ALPHA2 |
RGB10_ALPHA2. |
RGBA12 |
RGBA12. |
RGBA16 |
RGBA16. |
RGBA_FLOAT32 |
RGBA_FLOAT32. |
RGB_FLOAT32 |
RGB_FLOAT32. |
ALPHA_FLOAT32 |
ALPHA_FLOAT32. |
INTENSITY_FLOAT32 |
INTENSITY_FLOAT32. |
LUMINANCE_FLOAT32 |
LUMINANCE_FLOAT32. |
LUMINANCE_ALPHA_FLOAT32 |
LUMINANCE_ALPHA_FLOAT32. |
RGBA_FLOAT16 |
RGBA_FLOAT16. |
RGB_FLOAT16 |
RGB_FLOAT16. |
ALPHA_FLOAT16 |
ALPHA_FLOAT16. |
INTENSITY_FLOAT16 |
INTENSITY_FLOAT16. |
LUMINANCE_FLOAT16 |
LUMINANCE_FLOAT16. |
LUMINANCE_ALPHA_FLOAT16 |
LUMINANCE_ALPHA_FLOAT16. |
COMPRESSED_ALPHA |
COMPRESSED_ALPHA. |
COMPRESSED_LUMINANCE |
COMPRESSED_LUMINANCE. |
COMPRESSED_LUMINANCE_ALPHA |
COMPRESSED_LUMINANCE_ALPHA. |
COMPRESSED_INTENSITY |
COMPRESSED_INTENSITY. |
COMPRESSED_RGB |
COMPRESSED_RGB. |
COMPRESSED_RGBA |
COMPRESSED_RGBA. |
COMPRESSED_LUMINANCE_LATC1 | NOTE: enumeration value available since Open Inventor 7.0 |
COMPRESSED_SIGNED_LUMINANCE_LATC1 | NOTE: enumeration value available since Open Inventor 7.0 |
COMPRESSED_LUMINANCE_ALPHA_LATC2 | NOTE: enumeration value available since Open Inventor 7.0 |
COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2 | NOTE: enumeration value available since Open Inventor 7.0 |
COMPRESSED_RED_RGTC1 | NOTE: enumeration value available since Open Inventor 7.0 |
COMPRESSED_SIGNED_RED_RGTC1 | NOTE: enumeration value available since Open Inventor 7.0 |
COMPRESSED_RED_GREEN_RGTC2 | NOTE: enumeration value available since Open Inventor 7.0 |
COMPRESSED_SIGNED_RED_GREEN_RGTC2 | NOTE: enumeration value available since Open Inventor 7.0 |
DEPTH_COMPONENT16 | NOTE: enumeration value available since Open Inventor 9.0 |
DEPTH_COMPONENT24 | NOTE: enumeration value available since Open Inventor 9.0 |
DEPTH24_STENCIL8 | NOTE: enumeration value available since Open Inventor 9.0 |
R8I | NOTE: enumeration value available since Open Inventor 10.0 |
R8UI | |
R16I | |
R16UI | |
R32I | |
R32UI | |
RG8I | |
RG8UI | |
RG16I | |
RG16UI | |
RG32I | |
RG32UI | |
RGB8I | |
RGB8UI | |
RGB16I | |
RGB16UI | |
RGB32I | |
RGB32UI | |
RGBA8I | |
RGBA8UI | |
RGBA16I | |
RGBA16UI | |
RGBA32I | |
RGBA32UI |
enum SoTexture::Model |
Texture Combiner Functions.
MODULATE |
The texture color is multiplied by the surface color. |
DECAL |
In this mode, OpenGL requires that the specified texture image have either 3 or 4 components. For a 3-component texture, the texture color replaces the surface color. For a 4-component texture, the texture color is blended with the surface color using the texture alpha value. See OpenGL documentation on glTexEnv for details. |
BLEND |
Blends between the surface color and a specified blend color. |
REPLACE |
The texture color replaces the surface color. NOTE: enumeration value available since Open Inventor 4.0 |
ADD |
Adds incoming fragment and texture source colors. NOTE: enumeration value available since Open Inventor 5.0 |
COMBINE |
Provides a wide range of programmable combiner functions using the incoming fragment color, texture source color, texture constant color, and the result of the previous texture environment stage as possible parameters. NOTE: enumeration value available since Open Inventor 5.0 |
enum SoTexture::Wrap |
Texture wrap type.
REPEAT |
Repeats texture outside 0-1 texture coordinate range. |
CLAMP |
Clamps texture coordinates to lie within 0-1 range. This wrap type is deprecated in OpenGL core profile. Consider using CLAMP_TO_EDGE instead. |
CLAMP_TO_BORDER |
Clamps texture coordinates to a range coinciding with the centers of the border texels of a texture map at each mipmap level.
|
CLAMP_TO_EDGE |
Clamps texture coordinates to a range coinciding with the centers of the edge texels of a texture map at each mipmap level.
|
MIRRORED_REPEAT |
The texture image is repeated in such a way that every odd repetition is a mirror image.
|
FileType SoTexture::getBitmapFileType | ( | void | ) |
Gets the texture file format.
static SoType SoTexture::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoNode.
Reimplemented in SoExtTexture2, SoIndexedTexture2, SoTexture2, SoTexture3, SoTextureCubeMap, SoUniformGridClipping, and SoUniformGridProjectionClipping.
virtual SoType SoTexture::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoNode.
Reimplemented in SoExtTexture2, SoIndexedTexture2, SoTexture2, SoTexture3, SoTextureCubeMap, SoUniformGridClipping, and SoUniformGridProjectionClipping.
virtual SbBool SoTexture::isOverride | ( | ) | const [inline, virtual] |
Returns the state of the override field.
Reimplemented from SoNode.
static SbBool SoTexture::isSupported | ( | HW_Feature | feature | ) | [static] |
Returns information about hardware support for various texture features.
When using a debug build of Open Inventor, some "no context available" warning messages may be generated. You can ignore them or see SoGLExtension for an example of using SoGLContext to avoid them.
static SbRasterImage* SoTexture::readTexture | ( | const SbString & | filename, | |
FileType | filetype = UNKNOWN | |||
) | [static] |
Convenience function that loads the image data from any texture file supported by Open Inventor and returns an SbRasterImage object.
Returns null if the load fails for any reason.
If the file type is known, you may specify it using the FileType enum and Open Inventor will use the corresponding image reader. If filetype is UNKNOWN, Open Inventor will try to automatically determine which image reader should be used for the given file.
void SoTexture::setBitmapFileType | ( | FileType | in_type | ) |
Sets the texture file format.
Default is UNKNOWN. If file type is set to UNKNOWN, Open Inventor tries to determine the file type from the file name extension (e.g., foo. gif implies a GIF file). If the set or determined file type is not UNKNOWN, Open Inventor attempts to read the file as that format. If this fails, Open Inventor will try reading the file as each possible format in turn. It is not necessary to set the file type if the image file has the standard file name extension.
virtual void SoTexture::setOverride | ( | const SbBool | state | ) | [inline, virtual] |
friend class inventor::impl::SoExtTexture2Impl [friend] |
friend class inventor::impl::SoIndexedTexture2Impl [friend] |
friend class inventor::impl::SoRenderToTexturePropertyImpl [friend] |
friend class inventor::renderer::FixedPipelineShader [friend] |
friend class inventor::renderer::RendererContext [friend] |
friend struct inventor::renderer::Resource< SoTexture > [friend] |
Color used for BLEND model.
Defines border color used for border texture filtering.
This value is only used if enableBorder is FALSE.
NOTE: field available since Open Inventor 5.0Enables borders for textures.
This means that the border is already in the texture.
NOTE: field available since Open Inventor 5.0Enables storage of textures on the graphics board in compressed form.
The application supplies textures as usual, then OpenGL compresses the textures. This can reduce usage of texture memory significantly, depending on the texture image.
To use this option, you must be using OpenGL 1.3 or higher, or your board must support the OpenGL GL_ARB_texture_compression extension.
NOTE: field available since Open Inventor 4.0Internal format for texture storage.
If not available on the graphics device, internalFormat is set back to AUTO_INTERNAL_FORMAT. Use enum InternalFormat. Default is AUTO_INTERNAL_FORMAT. If internal format is set to AUTO_INTERNAL_FORMAT texture precision could only be 16-bit maximum. To go beyond this limitation, you must set the internal format to the needed value.
NOTE: field available since Open Inventor 6.0Specifies the OpenGL magFilter.
Use enum Filter. Default is AUTO. Only the following Filter values are valid: AUTO, NEAREST, and LINEAR.
The magnification filter is used when the rendered size of the geometry is larger than the texture image to be applied (typically near objects). Effectively controls whether the GPU will select the "nearest" texel in the texture image or do linear interpolation (smoothing). Using NEAREST may allow better performance, but the LINEAR options produce much higher quality rendering.
Only the values NEAREST and LINEAR are valid in this field (see OpenGL specification).
The default value (AUTO) means that the magnification filter setting is actually controlled by the SoComplexity::textureQuality field.
NOTE: field available since Open Inventor 5.0Specifies on a per-texture object basis, the maximum degree of anisotropy to account for in texture filtering.
If the specified value is greater than the maximum supported by the graphics board, the value is clamped to GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT.
To use this option, you must be using OpenGL 1.1 or higher, or your board must support the OpenGL GL_EXT_filter_anisotropic extension.
NOTE: field available since Open Inventor 5.0Specifies the OpenGL minFilter.
Use enum Filter. Default is AUTO. The minification filter is used when the rendered size of the geometry is smaller than the texture image to be applied (typically far away objects). Effectively controls whether the GPU will select the "nearest" texel in the texture image or do linear interpolation (smoothing) or even interpolate between mipmap levels (subsampled versions of the base image). Using NEAREST may allow better performance, but the LINEAR options produce much higher quality rendering.
The default value (AUTO) means that the minification filter setting is actually controlled by the SoComplexity::textureQuality field.
NOTE: field available since Open Inventor 5.0Specifies how to map texture onto surface.
Use enum Model. Default is MODULATE.
Indicates what to do when texture coordinates in the S (horizontal) direction lie outside the range 0-1.
Use enum Wrap. Default is REPEAT.