Sign in to follow this  
deadstar

Organising models, meshes, materials, textures and shaders

Recommended Posts

Hi, I'm redesigning the Model classes in my engine to something more structured. Here is a proposed design: - MODEL class: Contains pointer to a MESH object, and position/rotation information - MESH class: Contains mesh data, animation data, UV coords, pointers to MATERIAL objects - MATERIAL class: Contains colour info, UV tiling/offset, pointer to texture object, pointer to SHADER object - TEXTURE class: Just a GLuint - SHADER class: Just a CgEffect object Where appropriate, file loading is done through a resource manager. Can anyone foresee any problems? Should I really separate the MESH class from the MATERIAL class, or have it all in one? Is it wise to have a shader belong to a material? Thanks in advance for any feedback

Share this post


Link to post
Share on other sites
Sounds pretty good to me, just one note, you might want to add the ANIMATION resource and have mesh optionally contain a pointer to that, now you can also reference your animiations across mesh the same way you reference materials. Set to NULL and this mesh has no animation.

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