Jump to content
  • Advertisement
Sign in to follow this  
afraidofdark

multitexutring directx 11

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

hello,
I've got a model which needs 3 different textures to be drawn properly. Some faces (triangles) uses texture 1 (lets say face 1,2,3) and some other faces uses texture two (lets say face 4,5,6) and finally faces 7,8,9 uses texture 3.

Can I draw this mesh in a single draw call, using texture arrays & multitexturing (like this: http://www.rastertek.../dx10tut17.html) ?

what I am planning to do is :

assign mesh to the pipeline,

assign texture 1
draw call with indexes 1,2,3

assign texture 2
draw call with indexes 4,5,6

assign texture 3
draw call with indexes 7,8,9

can I do this in one draw call ?
thank you for taking time.

Share this post


Link to post
Share on other sites
Advertisement
Maybe you would merge them into one texture.
(Texture altas should be power of two size for its mipmaps.)

Share this post


Link to post
Share on other sites
If you add an attribute to each vertice containing a texture ID and bind the 3 textures to a shader you can choose which texture to sample from in the pixel shader.

If you choose to do this, output the textureID from the vertex shader to the pixel shader using the nointerpolation parameter.

Share this post


Link to post
Share on other sites
Putting a texture index in your vertices like Tiago suggests could work, but you would have to be careful not to share vertices among faces with different textures assigned to them. This means you might have to split some vertices, or use some other means of obtaining the texture index.


Maybe you would merge them into one texture.
(Texture altas should be power of two size for its mipmaps.)


Power-of-2 dimensions is not a requirement for texture atlases, or for mipmaps. Besides, he's asking about texture arrays which are a much better solution to his problem.

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!