Help with GLSL & FBO shadowing

Hi all,

I cobbled the attached code together from various tutes around the web. The torus, plane, and spinning spheres display with something that looks like shadowing, but the shadows do not seem to match the rotation/orientation of the objects. I think the problem lies with how I am setting up the texture matrix but I can’t figure out where I’ve gone wrong.

Would some kind soul familiar with GLSL shadow mapping please take a look and point me in the right direction?

Thanks,
Brett

*bjgil2 now knows the sound of one hand clapping and has achieved a state of zen-like transendence and oneness with the universe

also, I have figured it out (except for a slight offset issue).

So how about an update of the code? ;D

Ok, here is the new code rewritten from scratch. As I said above there is an issue with the offset when objects are shadowing themselves but overall it is working. There is room for optimisation of setting rendering states, etc. but the basics are there.

The two major issues with the first code were the setup of the texture matrix, and the shader code I was using to do the shadowing.

Cheers,
Brett