Line Rasterization
Today we went over two simple line rasterization algorithms, using the power of "algebra" and "algorithms".
If you remember back to middle school, one way to express a line is: y = mx+b. "m" is the slope for some reason, "b" is the y-intercept for some reason. Our algorithm iterates across every column (x-value) on the screen, computing the row (y-value) for that column, and then draws a white box there.
We then added a simple anti-aliasing algorithm that smooths out the stairstep patterns by using the fraction we are to the next row to split the color added between the current row and the next row. So if we were supposed to be at row 5.5 for the current column, it will draw half the color on row 5 and half on row 6. This is a simple implementation of an antialiasing algorithm created by Xiaolin Wu in 1991.
Other Videos By Bill Kerney
2021-08-25 | Final Project!!?! |
2021-08-24 | UE4 Material Instances |
2021-08-24 | RSA Encryption Part 2, Computer Security |
2021-08-23 | UNIX Shortcuts, C++ Shortcuts, Bools |
2021-08-23 | Welcome to CSCI 1 @ Fresno State! |
2021-08-20 | Conditionals Part III |
2021-08-20 | Navmesh, Materials, Axis-Aligned Bounding Boxes |
2021-08-19 | Multiplayer Balance and UE4 Materials Pt. 2 |
2021-08-19 | The Optimizer, Bigints, Prime Generation, RSA Encryption, Cryptographic Hashing |
2021-08-18 | Conditionals Part II |
2021-08-17 | Line Rasterization |
2021-08-17 | Game Design Principles and UE4 Materials |
2021-08-17 | Powm, Modular Division, Espionage |
2021-08-16 | Strings, Conditionals, Logical Operators |
2021-08-13 | C++ Variables, Algebra, I/O |
2021-08-12 | Week 1 Day 2 - Introduction to Rendering |
2021-08-12 | Week 1 Day 2 - Game Design / Intro to UE4 |
2021-08-12 | Week 1 Day 2 - More Modulus |
2021-08-12 | Week 1 Day 2 - UNIX and Vim Basics; Hello World |
2021-08-10 | CSCI 26 Week 1 Day 1 Lecture |
2021-08-10 | IS50A Game Development Week 1 Day 1 |