Creates a new Texture view. A texture view does not store any pixels on its own, but instead uses the pixel data of a "parent" Texture object. The width, height, format, sample count, and usage flags all match the parent. The view may have a different TextureType from the parent, and it may reference a subset of the parent texture's layers and mipmap levels.

Texture views can be used as render targets in a render pass and they can be bound to Shaders. They can not currently be used for transfer operations. They are used for:

view = Texture:newView(type, layer, layerCount, mipmap, mipmapCount)


typeTextureType The texture type of the view.
layernumber1 The index of the first layer in the view.
layerCountnumbernil The number of layers in the view, or nil to use all remaining layers.
mipmapnumber1 The index of the first mipmap in the view.
mipmapCountnumbernil The number of mipmaps in the view, or nil to use all remaining mipmaps.


viewTexture The new texture view.

See also