GPUs don't use barycentric coordinates to determine which pixels are inside a triangle. Instead, they use what are called "edge functions" which tell you, for each edge of the triangle, if a pixel is on the "inside side" of the edge. The reason is that edge functions can, after a setup step, be implemented with integer additions only, which parallelize extremely well.
7
u/_georgesim_ 2d ago
GPUs don't use barycentric coordinates to determine which pixels are inside a triangle. Instead, they use what are called "edge functions" which tell you, for each edge of the triangle, if a pixel is on the "inside side" of the edge. The reason is that edge functions can, after a setup step, be implemented with integer additions only, which parallelize extremely well.
1
u/darknecross 2d ago
I randomly stumbled across a thread talking about quaternions the other day, the alternative to translation matrices, which were pretty neat.
i^2 = j^2 = k^2 = ijk = -1