All examples · Meshes and 3D · As Markdown, for AIs

Matcap

What this example shows

Press space to turn the ground's bounce on and off.

There is not a single light in this scene. matcap(texture, { tint }) is a material recipe that colours a model with a picture of a ball already lit, read by which way each part faces the camera: its colour, its shadow and its shine. It is the soft look of a clay model or a product shot, with the light always coming from the same side of the screen.

The pictures are painted by the example with paintMatcap({ base, shade, shine, gloss }) from nacatamalon/pixels, one per colour. A matcap from a 3D program loads just the same.

On top of each material, the groundBounce({ color, reach, amount }) step brings the floor's orange up onto what stands on it: more the closer a part is to the ground and the more it looks down. Its amount is a uniform, so space changes it while the game runs.

Starting
Starting
—