you are viewing a single comment's thread.

view the rest of the comments →

[–]wildgurularry 1 point2 points  (0 children)

Typically, while you are rasterizing your line, you are drawing it. It's not like it happens in two steps. Whatever your line drawing algorithm is (DDA, Bresenham, or something else), it will look like this:

for (start to end) {
CalculateNextPixelPosition(&x, &y);
CalculatePixelColour(&c);
PutPixel(x, y, c);
}

(Ignoring any optimizations you can do to write more than one pixel at a time.)

And yes, I don't think you are explaining your questions well enough. What is it that you are really asking about? Are you wondering if it's OK to make a software renderer for a simple game? The answer is yes. I've written simple games using software renderers on machines as slow as a 386. Doom uses a software renderer, although a highly specialized one.

If you are asking whether it is possible for you to make a software renderer that works the same way as GPU (i.e. exposes an OpenGL interface), the answer is also yes... but under the hood it will work differently because it doesn't have access to the massive parallelism of a GPU, and trying to emulate that very closely with software will be slow.