Jump to content


What rendering technique is better?


2 replies to this topic

#1 Nick32

    New Member

  • Members
  • Pip
  • 4 posts

Posted 28 January 2009 - 08:07 PM

Hi!
I'm starting to develop my rendering engine using SDL.
I want to draw some complicated geometric shapes. I think approximation it with polygons is a right way. But how to render polygons effectively and with anti-aliasing?
As I see there are to ways: split polygon to triangles and render them or use more complex algorithms which can render polygons with holes and self-intersecting polygons. It is interesting to know what way better(faster, simpler to implement) and what algorithms exists?

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 4782 posts
  • LocationBellevue, WA

Posted 28 January 2009 - 09:04 PM

Are you aiming to build a software rasterizer, or use the GPU via OpenGL? Because if you're rasterizing on a GPU, you have no choice but to use triangles, because that's all they handle. Also, modern GPUs can antialias edges as well, via a feature called multisampling.

If you're building a software rasterizer you can do whatever you want - but it still makes a lot of sense to triangulate everything. The rasterization logic can be much simpler and faster. There is plenty of code out there for triangulating complex polygons, for instance this.
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 Nick32

    New Member

  • Members
  • Pip
  • 4 posts

Posted 29 January 2009 - 07:43 AM

Thank you for interesting reference. I'm going to build software rasterizer, which will not use GPU. I have implemented algorithm of triangle rasterization with anti-aliasing. This algorithm calculate coverage of pixel. I think it is similar to multisamling. Do you know how GPUs rasterize adjacent triangles? In my rasterizer there are two issues:
The first - I have to keep in memory two copies of vertexes and calculate twice slopes of edges.
Second - two adjacent edges are rasterized with anti-aliasing. It seems not effective and sometime I see bars on adjacent edges





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users