The OpenGL API already has functionality to share vertices between
primitives (triangles).

Also, the OpenGL spec has clear rules about how adjacent primitives
must be rendered. If they share an edge, as in the two points defining
it are identical, then every fragment along that edge must be rendered
only once between the two of them, and there may not be any gaps. This
sounds simple, but can lead to very difficult situations that are not
immediately obvious. For instance, many people believe that a very
long thin triangle should be contiguous, as in it should look
something like a line. But this is in fact quite wrong. If the long
triangle is at a steep angle, it will likely have gaps at the narrow
end where pixels in one scanline do not touch pixels in the next
scanline. Why must it have gaps? Because if it were connected, some of
those pixels would overlap the adjacent triangle, which is an error
and will produce horrible results for a highly-tesselated
high-polygon-count model.

The traditional solution is to not round vertices at all, but leave
them with sub-pixel vertices all the way up to scanline conversion.
Then, simply generate all fragments that might possibly overlap the
triangle. For each fragment, test whether the center of the fragment
is inside the triangle. For fragments that fall exactly on an edge,
include them on the top or right of the triangle, but not the bottom
or left. (This is a very gross explanation, but you get the idea.)

I hope I didn't misread your post and mouth off about the wrong thing.  :)

Kent


On Mon, 31 Jan 2005 05:52:51 +0100, Dusan Colic <[EMAIL PROTECTED]> wrote:
>    Just to note that I'm not a programer but just familiar with 3D-2D
> transformations. Also I've read source and outline you posted.
> 
> Q1: Do triangles share sides (have same edge)?  If it is true then all
> computation  with  X and Y coordinates  is doubled (minimaly). Why
> don't we round up X & Y on the start for every vertice that is shared
> between triangles (eg 100 packed triangles have 300 points but only
> approx. 100 different ones because they touch each other). Now every
> triangle is adjacent to next one and there is no progressive summing
> error. Then we calculate rounded Xd and Yd =Yb. And it's easy to check
> if Ya=Yb or Yb=Yc for already flat bottomed(top) triangles.
> Other calculations in render.c can stay the same and we make a very small 
> error.
> 
> Q2: Is adjusting of A,R,G,B,U,V,LOD,F (after rounding) necesary?
> Rounding error is about X1-X1f~1/(225) right? I gathered that they
> have to be enlarged by +0.5, but X1-X1f is so small. Oh and why color
> information has to be +0.5?
> 
> Q3: What is LOD?
> 
> Sorry if I've missed something obvious but my exams are killing me.
> 
> Best of luck with the project
> 
> Dushan
-- 
        The world before the fall
        Delightful is the light of dawn
        Noble is the heart of man...
                        -Cyan Garamonde, Final Fantasy VI
_______________________________________________
Open-graphics mailing list
[email protected]
http://lists.duskglow.com/mailman/listinfo/open-graphics
List service provided by Duskglow Consulting, LLC (www.duskglow.com)

Reply via email to