Rasterisation

In computer graphics, rasterisation (British English) or rasterization (American English) is the task of taking an image in a vector graphics format (shapes) and turning it into a raster image.[1][2] It can then be shown on different screens like a computer display, or video display. It can also be put into a bitmap file format. Rasterization can also be the task of drawing 3D models.
Where the word comes from
[change | change source]The term "rasterisation" comes from German Raster 'grid, pattern, schema', and Latin rāstrum 'scraper, rake'.[3][4]
2D images
[change | change source]Lines
[change | change source]Bresenham's line algorithm can be used to rasterize lines.
Circles
[change | change source]The Midpoint circle algorithm can be used to rasterize circles.
3D images
[change | change source]Rasterization is often used to render 3D models. Unlike things like ray tracing, rasterization is very fast and is used in most realtime 3D engines because of the speed. But, rasterization is the task of figuring out where the shapes in the scene go onto the screen's pixels; it does not say how to figure out the color of the pixels. The color of each pixel is figured out by a pixel shader.
Rasterizing 3D models onto a 2D plane for a computer screen ("screen space") is usually done by fixed (not programmable) function in the graphics pipeline. This is because there is usually no reason to use a different technique to rasterize.[5] It is also because having a system used for doing only this task is very efficient.
Triangle rasterization
[change | change source]
Polygons usually make up digital 3D models. Before rasterization, each polygon is usually made out of triangles. Because of this, rasterization is usually used on triangles.
One thing that is usually needed for rasterization is that two triangles next to each other leave no holes (non-rasterized pixels) between them, so that the rasterized area is completely filled. Also, no pixels should be rasterized more than once. This is needed so that it does not matter what order the triangles are in. Also, rasterizing a pixel more than once wastes time unnecessarily.
Rasterization rules are made to make sure that those rules are true. One of those rules are called the top-left rule, which means that a pixel is rasterized only if
- its center is inside the triangle. Or
- its center is on the triangle top or left edge.
A top edge is an edge that is horizontal and is above other edges, and a left edge is a non-horizontal edge that is on the left side of the triangle.
This rule is used by libraries like Direct3D[6] and many different types of OpenGL (even though OpenGL does not need the rules like this, and only needs a consistent rule[7]).
Quality
[change | change source]
The quality of rasterization can be better by anti-aliasing, which makes "smooth" edges. Sub-pixel precision is one way to do it. It thinks about the positions on a smaller scale than pixels. It can still do something even if the endpoints of a primitive are all on the same pixel, which can make the primitive move smoother. Old hardware, like the PlayStation 1, did not have sub-pixel precision in 3D rasterization.[8]
Related pages
[change | change source]- Raster image processor for 2D rasterization in printing systems
- Vector graphics for the source art
- Raster graphics for the result
References
[change | change source]- ↑ Michael F. Worboys (30 October 1995). GIS: A Computer Science Perspective. CRC Press. pp. 232–. ISBN 978-0-7484-0065-2.
- ↑ Kang-Tsung Chang (27 August 2007). Programming ArcObjects with VBA: A Task-Oriented Approach, Second Edition. CRC Press. pp. 91–. ISBN 978-1-4200-0918-7.
- ↑ Harper, Douglas. "raster". Online Etymology Dictionary.
- ↑ rastrum. Charlton T. Lewis and Charles Short. A Latin Dictionary on Perseus Project.
- ↑ "Rasterization: a Practical Implementation". www.scratchapixel.com. Retrieved 2023-10-06.
- ↑ "Rasterization Rules (Direct3D 9)". Microsoft Docs. Retrieved 19 April 2020.
- ↑ OpenGL 4.6 (PDF). p. 478.
- ↑ "PlayStation rasterization issues". Libretro. 4 October 2016. Retrieved 19 April 2020.