Atlaslog
Atlaslog / luma.gl / API reference / TextureView
luma.gl · API reference

TextureView

Quick answer

TextureView reinterprets a texture without copying memory: it selects mip levels, array layers or a compatible format for the same storage. Create it with texture.createView({dimension, baseMipLevel, levelCount, format}). Use views to render into one cube face or sample a single array slice.

Last verified 2026-11-03 · luma.gl 9.4 · Cite this page
texture. createView ( props ) → TextureView
Key points
Example
const target = device.createTexture({
  width: 256,
  height: 256,
  format: 'rgba8unorm',
  usage: Texture.SAMPLE | Texture.RENDER | Texture.COPY_DST
});

const fbo = device.createFramebuffer({
  width: 256,
  height: 256,
  colorAttachments: [target.createView({ mipLevelCount: 1, arrayLayerCount: 1 })]
});
const atlas = device.createTexture({
  width: 128,
  height: 128,
  depth: 8,
  dimension: '2d-array',
  format: 'rgba8unorm',
  usage: Texture.SAMPLE | Texture.RENDER
});

const layer3 = atlas.createView({
  dimension: '2d',
  baseArrayLayer: 3,
  arrayLayerCount: 1,
  baseMipLevel: 0,
  mipLevelCount: 1
});
Notes
Runnable examplesChinese originalAll API references
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Cite this page

Atlaslog (2026). TextureView. https://www.jingweizhi.com/en/lumagl/api/texture-view.html (accessed 2026-11-03).