Every frame your GPU renders is built out of triangles. Every triangle needs to be filled: given a pixel somewhere inside the triangle, what color should it have? The answer relies on a deceptively simple idea called barycentric coordinates.
The concept was introduced by the German mathematician August Ferdinand Möbius in 1827. His insight: instead of giving a point a position in space, express it as a weighted mixture of the triangle's three corners. If the triangle has vertices , , and , then every interior point can be written as
where and each . The three numbers are the barycentric coordinates of .
What makes this powerful is that the same weights apply to any attribute you attach to the vertices — color, depth, texture coordinates, surface normals. Interpolate the weights, and every attribute comes along for the ride.
Comments
Loading comments...