• Advertisement
Sign in to follow this  

what do you do about material and texture?

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

I do it this way: I put mesh and material and texture file in a class . but I find some engine(like ogre) put material and texture into seperate class. so what is good this way?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Reuse of resources most likely. A material is a composition of textures and effects, while a texture is strictly RGB(A) data. The same textures can be used in several materials, and it is better to reuse it in all materials, than having several copies of the same data.

Share this post


Link to post
Share on other sites
Several things.

Each instance of a mesh can have different materials.
Each material can share textures
Sorting based on material is easier, allowing for multiple objects to share a material, and thus be rendered together.

Share this post


Link to post
Share on other sites
A material contains other data in addition to textures (such as shaders and colors). A material can reference multiple textures, and different materials can reference the same texture.

So, materials and textures should be separate.

Share this post


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

  • Advertisement