#610 - PeterP - Wed Jan 08, 2003 11:50 pm
A piece of advice:
It's the number of rendered pixels on the screen that determines the speed, so make sure that you keep overdraw to minimum.
I use a span buffer to get zero overdraw. Much faster than z-buffering and more exact than just sorting.
Basically:
void RenderFrame()
{
Sort triangles front-to-back.
Clear span buffer.
for each triangle:
{
scan convert the edges.
compare each horizontal line of the triangle (the span) against the currently entered spans.
If no overlap => render the span and add it to the span buffer.
If complete overlap => don't render the span
Else clip the span, render it and add to the span buffer.
}
}
/pete
It's the number of rendered pixels on the screen that determines the speed, so make sure that you keep overdraw to minimum.
I use a span buffer to get zero overdraw. Much faster than z-buffering and more exact than just sorting.
Basically:
void RenderFrame()
{
Sort triangles front-to-back.
Clear span buffer.
for each triangle:
{
scan convert the edges.
compare each horizontal line of the triangle (the span) against the currently entered spans.
If no overlap => render the span and add it to the span buffer.
If complete overlap => don't render the span
Else clip the span, render it and add to the span buffer.
}
}
/pete