Lighting artikel

Ga'ash Soffer van Voodoo Extreme heeft weer een errug techie artikel in elkaar geschroefd, ditmaal over licht effecten gebruikt in games. Hieronder heb je een gedeelte, check de rest hier.

The most common use of environment mapping to render highly reflective objects (such as mirrors). The way environment mapping works is by generating an environment map (a large sphere, or a cube surrounding the object textured with the reflections) and then mapping each pixel on the object to a point on the environment map (or blending with a pixel on the environment map for partially reflective surfaces). The simple formula most people use is

U(texture x coordinate) = Normal.x*width*0.5 + width*0.5
V(texture y coordinate) = Normal.y*height*0.5 + height*0.5

The Normal refers to the normal of the object. The width and height are dimensions of the environment map texture. This simplified method is actually not correct because the environment map is sphere and you have to convert the normal into spherical coordinates before you can access it properly. In actual practice, the approximation above is easier/faster and the difference is negligible.

Door Tweakers

Tweakers HQ

16-10-1999 • 14:05

0

Bron: Voodoo Extreme

Lees meer

Reacties

Sorteer op:

Weergave:

Er zijn nog geen reacties geplaatst

Op dit item kan niet meer gereageerd worden.