[SlimDX][DX11] Can I do instancing with different textures?
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?
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement