ITexture2D
Description
Base interface for two-dimensional texture resources for rendering.
The texture UV-coordinates (0,0) correspond to the top-left corner of the top-left texel/pixel and the coordinates (1,1) correspond to the bottom-right corner of the bottom-right texel/pixel (see ColorBuffer.GetPixel).
Public / Methods
SetTexels
Updates a rectangular region of this texture with GpuUpdateFlag.Discard semantic.
The given targetX opt and targetY opt coordinates must align with the mipmap level chain, which means that they must be a multiple of:
2 ^ (Mipmaps - 1) * BlockSize
The values of ITexture.Mipmaps and ITexelBufferInfo.MipmapCount of source in should be identical. Otherwise, some texture mipmap levels will not be updated or some texel buffer mipmaps will not be used.
Public / Attributes
Count
The number of texture array slices.
No explicit distinction is made between regular 2D textures and texture arrays with only one slice.
Height
The texture height, in texels.
The height is always aligned with the block size of the texture format (see TextureFormat.BlockSizeAlign), which means that the actual texture height may be greater than the requested texture height that had been specified when the texture was created.
Width
The texture width, in texels.
The width is always aligned with the block size of the texture format (see TextureFormat.BlockSizeAlign), which means that the actual texture width may be greater than the requested texture width that had been specified when the texture was created.
Extensions
SetTexels
Copies a region of pixels from the given buffer to this texture data object, encoding them as necessary.
This method encodes the pixels and then sets the texel data by calling ITexture2D.SetTexels.