Anim8or Community
General Category => Anim8or v0.98 Discussion Forum => Topic started by: texel on December 04, 2008, 01:23:58 pm
-
This is a feature which could be great to use anim8or files in 3D engines:
An option in Anim8or to optimize vertex/index/UV/Normal export in .an8 files.
Here are some explanations:
In the current version of anim8or:
_ Each triangles have indices to 3 vertices. If 2 triangles use the same vertex, this vertex is stored just one time in the vertex bloc of the an8 file.
_ Each triangles have indices to 2 couple of uv coords (if used). If 2 vertices use the same uv, this uv is stored just one time in the uv bloc of the an8 file.
_ Each triangles have indices to 3 normales (if exported). If 2 vertices use the same normal, this normal is stored just one time in the normal bloc of the an8 file.
_ The same vertex can have sevral different normal (for each face)
_ The same vertex can have sevral different uv (for each face)
_ An .an8 file can have n vertex, m normal and k UVCoord
But for real time 3D application, it's better to have (to use vertex buffer AND index buffer):
_ 1 normal and 1 uv per vertex.
_ Create a copy of a vertex with its normal and uv, if and only if this vertex is used by several faces having different normal and/or uv and/or binormals.
With an option like "optimize buffer output" .an8 files would have:
_ n vertices
_ n uv coords
_ n normals
_ n binormals (if used)
_ each triangle would have just one index per vertex (and not 3). This index would be the same for the vertex, uv, normal and binormal bloc.
Without this feature, the use of IndexBuffer in OpenGL/DirectX is not very usefull because every vertices are duplicated in vertex bufffer. Developper can also create there own optimization, but it's hard and slow.
I hope it's enought clear :)
PS: This feature could also convert all faces to triangles.
-
Salut
Anim8or gives you the option of doing that thru ASL.
The tridata stucture lets you access data in a way
compatible with vertex array and VBO.
You have to create an export script to your own 3D file format
(compatible with vertex array and VBO) and obviously a loader
in your 3D engine.
The animation data and support for binary file are still missing,
but they are on the todo list.
I've tried it.It worked.The 3D file format was similar to OBJ,but adapted to Anim8or.
Not exactly what you asked for,but close enough,I think.
Unless,you already knew.
Hope this helps.
Bonne journée.
Claude
-
I didn't know that.
But i prefer C++ :)
-
The ASL script is just to export your model.
The loader could be written in C++.
That's what I did.
It's a lot faster to write than a loader for the
Anim8or file.