Jump to content
  • Advertisement
Sign in to follow this  
WebsiteWill

Question about model formats

This topic is 4145 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Couple questions actually: 1) Do you create your model to scale (I'm using Max 9) so that your engine doesn't ever have to worry about scale on objects except under certain circumstances (like when I want to shrink something at runtime)? Or do you create your objects to whatever size (everything is 1 unit) and tell the engine what scale to make them as necessary? 2) If you have a model (mesh) that you want to use multiple times (different objects in the game), how do you store this info? Do you create a separate file for each texture set? Do you somehow just export the vertices and the possible texture sets/materials and your engine contains the logic to know when to apply which texture? 3) The textures for the models. Say I have a sword model and multiple textures for it (shiny, rusty, bloody, etc). Do I store each of these textures in a separate file or is there a way to keep them all in the same file? I don't see how I would keep them in the same file without having at least 1 UV set for each texture. On the other hand, it seems you get performance increases if you can pack multiple things into a single texture. 4) Say you model a sword. The hilt always has a black shiny metalic material and texture applied but the blade can have different materials/textures. How do you store this? It seems like you will UV map the model for a single texture where the blade, hilt, etc images are all part of a single texture (Unwrap UVW or similar tool). So, if I do this, do I have to duplicate the hilt part of the image across every different texture the sword can have? Or would I keep the hilt and blade as separate meshes of the same model and UV Map them separately so that I only ever have to make one texture for the hilt and the blade can have as many textures as necessary? Lots of questions, thanks for the replies. I know a lot of this will be tailored to what my engine needs, but what are your preferences in terms of performance, memory consumption, etc. Thanks, Webby

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by WebsiteWill
Couple questions actually:

1) Do you create your model to scale (I'm using Max 9) so that your engine doesn't ever have to worry about scale on objects except under certain circumstances (like when I want to shrink something at runtime)? Or do you create your objects to whatever size (everything is 1 unit) and tell the engine what scale to make them as necessary?

2) If you have a model (mesh) that you want to use multiple times (different objects in the game), how do you store this info? Do you create a separate file for each texture set? Do you somehow just export the vertices and the possible texture sets/materials and your engine contains the logic to know when to apply which texture?

3) The textures for the models. Say I have a sword model and multiple textures for it (shiny, rusty, bloody, etc). Do I store each of these textures in a separate file or is there a way to keep them all in the same file? I don't see how I would keep them in the same file without having at least 1 UV set for each texture. On the other hand, it seems you get performance increases if you can pack multiple things into a single texture.

4) Say you model a sword. The hilt always has a black shiny metalic material and texture applied but the blade can have different materials/textures. How do you store this? It seems like you will UV map the model for a single texture where the blade, hilt, etc images are all part of a single texture (Unwrap UVW or similar tool). So, if I do this, do I have to duplicate the hilt part of the image across every different texture the sword can have? Or would I keep the hilt and blade as separate meshes of the same model and UV Map them separately so that I only ever have to make one texture for the hilt and the blade can have as many textures as necessary?

Lots of questions, thanks for the replies. I know a lot of this will be tailored to what my engine needs, but what are your preferences in terms of performance, memory consumption, etc.

Thanks,
Webby


1) You model everything to the same scale, otherwise, you'd have to scale every single object differently, and that would make many things harder.

2) The way I would do it is load the mesh as a 'Resource' and then for every mesh/model object that uses that Resource, have a pointer to it, or something similar. Then, everything specific to that model instance, keep in the model object, and for everything that will be the same for all the models of that object, keep in the mesh Resource object.

For example, just say that you load an animated character twice, but you want to have different textures on each. In the Resource mesh, you would keep the vertices that make up the model, the indices (assuming vertex arrays), and the animations. In each of the two Model objects, you would keep a list of vertices and indices that make up the current state of the animation for the model, and the texture that would be used to draw the model.

That way, because the original information is the same for both model objects, they would only access the Resource mesh when they are required to advance animation, so they can get the next animation keyframes.

Clear?

3) It would make sense to keep them in seperate files, I think. I mean, you might see a performance increase, but only if you are continually switching between a clean and bloody sword. In any case, the texture for a sword is likely to be fairly small and you shouldn't really bother with worrying about performance with something like that.

4) Yes. That makes the most sense. Each model should be able to have seperate meshes, so you can easily apply different materials to each. So, not only textures, but shaders, bump maps, normal maps, etc, etc and so forth.

Don't worry so much about memory consumption and performance. Get it working first, and then if it is too slow, or uses too much memory, re-write it a different way.

If your design doesn't allow easy re-writing of different parts, then that's the first thing that you re-write. [grin]

Share this post


Link to post
Share on other sites
As an addition to this question. I want a seamless terrain scheme for this engine and I have a plan for how I will implement this in XNA but I'm stumped as to how I would keep the textures consistent across the seams.

I plan to model the world in chunks in Max 9. Basically, model one chunk, then pick the side on which I want to model the next chunk, select the edge vertices and lock them (maybe import the edge as an XRef into the new terrain scene so I can have the reference without the overhead of the entire other terrain chunk). The first thing I would do is match my new terrain vertices with the existing edge and lock them. That way I'm free to edit the rest of the terrain.

So, now I have 4 pieces of terrain (imagine one big chunk divided by a quad tree). How does one keep the textures seamless at the model seams. I know the terrains will be seamless because the vertices at the very edges are identical, but textures?

I'd be UV Mapping each part of the terrain individually so is there a way to guarantee that the textures line up and continue to tile normally?

Thanks,
Webby

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!