- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Classes | Public Member Functions

# VertexDataProvider Class Reference

This reference page is linked to from the following overview topics: Mudbox 2013.

Search for all occurrences

## Detailed Description

This interface can be used to provide additional vertex data for the rendering.

When an object with this type is added as a child to a Mesh object in the scene graph, the renderer uses that object to obtain additional vertex data for the rendering (like vertex color, bone indices and weights). This interface is important when you want to use your own custom shader for rendering, which needs more data than the usual vertex data (position, normal, etc.).

Definition at line 105 of file renderer.h.

`#include <renderer.h>`

Inheritance diagram for VertexDataProvider:
[legend]

List of all members.

## Classes
struct | ComponentDescription
| This structure carries information about a component. More...
struct | DirtyVertex
| This structure describes a dirty vertex. More...
## Public Member Functions
virtual int | ComponentCount (void) const
| Returns the number of different vertex components this object has data for.
virtual ComponentDescription | Component (int iIndex) const
| Returns the description of a given component.
virtual const void * | VertexData (unsigned int iVertexIndex, int iComponentIndex) const
| Returns the data for a given vertex and component.
virtual void | SetVertexData (unsigned int iVertexIndex, int iComponentIndex, unsigned int iDimensionIndex, const void *pValue)
| Sets the data for a given vertex, component, and dimension For example, to set the 2nd element of the 1st component, for the 0th vertex: VertexDataProvider::ComponentDescription d = Component(1); if( d.m_eType == eFloat && d.m_iDimension >= 3 ) { float fNewValue = 1.0f; SetVertexData( 0, 1, 2, (const void*)&fNewValue); }.
virtual QVector< DirtyVertex > & | DirtyVertexList (void)
| This function must return an array of vertex indices whose data has been changed since the last call to this function.

## Member Function Documentation

virtual int ComponentCount | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the number of different vertex components this object has data for.

virtual ComponentDescription Component | ( | int | iIndex | ) | const `[virtual]`

Search for all occurrences

Returns the description of a given component.

Parameters:

  [in] | iIndex | Index of the component.

virtual const void* VertexData | ( | unsigned int | iVertexIndex,
|  | int | iComponentIndex
| ) |  | const `[virtual]`

Search for all occurrences

Returns the data for a given vertex and component.

Parameters:

  [in] | iVertexIndex | Index of the vertex.
  [in] | iComponentIndex | Index of the component.

virtual void SetVertexData | ( | unsigned int | iVertexIndex,
|  | int | iComponentIndex,
|  | unsigned int | iDimensionIndex,
|  | const void * | pValue
| ) |  | `[virtual]`

Search for all occurrences

Sets the data for a given vertex, component, and dimension For example, to set the 2nd element of the 1st component, for the 0th vertex: VertexDataProvider::ComponentDescription d = Component(1); if( d.m_eType == eFloat && d.m_iDimension >= 3 ) { float fNewValue = 1.0f; SetVertexData( 0, 1, 2, (const void*)&fNewValue); }.

Parameters:

  [in] | iVertexIndex | Index of the vertex.
  [in] | iComponentIndex | Index of the component.
  [in] | iDimensionIndex | Index of the dimension.
  [in] | pValue | an element of type m_eType.

virtual QVector<DirtyVertex>& DirtyVertexList | ( | void |  | ) | `[virtual]`

Search for all occurrences

This function must return an array of vertex indices whose data has been changed since the last call to this function.

There are two ways to update the buffers in the renderer object:

- When most or all of the vertices need to update, the VertexDataProvider object can instruct the renderer to do a global update on all the vertices by calling ContentChanged() on itself. This way the renderer will know about the change, and refresh every vertex buffer which contains data from this object.

- If only subset of the vertices are changed, the VertexDataProvider can collect the indices of the changed vertices to an array, and pass that array to the renderer when this function is called. The renderer will update the specified vertices, and clear the array. The VertexDataProvider can continue storing dirty vertex indices into the array after the call.

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

- Mudbox/renderer.h

VertexDataProvider VertexDataProvider VertexDataProvider VertexDataProvider VertexDataProvider VertexDataProvider VertexDataProvider VertexDataProvider VertexDataProvider VertexDataProvider
VertexDataProvider VertexDataProvider VertexDataProvider VertexDataProvider VertexDataProvider VertexDataProvider VertexDataProvider VertexDataProvider VertexDataProvider VertexDataProvider