Forum

Texture fx with spreadable input

is it possible to mix a spread of textures using a control texture ?
im guessing it’s a dx11 thing…

Yes. In dx9 I think you need a separate input & sampler per texture, In dx11 you can declare a texture array and use the same sampler on all of them.

// declare array of N textures
Texture2D MyTextureArray[N](N);

// sample texture of index I from array (0 to N-1)
MyTextureArray[I](I).Sample(MySampler, UV);

it’s actually works, without tex array, and in 11 you need only one sampler per shader

antokhio can you explain what you mean? I guess tfx is spreadable at the pass level (and can even access a previous pass), but if you want access to a bunch of textures in a shader for 1 output wouldn’t you still need to want to use an array?