Archived

This topic is now archived and is closed to further replies.

ToddTT

How many meshes???

Recommended Posts

ToddTT    122
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

Share this post


Link to post
Share on other sites
invective    118
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.

Share this post


Link to post
Share on other sites
ToddTT    122
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

Share this post


Link to post
Share on other sites
invective    118
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.

Share this post


Link to post
Share on other sites
ToddTT    122
>>> ...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]

Share this post


Link to post
Share on other sites