|
||
|
main screenshots download Requirements: Windows, Linux, or OSX ATI Radeon 9500 or above GeForce FX series or above Jeff Russell Andres Reinot |
This is a cloud demo written by Jeff Russell and Andres Reinot. It renders translucent clouds as sprites in openGL with ARB vertex and fragment programs. Each sprite has a normal map and a transmissivity map. The sprites are sorted and alpha blended. The complete lighting equation involves doing a diffuse calculation with the surface of the cloud defined by a normalmap. Added to the diffuse term is the illumination of the light transmitted through the cloud from any light sources behind it. This is approximated by the dot product of the eye and light vectors, and modulated by the transmissivity map of the sprite. Illum = Transmissivity * ( -Eye . Light ) + diffuse The diffuse term is calculated from a normal map in the standard per-pixel method. Wrap lighting is used for the transmissive term, which maps the values generated by the dot product from the range [-1,1] to [0,1]. This results in the hilight "wrapping" around edges to emulate subsurface scattering and keep the cloud looking good when the light is at a 90 degree angle to the eye. So the final equation with the scale and bias for the warp lighting ends up as: Illum = Transmissivity * ( ( -Eye . Light ) * 0.5 + 0.5 ) + diffuse |
|
|
copyright 2004-2005 (c) Jeff Russell & Andres Reinot |
||