• entries
    316
  • comments
    485
  • views
    321374

Progress

Sign in to follow this  
Jason Z

95 views

Performance Update
It's hard to believe, but I was able to almost triple the speed of my rasterizer by changing from an iterative algorithm to the gradient style algorithm - similar to what the Chris Hecker articles show. I am still using homogenous coordinates for my vertex transformation, and then use the homogenous coordinates (prior to the w-divide) to rasterize the triangle. This departs from what Hecker does, and seems to fit into the modern rendering paradigm a little bit better than his methods. This speed boost is also achieved with very little in the way of normal optimization as well, so there should be a good amount of room for improvement.

Just to use as a benchmark, I am testing my rasterizer speed by rendering a single triangle that covers approximately 1/3 of the framebuffer pixels and renders a bilinear sampled texture over the triangle. Before the change, I was getting about 20-25 FPS when clearing the z-buffer and backbuffer at the beginning of each frame on a 320x240 frame buffer (this is horribly slow, even for an old pentium M, but it should show the progress made with each optimization). After the change to the gradient algorithm the FPS went up to ~65. That is a big jump without even digging down to the assembly level.
Optimization Research
I have been searching the web for information on how to perform low level optimization on something like a rasterizer. I have found several very good resources that I will likely compile into a single list for distribution. So my task now is to really look into the code to see where I can optimize things and utilize these resources. Just as a teaser, when I switched to point sampling a texture instead of bilinear sampling, the frame rate went up to ~140 - so I know there is some optimization to do in the bilinear sampler!
Sign in to follow this  


1 Comment


Recommended Comments

You're killing me, Jason. Let's see some nitty gritty stuff so I don't need to look at my slow renders. [smile]



(And I'm not being facetious -- just 60fps with only triangle rasterization and z-buffering. [sad])

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now