From the images of the shadow maps, it appears you have clamped the near and far planes to encompass exactly the range from the top of the highest branch to the bottom of the trunk (the tree takes the full depth range).
If you will notice, the shadow itself seems to cover exactly half of that range over the tree.
This is likely because depth values in OpenGL cover the range from -1 to 1 rather than from 0 to 1 like in Direct3D.
Since your image of the shadow map isn’t clipping off negative values, it means either you are only using the 0-to-1 range inside the shadow map or that you have accounted for this upon displaying of the shadow map.
How are you writing depth values?
If you are manually calculating depth values to write into the shadow map, stretch them over the [-1,1] range.
Otherwise you have a problem with the bias matrix, which should have its Z scale halved and the Z offset increased by an additional 0.5f.
Since the the values closer to 1 are being used progressively more correctly starting at half the range of the shadow, I would assume the problem is in how the depth values are being written. Writing to only the [0,1] range would have such a result, whereas improperly biasing would have the opposite result (shadows would start more correct near the top of the tree and then at the mid-way point everything would become black, non-shadowed, or stretch-shadowed (depending on how you handle Z >= 1.0f in the shader).
Edited by L. Spiro, 07 October 2014 - 08:09 PM.
It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums