Colored background with smooth transition


Does anybody know how to define a smooth transition colored background instead of a constant colored background?

By transition I mean like the one you can see in some CAD packages. You can choose any two colors, one for the top and other for the bottom and there is a transition between them presented on screen.


Draw a square to cover the screen, set color1 for the upper two vertex, and color2 for the bottom two vertex. set glShadeModel(GL_SMOOTH). that will do.

I just need to maintain this square centered in the screen with vertexes corresponding to window coordinates.


That sounds like a good idea.

Yesterday I posted some code for having a background bitmap:

It is the same thing for your effect (except that you do not texture the quad and specify one color per vertex…).