Organising models, meshes, materials, textures and shaders

Started by
0 comments, last by lubby 15 years, 11 months ago
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

"The right, man, in the wrong, place, can make all the dif-fer-rence in the world..." - GMan, Half-Life 2

A blog of my SEGA Megadrive development adventures: http://www.bigevilcorporation.co.uk

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.

This topic is closed to new replies.

Advertisement