TextureInfo Class Reference

TextureInfo Class Reference

#include <mtl.h>

Class Description

See also
Class MtlMakerCallback, Class Material, Class Matrix3.

Description:
This class describes a texture used by the interactive renderer. This includes all the information about the mapping channel, tiling, etc. A table of these is maintained by the texture data member of class Material.

There are data members related to maps which specify how the texture should be applied. These are specified independently for color and alpha and include a scale. For example, for normal multiplication (modulation) application of a texture, the entries would be:

colorOp = GW_TEX_MODULATE

colorAlphaSource = GW_TEX_TEXTURE

colorScale = GW_TEX_SCALE_1X

alphaOp = GW_TEX_MODULATE

alphaAlphaSource = GW_TEX_TEXTURE

alphaScale = GW_TEX_SCALE_1X

For applying a texture with alpha blending, the entry would be:

colorOp = GW_TEX_ALPHA_BLEND

colorAlphaSource = GW_TEX_TEXTURE

colorScale = GW_TEX_SCALE_1X

alphaOp = GW_TEX_LEAVE

alphaAlphaSource = GW_TEX_TEXTURE

alphaScale = GW_TEX_SCALE_1X

For applying an opacity map, the entry would be:

colorOp = GW_TEX_LEAVE

colorAlphaSource = GW_TEX_TEXTURE

colorScale = GW_TEX_SCALE_1X

alphaOp = GW_TEX_REPLACE

alphaAlphaSource = GW_TEX_TEXTURE

alphaScale = GW_TEX_SCALE_1X
Data Members:
int useTex;

Indicates if the material uses textures. Nonzero indicates textures are used.

int faceMap;

Indicates if the material is face mapped. Nonzero indicates it is.

DWORD_PTR textHandle;

The texture handle.

int uvwSource;

The UVW source used.

UVSOURCE_MESH

Use UVW coordinates from a standard map channel.

UVSOURCE_XYZ

Compute UVW from object XYZ.

UVSOURCE_MESH2

Use UVW2 (Vertex Color) coordinates.

UVSOURCE_WORLDXYZ

Use World XYZ as UVW.

int mapChannel;

The mapping channel used.

Matrix3 textTM;

The texture transformation matrix.

UBYTE tiling[3];

The UVW tiling. One of the following values:

GW_TEX_REPEAT

GW_TEX_MIRROR

GW_TEX_NO_TILING

UBYTE colorOp;

The color texture operation. One of the following values:

GW_TEX_LEAVE

Use the source pixel value

GW_TEX_REPLACE

Use the texture pixel value

GW_TEX_MODULATE

Multiply the source with the texture

GW_TEX_ADD

Add the source and texture

GW_TEX_ADD_SIGNED

Add the source and texture with an 0.5 subtraction

GW_TEX_SUBTRACT

Subtract the source from the texture

GW_TEX_ADD_SMOOTH

Add the source and the texture then subtract their product

GW_TEX_ALPHA_BLEND

Alpha blend the texture with the source

GW_TEX_PREMULT_ALPHA_BLEND

Alpha blend the source with a premultiplied alpha

UBYTE colorAlphaSource;

The color blend alpha source. One of the following values:

GW_TEX_ZERO

Use no alpha value

GW_TEX_SOURCE

Use the source alpha

GW_TEX_TEXTURE

Use the texture alpha

GW_TEX_CONSTANT

Use a constant BGRA color as an alpha

GW_TEX_PREVIOUS

Use the previous texture stage alpha

UBYTE colorScale;

The color scale factor. One of the following values:

GW_TEX_SCALE_1X

Multiply the tex op result by 1

GW_TEX_SCALE_2X

Multiply the tex op result by 2

GW_TEX_SCALE_4X

Multiply the tex op result by 4

UBYTE alphaOp;

The alpha texture operation. One of the following values:

GW_TEX_LEAVE

Use the source pixel value

GW_TEX_REPLACE

Use the texture pixel value

GW_TEX_MODULATE

Multiply the source with the texture

GW_TEX_ADD

Add the source and texture

GW_TEX_ADD_SIGNED

Add the source and texture with an 0.5 subtraction

GW_TEX_SUBTRACT

Subtract the source from the texture

GW_TEX_ADD_SMOOTH

Add the source and the texture then subtract their product

GW_TEX_ALPHA_BLEND

Alpha blend the texture with the source

GW_TEX_PREMULT_ALPHA_BLEND

Alpha blend the source with a premultiplied alpha

UBYTE alphaAlphaSource;

The alpha blend alpha source. One of the following values:

GW_TEX_ZERO

Use no alpha value

GW_TEX_SOURCE

Use the source alpha

GW_TEX_TEXTURE

Use the texture alpha

GW_TEX_CONSTANT

Use a constant BGRA color as an alpha

GW_TEX_PREVIOUS

Use the previous texture stage alpha

UBYTE alphaScale;

The alpha scale factor. One of the following values:

GW_TEX_SCALE_1X

Multiply the tex op result by 1

GW_TEX_SCALE_2X

Multiply the tex op result by 2

GW_TEX_SCALE_4X

Multiply the tex op result by 4
+ Inheritance diagram for TextureInfo:

Public Member Functions

DllExport TextureInfo ()
 
virtual ~TextureInfo ()
 
DllExport TextureInfooperator= (const TextureInfo &from)
 
DllExport bool operator== (const TextureInfo &b) const
 
- Public Member Functions inherited from BaseInterfaceServer
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
virtual UtilExport int NumInterfaces () const
 
virtual UtilExport BaseInterfaceGetInterfaceAt (int i) const
 
virtual UtilExport ~BaseInterfaceServer ()
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 

Public Attributes

int useTex
 
int faceMap
 
DWORD_PTR textHandle
 
int uvwSource
 
int mapChannel
 
Matrix3 textTM
 
UBYTE tiling [3]
 
UBYTE colorOp
 
UBYTE colorAlphaSource
 
UBYTE colorScale
 
UBYTE alphaOp
 
UBYTE alphaAlphaSource
 
UBYTE alphaScale
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
- Protected Attributes inherited from BaseInterfaceServer
Tab< BaseInterface * > interfaces
 

Constructor & Destructor Documentation

Remarks
Constructor. The data members are initialized as follows:

useTex = 1;

faceMap = 0;

textHandle = 0;

uvwSource = UVSOURCE_MESH;

mapChannel = 1;

tiling[0] = tiling[1] = tiling[2] = GW_TEX_REPEAT;

colorOp = GW_TEX_MODULATE;

colorAlphaSource = GW_TEX_TEXTURE;

colorScale = GW_TEX_SCALE_1X;

alphaOp = GW_TEX_LEAVE;

alphaAlphaSource = GW_TEX_TEXTURE;

alphaScale = GW_TEX_SCALE_1X;
virtual ~TextureInfo ( )
inlinevirtual
Remarks
Destructor.
184 {};

Member Function Documentation

DllExport TextureInfo& operator= ( const TextureInfo from)
DllExport bool operator== ( const TextureInfo b) const
Remarks
Compares this class instance to another one

Member Data Documentation

int useTex
int faceMap
DWORD_PTR textHandle
int uvwSource
int mapChannel
Matrix3 textTM
UBYTE tiling[3]
UBYTE colorOp
UBYTE colorAlphaSource
UBYTE colorScale
UBYTE alphaOp
UBYTE alphaAlphaSource
UBYTE alphaScale