• Advertisement
Sign in to follow this  

Organising models, meshes, materials, textures and shaders

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

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
Advertisement
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
Sign in to follow this  

  • Advertisement