> Hello,
>
> I've been playing for a few weeks with the WARP accelerator(s) engine of
> the G400 (3D setup + 2D raster engine) on a KGI-enabled kernel. Up to now
> I've postponed an actual drawing weirdness problem (because I had lower
> level issues to tackle first ;-) but now I'm adressing it and... well...
> I'd like to share my experiments and take advantage of the experience of
> those reading the lists because I don't really understand {what,if there}
> is the problem.
>
> My usual test program draws a few thousand random Gouraud shaded triangles
> on a 1024x768 16bpp framebuffer (5:6:5), using a 16bpp Z-buffer. Each
> triangle is defined by 3 vertices which are defined using the
> (Matrox-related) structs shown at the end of this mail. The WARP program
> (aka pipe) I use is a TGZ one, so specular, fog, and alpha color
> parameters theoretically have no effect on the drawing.
>
> Triangles get drawn correctly wrt x,y positions on the screen. However,
> The actual shading of the triangles is very "strange". I usually get a
> *striped* rainbow color-gradient on all triangles. Changing the color of
> the vertices influences the "shading", setting textures also affects the
> colors (but textures do not really show up yet). However, overall, it
> seems to me that the triangle drawing is wrong. (I expected to have a
> smooth transition on the triangle surface, not a striped result - but I'm
> not sure of what the drawing should be.)
>
> I am not very familiar with Gouraud shading, nor with the potential
> artifacts of this algorithm. (My test program more or less generates the
> vertices parameters randomly - so I guess it may really use the Gouraud
> algo. the ill way.) Initially, I thought it was a problem due to hardware
> setup (this is still a possibility and I'm pursuing efforts to check the
> driver) but well, maybe it is something else.
I have written a 3d engine with flat- and gouraud-shading, textures and
z-buffer support (all in software).
So I know exactly how such a algorithm works.
There are different ways how to do gouraud-shading:
colored-gouraud-shading and brightness-gouraud-shading.
The first one (also known as color-blending) interpolates the colors from
one edge to the others with the result of having a smooth gradient from one
color to the others.
When you have textures enabled they won't be shown unless the colors are
transparent (known as alpha color-blending).
The second one does the same with a brightness.
The colors (or texture) is shown with a higher or lower brightness from one
egde to the others.
Have a look in my 3d rendering engine at http://lib3dtk.sourceforge.net/.
If you have more questions, feel free to ask.
--
CU,
Christoph Egger
E-Mail: [EMAIL PROTECTED]
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net