Per-pixel lighting
Per-pixel lighting or pixel-based lighting is a shading method that is similar to vertex-based lighting.
background
In contrast to vertex based lighting, with per-pixel lighting the lighting is not calculated and interpolated for each vertex , but a lighting value is calculated for each individual pixel. The advantage is that even if areas that are larger than the lighting area are illuminated, a realistic effect is achieved. This enables the realistic representation of extremely fine light and reflection effects such as welding gloss . The color is calculated for each of these pixels according to a lighting model .
So-called bump maps and normal maps store the surface vectors in their pixels. Since the lighting model calculates the light conditions per pixel (per pixel), additional, (in real time) shaded details can be drawn on the surface.
If the normal and lighting vectors are unit vectors , a result between 0 and 1 is obtained, which makes it easy to determine a percentage of lighting .
The process is offered by all graphics cards that support hardware shaders and from DirectX 8 . The pioneers include the ATI Radeon 8500 and the Nvidia GeForce 3 as well as all successor models. However, these per-pixel lighting effects can only be fully exploited in games with DirectX 9-compatible graphics cards, as the speed of older graphics cards restrict them too much.
A list of some engines that support per-pixel lighting:
- Cafu engine
- CryEngine ( Far Cry )
- Doom 3 engine
- Jupiter EX ( FEAR )
- Nebula2 ( Open Source )
- OGRE ( Open Source )
- Source Engine ( Half-Life 2 )
- Tenebrae (further developed Quake engine )
- Unreal Engine 3
Web links
- Article "Driving DirectX - Per-Pixel Lighting" in MSDN (English, Introduction to Per-Pixel Lighting including theory and program structures.)
- Example of an effect that can be created with per-pixel lighting. (Screenshot and source code)