A turning cube on a screen inside the scene
The cube is drawn into a 256 × 256 texture, and a plane in another scene shows that texture. Watch the status bar: the geometry count and texture count.
A render target is a picture the GPU draws into instead of the screen. It becomes a texture you can show on a mirror, a screen inside the scene, or feed to an effect. It costs memory, and it does not resize by itself.
Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.
Ready for more? This phase has 4 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
Compute the memory of a half-float target for a 1366 × 768 screen at ratio 1, and of a chain holding two.
Write the lines that draw photoScene into target and then world to the canvas, restoring whatever target was active before.
Explain it without notes
What is a render target, and when would a showroom need one?
Why does a render target not resize with the canvas, and how do you keep them in step on a phone with pixel ratio 3?
Console
Nothing logged yet.Expected console output
target: 256 x 256 | is a render-target texture: true
textures on the GPU: 1 | draw calls in the last render: 1
size of the picture: 262144 bytes (4 per pixel)