Sign in to follow this  
Bertdil

Different textures for different faces

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
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

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