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!
🎉 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!
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!
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!
Previous Entry
Reworking the rasterizer again
Next Entry
Profiling
Advertisement
Latest Entries
Wrapping up 2015, planning for 2016
2321 views
Visual Studio 2013 and Graphics Development
1897 views
Using STL Algorithms
1742 views
Microsoft's Hololens
2674 views
Data Design for Scene Graphs Pt.II
1627 views
Tune in to the Connect(); conference
1315 views
Data Design for Scene Graphs
2275 views
Using NuGet to Manage Dependencies
1686 views
Advertisement
(And I'm not being facetious -- just 60fps with only triangle rasterization and z-buffering. [sad])