can Balancer be forced to create LOD's only from the original vertices?

3 replies [Last post]
conan
Offline
Joined: 10/22/2010

Hi,

we are currently evaluating Balancer, to create reduced-polycount LOD-levels for our in-game models.

However, the memory footprint for the complete LOD-chain is quite important for us. Since we render
using triangle lists during runtime, the ideal solution for us is when the LOD-levels contain only
vertices from the original mesh. (Vertices not present in the original mesh are never generated.)

Thus we would like to store only the following:
- a vertex buffer, storing the original vertices of the model
- an index buffer, storing the original indices, and indices for the LOD levels, both referring to the original
vertex buffer

Is it possible to use Balancer this way with the SDK?

Also, is it possible to programmatically lock vertices to make them persistent in all LOD levels?

Have a nice day Smile,

Ferenc

JackJack
JackJack's picture
Offline
Joined: 04/18/2009

Hi Ferenc,

Thanks for your questions.

Is it possible to use Balancer this way with the SDK?

The SDK is designed for this type of scenario in mind.

It actually stores vertices as a vertex buffer.
IMesh::pointArray() gives you a pointer that can be used as a vertex buffer.
IMesh::faceArray() gives you a pointer that can be used as an index buffer.

You can modify the the internal index buffer using
ISimplificationHierarchy::goToFaces() or goToStep() functions.
These functions are very fast.
Alternatively, you can store the original (full res) index buffer.

Note however that after the mesh is constructed, the SDK can modify
the original indices when the mesh has vertices with different normals
or uvs at their adjacent faces. Such vertices will be duplicated,
and the indices will be updated accordingly.
If you use IMesh::pointArray() for your vertex buffer after the LOD hierarchy
is constructed, everything should be consistent and correct.

Also, is it possible to programmatically lock vertices
to make them persistent in all LOD levels?

Just use IMesh::lockVertex() for this.

Best regards Smile

conan
Offline
Joined: 10/22/2010

Hi,

sorry to ask the same question again, but I think I wasn't clear about it.
What I would like to achieve, is the following:

original model:
100 vertices, 600 indices

final complete LOD-chain:
100 vertices - the same vertices bit-to-bit as in the original model (not modified in any way),
600 indices for LOD0, 400 indices for LOD1, etc.
(every LOD-mesh triangle uses the original vertices, and only them - but <100, of course)

Is this a supported functionality?

Thanks,

Ferenc

JackJack
JackJack's picture
Offline
Joined: 04/18/2009

Hi Ferenc,

Thank you for the detailed description.

This type of functionality is supported exactly as you described.

Best regards Smile