vtlib library
Public Member Functions
vtMaterial Class Reference

List of all members.

Public Member Functions

void CopyFrom (vtMaterial *pFrom)
void SetDiffuse (float r, float g, float b, float a=1.0f)
RGBAf GetDiffuse () const
void SetSpecular (float r, float g, float b)
RGBf GetSpecular () const
void SetAmbient (float r, float g, float b)
RGBf GetAmbient () const
void SetEmission (float r, float g, float b)
RGBf GetEmission () const
void SetCulling (bool bCulling)
bool GetCulling () const
void SetLighting (bool bLighting)
bool GetLighting () const
void SetTransparent (bool bOn, bool bAdd=false)
bool GetTransparent () const
void SetWireframe (bool bOn)
bool GetWireframe () const
void SetTexture (osg::Image *pImage)
osg::Image * GetTexture () const
void ModifiedTexture ()
void SetClamp (bool bClamp)
bool GetClamp () const
void SetMipMap (bool bMipMap)
bool GetMipMap () const

Detailed Description

A material is a description of how geometry (typically, a surface) should be rendered. For a good description of how Materials work, see the opengl.org website or the OpenGL Red Book.

vtlib's concept of a material is slightly more broad than OpenGL's, because it includes texture and transparency (alpha). It maps closely to OSG's "state set", though that is even broader in scope.


Member Function Documentation

void vtMaterial::CopyFrom ( vtMaterial pFrom)

Copy this material from another.

RGBf vtMaterial::GetAmbient ( ) const

Get the ambient color of this material.

bool vtMaterial::GetClamp ( ) const

Get the texture clamping property of this material.

bool vtMaterial::GetCulling ( ) const

Get the backface culling property of this material.

RGBAf vtMaterial::GetDiffuse ( ) const

Get the diffuse color of this material.

RGBf vtMaterial::GetEmission ( ) const

Get the emissive color of this material.

bool vtMaterial::GetLighting ( ) const

Get the lighting property of this material.

bool vtMaterial::GetMipMap ( ) const

Get the texture mipmapping property of this material.

RGBf vtMaterial::GetSpecular ( ) const

Get the specular color of this material.

osg::Image * vtMaterial::GetTexture ( ) const

Returns the texture (image) associated with a material.

bool vtMaterial::GetTransparent ( ) const

Get the transparent property of this material.

bool vtMaterial::GetWireframe ( ) const

Get the wireframe property of this material.

void vtMaterial::ModifiedTexture ( )

Call this method to tell vtlib that you have modified the contents of a texture so it needs to be sent again to the graphics card.

void vtMaterial::SetAmbient ( float  r,
float  g,
float  b 
)

Set the ambient color of this material.

void vtMaterial::SetClamp ( bool  bClamp)

Set the texture clamping property for this material.

void vtMaterial::SetCulling ( bool  bCulling)

Set the backface culling property of this material.

void vtMaterial::SetDiffuse ( float  r,
float  g,
float  b,
float  a = 1.0f 
)

Set the diffuse color of this material.

Parameters:
r,g,bThe rgb value (0.0 to 1.0) of this material
aFor a material with transparency enabled, the alpha component of the diffuse color determines the overall transparency of the material. This value ranges from 0 (totally transparent) to 1 (totally opaque.)
void vtMaterial::SetEmission ( float  r,
float  g,
float  b 
)

Set the emissive color of this material.

void vtMaterial::SetLighting ( bool  bLighting)

Set the lighting property of this material.

void vtMaterial::SetMipMap ( bool  bMipMap)

Set the texture mipmapping property for this material.

void vtMaterial::SetSpecular ( float  r,
float  g,
float  b 
)

Set the specular color of this material.

void vtMaterial::SetTexture ( osg::Image *  pImage)

Set the texture for this material.

"Note, If the mode is set USE_IMAGE_DATA_FORMAT, USE_ARB_COMPRESSION, USE_S3TC_COMPRESSION the internalFormat is automatically selected, and will overwrite the previous _internalFormat.

void vtMaterial::SetTransparent ( bool  bOn,
bool  bAdd = false 
)

Set the transparent property of this material.

Parameters:
bOnTrue to turn on transparency (blending).
bAddTrue for additive blending.
void vtMaterial::SetWireframe ( bool  bOn)

Set the wireframe property of this material.

Parameters:
bOnTrue to turn on wireframe.
 All Classes Files Functions Variables Friends