Sign in to follow this  

about Faces Grouping in loading a 3d mesh file

This topic is 4112 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

As I know, a 3d model will contain several meshes, and a single mesh may be textured by multiple textures. And, when we render the model, we would have to set the texture coordinates of vertexes. Usually we would use glTexCoordPointer to set the texture coordinates of a group of vertexes. As we know, when exporting models from modeling tools, vertexes will not be optimized to be grouped according to different textures. So, we have to group them according to different textures, right or wrong? I wonder if there's anyone would correct my opinion?

Share this post


Link to post
Share on other sites
Well, depending on the exporting done from the modeler, you can have information about what material each face has applied to it. At least in MAX, the ASE file format supports this.

So, given a 3D model, you can have multiple sub-meshes, each one using a different material. IIRC, you can only have one material per face - but you find out which faces use which materials and there's your grouping.

Materials can have a number of texture channels, plus surface parameters for lighting, etc. But then again, grouping by material is not the only grouping you can do to optimize state changes - this will vary with what you're actualy rendering.

For example, optimizing state changes for rendering lots of instances of one mesh using different materials is different from optimizing for lots of different meshes that use the same material - in the first case, you'll probably want to group on the top level by mesh, and on a second level by material. The second case benefits from grouping by material on the top level, and then by geometry on the next.

Hope that helps.

[]s,
M.

Share this post


Link to post
Share on other sites

This topic is 4112 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.

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