SoTexture Class Reference
[Textures]

Abstract base class for texture mapping nodes. More...

#include <Inventor/nodes/SoTexture.h>

Inheritance diagram for SoTexture:
SoNode SoFieldContainer SoBase SoRefCounter SoTypedObject SoExtTexture2 SoIndexedTexture2 SoTexture2 SoTexture3 SoTextureCubeMap SoUniformGridClipping SoUniformGridProjectionClipping

List of all members.

Public Types

enum  InternalFormat {
  AUTO_INTERNAL_FORMAT,
  ALPHA_FORMAT,
  ALPHA4,
  ALPHA8,
  ALPHA12,
  ALPHA16,
  LUMINANCE_FORMAT,
  LUMINANCE4,
  LUMINANCE8,
  LUMINANCE12,
  LUMINANCE16,
  LUMINANCE_ALPHA,
  LUMINANCE4_ALPHA4,
  LUMINANCE6_ALPHA2,
  LUMINANCE8_ALPHA8,
  LUMINANCE12_ALPHA4,
  LUMINANCE12_ALPHA12,
  LUMINANCE16_ALPHA16,
  INTENSITY_FORMAT,
  INTENSITY4,
  INTENSITY8,
  INTENSITY12,
  INTENSITY16,
  R3_G3_B2,
  RGB_FORMAT,
  RGB4,
  RGB5,
  RG8,
  RGB8,
  RGB10,
  RGB12,
  RGB16,
  RGBA_FORMAT,
  RGBA2,
  RGBA4,
  RGB5_ALPHA1,
  RGBA8,
  RGB10_ALPHA2,
  RGBA12,
  RGBA16,
  RGBA_FLOAT32,
  RGB_FLOAT32,
  ALPHA_FLOAT32,
  INTENSITY_FLOAT32,
  LUMINANCE_FLOAT32,
  LUMINANCE_ALPHA_FLOAT32,
  RGBA_FLOAT16,
  RGB_FLOAT16,
  ALPHA_FLOAT16,
  INTENSITY_FLOAT16,
  LUMINANCE_FLOAT16,
  LUMINANCE_ALPHA_FLOAT16,
  COMPRESSED_ALPHA,
  COMPRESSED_LUMINANCE,
  COMPRESSED_LUMINANCE_ALPHA,
  COMPRESSED_INTENSITY,
  COMPRESSED_RGB,
  COMPRESSED_RGBA,
  COMPRESSED_LUMINANCE_LATC1,
  COMPRESSED_SIGNED_LUMINANCE_LATC1,
  COMPRESSED_LUMINANCE_ALPHA_LATC2,
  COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2,
  COMPRESSED_RED_RGTC1,
  COMPRESSED_SIGNED_RED_RGTC1,
  COMPRESSED_RED_GREEN_RGTC2,
  COMPRESSED_SIGNED_RED_GREEN_RGTC2,
  DEPTH_COMPONENT16,
  DEPTH_COMPONENT24,
  DEPTH24_STENCIL8,
  R8I,
  R8UI,
  R16I,
  R16UI,
  R32I,
  R32UI,
  RG8I,
  RG8UI,
  RG16I,
  RG16UI,
  RG32I,
  RG32UI,
  RGB8I,
  RGB8UI,
  RGB16I,
  RGB16UI,
  RGB32I,
  RGB32UI,
  RGBA8I,
  RGBA8UI,
  RGBA16I,
  RGBA16UI,
  RGBA32I,
  RGBA32UI
}
enum  Model {
  MODULATE = SbEnums::TEX_MODEL_MODULATE,
  DECAL = SbEnums::TEX_MODEL_DECAL,
  BLEND = SbEnums::TEX_MODEL_BLEND,
  REPLACE = SbEnums::TEX_MODEL_REPLACE,
  ADD = SbEnums::TEX_MODEL_ADD,
  COMBINE = SbEnums::TEX_MODEL_COMBINE
}
enum  Wrap {
  REPEAT = SbEnums::TEX_ADDRESS_REPEAT,
  CLAMP = SbEnums::TEX_ADDRESS_CLAMP,
  CLAMP_TO_BORDER = SbEnums::TEX_ADDRESS_CLAMP_BORDER,
  CLAMP_TO_EDGE = SbEnums::TEX_ADDRESS_CLAMP_TO_EDGE,
  MIRRORED_REPEAT = SbEnums::TEX_ADDRESS_MIRROR_REPEAT
}
enum  Filter {
  AUTO = SbEnums::TEX_FILTER_AUTO,
  NEAREST = SbEnums::TEX_FILTER_NEAREST,
  LINEAR = SbEnums::TEX_FILTER_LINEAR,
  NEAREST_MIPMAP_NEAREST = SbEnums::TEX_FILTER_NEAREST_MIPMAP_NEAREST,
  NEAREST_MIPMAP_LINEAR = SbEnums::TEX_FILTER_NEAREST_MIPMAP_LINEAR,
  LINEAR_MIPMAP_NEAREST = SbEnums::TEX_FILTER_LINEAR_MIPMAP_NEAREST,
  LINEAR_MIPMAP_LINEAR = SbEnums::TEX_FILTER_LINEAR_MIPMAP_LINEAR
}
enum  HW_Feature {
  HW_NPOT = 0,
  HW_FLOATFORMAT,
  HW_DEPTHFORMAT,
  HW_AUTOMIPMAP,
  HW_BORDER_CLAMP,
  HW_EDGE_CLAMP,
  HW_MIRRORED_REPEAT,
  HW_COMPRESSION_S3TC,
  HW_COMPRESSION_LATC,
  HW_COMPRESSION_RGTC
}
enum  FileType {
  UNKNOWN,
  RGB,
  SGI,
  TIFF,
  GIF,
  JPEG,
  BMP,
  PNG,
  JPEG2000,
  PGX,
  PNM,
  RAS,
  DDS,
  HDRI,
  NUM_FILETYPES
}

Public Member Functions

virtual SoType getTypeId () const
void setBitmapFileType (FileType in_type)
FileType getBitmapFileType (void)
virtual void setOverride (const SbBool state)
virtual SbBool isOverride () const

Static Public Member Functions

static SoType getClassTypeId ()
static SbBool isSupported (HW_Feature feature)
static SbRasterImagereadTexture (const SbString &filename, FileType filetype=UNKNOWN)

Public Attributes

SoSFEnum internalFormat
SoSFBool enableCompressedTexture
SoSFEnum wrapS
SoSFEnum model
SoSFColor blendColor
SoSFBool enableBorder
SoSFVec4f borderColor
SoSFFloat maxAnisotropy
SoSFEnum minFilter
SoSFEnum magFilter

Friends

class inventor::impl::SoExtTexture2Impl
class inventor::impl::SoIndexedTexture2Impl
class inventor::impl::SoRenderToTexturePropertyImpl
struct inventor::renderer::Resource< SoTexture >
class inventor::renderer::FixedPipelineShader
class inventor::renderer::RendererContext

Detailed Description

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.

FILE FORMAT/DEFAULT

SEE ALSO

SoComplexity, SoExtTexture2, SoIndexedTexture2, SoMaterial, SoTexture2, SoTexture2Transform, SoTexture3, SoTextureCombiner, SoTextureCoordinate2, SoTextureCoordinateBinding, SoTextureCoordinateFunction, SoTextureCubeMap, SoTextureUnit


Member Enumeration Documentation

File Type possible values.

Enumerator:
UNKNOWN 

Unknown file.

RGB 

RGB.

SGI 

SGI.

TIFF 

TIFF.

GIF 

GIF.

JPEG 

JPEG.

BMP 

BMP.

PNG 

PNG.

JPEG2000 

JPEG2000.

PGX 

PGX.

PNM 

PNM.

RAS 

RAS.

DDS 

DDS.

HDRI 

HDRI.

NUM_FILETYPES 

NUM_FILETYPES.

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.

Enumerator:
AUTO 

AUTO.

NEAREST 

NEAREST.

LINEAR 

LINEAR.

NEAREST_MIPMAP_NEAREST 

NEAREST_MIPMAP_NEAREST.

NEAREST_MIPMAP_LINEAR 

NEAREST_MIPMAP_LINEAR.

LINEAR_MIPMAP_NEAREST 

LINEAR_MIPMAP_NEAREST.

LINEAR_MIPMAP_LINEAR 

LINEAR_MIPMAP_LINEAR.

Enumerator:
HW_NPOT 

Check support for non-power-of-2 textures.

HW_FLOATFORMAT 

Check support for floating point texture format.

HW_DEPTHFORMAT 

Check support for depth textures.

HW_AUTOMIPMAP 

Check support for automatic mipmap generation.

HW_BORDER_CLAMP 

Check support for texture coordinates border clamp.

HW_EDGE_CLAMP 

Check support for texture coordinates edge clamp.

HW_MIRRORED_REPEAT 

Check support for texture coordinates mirrored repeat.

HW_COMPRESSION_S3TC 

Check support for DDS support (S3TC).

HW_COMPRESSION_LATC 

Check support for texture_compression_latc.

HW_COMPRESSION_RGTC 

Check support for texture_compression_rgtc.

Texture internal storage format.

AUTO_INTERNAL_FORMAT (equivalent to RGB_FORMAT) by default.

Enumerator:
AUTO_INTERNAL_FORMAT 

Default.

ALPHA_FORMAT 

ALPHA_FORMAT.

ALPHA4 

ALPHA4.

Deprecated:

Deprecated since Open Inventor 9610
Use an 8 bit type instead.
ALPHA8 

ALPHA8.

ALPHA12 

ALPHA12.

ALPHA16 

ALPHA16.

LUMINANCE_FORMAT 

LUMINANCE_FORMAT.

LUMINANCE4 

LUMINANCE4.

Deprecated:

Deprecated since Open Inventor 9610
Use an 8 bit type instead.
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.

Deprecated:

Deprecated since Open Inventor 9610
Use an 8 bit type instead.
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 

Texture Combiner Functions.

Enumerator:
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

Texture wrap type.

Enumerator:
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.


NOTE: enumeration value available since Open Inventor 5.0

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.


NOTE: enumeration value available since Open Inventor 5.0

MIRRORED_REPEAT 

The texture image is repeated in such a way that every odd repetition is a mirror image.


NOTE: enumeration value available since Open Inventor 5.0


Member Function Documentation

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]

Set the state of the override field.

see SoNode::setOverride doc.

Reimplemented from SoNode.


Friends And Related Function Documentation

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]

Member Data Documentation

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.0

Enables borders for textures.

This means that the border is already in the texture.

NOTE: field available since Open Inventor 5.0

Enables 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.0

Internal 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.0

Specifies 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.0

Specifies 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.0

Specifies 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.0

Specifies 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.


The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/