All examples · Meshes and 3D

Fog

What this example shows

The further a thing is from the camera, the more it fades into one colour. It is what the Nintendo 64 is remembered by, and the way every game of the era hid how near it stopped drawing.

useFog belongs to the scene, like its camera, and covers every model in it, one with a material of its own included. The trick is the colour: the same as the background, so the end of the avenue melts into the sky instead of stopping at a wall. It is worked out per corner and smeared across each triangle, like the light, as that hardware did.

Space switches it on and off; up and down move where it is complete. Everything useFog returns is read every frame, so a change shows on the next one.

Starting