Hi I have, once again, a problem using PSSM shadows.

http://www.youtube.com/watch?v=Cg_BhmDJGE0

The shadows are flickering, popping up and changing colors from "normal" to completely black.

Any idea if this is just an implementation problem or (hopefully) my fault?

This is my code:
Code:
void activatePSSM() {
	if (d3d_shaderversion >= 3) {
		//	pssm_run(0);
		shadow_stencil = 8;	
		shadow_lod = 2;
		camera.clip_far = 10000;
		camera.clip_near = 30;
		pssm_fbias = 0.0005;
		pssm_run(4);
		d3d_near_models = 0.5;		
	} else {
		printf("Ihre Grafikkarte unterstützt Shader Model 3 nicht!");
	}
}