okay, I think I found the reason, the errors were not really my fault, the answers are within shadows.c in this part:

Code:
while(!level_ent) wait(1); 	// wait until the level is loaded
level_ent->flags |= SHADOW;	// enable shadow on level geometry
// calculate a minimum sun distance for placing the sun slightly outside the level
sun_angle.roll = 1.1*maxv(vec_length(level_ent->max_x),vec_length(level_ent->min_x));



1) I normally use a NULL level, initialize terrain settings when created (including set(my,SHADOW);), but run PSSM later, during test mode only. this error was caused by wrong terrain SHADOW settings, so the first lines could cause it.

2) this error emerged in case of high pssm_splitweight values, and was much worse in case of large levels. probably water entity also increased level size, and Sun distance is level size dependent. if I use a constant or as a better solution a clip_far dependent one, everything becomes fine.

I can upload a little demo if you are interested mainly because of case 2), but I think it is not essential.


Free world editor for 3D Gamestudio: MapBuilder Editor