# IRdLWMaterial Interface Reference

Inherits IRsDataObject.

List of all members.

## Public Member Functions
HRESULT | Clear ()
HRESULT | PutShader ([in] BSTR dwShaderType,[out, retval] void *pShaderData)
HRESULT | GetShader ([in] BSTR dwShaderType,[out, retval] void *ppShaderData)
HRESULT | GetShaderCount ([in] BSTR bShaderType,[out] RtDWORD *pdwAttributeCount)
HRESULT | LockObject ()
| Lock the object:.
HRESULT | UnlockObject ()
| Unlock the object:.
HRESULT | GetGenericDesc (IRdMaterialGeneric **ppMaterialGen)

## Detailed Description

This dataobject represents material interface.

## Member Function Documentation

HRESULT IRdLWMaterial::Clear | ( |  | ) |

Clear the dataobject.

HRESULT IRdLWMaterial::PutShader | ( | [in] BSTR | dwShaderType,
|  | [out, retval] void * | pShaderData |
| ) |  |  |

This method is used to add source code of specific shader into the material.

Parameters:

  | dwAttributeID | specifies the material attribute ID (material channel). 0xFFFFFFFF should be specified in case of default shader.
  | bstrShaderType | specifies the shader type (the same as shader function prefix. i.e. color for the Color shader).
  | bstrShaderName | specifies the shader name.
  | bstrShaderText | specifies the shader code. Note that it is converted to ANSI charset internally.

HRESULT IRdLWMaterial::GetShader | ( | [in] BSTR | dwShaderType,
|  | [out, retval] void * | ppShaderData |
| ) |  |  |

This method is used to get source code of specific shader from the material.

Parameters:

  | dwAttributeID | specifies the material attribute ID (material channel). 0xFFFFFFFF should be specified in case of default shader.
  | bstrShaderType | specifies the shader type (the same as shader function prefix. i.e. color for the Color shader).
  | pbstrShaderName | is filled with shader name.
  | pbstrShaderText | is filled with the shader code. Note that it is converted to ANSI charset internally.

Return values:

  | S_FALSE | is returned if shader of specified type is not available for the attribute ID.

HRESULT IRdLWMaterial::GetShaderCount | ( | [in] BSTR | bShaderType,
|  | [out] RtDWORD * | pdwAttributeCount |
| ) |  |  |

This method is used to get the count of different attributes for given shader type.

Parameters:

  | bstrShaderType | specifies the shader type (the same as shader function prefix. i.e. color for the Color shader).
  | pdwAttributeCount | is filled with the attribute count.

HRESULT IRdLWMaterial::LockObject | ( |  | ) |

Lock the object:.

HRESULT IRdLWMaterial::UnlockObject | ( |  | ) |

Unlock the object:.

HRESULT IRdLWMaterial::GetGenericDesc | ( | IRdMaterialGeneric ** | ppMaterialGen | ) |

Return generic material description of the LW material.

Parameters:

  | ppMaterialGen | is filled with the generic material description.