Picking
Selecting objects and faces with a colour-ID render pass.
To find what is under the cursor, the renderer draws the scene to an off-screen buffer with a unique colour per object and face, then reads the pixel.
The object index is in the red channel, and the face index is split across green and blue. That gives 255 objects and 65,536 faces per object.
picking.js holds the encode and decode functions in one file, because a mismatch between them would select the wrong thing without any error.