What do you gain from using 3ds files performancewise?

Started by
4 comments, last by DalTXColtsFan 21 years, 1 month ago
Or any other modelfile format for that matter. Obviously in the cases of 3ds or md2 you get the benefit of being an industry standard, and the possibility that your models can be reused easily, and you get the advantage of having the model data in an external file instead of in your source code. But I was looking at the code for loading a 3ds file from GameTutorials.com, and also the MD2 example from OpenGL Game Programming. Unless I''m missing something, it looks like all they''re doing is loading the data into collections of classes or structs memory - they''re still calling glVertex3f for every single vertex in the file. Do you really gain anything performancewise from that over having the objects in your code, or even having them in vertex arrays? Thoughts appreciated! Thanks
Advertisement
if you think this is about performance, or that performance matters really that much, you have still much to learn. model format is independent on rendering format, and, guess what? those tutorials are about LOADING. glVertex is always simpler to understand, thats why its used.

"take a look around" - limp bizkit
www.google.com
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

You seem to have answered my question. All I was getting at is, it doesn''t look like OpenGL has a magic and optimal 3ds file importer that loads and renders a 3ds file superfast. It looks like a data file is a data file and it''s up to the programmer to load the data and figure out the most optimal rendering mechanism. And it seems that that goes for ANY file format - 3ds, md2, or ANY other format - there doesn''t seem to be a big advantage of any one over any other besides popularity.

Would you say that''s true?

My gut instinct is, I would try to figure out some way to load the data into vertex arrays, possibly sorting by texture ID as RipTorn suggested in another thread.

So all I want to know is, is there a "hidden benefit" to using 3ds files or md2 files over any other file format that I''m completely missing?

Thanks
if you think about what you think (uh, ohh:D), you realise there is _NO_WAY_ .3ds can be bether than any other format performance wise. because file format is independent on rendering format.

.3ds is used because you can export it in about every 3d program out in this world, not actually because it is very good. it fits the needs: readable, exportable, => usable for artist and programmer.

your "hidden benefit" is compatibility. thats all.

"take a look around" - limp bizkit
www.google.com
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

In fact you should seriously consider loading a 3ds file into a vertex array for rendering ( Thats what I do in my project ). I load and render a 27000 poly 3ds with (default OpenGL) lighting / texturemapping at around 30 - 40 fps using a gf3 ti 200. I imagine that could improved a lot if I didn''t use the default OpenGL lighting.
quote:
...over having the objects in your code...


are you saying what I think your saying?


*shudder*


how to render a mesh, in order of speed:

using the likes of VAR/VAO with a static index/vertex buffer, with a well ordererd triangle list that takes maximum advantage of vertex chaching. Rendered in texture groups.
v.cache ordered vertex array. Rendered in texture groups.
display list. Rendered in texture groups.
standard vertex array. Rendered in texture groups.
immediate mode with texture groups.
display list, no ordering/grouping.
vertex array using glArrayElement. no ordering/grouping.
immediate mode.


the difference between the fastest and slowest mode here is hard to express... the CPU usage is consdierably less, and tris/sec rates can literally be 100 times higher.

this applies to pretty much all rendering, but if your not bound by vertex througput or CPU usage, then you will likly see no difference in performance whatsoever between any of these modes. (ie, if your heavily fillrate bound)

Animation speed:
keyframed models (md2) with no interpolation. (static) - memory hog though
skeletal bone indexed using hardware matrix indexing.
skeletal bone indexed using cpu + dynamic hardware vertex buffer. ie, copy to VRAM/AGP every frame
skeletal bone weighting using hardware matrix blending.
interpolated keyframe model (cpu+ dbuff)
skeletal bone weighting using cpu + dbuff.

| - Project-X - my mega project.. yup, still cracking along - | - adDeath - an ad blocker I made - | - email me - |

[edited by - RipTorn on March 3, 2003 6:56:23 PM]

This topic is closed to new replies.

Advertisement