   How can i put a texture array into hlsl?
  Im using directX managed C#:). I am making a terrain engineAny help?   
  Instead of using an array, you can just have sampler0, sampler1, sampler2, etc...   ;  Yes but the user picks the number of textures so there might be 20 or 30   ;  I'm not sure how C# works but in C++ you use SetTexture to set a texture, and SetTextureArray to set an array of textures, there might be something similar in C#HOWEVER!Shaders can't have dynamically sized arrays, so you are going to have to hard code a limit to the number of textures in the shader itself.As far as i know there is no way to do what you are trying to do.You could however limit it to something like 16 textures, which may be pretty reasonable depending on your circumstances.You gotta draw the line somewhere! (:   ;  For smaller textures, a texture atlas could work well.If you use D3D10 or higher (through SlimDX), texture arrays are natively supported in the hardware and API.If not, and texture atlases don't solve your problem, I'd suggest breaking the terrain by texture use. I assume you're not going to use more than 16 textures per tile.   