TextureLayered
Base contract for 2D-layer arrays and cube maps.
TextureLayered groups dimension, format and data queries for Texture2DArray, Cubemap and CubemapArray. It is not Texture3D: layers do not form a continuous depth coordinate. Filtering within a layer or between mip levels does not imply blending adjacent layers.
GetLayers counts images/faces; GetLayerData reads one layer. Cube-map count is GetLayers()/6 for cube arrays. Create ordinary resources through a concrete subclass and CreateFromImages; underscored hooks serve custom implementations.
Native custom-subclass queries and concrete resource operations were checked in Windows Forward+/Vulkan. This does not establish every backend supports all types or arbitrary custom sampler correctness.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
TextureLayeredConstructor
public TextureLayered();Creates a base resource without uploaded layers. Normally instantiate Texture2DArray, Cubemap or CubemapArray and call CreateFromImages. A custom subclass must consistently supply type, dimensions, format and layer data.
Methods14
GetFormatImage.Format
public Image.Format GetFormat();Returns the implementation common Image.Format for layers. Base Max without a provider is not a usable image format. Readback layers are not necessarily RGBA8.
Image.FormatCommon layer-image format.
GetHeightint
public int GetHeight();Returns one layer base-level height; for a cubemap this is a square face height.
intOne layer height in texels.
GetLayerDataImage
public Image GetLayerData(int layer);Reads one zero-based layer. Concrete ImageTextureLayered resources return a separate Image from GPU data; editing it does not update the texture, so use UpdateLayer. The Image includes its own mip chain when present. Readback can be costly; avoid unnecessary per-frame reads. A CubemapArray face index is 6 × cube index + face index.
| Name | Type | Default |
|---|---|---|
layer | int | — |
layerLayer index from 0 through GetLayers() − 1; for cube arrays, 6 × cube index + face.
ImageSelected layer Image; check data availability before reading pixels.
GetLayeredTypeTextureLayered.LayeredType
public TextureLayered.LayeredType GetLayeredType();Returns the resource kind: Type2DArray, Cubemap or CubemapArray. This classifies the texture; it is neither a RID nor Image.Format.
TextureLayered.LayeredTypeResource kind from LayeredType.
GetLayersint
public int GetLayers();Returns layer count. Cubemap has 6; CubemapArray reports face count, a multiple of 6, rather than cube count. Mipmap levels are not added to this count.
intLayer count, including all cubemap faces.
GetWidthint
public int GetWidth();Returns one layer base-level width rather than the total width of all images or an imported sheet.
intOne layer width in texels.
HasMipmapsbool
public bool HasMipmaps();Returns whether layers have mipmaps. ImageTextureLayered stores the chain inside each Image, unlike separate Texture3D mip slices. The flag does not generate missing levels.
boolWhether layers have mip chains according to the implementation.
_GetFormatImage.Format
public virtual Image.Format _GetFormat();Override for a custom TextureLayered. Returns the implementation common Image.Format for layers. Base Max without a provider is not a usable image format. Readback layers are not necessarily RGBA8.
Image.FormatCommon layer-image format.
_GetHeightint
public virtual int _GetHeight();Override for a custom TextureLayered. Returns one layer base-level height; for a cubemap this is a square face height.
intOne layer height in texels.
_GetLayerDataImage
public virtual Image _GetLayerData(int layerIndex);Custom TextureLayered Image provider used by native GetLayerData. Keep data consistent with format, dimensions and mipmaps. Handle index bounds in the implementation; arbitrary subclasses need not behave identically to GPU-backed ImageTextureLayered.
| Name | Type | Default |
|---|---|---|
layerIndex | int | — |
layerIndexLayer index for which the custom implementation supplies an Image.
ImageRequested layer Image, consistent with resource metadata.
_GetLayeredTypeuint
public virtual uint _GetLayeredType();Custom TextureLayered resource-kind provider. The C# hook returns uint: use the numeric value of the corresponding TextureLayered.LayeredType. Returning it does not automatically allocate a GPU texture.
uintNumeric uint LayeredType value.
_GetLayersint
public virtual int _GetLayers();Override for a custom TextureLayered. Returns layer count. Cubemap has 6; CubemapArray reports face count, a multiple of 6, rather than cube count. Mipmap levels are not added to this count.
intLayer count, including all cubemap faces.
_GetWidthint
public virtual int _GetWidth();Override for a custom TextureLayered. Returns one layer base-level width rather than the total width of all images or an imported sheet.
intOne layer width in texels.
_HasMipmapsbool
public virtual bool _HasMipmaps();Override for a custom TextureLayered. Returns whether layers have mipmaps. ImageTextureLayered stores the chain inside each Image, unlike separate Texture3D mip slices. The flag does not generate missing levels.
boolWhether layers have mip chains according to the implementation.
TextureLayered.LayeredType
| Value | Description |
|---|---|
Cubemap = 1 | Texture is a |
CubemapArray = 2 | Texture is a |
Type2DArray = 0 | Texture is a generic |