I’m writing a simple application to play with shadow maps in OpenGL, but I’m getting shadows that are much lighter and sharper than I expect (and what I get on another system).
I’ve thrown up a couple of images to show what I’m getting and what I expect, as well as the shader: http://glosx.blogspot.com/
Section 13.2.3 of the orangebook says that I should expect a binary 0 or 1 value back from shadow2DProj, but that’s not what I’m seeing. When I run the same code on another machine, I get exactly what I expect. The other machine has an older GPU, so I could reasonably believe that the sharper edges are the result of the newer machine doing some PCF for me when it samples the shadow map. That doesn’t directly explain why the shadows are so light though. I have considered that perhaps my shadow matrix is incorrect, but shadows are generally where they should be… If anyone has any thoughts as to where I’ve goofed, I’d appreciate it.