mudbox::VertexDataProvider Class Reference

#include <renderer.h>

Inheritance diagram for mudbox::VertexDataProvider:

Inheritance graph
[legend]
List of all members.

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.).


Public Member Functions

virtual const mudbox::ClassDesc RuntimeClass (void) const
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 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.

Static Public Member Functions

const mudbox::ClassDesc StaticClass (void)
mudbox::Node CreateInstances (unsigned int iCount=1)

Member Function Documentation

virtual const mudbox::ClassDesc* mudbox::VertexDataProvider::RuntimeClass void   )  const [inline, virtual]
 

Reimplemented from mudbox::TreeNode.

00112 :
const mudbox::ClassDesc* mudbox::VertexDataProvider::StaticClass void   )  [static]
 

Reimplemented from mudbox::TreeNode.

mudbox::Node* mudbox::VertexDataProvider::CreateInstances unsigned int  iCount = 1  )  [static]
 

Reimplemented from mudbox::TreeNode.

virtual int mudbox::VertexDataProvider::ComponentCount void   )  const [virtual]
 

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

virtual ComponentDescription mudbox::VertexDataProvider::Component int  iIndex  )  const [virtual]
 

Returns the description of a given component.

Parameters:
iIndex  [in] Index of the component.
virtual const void* mudbox::VertexDataProvider::VertexData unsigned int  iVertexIndex,
int  iComponentIndex
const [virtual]
 

Returns the data for a given vertex and component.

Parameters:
iVertexIndex  [in] Index of the vertex.
iComponentIndex  [in] Index of the component.
virtual QVector<DirtyVertex>& mudbox::VertexDataProvider::DirtyVertexList void   )  [virtual]
 

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.

mudbox::VertexDataProvider mudbox::VertexDataProvider mudbox::VertexDataProvider mudbox::VertexDataProvider mudbox::VertexDataProvider mudbox::VertexDataProvider mudbox::VertexDataProvider mudbox::VertexDataProvider mudbox::VertexDataProvider mudbox::VertexDataProvider
mudbox::VertexDataProvider mudbox::VertexDataProvider mudbox::VertexDataProvider mudbox::VertexDataProvider mudbox::VertexDataProvider mudbox::VertexDataProvider mudbox::VertexDataProvider mudbox::VertexDataProvider mudbox::VertexDataProvider mudbox::VertexDataProvider