Omni-directional shadow mapping

Posted by gridzbi on Game Development See other posts from Game Development or by gridzbi
Published on 2012-07-04T23:02:35Z Indexed on 2012/07/05 3:23 UTC
Read the original article Hit count: 365

Filed under:
|
|
|

What is a good/the best way to fill a cube map with depth values that are going to give me the least amount of trouble with floating point imprecision?

To get up and running I'm just writing the raw depth to the buffer, as you can imagine it's pretty terrible - I need to to improve it, but I'm not sure how.

A few tutorials on directional lights divide the depth by W and store the Z/W value in the cube map - How would I perform the depth comparison in my shadow mapping step?

The nvidia article here http://http.developer.nvidia.com/GPUGems/gpugems_ch12.html appears to do something completely different and use the dot of the light vector, presumably to counter the depth precision worsening over distance? He also scales the geometry so that it fits into the range -.5 +.5 - The article looks a bit dated, though - is this technique still reasonable?

Shader code http://pastebin.com/kNBzX4xU

Screenshot http://imgur.com/54wFI

© Game Development or respective owner

Related posts about hlsl

Related posts about directx9