shadow map artefacts based on camera pos

I’m doing shadow maps and I get the same artefacts as valoh as he showed in this screen shot http://www.krautgames.de/valoh/opengl/shadow.jpg

I can’t link to a screen shot, but it looks very similar. I have a roof of a house with the sun on one side. The side facing away from the sun has the artefacts (imagine it is the left side of the ‘A’ with the o as the sun)

   o

A

I’m rendering only back facing polygons to the depth buffer and the artefacts go away as I pull the camera further away from my house. I’ve tried tweaking the offset and bias a lot, but no matter what I do I can’t get rid of them.

As the camera moves closer the artefacts “climb” up the slope from the bottom until they almost reach the top.

What am I doing wrong?

The o was supposed to be on the right of the A
____o
A

But the spaces got trimmed…

Opps. It was a scaling problem. I had code to in there to scale my objects if needed and I found I hadn’t removed all of it.