I'm probably saying something you might already know Frank...You get the darkness and color of the surface below a dynamic entity like the player and change it's ambient/color based on that. Otherwise if the player steps into a shadow it'll have the same ambient, but using this code you can change it's ambient because you can read from the shadow map below the player ^^