# Normal mapping vertex-tangent TBN with a derivative fallback. ```{raw} html ▶ Run in browser ``` **Tags:** `3d` Two spheres share one procedurally generated normal map (diagonal ridges). The left sphere has no tangent data, so the renderer reconstructs a tangent frame from screen-space derivatives. The right sphere calls ``Mesh.generate_tangents()``: its authored per-vertex tangents ride the extras vertex stream and select the tangent normal-mapping pipeline, the same path glTF models with TANGENT accessors use. Both paths light the ridges; the vertex-tangent frame is smooth and view-independent where the derivative frame is faceted per pixel-quad. Controls: Escape - Quit Run: uv run python examples/features/3d/normal_mapping.py ## Source ```{literalinclude} ../../examples/features/3d/normal_mapping.py :language: python :linenos: ```