• Advertisement
Sign in to follow this  

Texture class confusion....Texture, Texture2d, Texture3d, TextureCollection, Texture Sampler arrays

This topic is 2419 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. I can't seem to find a lot of info about this. I'm using XNA 4.0 for Windows for what it matters.

1. The Texture2d class is defined as a collection of texels. The Texture class is defined as a Texture resource. Very helpful. What is the relationship between Texture and Texture2D?

2. I need to refer to an array of texture samplers in PixelShader 2.0 by a variable indice....i.e., tex2D(TextureSamplerArray, texcoords), where is not defined at compile time. Which is not supported. Should I use Texture3d or a TextureCollection to pull this off? I can't find any info about TextureCollection at all besides MS's barebones definition and would rather not have to code myself into a corner to find out.

Thanks for the help.

Share this post


Link to post
Share on other sites
Advertisement

Hello. I can't seem to find a lot of info about this. I'm using XNA 4.0 for Windows for what it matters.

1. The Texture2d class is defined as a collection of texels. The Texture class is defined as a Texture resource. Very helpful. What is the relationship between Texture and Texture2D?

2. I need to refer to an array of texture samplers in PixelShader 2.0 by a variable indice....i.e., tex2D(TextureSamplerArray, texcoords), where is not defined at compile time. Which is not supported. Should I use Texture3d or a TextureCollection to pull this off? I can't find any info about TextureCollection at all besides MS's barebones definition and would rather not have to code myself into a corner to find out.

Thanks for the help.


1. Texture is an abstract base class. It just contains functionality common to the 3 texture types (Texture2D, Texture3D, and TextureCube).

2. TextureCollection is not a resource type. It has the name "collection" as in the kind of collections you find in System.Collections. It's basically just an array of Texture's. The class exists for the Textures property of GraphicsDevice.

What you're trying to accomplish is most commonly achieved using a texture atlas. You can probably dig up some resources on terrain rendering that implement something similar.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement