Gauntlets of Recursion (+3)

Times, trials, and turbulence.

More rasterization.

Today saw more progress on my 3D rasterizer project. Clearly most readers aren’t nearly as fascinated by this topic as I am, so I’ll have to try and fit some more game development-y content in here rather soon. Yay or nay?

Step 2: Triangle rendering

After the tedious step of getting DirectDraw working, the main thing any rasterizer needs to be able to do is draw triangles. And fast. My algorithm is pretty fast, but the current code is only my first shot at it. As time goes by I’ll work on optimizing it further, and squeezing out as much performance as I can out of this. This and the below step are the workhorses of a 3D engine. I can venture into some detail about the algorithm I’m using if there is any interest.

Step 3: Vertex attribute interpolation

Sounds fancy, but what does it mean? Lots of values get interpolated — or “shaded across” — a given triangle, such as colour, surface normals, and texture coordinates. I’ve managed to implement per-vertex colours at this point, but have yet to abstract the values more so that it can be used to interpolate virtually any value across the triangle. What does this mean in terms of graphical shininess?

sw3d_2.JPG

(Above: Gouraud-shaded triangles, using vertex attribute interpolation.)

If you are not already familiar with the joys of linear interpolation, I suggest you read up on it. It’s an indespensible technique that any game developer can easily benefit from. You’ve probably been using it for ages without even realizing it had a spiffy name!

What’s Next?

Cleaning up my existing code, and figuring out how to turn this all into some kind of graphics pipeline. This will call for some research: probably looking at how OpenGL and Direct3D do their pipelining — fixed function, that is. Afterwards, implementing matrices will be the main task. This includes transformation matrices, the projection matrix, and a camera matrix. That’s when things start to look a little more interesting. πŸ™‚

Advertisements

4 responses to “More rasterization.

  1. Lachlan Littlemore October 14, 2007 at 11:04 pm

    Yay.

    But seriously, do what you’re interested in man. We’re not babies that rely on you for entertainment πŸ˜‰

    A solid understanding of the inner-workings of a rasterizer is a very cool thing to have.

  2. Scet October 15, 2007 at 8:12 am

    I vote nay, software rasterizer is pure awesome. Everyone knows the best games don’t need video cards.

  3. Stephen October 15, 2007 at 9:06 am

    @Lachlan: I was asking because I was curious what most readers are more interested in, not because I was looking to be dictated by the responses. Furthermore, I choose to refute your claim that I am not the sole source of entertainment for everyone. πŸ™‚

    @Scet: As expected from an emulator enthusiast. πŸ˜‰ (Which is looking nice, by the way!)

  4. zyklon October 15, 2007 at 8:25 pm

    I must say, i could never do that, and it is kind of interesting but, if there were more visuals or something we could play with…. But whatever you do, you do, you are not my sole entertainment. I am my own(I know where that comment can go….)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: