using .obj files in 3D game

geo_diver

Newcomer
Hi,

I am constructing 3D models and exporting them for use in a game. I tune them in poser, but that doesn't really matter. I was just curious if a professional can tell me what would be the best for the performace of my game, to construct my 3D world as one large .obj file, or to load files individually (trees, grass, buildings, etc.)
Thanks,
-geo_diver
 
If you have a serious sized level, then doing object level bounding volume checks will speed things up* If its simple enough level to not push the video card, the the single object will be faster.

* There is an overhead for sending things as smaller peices, however the bet is that the saving by better culling (frustum, occlusion, etc.) will be worth it. So the general case is divide your world into chunks (chunk size will differ radicalyl based on engine and scene).
 
What game engine are you using? And what does the .obj importer support?
Not all loaders/importers support having all the objects in one .obj file judging from what I've seen so far.
(Had a quick look around a couple of weeks ago, since I'm writing one myself)
 
You could do that but it's going to limit what you can do.

I use several 3D packages and having a common format for exchange is convenient, so I decided to use .obj, which is very easy to parse and convert to whatever format your engine uses.

My engine targets the PSP (and in the near future the iPhone/iPod Touch) so I have some specific needs but can do without certain features (shaders for example).

You will need some LOD management at some point. I found it more convenient to do this step with a 3D program and let the engine switch meshes and mipmap levels.

Having a simple .obj file is inefficient and not really flexible. What I do is I build the scene in Maya or Houdini, texture the objects, bake the textures and export the single objects as .obj. Then I use my own scene compositor software to put everything together and then dump that to a PSP friendly format: a packed file with scene description, geometry and texture data.

If you're going to support a file format I'd suggest you try to go with COLLADA, .XSI or .ma/.mb. Unless your game is extremely simple you will be limited by what you can do with .obj.

Note that I don't program games for a living, it's just my weekend hobby, but this is the solution I found that works best for me.
 
Back
Top