From e0aa1e66617bbe6e102a355928df45bfdeedb247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Fri, 3 May 2019 20:52:40 +0200 Subject: [PATCH] Add rasterization conventions --- s3l.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/s3l.h b/s3l.h index 8b69211..7b95579 100644 --- a/s3l.h +++ b/s3l.h @@ -64,6 +64,20 @@ | Coordinates of pixels on screen start typically at the top left, from [0,0]. + + Rasterization rules are to be the same as in OpenGL or DirectX: + + - Pixel centers are at integer coordinates. + - Pixel is rasterized if its center is inside the primitive (e.g. a triangle) + OR + if its center is exactly on the primitive's side, which is either left + (no exactly horizontal and on the left side of triangle) or top (exactly + horizontal and above the other two edges) + + These rules imply e.g.: + + - Triangles of points that lie on a single line are not rasterized. + - A single "long" triangle can be rasterized as non-continuous. */ #ifndef S3L_H