locked
How to get a texture from texture array?

    Question

  • I have used CreateTexture2D to create 2D texture, In the D3D11_TEXTURE2D_DESC structure, set ArraySize equal to 10. How can I get a texture from the TextureArray created before? I want to use only one texture for each rendering.

    Thank you for your reply

    Monday, March 05, 2012 9:15 AM

Answers

  • For a standard texture, in your HLSL, you use a Texture2DArray texture object and then provide the index as part of your use of .Sample via a float3: x is the u parameter, y is the v parameter, and z is the index.

    For render target arrays, you have to specify the target index in a geometry shader.

    Monday, March 05, 2012 7:27 PM

All replies

  • For a standard texture, in your HLSL, you use a Texture2DArray texture object and then provide the index as part of your use of .Sample via a float3: x is the u parameter, y is the v parameter, and z is the index.

    For render target arrays, you have to specify the target index in a geometry shader.

    Monday, March 05, 2012 7:27 PM
  • Thank you very much
    Tuesday, March 06, 2012 6:16 AM