Skip to content

writeChannels

writeChannels(texture, channels, options?): void

Defined in: packages/typegpu/src/common/writeChannels.ts:37

Writes image sources into individual channels of texture. Each entry writes a single channel, with from selecting which channel of the source to read. Omitted channels are left untouched.

Requires the 'render' usage flag on the texture.

TgpuTexture<any> & RenderFlag

TextureChannels

TextureWriteOptions = {}

void

common.writeChannels(material, {
r: { source: roughnessMap, from: 'r' },
g: { source: metalnessMap, from: 'r' },
a: { source: maskMap, from: 'r' },
});

© Software Mansion 2026. All trademarks and copyrights belong to their respective owners. Read about our Privacy Policy.