It leaks: a texture per click
renderer.info.memory.textures counts textures on the GPU right now.
Debugging rounds hand you a broken scene. Five symptoms cover most of them: it is black, it is slow, it leaks, it is blurry, it flickers. Each has a short checklist, and each check is a measurement: a pixel, a triangle count, renderer.info, the pixel ratio, a depth calculation.
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.
Write a function whyBlack(renderer, scene, camera) that renders, reads the centre pixel and the triangle count, and returns the likely group of causes.
Write a leak test: call an action N times and fail if renderer.info.memory.textures grew by more than one.
Explain it without notes
Your scene is black. Give the checks you'd run, in order.
A configurator gets slower and slower the longer it is used. What's your hypothesis and test?
Console
Nothing logged yet.Expected console output
leaky: new textures on the GPU after 5, 10, 15, 20 clicks: 5, 10, 15, 20
clean: new textures on the GPU after 5, 10, 15, 20 clicks: 1, 1, 1, 1
one 256 x 256 RGBA texture with mipmaps is about 341 KiB