What reaches the GPU, and what is skipped
The same box in five situations. Look for the cases where the draw call count is 0 and the case where it is 1 but nothing is drawn.
The rendering pipeline is the fixed chain of steps that turns corner positions into coloured pixels: vertex shader, clip space, rasterisation, fragment shader, depth test and the picture. You program two of the steps; the rest are built into the GPU.
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 5 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
Using the pixel-read code in the depth-test example, write a check that reads the middle pixel of a scene and logs whether it is black.
A transparent window and a car behind it are drawn in the wrong order and the car shows through wrongly. Which stage of the pipeline is responsible, and what would you check first?
Explain it without notes
Walk one vertex through the pipeline in your own words, from a position in your code to a pixel on the screen.
A hand-built triangle doesn't show up, and renderer.info.render.triangles says 1. Give three possible causes.
Console
Nothing logged yet.Expected console output
in front of the camera draw calls 1, triangles 12
behind the camera (z = 10) draw calls 0, triangles 0
behind it, frustumCulled = false draw calls 1, triangles 12
scale 0, frustumCulled = false draw calls 1, triangles 12
near = 5 (box is 3 away) draw calls 0, triangles 0