🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Progress

Published May 30, 2007
Advertisement
Performance UpdateIt'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 ResearchI 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!
Next Entry Profiling
0 likes 1 comments

Comments

HopeDagger
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])
May 30, 2007 08:14 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement