Node that specifies the current texture unit and the associated mapping method. More...
#include <Inventor/nodes/SoTextureUnit.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
SoTextureUnit () | |
Static Public Member Functions | |
static SoType | getClassTypeId () |
static unsigned int | getMaxTextureUnit (SoState *state=NULL) |
Public Attributes | |
SoSFUInt32 | unit |
Deprecated | |
| |
enum | MappingMethod { BUMP_MAPPING = SoTextureUnitElement::BUMP_MAPPING, IMAGE_MAPPING = SoTextureUnitElement::IMAGE_MAPPING } |
SoDEPRECATED SoSFEnum | mappingMethod |
This node specifies the current texture unit for all subsequent 2D and 3D texture nodes (for example, SoTexture2, SoTexture2Transform, SoTextureCoordinate2, SoTextureCoordinateBinding, and SoTextureCoordinateFunction).
If the graphics board supports multitexturing (OpenGL 1.5 or GL_ARB_multitexture extension), then multiple textures, each defined by a texture unit, can be applied to the same shape. The maximum number of texture units depends on the board and can be queried using getMaxTextureUnit.
Multitexturing is supported by the following shapes:
Each texture unit is defined by the following texture properties:
Limitations:
unit | 0 |
mappingMethod | IMAGE_MAPPING |
SoBumpMappingProperty, SoTexture2, SoTexture2Transform, SoTextureCoordinate2, SoTextureCoordinateBinding, SoTextureCoordinateFunction.
Mapping method possible values.
BUMP_MAPPING |
The texture stored in SoTexture2 is used as a bump map texture. |
IMAGE_MAPPING |
The texture stored in SoTexture2 is used as an image map texture. |
SoTextureUnit::SoTextureUnit | ( | ) |
Constructor.
static SoType SoTextureUnit::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoNode.
static unsigned int SoTextureUnit::getMaxTextureUnit | ( | SoState * | state = NULL |
) | [static] |
Returns the maximum number of texture units.
This is the max which can be used when a shader is on state. Without shaders, only the first 4 units (0..3) can be used.
virtual SoType SoTextureUnit::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoNode.
SoDEPRECATED SoSFEnum SoTextureUnit::mappingMethod |
Specifies the mapping method used for texture mapping.
Use enum MappingMethod. Default is IMAGE_MAPPING.
Specifies the texture unit identifier.
Can range from 0 to the largest texture unit, which is getMaxTextureUnit()-1. Values greater than the largest texture unit are clamped at the largest texture unit.