This reference page is linked to from the following overview topics: Low-level Device API.
#include <StandardMaterialHandle.h>
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. |
|
| GraphicsDriverAPI StandardMaterialHandle | ( | ) |
| GraphicsDriverAPI StandardMaterialHandle | ( | const StandardMaterialHandle & | from | ) |
| virtual GraphicsDriverAPI ~StandardMaterialHandle | ( | ) | [virtual] |
| GraphicsDriverAPI StandardMaterialHandle& operator= | ( | const StandardMaterialHandle & | from | ) |
| GraphicsDriverAPI bool Initialize | ( | ) |
Initialize the standard material instance.
A StandardMaterialHandle must be initialized before it's used.
| 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.
Reimplemented from BaseMaterialHandle.
| GraphicsDriverAPI void SetAmbient | ( | const AColor & | color | ) |
| GraphicsDriverAPI const AColor& GetAmbient | ( | ) | const |
| GraphicsDriverAPI void SetDiffuse | ( | const AColor & | color | ) |
Sets diffuse color.
If diffuse texture exists, this value will be ignored.
| [in] | color | The diffuse color. |
| GraphicsDriverAPI const AColor& GetDiffuse | ( | ) | const |
| GraphicsDriverAPI void SetSpecular | ( | const AColor & | color | ) |
| GraphicsDriverAPI const AColor& GetSpecular | ( | ) | const |
| GraphicsDriverAPI void SetSpecularLevel | ( | float | level | ) |
| GraphicsDriverAPI float GetSpecularLevel | ( | ) | const |
| GraphicsDriverAPI void SetSpecularPower | ( | float | power | ) |
| GraphicsDriverAPI float GetSpecularPower | ( | ) | const |
| GraphicsDriverAPI void SetEmission | ( | const AColor & | color | ) |
| GraphicsDriverAPI const AColor& GetEmission | ( | ) | const |
| GraphicsDriverAPI void SetOpacity | ( | float | opacity | ) |
Sets opacity value.
If opacity texture exists, this value will be ignored.
| [in] | opacity | The opacity value. |
| GraphicsDriverAPI float GetOpacity | ( | ) | const |
| GraphicsDriverAPI void SetTwoSided | ( | bool | twoSided | ) |
| GraphicsDriverAPI bool GetTwoSided | ( | ) | const |
| GraphicsDriverAPI void SetDiffuseTexture | ( | const BaseRasterHandle & | hTexture | ) |
Sets diffuse texture.
| [in] | hTexture | The diffuse texture handle. |
| GraphicsDriverAPI BaseRasterHandle GetDiffuseTexture | ( | ) |
| GraphicsDriverAPI void ClearDiffuseTexture | ( | ) |
Clear the diffuse texture.
| GraphicsDriverAPI void SetOpacityTexture | ( | const BaseRasterHandle & | hTexture | ) |
| GraphicsDriverAPI BaseRasterHandle GetOpacityTexture | ( | ) |
| GraphicsDriverAPI void ClearOpacityTexture | ( | ) |
Clear the opacity texture.