StandardMaterialHandle Class Reference
 
 
 
StandardMaterialHandle Class Reference

This reference page is linked to from the following overview topics: Low-level Device API.


#include <StandardMaterialHandle.h>

Inheritance diagram for StandardMaterialHandle:
BaseMaterialHandle SmartHandle Noncopyable MaxHeapOperators

Class Description

StandardMaterialHandle is a material class to support phong style material .

This class is used for viewport display and Quicksilver. It's used by RenderItemHandle::SetCustomMaterial() to describe the phong style surface. How to use:

StandardMaterialHandle hMaterial;
hMaterial.Initialize();
pItem->SetCustomMaterial(hMaterial); // pItem is an instance of RenderItemHandle

Public Member Functions

GraphicsDriverAPI  StandardMaterialHandle ()
GraphicsDriverAPI  StandardMaterialHandle (const StandardMaterialHandle &from)
GraphicsDriverAPI
StandardMaterialHandle
operator= (const StandardMaterialHandle &from)
virtual GraphicsDriverAPI  ~StandardMaterialHandle ()
GraphicsDriverAPI bool  Initialize ()
  Initialize the standard material instance.
virtual GraphicsDriverAPI
const MaterialRequiredStreams
GetRequiredStreams () const
  Returns the material required streams to tell how to setup mesh data.
GraphicsDriverAPI void  SetAmbient (const AColor &color)
  Sets ambient color.
GraphicsDriverAPI const AColor GetAmbient () const
  Returns the ambient color.
GraphicsDriverAPI void  SetDiffuse (const AColor &color)
  Sets diffuse color.
GraphicsDriverAPI const AColor GetDiffuse () const
  Returns the diffuse color.
GraphicsDriverAPI void  SetSpecular (const AColor &color)
  Sets specular color.
GraphicsDriverAPI const AColor GetSpecular () const
  Returns the specular color.
GraphicsDriverAPI void  SetSpecularLevel (float level)
  Sets specular level.
GraphicsDriverAPI float  GetSpecularLevel () const
  Returns the specular level.
GraphicsDriverAPI void  SetSpecularPower (float power)
  Sets specular power.
GraphicsDriverAPI float  GetSpecularPower () const
  Returns the specular power.
GraphicsDriverAPI void  SetEmission (const AColor &color)
  Sets emission color.
GraphicsDriverAPI const AColor GetEmission () const
  Returns the emission color.
GraphicsDriverAPI void  SetOpacity (float opacity)
  Sets opacity value.
GraphicsDriverAPI float  GetOpacity () const
  Returns the opacity value.
GraphicsDriverAPI void  SetTwoSided (bool twoSided)
  Sets two side flag.
GraphicsDriverAPI bool  GetTwoSided () const
  Returns the two side flag.
GraphicsDriverAPI void  SetDiffuseTexture (const BaseRasterHandle &hTexture)
  Sets diffuse texture.
GraphicsDriverAPI BaseRasterHandle  GetDiffuseTexture ()
  Returns the diffuse texture.
GraphicsDriverAPI void  ClearDiffuseTexture ()
  Clear the diffuse texture.
GraphicsDriverAPI void  SetOpacityTexture (const BaseRasterHandle &hTexture)
  Sets opacity texture.
GraphicsDriverAPI BaseRasterHandle  GetOpacityTexture ()
  Returns the opacity texture.
GraphicsDriverAPI void  ClearOpacityTexture ()
  Clear the opacity texture.

Constructor & Destructor Documentation

GraphicsDriverAPI StandardMaterialHandle ( )
GraphicsDriverAPI StandardMaterialHandle ( const StandardMaterialHandle from )
virtual GraphicsDriverAPI ~StandardMaterialHandle ( ) [virtual]

Member Function Documentation

GraphicsDriverAPI StandardMaterialHandle& operator= ( const StandardMaterialHandle from )
GraphicsDriverAPI bool Initialize ( )

Initialize the standard material instance.

A StandardMaterialHandle must be initialized before it's used.

Returns:
true if successfully initialized, false otherwise.
virtual GraphicsDriverAPI const MaterialRequiredStreams* GetRequiredStreams ( ) const [virtual]

Returns the material required streams to tell how to setup mesh data.

When a StandardMaterialHandle is used by RenderItemHandle::SetCustomMaterial(), it also needs to know about the material requirement streams to setup corresponding mesh data. It could be used by GenerateRenderItems::GenerateRenderItems() for RenderItemHandle.

Returns:
the material required streams.

Reimplemented from BaseMaterialHandle.

GraphicsDriverAPI void SetAmbient ( const AColor color )

Sets ambient color.

Parameters:
[in] color The ambient color.
GraphicsDriverAPI const AColor& GetAmbient ( ) const

Returns the ambient color.

Returns:
the ambient color.
GraphicsDriverAPI void SetDiffuse ( const AColor color )

Sets diffuse color.

If diffuse texture exists, this value will be ignored.

Parameters:
[in] color The diffuse color.
GraphicsDriverAPI const AColor& GetDiffuse ( ) const

Returns the diffuse color.

Returns:
the diffuse color.
GraphicsDriverAPI void SetSpecular ( const AColor color )

Sets specular color.

Parameters:
[in] color The specular color.
GraphicsDriverAPI const AColor& GetSpecular ( ) const

Returns the specular color.

Returns:
the specular color.
GraphicsDriverAPI void SetSpecularLevel ( float  level )

Sets specular level.

Parameters:
[in] level The specular level.
GraphicsDriverAPI float GetSpecularLevel ( ) const

Returns the specular level.

Returns:
the specular level.
GraphicsDriverAPI void SetSpecularPower ( float  power )

Sets specular power.

Parameters:
[in] power The specular power.
GraphicsDriverAPI float GetSpecularPower ( ) const

Returns the specular power.

Returns:
the specular power.
GraphicsDriverAPI void SetEmission ( const AColor color )

Sets emission color.

Parameters:
[in] color The emission color.
GraphicsDriverAPI const AColor& GetEmission ( ) const

Returns the emission color.

Returns:
the emission color.
GraphicsDriverAPI void SetOpacity ( float  opacity )

Sets opacity value.

If opacity texture exists, this value will be ignored.

Parameters:
[in] opacity The opacity value.
GraphicsDriverAPI float GetOpacity ( ) const

Returns the opacity value.

Returns:
the opacity value.
GraphicsDriverAPI void SetTwoSided ( bool  twoSided )

Sets two side flag.

Parameters:
[in] twoSided The two side flag.
GraphicsDriverAPI bool GetTwoSided ( ) const

Returns the two side flag.

Returns:
the two side flag.
GraphicsDriverAPI void SetDiffuseTexture ( const BaseRasterHandle hTexture )

Sets diffuse texture.

Parameters:
[in] hTexture The diffuse texture handle.
GraphicsDriverAPI BaseRasterHandle GetDiffuseTexture ( )

Returns the diffuse texture.

Returns:
the diffuse texture.
GraphicsDriverAPI void ClearDiffuseTexture ( )

Clear the diffuse texture.

GraphicsDriverAPI void SetOpacityTexture ( const BaseRasterHandle hTexture )

Sets opacity texture.

Parameters:
[in] hTexture The opacity texture.
GraphicsDriverAPI BaseRasterHandle GetOpacityTexture ( )

Returns the opacity texture.

Returns:
the opacity texture.
GraphicsDriverAPI void ClearOpacityTexture ( )

Clear the opacity texture.