Jump to content
  • Advertisement
Sign in to follow this  
kimchi325

DX11 [SlimDX][DX11] Can I do instancing with different textures?

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

In my application, I'm rendering many objects which have identical vertex/index buffers, so I figured instancing would be appropriate. I've found that this works fine for setting instance transformations et cetera, but I'd like to be able to potentially render each instance with a different set of textures. Is this possible?

Share this post


Link to post
Share on other sites
Advertisement
Hi!

Sure, just pass the SV_InstanceID from the vertex shader all the way down to the pixel shader.
There, you bind preferably a Texture2DArray and use the InstanceID as index.
Here is an example.

Cheers

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!