PDA

View Full Version : Quad color shading



yuv
12-31-2002, 01:01 PM
hi

i want to render quad with color's in the vertex, and to use smooth shading when fill the quad.

if for example i have

1.white--------2.black
| |
| |
| |
3.black--------4.white

i will get 2 difrent results if i render
1,2,4,3
or
2,4,3,1

how can i get true smoth shading over the quad?

thanks yuv

DFrey
12-31-2002, 03:32 PM
Well, if neither of the vertex orders provide the shading you want, then you must either change the geometry, or the shading pipeline itself, i.e. don't use the standard one.

Coriolis
12-31-2002, 03:39 PM
You may be able to get the shading you want by adding a vertex in the middle of the quad that has the desired color, and then drawing four triangles.

pbrown
01-01-2003, 07:18 PM
Most graphics hardware renders quads as a pair of triangles. The specific triangulation used by a device would be implementation-dependent.

You may well get completely different images in the opposite black/white case cited above -- most scenes will not be that bad, however.

zeckensack
01-02-2003, 06:24 AM
Quads must be planar for guaranteed results. 'Planar' does not limit itself to geometry, but to all attributes (color, fog coordinate, texture coordinates, whatever).

And you quad is not planar http://www.opengl.org/discussion_boards/ubb/wink.gif