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

Started by
1 comment, last by kimchi325 12 years, 4 months ago
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?
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
Tsus, you've provided exactly what I was looking for again! Thanks so much! :)

This topic is closed to new replies.

Advertisement