mirror of
https://git.coom.tech/drummyfish/small3dlib.git
synced 2024-11-21 20:39:57 +01:00
Add rasterization conventions
This commit is contained in:
parent
db06869dd7
commit
e0aa1e6661
1 changed files with 14 additions and 0 deletions
14
s3l.h
14
s3l.h
|
@ -64,6 +64,20 @@
|
||||||
|
|
|
|
||||||
|
|
||||||
Coordinates of pixels on screen start typically at the top left, from [0,0].
|
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
|
#ifndef S3L_H
|
||||||
|
|
Loading…
Reference in a new issue