AMD Tootle (Triangle Order Optimization Tool) is a 3D triangle mesh optimization library that improves on existing mesh preprocessing techniques. By using AMD Tootle, developers can optimize their models for pixel overdraw as well as vertex cache performance. This can provide significant performance improvements in pixel limited situations, with no penalty in vertex-limited scenarios, and no runtime cost.
The Direct3D optimizers are currently not supported.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | TOOTLE_3D_API_ERROR
Enumeration for Tootle return codes. |
| public static final int | TOOTLE_CCW
Enumeration for face winding order. |
| public static final int | TOOTLE_CW
Enumeration for face winding order. |
| public static final float | TOOTLE_DEFAULT_ALPHA
The parameter for |
| public static final int | TOOTLE_DEFAULT_VCACHE_SIZE
The default vertex cache size. |
| public static final int | TOOTLE_INTERNAL_ERROR
Enumeration for Tootle return codes. |
| public static final int | TOOTLE_INVALID_ARGS
Enumeration for Tootle return codes. |
| public static final int | TOOTLE_MAX_FACES
The maximum allowed number of faces in the mesh. |
| public static final int | TOOTLE_MAX_VERTICES
The maximum allowed number of vertices in the mesh. |
| public static final int | TOOTLE_NOT_INITIALIZED
Enumeration for Tootle return codes. |
| public static final int | TOOTLE_OK
Enumeration for Tootle return codes. |
| public static final int | TOOTLE_OUT_OF_MEMORY
Enumeration for Tootle return codes. |
| public static final int | TOOTLE_OVERDRAW_AUTO
Enumeration for the algorithm for overdraw optimization. |
| public static final int | TOOTLE_OVERDRAW_DIRECT3D
Enumeration for the algorithm for overdraw optimization. |
| public static final int | TOOTLE_OVERDRAW_FAST
Enumeration for the algorithm for overdraw optimization. |
| public static final int | TOOTLE_OVERDRAW_RAYTRACE
Enumeration for the algorithm for overdraw optimization. |
| public static final int | TOOTLE_VCACHE_AUTO
Enumeration for the algorithm for vertex optimization. |
| public static final int | TOOTLE_VCACHE_DIRECT3D
Enumeration for the algorithm for vertex optimization. |
| public static final int | TOOTLE_VCACHE_LSTRIPS
Enumeration for the algorithm for vertex optimization. |
| public static final int | TOOTLE_VCACHE_TIPSY
Enumeration for the algorithm for vertex optimization. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| public static native int | nTootleClusterMesh(long pVB, long pnIB, int
number of vertices. This must be non-zero and less than nVertices, int MAX_VERTICES.number of faces. This must be non-zero and less than nFaces, int nVBStride, int nTargetClusters, long pnClusteredIBOut, long pnFaceClustersOut, long pnFaceRemapOut)MAX_FACES.Unsafe version of: | ||||||||
| public static native int | nTootleFastOptimize(long pVB, long pnIB, int
the number of vertices in the vertex buffer nVertices, int the number of faces in the index buffer nFaces, int nVBStride, int nCacheSize, int eFrontWinding, long pnIBOut, long pnNumClustersOut, float fAlpha)Unsafe version of: | ||||||||
| public static native int | nTootleFastOptimizeVCacheAndClusterMesh(long pnIB, int
the number of faces in the index buffer nFaces, int nVertices, int nCacheSize, long pnIBOut, long pnClustersOut, long pnNumClustersOut, float fAlpha)Unsafe version of: | ||||||||
| public static native int | nTootleMeasureCacheEfficiency(long pnIB, int
the number of faces in the index buffer. This must be non-zero and less than nFaces, int nCacheSize, long pfEfficiencyOut)MAX_FACES.Unsafe version of: | ||||||||
| public static native int | nTootleMeasureOverdraw(long pVB, long pnIB, int
the number of vertices. This must be non-zero and less than nVertices, int MAX_VERTICES.the number of indices. This must be non-zero and less than nFaces, int nVBStride, long pfViewpoint, int MAX_FACES.the number of viewpoints in the viewpoint array nViewpoints, int eFrontWinding, long pfAvgODOut, long pfMaxODOut, int eOverdrawOptimizer)Unsafe version of: | ||||||||
| public static native int | nTootleOptimize(long pVB, long pnIB, int
number of vertices. This must be non-zero and less than nVertices, int MAX_VERTICES.number of faces. This must be non-zero and less than nFaces, int nVBStride, int nCacheSize, long pViewpoints, int MAX_FACES.the number of viewpoints in the viewpoint array nViewpoints, int eFrontWinding, long pnIBOut, long pnNumClustersOut, int eVCacheOptimizer, int eOverdrawOptimizer)Unsafe version of: | ||||||||
| public static native int | nTootleOptimizeOverdraw(long pVB, long pnIB, int
the number of vertices in the mesh. This must be non-zero and less than nVertices, int MAX_VERTICES.the number of faces in the mesh. This must be non-zero and less than nFaces, int nVBStride, long pfViewpoint, int MAX_FACES.the number of viewpoints in the viewpoint array nViewpoints, int eFrontWinding, long pnFaceClusters, long pnIBOut, long pnClusterRemapOut, int eOverdrawOptimizer)Unsafe version of: | ||||||||
| public static native int | nTootleOptimizeVCache(long pnIB, int
the number of faces in the index buffer. This must be non-zero and less than nFaces, int nVertices, int nCacheSize, long pnIBOut, long pnFaceRemapOut, int eVCacheOptimizer)MAX_FACES.Unsafe version of: | ||||||||
| public static native int | nTootleOptimizeVertexMemory(long pVB, long pnIB, int
the number of vertices in the mesh. This must be non-zero and less than nVertices, int MAX_VERTICES.the number of faces in the mesh. This must be non-zero and less than nFaces, int nVBStride, long pVBOut, long pnIBOut, long pnVertexRemapOut)MAX_FACES.Unsafe version of: | ||||||||
| public static native int | nTootleVCacheClusters(long pnIB, int
the number of faces in the index buffer. This must be non-zero and less than nFaces, int nVertices, int nCacheSize, long pnFaceClusters, long pnIBOut, long pnFaceRemapOut, int eVCacheOptimizer)MAX_FACES.Unsafe version of: | ||||||||
| public static native void | |||||||||
| public static int | TootleClusterMesh(ByteBuffer
a pointer to the vertex buffer. The pointer pVB, IntBuffer pVB must point to the vertex position. The vertex position must be a 3-component floating point
value (X,Y,Z).an index buffer. Must be a triangle list. pnIB, int the distance between successive vertices in the vertex buffer, in bytes. This must be at least nVBStride, int 3*sizeof(float).a target number of clusters. The clustering algorithm will create at least this many clusters, but not more than nTargetClusters, IntBuffer nFaces. This value is only
a hint. More clusters may be created if Tootle considers it necessary. (for example, if there are numerous connected components in the mesh).
Passing 0 for this value causes Tootle to use an automatic method to determine when to stop creating clusters. an array that will receive a copy of the index buffer, sorted by cluster ID. May not be pnClusteredIBOut, IntBuffer NULL. May equal pnIB.an array of pnFaceClustersOut, IntBuffer nFaces+1 unsigned ints, that will be filled with the cluster ID that was assigned to each face in the output index buffer. The
last element of the array contains the number of cluster. This is of a full format type. May not be NULL.an array that will receive a face re-mapping. May be pnFaceRemapOut)NULL. If not NULL, must be an array of size nFaces. The i'th element of the
output array contains the position of input face i in the new face ordering.This function partitions a mesh into a set of connected, roughly planar clusters. | ||||||||
| public static int | TootleClusterMesh(FloatBuffer
a pointer to the vertex buffer. The pointer pVB, IntBuffer pVB must point to the vertex position. The vertex position must be a 3-component floating point
value (X,Y,Z).an index buffer. Must be a triangle list. pnIB, int the distance between successive vertices in the vertex buffer, in bytes. This must be at least nVBStride, int 3*sizeof(float).a target number of clusters. The clustering algorithm will create at least this many clusters, but not more than nTargetClusters, IntBuffer nFaces. This value is only
a hint. More clusters may be created if Tootle considers it necessary. (for example, if there are numerous connected components in the mesh).
Passing 0 for this value causes Tootle to use an automatic method to determine when to stop creating clusters. an array that will receive a copy of the index buffer, sorted by cluster ID. May not be pnClusteredIBOut, IntBuffer NULL. May equal pnIB.an array of pnFaceClustersOut, IntBuffer nFaces+1 unsigned ints, that will be filled with the cluster ID that was assigned to each face in the output index buffer. The
last element of the array contains the number of cluster. This is of a full format type. May not be NULL.an array that will receive a face re-mapping. May be pnFaceRemapOut)NULL. If not NULL, must be an array of size nFaces. The i'th element of the
output array contains the position of input face i in the new face ordering.This function partitions a mesh into a set of connected, roughly planar clusters. | ||||||||
| public static int | TootleFastOptimize(ByteBuffer
a pointer to the vertex buffer. The pointer pVB, IntBuffer pVB must point to the vertex position. The vertex position must be a 3-component floating point
value (X,Y,Z).the input index buffer: 3 pnIB, int unsigned int per trianglethe distance between successive vertices in the vertex buffer, in bytes. This must be at least nVBStride, int 3*sizeof(float).hardware cache size (12 to 24 are good options) nCacheSize, int eFrontWinding, IntBuffer the updated index buffer (the output). May not be pnIBOut, IntBuffer NULL. May equal pnIB.the number of output clusters. May be pnNumClustersOut, float NULL if not requested.a linear parameter to compute lambda term from the algorithm. Pass fAlpha)DEFAULT_ALPHA as a default.This is a utility function that performs the entire optimization using the new algorithm from SIGGRAPH 2007. | ||||||||
| public static int | TootleFastOptimize(FloatBuffer
a pointer to the vertex buffer. The pointer pVB, IntBuffer pVB must point to the vertex position. The vertex position must be a 3-component floating point
value (X,Y,Z).the input index buffer: 3 pnIB, int unsigned int per trianglethe distance between successive vertices in the vertex buffer, in bytes. This must be at least nVBStride, int 3*sizeof(float).hardware cache size (12 to 24 are good options) nCacheSize, int eFrontWinding, IntBuffer the updated index buffer (the output). May not be pnIBOut, IntBuffer NULL. May equal pnIB.the number of output clusters. May be pnNumClustersOut, float NULL if not requested.a linear parameter to compute lambda term from the algorithm. Pass fAlpha)DEFAULT_ALPHA as a default.This is a utility function that performs the entire optimization using the new algorithm from SIGGRAPH 2007. | ||||||||
| public static int | TootleFastOptimizeVCacheAndClusterMesh(IntBuffer
the input index buffer: 3 pnIB, int unsigned int per triangle.the number of vertices in the vertex buffer nVertices, int hardware cache size (12 to 24 are good options) nCacheSize, IntBuffer the updated index buffer (the output). May not be pnIBOut, IntBuffer NULL. May equal pnIB.the output clusters which is an array of pnClustersOut, IntBuffer nFaces+1 unsigned ints. It is of a compact format type. Entry i and i+1
mark all face ids in [i, i+1) to be in cluster i. The last element of the array contains the number of clusters. May not be NULL.
This has to be pre-allocated of size nFaces+1.the total number of clusters in pnNumClustersOut, float pnClustersOuta linear parameter to compute lambda term from the algorithm. Pass fAlpha)DEFAULT_ALPHA as a default.This function performs vertex cache optimization and clustering the mesh based on the algorithm from SIGGRAPH 2007. | ||||||||
| public static native int | |||||||||
| public static int | TootleMeasureCacheEfficiency(IntBuffer
the index buffer whose efficiency should be measured. Must be a triangle list. pnIB, int the number of vertices that will fit in cache. If the application doesn't know or care, it should use nCacheSize, FloatBuffer DEFAULT_VCACHE_SIZE.a pointer to receive the vertex cache efficiency. This is defined as the number of cache misses per triangle. pfEfficiencyOut)A utility function to simulate vertex processing and measures the cache efficiency of an index buffer. | ||||||||
| public static int | TootleMeasureOverdraw(ByteBuffer
a pointer to the vertex buffer. The pointer pVB, IntBuffer pVB must point to the vertex position. The vertex position must be a 3-component floating point
value (X,Y,Z).the index buffer. Must be a triangle list. pnIB, int the distance between successive vertices in the vertex buffer, in bytes. This must be at least nVBStride, FloatBuffer 3*sizeof(float).an array of viewpoints to use to measure overdraw. Each viewpoint must be a point on or in the unit sphere. When measuring overdraw, the mesh will
be scaled and translated so that it lies inside the unit sphere. The mesh will be rendered with orthographic projections, with the camera centered
at the given point looking at the origin. If this argument is pfViewpoint, int NULL, a default viewpoint set will be used.the winding order of front-faces in the model eFrontWinding, FloatBuffer a pointer to a variable to receive the average overdraw per pixel. May be pfAvgODOut, FloatBuffer NULL.a pointer to a variable to receive the maximum overdraw per pixel. May be pfMaxODOut, int NULL.the algorithm selection for optimizing overdraw. One of: eOverdrawOptimizer)
A utility function to measure the amount of overdraw that occurs over a set of views. | ||||||||
| public static int | TootleMeasureOverdraw(FloatBuffer
a pointer to the vertex buffer. The pointer pVB, IntBuffer pVB must point to the vertex position. The vertex position must be a 3-component floating point
value (X,Y,Z).the index buffer. Must be a triangle list. pnIB, int the distance between successive vertices in the vertex buffer, in bytes. This must be at least nVBStride, FloatBuffer 3*sizeof(float).an array of viewpoints to use to measure overdraw. Each viewpoint must be a point on or in the unit sphere. When measuring overdraw, the mesh will
be scaled and translated so that it lies inside the unit sphere. The mesh will be rendered with orthographic projections, with the camera centered
at the given point looking at the origin. If this argument is pfViewpoint, int NULL, a default viewpoint set will be used.the winding order of front-faces in the model eFrontWinding, FloatBuffer a pointer to a variable to receive the average overdraw per pixel. May be pfAvgODOut, FloatBuffer NULL.a pointer to a variable to receive the maximum overdraw per pixel. May be pfMaxODOut, int NULL.the algorithm selection for optimizing overdraw. One of: eOverdrawOptimizer)
A utility function to measure the amount of overdraw that occurs over a set of views. | ||||||||
| public static int | TootleOptimize(ByteBuffer
a pointer to the vertex buffer. The pointer pVB, IntBuffer pVB must point to the vertex position. The vertex position must be a 3-component floating point
value (X,Y,Z).an index buffer. Must be a triangle list. pnIB, int the distance between successive vertices in the vertex buffer, in bytes. This must be at least nVBStride, int 3*sizeof(float).the number of vertices that will fit in cache. If the application does not know or care about the vertex cache size, then it should pass
nCacheSize, FloatBuffer DEFAULT_VCACHE_SIZE. This value must be non-zero.an array of viewpoints to use to measure overdraw. Each viewpoint must be a point on or in the unit sphere. When measuring overdraw, the mesh will
be scaled and translated so that it lies inside the unit sphere. The mesh will be rendered with orthographic projections, with the camera centered
at the given point looking at the origin. If this argument is pViewpoints, int eFrontWinding, IntBuffer NULL, a default viewpoint set will be used.a pointer that will be filled with an optimized index buffer. May not be pnIBOut, IntBuffer NULL. May equal pIB.the number of clusters generated by the algorithm. May be pnNumClustersOut, int NULL if the output is not requested.the selection for choosing the algorithm to optimize vertex cache. One of: eVCacheOptimizer, int
the algorithm selection for optimizing overdraw. One of: eOverdrawOptimizer)
This is a utility function that is provided for developers to perform the entire optimization for a mesh. | ||||||||
| public static int | TootleOptimize(FloatBuffer
a pointer to the vertex buffer. The pointer pVB, IntBuffer pVB must point to the vertex position. The vertex position must be a 3-component floating point
value (X,Y,Z).an index buffer. Must be a triangle list. pnIB, int the distance between successive vertices in the vertex buffer, in bytes. This must be at least nVBStride, int 3*sizeof(float).the number of vertices that will fit in cache. If the application does not know or care about the vertex cache size, then it should pass
nCacheSize, FloatBuffer DEFAULT_VCACHE_SIZE. This value must be non-zero.an array of viewpoints to use to measure overdraw. Each viewpoint must be a point on or in the unit sphere. When measuring overdraw, the mesh will
be scaled and translated so that it lies inside the unit sphere. The mesh will be rendered with orthographic projections, with the camera centered
at the given point looking at the origin. If this argument is pViewpoints, int eFrontWinding, IntBuffer NULL, a default viewpoint set will be used.a pointer that will be filled with an optimized index buffer. May not be pnIBOut, IntBuffer NULL. May equal pIB.the number of clusters generated by the algorithm. May be pnNumClustersOut, int NULL if the output is not requested.the selection for choosing the algorithm to optimize vertex cache. One of: eVCacheOptimizer, int
the algorithm selection for optimizing overdraw. One of: eOverdrawOptimizer)
This is a utility function that is provided for developers to perform the entire optimization for a mesh. | ||||||||
| public static int | TootleOptimizeOverdraw(ByteBuffer
a pointer to the vertex buffer. The pointer pVB, IntBuffer pVB must point to the vertex position. The vertex position must be a 3-component floating point
value (X,Y,Z).the mesh index buffer. This must be a triangle list. The faces must be clustered. pnIB, int the distance between successive vertices in the vertex buffer, in bytes. This must be at least nVBStride, FloatBuffer 3*sizeof(float).an array of viewpoints to use to measure overdraw. Each viewpoint must be a point on or in the unit sphere. When measuring overdraw, the mesh will
be scaled and translated so that it lies inside the unit sphere. The mesh will be rendered with orthographic projections, with the camera centered
at the given point looking at the origin. If this argument is pfViewpoint, int eFrontWinding, IntBuffer NULL, a default viewpoint set will be used.this array of pnFaceClusters, IntBuffer nFaces+1 size can be either of two types: a full format (the output of ClusterMesh) or a compact format (the output of
FastOptimizeVCacheAndClusterMesh).
The full format is an array of mapping for each face to the cluster ID. The entry The compact format is an array that maps every face ID between entry For both formats, the last entry of the array ( an array that will receive the re-ordered index buffer. May be pnIBOut, IntBuffer NULL. May equal pnIB.an array that will receive the cluster ordering. May be pnClusterRemapOut, int NULL. If non-null, the size of the array must be equal to the number of clusters in the
mesh. pClusterRemapOut[i] will be set to the ID of the cluster that should come i'th in the draw order.the algorithm selection for optimizing overdraw. One of: eOverdrawOptimizer)
Given a clustered mesh, this function computes a cluster ordering that minimizes expected overdraw, and sorts the clusters according to this ordering. | ||||||||
| public static int | TootleOptimizeOverdraw(FloatBuffer
a pointer to the vertex buffer. The pointer pVB, IntBuffer pVB must point to the vertex position. The vertex position must be a 3-component floating point
value (X,Y,Z).the mesh index buffer. This must be a triangle list. The faces must be clustered. pnIB, int the distance between successive vertices in the vertex buffer, in bytes. This must be at least nVBStride, FloatBuffer 3*sizeof(float).an array of viewpoints to use to measure overdraw. Each viewpoint must be a point on or in the unit sphere. When measuring overdraw, the mesh will
be scaled and translated so that it lies inside the unit sphere. The mesh will be rendered with orthographic projections, with the camera centered
at the given point looking at the origin. If this argument is pfViewpoint, int eFrontWinding, IntBuffer NULL, a default viewpoint set will be used.this array of pnFaceClusters, IntBuffer nFaces+1 size can be either of two types: a full format (the output of ClusterMesh) or a compact format (the output of
FastOptimizeVCacheAndClusterMesh).
The full format is an array of mapping for each face to the cluster ID. The entry The compact format is an array that maps every face ID between entry For both formats, the last entry of the array ( an array that will receive the re-ordered index buffer. May be pnIBOut, IntBuffer NULL. May equal pnIB.an array that will receive the cluster ordering. May be pnClusterRemapOut, int NULL. If non-null, the size of the array must be equal to the number of clusters in the
mesh. pClusterRemapOut[i] will be set to the ID of the cluster that should come i'th in the draw order.the algorithm selection for optimizing overdraw. One of: eOverdrawOptimizer)
Given a clustered mesh, this function computes a cluster ordering that minimizes expected overdraw, and sorts the clusters according to this ordering. | ||||||||
| public static int | TootleOptimizeVCache(IntBuffer
the index buffer to optimize. Must be a triangle list. pnIB, int the number of vertices in the model. This must non-zero and less than nVertices, int MAX_VERTICES.the number of vertices that will fit in cache. If the application does not know or care about the vertex cache size, then it should pass
nCacheSize, IntBuffer DEFAULT_VCACHE_SIZE. This value must be non-zero.a pointer that will be filled with an optimized index buffer. May be pnIBOut, IntBuffer NULL. May equal pnIB.a pointer to an array that will be filled with a face re-mapping. May be pnFaceRemapOut, int NULL. This is an array of nFaces elements.
Element the selection for choosing the algorithm to optimize vertex cache. One of: eVCacheOptimizer)
This function performs vertex cache optimization on an index buffer. | ||||||||
| public static int | TootleOptimizeVertexMemory(ByteBuffer
a pointer to the vertex buffer. The pointer pVB, IntBuffer pVB must point to the vertex position. The vertex position must be a 3-component floating point
value (X,Y,Z).the mesh index buffer. This must be a triangle list. pnIB, int the distance between successive vertices in the vertex buffer, in bytes. This must be at least nVBStride, ByteBuffer 3*sizeof(float).the output vertex buffer. May be pVBOut, IntBuffer NULL. May equal pVB.the output index buffer. May not be pnIBOut, IntBuffer NULL. May equal pnIB.an array that will receive a vertex re-mapping. May be pnVertexRemapOut)NULL if the output is not requested. If not NULL, must be an array of size
nVertices. The i'th element of the output array contains the position of the input vertex i in the new vertex re-ordering.This function rearranges the vertex buffer's memory location based on the index buffer. | ||||||||
| public static int | TootleOptimizeVertexMemory(FloatBuffer
a pointer to the vertex buffer. The pointer pVB, IntBuffer pVB must point to the vertex position. The vertex position must be a 3-component floating point
value (X,Y,Z).the mesh index buffer. This must be a triangle list. pnIB, int the distance between successive vertices in the vertex buffer, in bytes. This must be at least nVBStride, FloatBuffer 3*sizeof(float).the output vertex buffer. May be pVBOut, IntBuffer NULL. May equal pVB.the output index buffer. May not be pnIBOut, IntBuffer NULL. May equal pnIB.an array that will receive a vertex re-mapping. May be pnVertexRemapOut)NULL if the output is not requested. If not NULL, must be an array of size
nVertices. The i'th element of the output array contains the position of the input vertex i in the new vertex re-ordering.This function rearranges the vertex buffer's memory location based on the index buffer. | ||||||||
| public static int | TootleVCacheClusters(IntBuffer
the index buffer to optimize. Must be a triangle list. pnIB, int the number of vertices in the model. This must be non-zero and less than nVertices, int MAX_VERTICES.the number of vertices that will fit in cache. If the application does not know or care about the vertex cache size, then it should pass
nCacheSize, IntBuffer DEFAULT_VCACHE_SIZE. This value must be non-zero.an array giving the cluster ID for each face. All faces in a particular cluster should appear consecutively in the index buffer, as well as in this
array. It should be of size pnFaceClusters, IntBuffer nFaces+1.a pointer that will be filled with an optimized index buffer. May be pnIBOut, IntBuffer NULL. May equal pnIB.a pointer to an array that will be filled with a face re-mapping. May be pnFaceRemapOut, int NULL. This is an array of nFaces elements.
Element the selection for choosing the algorithm to optimize vertex cache. One of: eVCacheOptimizer)
This is a utility function to optimize vertex cache on a clustered index buffer. |