Skip to main content
gamedev.net
🔒 Locked

Model loader advice

Started by -Datriot- Mar 22, 2009 at 7:20 AM 1 replies 650+ views
Original Post
-Datriot-
-Datriot-
I've created a functional OBJ model loader and I'd like your opinion on something. At the moment, it can only load triangles (no other type of primitive) which specify vertex, texture coordinate and normal indices and cannot load a triangle that only specifies vertex data. Would it be worth making the model loader read primitives that only specify vertex indices (or a combination of two, like indices to vertex coordinates and normals), or would it just be a waste of time? Since I might have the model loader calculate normals for each pritmive, it would make models larger when I have to put dummy normals inside them, but it is worth the extra effort?
Stani R
Stani R
Well, if you're never gonna be loading models that have no normal or texcoord values, then you don't really need to code for it. YAGNI (although it's relatively simple to implement, apart from the normal computation issue). You could also do some timing tests to see whether its faster to load models with precomputed normals or to load without and compute normals on the fly. My gut feeling is that precomputed will be faster to load. Plus, size on disk has not been an issue for years.
Dolf
Dolf
Quote:
Original post by lightbringer
Plus, size on disk has not been an issue for years.


It does matter if he wants to have his game downloaded. Or maybe he is streaming in the models he needs... but that's unlikely because he wouldn't have chosen .obj files then.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.