Jump to content
  • Advertisement
Sign in to follow this  
Bertdil

Different textures for different faces

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

Here's what I want to do. I want to have an mesh that can have a different set of textures on each face. So far all I have come up with is to have a single vertex/index buffer and multiple DrawIndexedPrimitive calls with a separate material for each. Something like this: Set vertex buffer Set indices Set material for face 1 Draw index buffer for face 1 Set material for face 2 Draw index buffer for face 2 etc... Is this the best way to do this? Can I do it with a single DrawIndexedPrimitive?

Share this post


Link to post
Share on other sites
Advertisement
sure, if you put all the faces in a texture atlas or a texture array, and you should set a unique value for each face, let's say a different color, texture coordinate or whatever.
using that you can create some shader code that offsets the texture coordinates for each face.
I couldn't tell you exactly how since i am not that familiar with d3d, but it's pretty easy in openGL.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!