Sign in to follow this  
thedodgeruk

Heirachy vs seperate models?

Recommended Posts

i am in two minds about which is better .
at the moment , if a model has sub meshs then i use a Heirachy method and recurion to display each model , this seams to be the fastest method to render large models with lots of sub meshs, ie robots etc

but i did a quick test and did it so each submesh has its own model and connected together via parenting , this in my head slower to render , but would allow for compleate seperate movement and destruction/removing of sub meshs at render time


is there a convention that people should follow or , just what you wish you engine to do ?[color=#FFFFFF][font=Calibiri, Tahoma, Verdana, Arial, sans-serif][size=2]
[b]
[/b]
[/size][/font][/color]

Share this post


Link to post
Share on other sites
I think the problem with what you are proposing is that it assumes all meshes have the same or at least similar properties, imagine for instance that you are rendering a car. Its all fun an games until you have to change shaders every two meshes because one had transparency, then you found one with normal mapping and then you got a flat rubbery looking mesh.

As I understand it, avoiding to change shaders as much as possible is a pretty high priority, so whatever structure you use should allow you to group by material rather than hierarchy, hierarchy is more useful for position, animation and physics, but at render time I don't think that running through the hierarchy will give you the best results.

This is a lot of guesswork on my part so if I'm wrong about it I would LOVE to be corrected.

Share this post


Link to post
Share on other sites
In my opinion it would be like this

A model as a group of meshes
A mesh is a group of polygons that use the same material

Only have one model, made by a bunch of meshes. But you can have many meshes using the same material, don't think that just because a mesh is a group of polygons that use the same material, then you'll have to group every polygons that uses the same material into a mesh.

Just make each part of the model a mesh (a torso, leg, arm, head, etc), then render them all.

About the disappearing / exploding parts, you could implement some code to not render a particular mesh (hence the need to separate the various parts of a model into meshes).

If you want to know more, go to http://tfc.duke.free.fr/old/models/md2.htm

There's a nice tutorial about the MD2 (Quake) model format. You could read it to get a general idea how models are created / rendered, however, you don't need to do exactly like this, you can make it as you feel better.

Hope it helps...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this