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.
Parameters
Section titled “Parameters”texture
Section titled “texture”TgpuTexture<any> & RenderFlag
channels
Section titled “channels”TextureChannels
options?
Section titled “options?”TextureWriteOptions = {}
Returns
Section titled “Returns”void
Example
Section titled “Example”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.