One material, five textures

Texture map stack

A modern material is not one image. It is a stack of them, each feeding a different term of the lighting calculation: colour, normal direction, apparent depth, indirect shadowing, and fine detail. Switch them on in order and watch a flat coloured rectangle turn into a rock face — without a single extra triangle.

The surface 2 triangles
Drag to move the light

Only the albedo map is on. The surface is lit, but every pixel shares one normal, so the lighting is a single soft gradient and the rock reads as a photograph glued to a flat board.

The stack click a row to toggle
Controls scene & maps
38°
0.55
0.055
0.85
10×
2.10

Pull camera distance right in and the detail map earns its keep: the base maps run out of resolution long before the detail map does, which is the whole argument for a second set of textures at a much smaller scale.

The fragment shader you are describing live

      

Greyed lines are the maps you have switched off. Each one is a texture fetch feeding a different input of the same lighting equation — none of them changes the geometry.

Where each map lands in the equation. Albedo is the colour multiplied by the result. The normal map replaces N, so it changes both the diffuse N·L and the specular term. The height map does not touch the lighting at all — it shifts the texture coordinates everything else is read from, which is why it makes rocks appear to stand in front of each other. Occlusion multiplies only the ambient term, because it describes light arriving from everywhere rather than from your lamp. And the detail maps are simply a second albedo and normal read at a much higher tiling rate, blended over the first.