PDA

View Full Version : Model Format for GL3



madman2k
12-25-2009, 09:56 AM
hi, I am writing on my first 3D engine which is supposed to run on GL3/GLES2. Currently I am wondering which model format to choose. As I am only going to render static objects (only camera and lighting changes), I was thinking about throwing all vertices+attributes of an model in an VBO and then render it as a triangle-strip using offsets for texturing different parts. like:


VBO: [v1, v2, v3, .. ,vN]
bindTexture(foo)
glDrawArrays(GL_TRIANGLE_STRIP, 0, N/2);
bindTexture(bar)
glDrawArrays(GL_TRIANGLE_STRIP, N/2, N);


since I would like to use existing models, I would rather use an existing format then inventing my own. Do you know any Model format which allows this kind of rendering without too much work?

remdul
12-26-2009, 06:26 AM
I would suggest OBJ. It is widely supported and relatively easy to debug as they are text files. Though you will probably want to post process the raw data to be used for optimized rendering.

Avoid 3DS at all cost.

zeoverlord
12-26-2009, 07:38 AM
Yea i agree that .obj is the easiest format to start with, i just wish i could export animation data with it.

ugluk
12-26-2009, 06:35 PM
What tool are you using for generating tristrips?

Ilian Dinev
12-27-2009, 01:46 AM
Pick any modern PC game (Crysis). Find-out its file-format via online docs. Fetch exporters from its mod-tools.
Code away.

ColacX
12-28-2009, 05:12 AM
Pick any modern PC game (Crysis). Find-out its file-format via online docs. Fetch exporters from its mod-tools.
Code away.
What is Crysis using?

martinsm
12-28-2009, 05:52 AM
I was thinking about throwing all vertices+attributes of an model in an VBO and then render it as a triangle-strip using offsets for texturing different parts. like:
Under GL3 you can do it with one draw call, if you pack textures into one texture array. Then use third texcoord to select from which slice of this array to take texture. This can significantly reduce draw calls.