SoVRMLImageTexture Class Reference
[VRML97 nodes]

VSG extension Texture map node. More...

#include <Inventor/VRMLnodes/SoVRMLImageTexture.h>

Inheritance diagram for SoVRMLImageTexture:
SoVRMLTexture SoVRMLNode SoNode SoFieldContainer SoBase SoRefCounter SoTypedObject

List of all members.

Public Types

enum  FileType {
  UNKNOWN = SoTexture::UNKNOWN,
  RGB = SoTexture::RGB,
  SGI = SoTexture::SGI,
  TIFF = SoTexture::TIFF,
  GIF = SoTexture::GIF,
  JPEG = SoTexture::JPEG,
  BMP = SoTexture::BMP,
  PNG = SoTexture::PNG,
  JPEG2000 = SoTexture::JPEG2000,
  PGX = SoTexture::PGX,
  PNM = SoTexture::PNM,
  RAS = SoTexture::RAS,
  DDS = SoTexture::DDS,
  HDRI = SoTexture::HDRI,
  NUM_FILETYPES
}

Public Member Functions

virtual SoType getTypeId () const
 SoVRMLImageTexture ()
void allowPrequalifyFile (SbBool)
void setBitmapFileType (FileType in_type)
FileType getBitmapFileType (void)
const unsigned char * getImage (SbVec2s &size, int &numcomp)

Static Public Member Functions

static SoType getClassTypeId ()
static void setPrequalifyFileCallBack (VRMLPrequalifyFileCallback *, void *)

Public Attributes

SoMFFilePathString url

Detailed Description

VSG extension Texture map node.

The SoVRMLImageTexture node defines a texture map by specifying an image file and general parameters for mapping to geometry. Texture maps are defined in a 2D coordinate system, (s,t), that ranges from 0.0 to 1.0 in both directions. The bottom edge of the image corresponds to the S-axis of the texture map, and left edge of the image corresponds to the T-axis of the texture map. The lower-left pixel of the image corresponds to s=0, t=0, and the top-right pixel of the image corresponds to s=1, t=1.

NOTE: This class does not exist in Open Inventor 10.0 and later.

Texture images may be one component (grayscale), two component (grayscale plus transparency), three component (full RGB color), or four-component (full RGB color plus transparency).

The repeatS and repeatT fields specify how the texture wraps in the S and T directions. If repeatS is TRUE (the default), the texture map is repeated outside the 0-to-1 texture coordinate range in the S direction so that it fills the shape. If repeatS is FALSE, the texture coordinates are clamped in the S direction to lie within the 0-to-1 range. The repeatT field is analogous to the repeatS field.

If the texture image's width or height is not a power of 2, or the image's width or height is greater than the maximum supported by OpenGL, then the image will be automatically scaled up or down to the next power of 2 or the maximum texture size. For maximum speed, point-sampling is used to do the scale; if you want more accurate resampling, pre-filter images to a power of 2 smaller than the maximum texture size (use the OpenGL glGetIntegerv(GL_MAX_TEXTURE_SIZE...) call to determine maximum texture for a specific OpenGL implementation).

The quality of the texturing is affected by the textureQuality field of the SoComplexity node. The textureQuality field affects what kind of filtering is done to the texture when it must be minified or magnified. The mapping of a particular texture quality value to a particular OpenGL filtering technique is implementation dependent, and varies based on the texturing performance. If mipmap filtering is required, mipmaps are automatically created using the simple box filter.

Open Inventor can read GIF, JPEG, PNG, RGB (native Silicon Graphics format), TIFF, and BMP texture files.

Performance Note: Automatic scaling of texture images to a power of 2 is a very convenient feature for prototyping, but it does take additional time the first time the texture node is traversed for rendering. For large images, or a large number of images, this can make the application seem slow while starting up or loading a new data file. Avoid this effect by either pre-scaling the image or by storing it as a sub-image in a "power of 2" image (then provide explicit texture coordinates such that only the sub-image is used).

VRML97 SPECIFICATION

FILE FORMAT/DEFAULT

ACTION BEHAVIOR

EVENTS


Open Inventor Toolkit reference manual, generated on 12 Feb 2024
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/