| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/vertexcacheoptimizer.h>
Static Public Member Functions | |
| static SO< Iterator< SO < PolygonSet > > > | createOptimizedClusters (SO< PolygonSet > source) |
| This methods builds upon all other methods below. | |
| static SO< PolygonSet > | optimize (SO< PolygonSet > poly) |
| Returns an optimized copy. | |
| static SO< TriangleSet > | optimize (SO< TriangleSet > triangleSet) |
| static SO< Iterator< unsigned int > > | optimize (SO< Iterator< unsigned int > > indices, int numVertices) |
| Actually, the vertex-cache optimization concerns the index array only. | |
| static SO< Iterator< SO < PolygonSet > > > | splitMesh (SO< PolygonSet > source) |
| Splits an indexed triangle mesh into one or more connected components, i.e., sub meshes, for which each two vertex a and b are connected via a path of triangle edges. | |
| static SO< Iterator< SO < PolygonSet > > > | clusterMeshes (SO< Iterator< SO< PolygonSet > > > meshes, int maxVertices=0xFFFF) |
| Clusters the meshes in the input iterator in a way that the number of vertices in the resulting meshes is as close to the given target vertex number as possible. | |
| static SO< Iterator< SO < PolygonSet > > > | splitLargeMeshes (SO< Iterator< SO< PolygonSet > > > meshes, int maxVertices=0xFFFF) |
| Splits all meshes with more than 'maxVertices' vertices up into smaller ones. | |
| static SO< PolygonSet > | extractSubMesh (SO< PolygonSet > mesh, SO< Iterator< unsigned int > > indexSubIterator) |
| Given an indexed triangle mesh and a subset of its index iterator, this method creates a submesh containing the triangles within this iterator. | |
In addition, it provides methods to subdivide a given mesh into connected components, which are clustered into batches of desired vertex size.
| static SO<Iterator<SO<PolygonSet> > > VRS::VertexCacheOptimizer::createOptimizedClusters | ( | SO< PolygonSet > | source | ) | [static] |
This methods builds upon all other methods below.
The result is a set of sub meshes that are optimized for rendering. It performs the following steps:
| static SO<PolygonSet> VRS::VertexCacheOptimizer::optimize | ( | SO< PolygonSet > | poly | ) | [static] |
Returns an optimized copy.
If necessary, 'poly' is first converted into an indexed triangle mesh. Lines and points are not supported and will be lost. If 'poly' is already an indexed triangle mesh, the result differs only be the triangle order.
| static SO<TriangleSet> VRS::VertexCacheOptimizer::optimize | ( | SO< TriangleSet > | triangleSet | ) | [static] |
| static SO<Iterator<unsigned int> > VRS::VertexCacheOptimizer::optimize | ( | SO< Iterator< unsigned int > > | indices, | |
| int | numVertices | |||
| ) | [static] |
Actually, the vertex-cache optimization concerns the index array only.
The upper method is only provided for convenience.
| static SO<Iterator<SO<PolygonSet> > > VRS::VertexCacheOptimizer::splitMesh | ( | SO< PolygonSet > | source | ) | [static] |
Splits an indexed triangle mesh into one or more connected components, i.e., sub meshes, for which each two vertex a and b are connected via a path of triangle edges.
| static SO<Iterator<SO<PolygonSet> > > VRS::VertexCacheOptimizer::clusterMeshes | ( | SO< Iterator< SO< PolygonSet > > > | meshes, | |
| int | maxVertices = 0xFFFF | |||
| ) | [static] |
Clusters the meshes in the input iterator in a way that the number of vertices in the resulting meshes is as close to the given target vertex number as possible.
Meshes can only exceed the vertex number limit if a single input mesh already did.
| static SO<Iterator<SO<PolygonSet> > > VRS::VertexCacheOptimizer::splitLargeMeshes | ( | SO< Iterator< SO< PolygonSet > > > | meshes, | |
| int | maxVertices = 0xFFFF | |||
| ) | [static] |
Splits all meshes with more than 'maxVertices' vertices up into smaller ones.
All meshes below the vertex number limit are left as they are. Note: The current implementation just splits meshes into index-array ranges. A more sophisticated implementation could try to minimize the number of replicated vertices.
| static SO<PolygonSet> VRS::VertexCacheOptimizer::extractSubMesh | ( | SO< PolygonSet > | mesh, | |
| SO< Iterator< unsigned int > > | indexSubIterator | |||
| ) | [static] |
Given an indexed triangle mesh and a subset of its index iterator, this method creates a submesh containing the triangles within this iterator.
'mesh' must be indexed and 'indexSubIterator' must be a subset (not necessarily a sub range) of its index iterator.