Hi Kosmonaut, thanks for the answer. I tried to remove all ifs so that it always enters the light generation, but the problem persists.
I’ve been having a look at it. I’m by not means an expert in this field, so take my message with a grain of salt ( lucky you, my blood pression is high and I can’t )
I’ve rendered the shadowmap for the first frame and subsequent frames. It is rendered differently.
First shadowmap render:
Next shadowmap render:
If you look closer, the second shadowmap shows all the balls (including the ones that are below the roof). I think for some reason the depth buffer is not working well after the first frame. It’s like it’s rendered backwards, or maybe just not using the depth information at all (like DepthStencilState.None, but I suppose the shader doesn’t use the DepthStencilState.) Or maybe it’s near-clipping the roof (but I don’t think so because of the next image)
this image is curious and probably gives some clues about the problem:
I’m hopeful I’ll be able to nail the problem tomorrow
p.s. in the screenshots I forgot to disable the point lights, so the floor level looks lighted and with shadows, but most of the light as well as all the ball shadows come from the point light.