PDA

View Full Version : How to make gradient-color or image background?



Kritsana
11-13-2002, 09:58 PM
How to make gradient-color or image background?
In some CAD applications, they use gradient background, such as Catia V5, Unigraphics V18. How they programmed? If some one knew please contack me via my e-mail kritsana@msn.com thenks.

StefanG
11-14-2002, 08:27 AM
This was not really an advanced question. You might have better luck looking for answers in the "beginner's" forum, but
here's a brief answer anyway:

Linear gradients are easily generated by a single polygon with different colors at each vertex. Just make the polygon fill the entire screen. If you want it as a backdrop behind everything else, and don't want to match it with the Z values in your scene, draw it with any Z value betweeen the front and back clipping planes, draw it before everything else in the scene, and switch off depth buffer writes while rendering the background.
If you want a non-linear gradient or a gradient with many transitions, you can use more polygons and more vertex colors, or you could try a 1D texture with any gradient ramp you want and map it to the backdrop polygon.


[This message has been edited by StefanG (edited 11-14-2002).]