How many meshes???

Started by
4 comments, last by ToddTT 22 years, 1 month ago
In a game with expansive environments and lots of objects, are meshes: 1. Created as they are needed? 2. Cloned from a set of pre-loaded meshes? 3. Taken from a pool of meshes as the objects they represent enter the view? 4. Some other technique? Also, any links to related info(performance optimizations, memory utilization, etc.) would be greatly appreciated. Thanks! Todd
Advertisement
This is too open ended of a question. It depends entirely on how your game operates and what kind of geometry and performance you require. A game with a continuous world is very different from one with discreet levels and is handled differently.

Meshes are often build using some kind of LOD (Level Of Detail). Search for ROAM, QuadTree, Rottger, LOD, VLOD, and you will get some interesting sites.

Edo
Edo
quote:Original post by invective
This is too open ended of a question. It depends entirely on how your game operates and what kind of geometry and performance you require. A game with a continuous world is very different from one with discreet levels and is handled differently.


Fair enough... assume discrete levels, such as a typical platformer(Mario, Maximo, etc.).

What''s important is that despite this, there''s no way I want to create a mesh for every single object in the level. I''m assuming the answer to my question will involve "cloning" and pools of objects in some fashion.

Thanks!
Todd
quote:Original post by ToddTT

What''s important is that despite this, there''s no way I want to create a mesh for every single object in the level.


You mean as in if you have the same pine tree drawn 50 times, you do not want a separate mesh for each tree, right? Each object, at a minimum, should store its position and orientation (either euler angles or up, right, forward vectors), and a pointer to the mesh used to draw it. When you draw the object you load its transformation matrix into the world matrix, then you draw the mesh.

Long story short, you have one mesh for each TYPE of object, not for each object.

You usually want to be able to hold all the meshes for a level in memory. If not, subdivide the world and swap in only the meshes that can be viewed from the player''s position in the world.

>>> ...and a pointer to the mesh used to draw it. When you
>>> draw the object you load its transformation matrix into
>>> the world matrix, then you draw the mesh.
>>>
>>> Long story short, you have one mesh for each TYPE of
>>> object, not for each object.

Ahhh... this makes perfect sense. I'll try that. Thanks!

-Todd

[edited by - ToddTT on March 19, 2002 7:53:41 PM]

This topic is closed to new replies.

Advertisement