Worksheet 7 — Part 2 · Environment Background

WebGPU not supported.

A screen-filling quad at the far plane shows the surrounding environment; the sphere shows it through its normal. Drag to orbit.

The Mtex transformation (background quad): the quad's vertices are already in clip space, so its model-view-projection matrix is the identity. To texture it we need the world-space ray direction through each pixel. Mtex = (V⁻¹)3×3 · P⁻¹: the inverse projection P⁻¹ takes a clip-space position back to camera coordinates, and the rotational part of the inverse view matrix (translation dropped) rotates that camera-space direction into world space. The result is exactly the look-up direction the cube map needs.