THREE.JS / FOUNDATIONS 86

Read the target back.

One layered render target writes color and normals with an array depth attachment. A selected layer then crosses the GPU/CPU boundary through the official async readback API.

Initializing —

Creating two color attachments and layered depth.

Backend
—
MRT
—
Target
—
Draw calls
—
Color attachmenttextureIndex 0

Beauty output is read as an unsigned-byte RGBA buffer.

Bytes
—
Last pixel
—
Reads
0
Normal attachmenttextureIndex 1

World normals travel through the second MRT attachment.

Bytes
—
Last pixel
—
Reads
0
Depth attachmentuseArrayDepthTexture

Per-layer depth testing stays separate from the color MRT.

Class
—
Shape
—
Layers
—
Readback controls
GPU → CPU lifecycle
MRT→array layer→readRenderTargetPixelsAsync→DataTexture

The first completed frame will populate the selected CPU preview.

Drag to orbit · choose an attachment/layer · read back a complete 64 × 64 slice

Previous: texture targets →
LAB 86 / READBACK + DEPTH