Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
vtMaterial Class Reference

#include <Material.h>

Inheritance diagram for vtMaterial:

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
 
void SetDiffuse1 (const RGBAf &c)
 
void SetDiffuse2 (float f)
 
void SetSpecular1 (const RGBf &c)
 
void SetSpecular2 (float f)
 
void SetAmbient1 (const RGBf &c)
 
void SetAmbient2 (float f)
 
void SetEmission1 (const RGBf &c)
 
void SetEmission2 (float f)
 

Public Attributes

osg::ref_ptr< osg::Image > m_Image
 
osg::ref_ptr< osg::Material > m_pMaterial
 
osg::ref_ptr< osg::Texture2D > m_pTexture
 
osg::ref_ptr< osg::BlendFunc > m_pBlendFunc
 
osg::ref_ptr< osg::AlphaFunc > m_pAlphaFunc
 

Static Public Attributes

static bool s_bTextureCompression = false
 

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.

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