Top Description Fields Constructors Methods
org.lwjgl.util.tootle

public Class Tootle

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.system.*

Bindings to AMD Tootle.

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.

Features

The Direct3D optimizers are currently not supported.

Field Summary

Modifier and TypeField 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 FastOptimize to create more clusters (lower number generates more clusters).

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.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static native int
nTootleClusterMesh(long pVB, long pnIB, int
number of vertices. This must be non-zero and less than MAX_VERTICES.
nVertices
,
int
number of faces. This must be non-zero and less than MAX_FACES.
nFaces
,
int nVBStride, int nTargetClusters, long pnClusteredIBOut, long pnFaceClustersOut, long pnFaceRemapOut)

Unsafe version of: ClusterMesh

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: FastOptimize

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: FastOptimizeVCacheAndClusterMesh

public static native int
nTootleMeasureCacheEfficiency(long pnIB, int
the number of faces in the index buffer. This must be non-zero and less than MAX_FACES.
nFaces
,
int nCacheSize, long pfEfficiencyOut)

Unsafe version of: MeasureCacheEfficiency

public static native int
nTootleMeasureOverdraw(long pVB, long pnIB, int
the number of vertices. This must be non-zero and less than MAX_VERTICES.
nVertices
,
int
the number of indices. This must be non-zero and less than MAX_FACES.
nFaces
,
int nVBStride, long pfViewpoint, int
the number of viewpoints in the viewpoint array
nViewpoints
,
int eFrontWinding, long pfAvgODOut, long pfMaxODOut, int eOverdrawOptimizer)

Unsafe version of: MeasureOverdraw

public static native int
nTootleOptimize(long pVB, long pnIB, int
number of vertices. This must be non-zero and less than MAX_VERTICES.
nVertices
,
int
number of faces. This must be non-zero and less than MAX_FACES.
nFaces
,
int nVBStride, int nCacheSize, long pViewpoints, int
the number of viewpoints in the viewpoint array
nViewpoints
,
int eFrontWinding, long pnIBOut, long pnNumClustersOut, int eVCacheOptimizer, int eOverdrawOptimizer)

Unsafe version of: Optimize

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 MAX_VERTICES.
nVertices
,
int
the number of faces in the mesh. This must be non-zero and less than MAX_FACES.
nFaces
,
int nVBStride, long pfViewpoint, int
the number of viewpoints in the viewpoint array
nViewpoints
,
int eFrontWinding, long pnFaceClusters, long pnIBOut, long pnClusterRemapOut, int eOverdrawOptimizer)

Unsafe version of: OptimizeOverdraw

public static native int
nTootleOptimizeVCache(long pnIB, int
the number of faces in the index buffer. This must be non-zero and less than MAX_FACES.
nFaces
,
int nVertices, int nCacheSize, long pnIBOut, long pnFaceRemapOut, int eVCacheOptimizer)

Unsafe version of: OptimizeVCache

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 MAX_VERTICES.
nVertices
,
int
the number of faces in the mesh. This must be non-zero and less than MAX_FACES.
nFaces
,
int nVBStride, long pVBOut, long pnIBOut, long pnVertexRemapOut)

Unsafe version of: OptimizeVertexMemory

public static native int
nTootleVCacheClusters(long pnIB, int
the number of faces in the index buffer. This must be non-zero and less than MAX_FACES.
nFaces
,
int nVertices, int nCacheSize, long pnFaceClusters, long pnIBOut, long pnFaceRemapOut, int eVCacheOptimizer)

Unsafe version of: VCacheClusters

public static native void
TootleCleanup()

Frees all resources held by Tootle.

public static int

Returns:

one of: OK, OUT_OF_MEMORY, INVALID_ARGS
TootleClusterMesh
(ByteBuffer
a pointer to the vertex buffer. The pointer pVB must point to the vertex position. The vertex position must be a 3-component floating point value (X,Y,Z).
pVB
,
IntBuffer
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 3*sizeof(float).
nVBStride
,
int
a target number of clusters. The clustering algorithm will create at least this many clusters, but not more than 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.

nTargetClusters
,
IntBuffer
an array that will receive a copy of the index buffer, sorted by cluster ID. May not be NULL. May equal pnIB.
pnClusteredIBOut
,
IntBuffer
an array of 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.
pnFaceClustersOut
,
IntBuffer
an array that will receive a face re-mapping. May be 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.
pnFaceRemapOut
)

This function partitions a mesh into a set of connected, roughly planar clusters.

public static int

Returns:

one of: OK, OUT_OF_MEMORY, INVALID_ARGS
TootleClusterMesh
(FloatBuffer
a pointer to the vertex buffer. The pointer pVB must point to the vertex position. The vertex position must be a 3-component floating point value (X,Y,Z).
pVB
,
IntBuffer
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 3*sizeof(float).
nVBStride
,
int
a target number of clusters. The clustering algorithm will create at least this many clusters, but not more than 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.

nTargetClusters
,
IntBuffer
an array that will receive a copy of the index buffer, sorted by cluster ID. May not be NULL. May equal pnIB.
pnClusteredIBOut
,
IntBuffer
an array of 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.
pnFaceClustersOut
,
IntBuffer
an array that will receive a face re-mapping. May be 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.
pnFaceRemapOut
)

This function partitions a mesh into a set of connected, roughly planar clusters.

public static int

Returns:

one of: OK, OUT_OF_MEMORY, INVALID_ARGS
TootleFastOptimize
(ByteBuffer
a pointer to the vertex buffer. The pointer pVB must point to the vertex position. The vertex position must be a 3-component floating point value (X,Y,Z).
pVB
,
IntBuffer
the input index buffer: 3 unsigned int per triangle
pnIB
,
int
the distance between successive vertices in the vertex buffer, in bytes. This must be at least 3*sizeof(float).
nVBStride
,
int
hardware cache size (12 to 24 are good options)
nCacheSize
,
int
the winding order of front-faces in the model. One of:
CCWCW
eFrontWinding
,
IntBuffer
the updated index buffer (the output). May not be NULL. May equal pnIB.
pnIBOut
,
IntBuffer
the number of output clusters. May be NULL if not requested.
pnNumClustersOut
,
float
a linear parameter to compute lambda term from the algorithm. Pass DEFAULT_ALPHA as a default.
fAlpha
)

This is a utility function that performs the entire optimization using the new algorithm from SIGGRAPH 2007.

public static int

Returns:

one of: OK, OUT_OF_MEMORY, INVALID_ARGS
TootleFastOptimize
(FloatBuffer
a pointer to the vertex buffer. The pointer pVB must point to the vertex position. The vertex position must be a 3-component floating point value (X,Y,Z).
pVB
,
IntBuffer
the input index buffer: 3 unsigned int per triangle
pnIB
,
int
the distance between successive vertices in the vertex buffer, in bytes. This must be at least 3*sizeof(float).
nVBStride
,
int
hardware cache size (12 to 24 are good options)
nCacheSize
,
int
the winding order of front-faces in the model. One of:
CCWCW
eFrontWinding
,
IntBuffer
the updated index buffer (the output). May not be NULL. May equal pnIB.
pnIBOut
,
IntBuffer
the number of output clusters. May be NULL if not requested.
pnNumClustersOut
,
float
a linear parameter to compute lambda term from the algorithm. Pass DEFAULT_ALPHA as a default.
fAlpha
)

This is a utility function that performs the entire optimization using the new algorithm from SIGGRAPH 2007.

public static int

Returns:

one of: OK, OUT_OF_MEMORY, INVALID_ARGS
TootleFastOptimizeVCacheAndClusterMesh
(IntBuffer
the input index buffer: 3 unsigned int per triangle.
pnIB
,
int
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 NULL. May equal pnIB.
pnIBOut
,
IntBuffer
the output clusters which is an array of 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.
pnClustersOut
,
IntBuffer
the total number of clusters in pnClustersOut
pnNumClustersOut
,
float
a linear parameter to compute lambda term from the algorithm. Pass DEFAULT_ALPHA as a default.
fAlpha
)

This function performs vertex cache optimization and clustering the mesh based on the algorithm from SIGGRAPH 2007.

public static native int
TootleInit()

Performs one-time initialization required by Tootle.

public static int

Returns:

one of: OK, OUT_OF_MEMORY, INVALID_ARGS
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 DEFAULT_VCACHE_SIZE.
nCacheSize
,
FloatBuffer
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 must point to the vertex position. The vertex position must be a 3-component floating point value (X,Y,Z).
pVB
,
IntBuffer
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 3*sizeof(float).
nVBStride
,
FloatBuffer
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 NULL, a default viewpoint set will be used.
pfViewpoint
,
int
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 NULL.
pfAvgODOut
,
FloatBuffer
a pointer to a variable to receive the maximum overdraw per pixel. May be NULL.
pfMaxODOut
,
int
the algorithm selection for optimizing overdraw. One of:
OVERDRAW_AUTOOVERDRAW_DIRECT3DOVERDRAW_RAYTRACEOVERDRAW_FAST
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 must point to the vertex position. The vertex position must be a 3-component floating point value (X,Y,Z).
pVB
,
IntBuffer
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 3*sizeof(float).
nVBStride
,
FloatBuffer
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 NULL, a default viewpoint set will be used.
pfViewpoint
,
int
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 NULL.
pfAvgODOut
,
FloatBuffer
a pointer to a variable to receive the maximum overdraw per pixel. May be NULL.
pfMaxODOut
,
int
the algorithm selection for optimizing overdraw. One of:
OVERDRAW_AUTOOVERDRAW_DIRECT3DOVERDRAW_RAYTRACEOVERDRAW_FAST
eOverdrawOptimizer
)

A utility function to measure the amount of overdraw that occurs over a set of views.

public static int

Returns:

one of: OK, OUT_OF_MEMORY, INVALID_ARGS
TootleOptimize
(ByteBuffer
a pointer to the vertex buffer. The pointer pVB must point to the vertex position. The vertex position must be a 3-component floating point value (X,Y,Z).
pVB
,
IntBuffer
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 3*sizeof(float).
nVBStride
,
int
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 DEFAULT_VCACHE_SIZE. This value must be non-zero.
nCacheSize
,
FloatBuffer
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 NULL, a default viewpoint set will be used.
pViewpoints
,
int
the winding order of front-faces in the model. One of:
CCWCW
eFrontWinding
,
IntBuffer
a pointer that will be filled with an optimized index buffer. May not be NULL. May equal pIB.
pnIBOut
,
IntBuffer
the number of clusters generated by the algorithm. May be NULL if the output is not requested.
pnNumClustersOut
,
int
the selection for choosing the algorithm to optimize vertex cache. One of:
VCACHE_AUTOVCACHE_DIRECT3DVCACHE_LSTRIPSVCACHE_TIPSY
eVCacheOptimizer
,
int
the algorithm selection for optimizing overdraw. One of:
OVERDRAW_AUTOOVERDRAW_DIRECT3DOVERDRAW_RAYTRACEOVERDRAW_FAST
eOverdrawOptimizer
)

This is a utility function that is provided for developers to perform the entire optimization for a mesh.

public static int

Returns:

one of: OK, OUT_OF_MEMORY, INVALID_ARGS
TootleOptimize
(FloatBuffer
a pointer to the vertex buffer. The pointer pVB must point to the vertex position. The vertex position must be a 3-component floating point value (X,Y,Z).
pVB
,
IntBuffer
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 3*sizeof(float).
nVBStride
,
int
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 DEFAULT_VCACHE_SIZE. This value must be non-zero.
nCacheSize
,
FloatBuffer
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 NULL, a default viewpoint set will be used.
pViewpoints
,
int
the winding order of front-faces in the model. One of:
CCWCW
eFrontWinding
,
IntBuffer
a pointer that will be filled with an optimized index buffer. May not be NULL. May equal pIB.
pnIBOut
,
IntBuffer
the number of clusters generated by the algorithm. May be NULL if the output is not requested.
pnNumClustersOut
,
int
the selection for choosing the algorithm to optimize vertex cache. One of:
VCACHE_AUTOVCACHE_DIRECT3DVCACHE_LSTRIPSVCACHE_TIPSY
eVCacheOptimizer
,
int
the algorithm selection for optimizing overdraw. One of:
OVERDRAW_AUTOOVERDRAW_DIRECT3DOVERDRAW_RAYTRACEOVERDRAW_FAST
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 must point to the vertex position. The vertex position must be a 3-component floating point value (X,Y,Z).
pVB
,
IntBuffer
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 3*sizeof(float).
nVBStride
,
FloatBuffer
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 NULL, a default viewpoint set will be used.
pfViewpoint
,
int
the winding order of front-faces in the mesh. One of:
CCWCW
eFrontWinding
,
IntBuffer
this array of 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 i of this array contains the cluster ID of face i.

The compact format is an array that maps every face ID between entry i and i+1 to be in cluster i.

For both formats, the last entry of the array ( pnFaceClusters[ nFaces ] ) should contains the number of total clusters.

pnFaceClusters
,
IntBuffer
an array that will receive the re-ordered index buffer. May be NULL. May equal pnIB.
pnIBOut
,
IntBuffer
an array that will receive the cluster ordering. May be 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.
pnClusterRemapOut
,
int
the algorithm selection for optimizing overdraw. One of:
OVERDRAW_AUTOOVERDRAW_DIRECT3DOVERDRAW_RAYTRACEOVERDRAW_FAST
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 must point to the vertex position. The vertex position must be a 3-component floating point value (X,Y,Z).
pVB
,
IntBuffer
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 3*sizeof(float).
nVBStride
,
FloatBuffer
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 NULL, a default viewpoint set will be used.
pfViewpoint
,
int
the winding order of front-faces in the mesh. One of:
CCWCW
eFrontWinding
,
IntBuffer
this array of 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 i of this array contains the cluster ID of face i.

The compact format is an array that maps every face ID between entry i and i+1 to be in cluster i.

For both formats, the last entry of the array ( pnFaceClusters[ nFaces ] ) should contains the number of total clusters.

pnFaceClusters
,
IntBuffer
an array that will receive the re-ordered index buffer. May be NULL. May equal pnIB.
pnIBOut
,
IntBuffer
an array that will receive the cluster ordering. May be 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.
pnClusterRemapOut
,
int
the algorithm selection for optimizing overdraw. One of:
OVERDRAW_AUTOOVERDRAW_DIRECT3DOVERDRAW_RAYTRACEOVERDRAW_FAST
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

Returns:

one of: OK, OUT_OF_MEMORY, INVALID_ARGS
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 MAX_VERTICES.
nVertices
,
int
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 DEFAULT_VCACHE_SIZE. This value must be non-zero.
nCacheSize
,
IntBuffer
a pointer that will be filled with an optimized index buffer. May be NULL. May equal pnIB.
pnIBOut
,
IntBuffer
a pointer to an array that will be filled with a face re-mapping. May be NULL. This is an array of nFaces elements.

Element i in the array will contain the position of input face i in the output face ordering.

pnFaceRemapOut
,
int
the selection for choosing the algorithm to optimize vertex cache. One of:
VCACHE_AUTOVCACHE_DIRECT3DVCACHE_LSTRIPSVCACHE_TIPSY
eVCacheOptimizer
)

This function performs vertex cache optimization on an index buffer.

public static int

Returns:

one of: OK, OUT_OF_MEMORY, INVALID_ARGS
TootleOptimizeVertexMemory
(ByteBuffer
a pointer to the vertex buffer. The pointer pVB must point to the vertex position. The vertex position must be a 3-component floating point value (X,Y,Z).
pVB
,
IntBuffer
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 3*sizeof(float).
nVBStride
,
ByteBuffer
the output vertex buffer. May be NULL. May equal pVB.
pVBOut
,
IntBuffer
the output index buffer. May not be NULL. May equal pnIB.
pnIBOut
,
IntBuffer
an array that will receive a vertex re-mapping. May be 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.
pnVertexRemapOut
)

This function rearranges the vertex buffer's memory location based on the index buffer.

public static int

Returns:

one of: OK, OUT_OF_MEMORY, INVALID_ARGS
TootleOptimizeVertexMemory
(FloatBuffer
a pointer to the vertex buffer. The pointer pVB must point to the vertex position. The vertex position must be a 3-component floating point value (X,Y,Z).
pVB
,
IntBuffer
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 3*sizeof(float).
nVBStride
,
FloatBuffer
the output vertex buffer. May be NULL. May equal pVB.
pVBOut
,
IntBuffer
the output index buffer. May not be NULL. May equal pnIB.
pnIBOut
,
IntBuffer
an array that will receive a vertex re-mapping. May be 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.
pnVertexRemapOut
)

This function rearranges the vertex buffer's memory location based on the index buffer.

public static int

Returns:

one of: OK, OUT_OF_MEMORY, INVALID_ARGS
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 MAX_VERTICES.
nVertices
,
int
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 DEFAULT_VCACHE_SIZE. This value must be non-zero.
nCacheSize
,
IntBuffer
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 nFaces+1.
pnFaceClusters
,
IntBuffer
a pointer that will be filled with an optimized index buffer. May be NULL. May equal pnIB.
pnIBOut
,
IntBuffer
a pointer to an array that will be filled with a face re-mapping. May be NULL. This is an array of nFaces elements.

Element i in the array will contain the position of input face i in the output face ordering.

pnFaceRemapOut
,
int
the selection for choosing the algorithm to optimize vertex cache. One of:
VCACHE_AUTOVCACHE_DIRECT3DVCACHE_LSTRIPSVCACHE_TIPSY
eVCacheOptimizer
)

This is a utility function to optimize vertex cache on a clustered index buffer.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait