Here is a list of good books that all graphics programmer’s should read. They are a little dated now, but FREE!
Shadow mapping works in that it checks if a point is visible from the light or not. If a point is visible from the light then it’s obviously not in shadow, otherwise it is. The basic shadow mapping algorithm can be described as short as this:
- Render the scene from the lights view and store the depths as shadow map
- Render the scene from the camera and compare the depths, if the current fragments depth is greater than the shadow depth then the fragment is in shadow
It’s the implementation of it that is hard.
The two big problem areas with shadow mapping:
- Hard to select an appropriate bias (epsilon)
- Hard to get rid of artifacts at shadow edges
Projective texturing ( the method used to transform the fragment depth to the light space (where the shadow map is) for comparision)
OpenGL fixed-function pipeline implementation of shadow mapping:
A GLSL implementation of shadow mapping (in one of the posts)
Another GLSL shadow mapping shader:
DirectX9 shadow mapping example with source
Nvidias implementation of shadow mapping with source for both OpenGL and DirectX.
Instancing is a new way to offload the CPU from some work when rendering many copies of the same geometry. It does it by reducing the overhead of drawing multiple copies of the same vertex buffer.
In OpenGL it’s only fast to use instancing when the instanced mesh consists of very few triangles.
Nvidias instancing demo, here with 136499 meshes rendered at once with 24 triangles per mesh. It runs at 20 fps stable on a GeForce 8800 GTS. (left image is all objects viewed from far away, right is zoomed in)
A image from Microsofts DirectX10 instancing demo
Some test made that shows when to use instancing and when not
HLSL instancing (therefore DirectX)
Nvidias DirectX10 implementation of instancing
Microsofts DirectX9 instancing sample
Microsofts DirectX10 instancing sample
An OpenGL implementation of a pseduo-instancing (recommended for old hardware).
Tangent space is (when speaking of rendering) the space built up by the vertex normal and the vertex texture coordinates often called (u,v). This space is useful when dealing with textures with information in tangent space, for example a normal map.
The tangent space matrix can be separated in three vectors:
- The normal vector
- The tangent vector
- The bitangent vector
A detailed description of how to create the tangent vector from the u,v coordinates. (including source code)
More information about tangent Space (and an OpenGL implementation):