I am trying to learn about shadows in panda, and I have a simple example setup that exhibits some strange behavior. I am sure that I have done something wrong with the DirectionalLight lens setup, but it appears that the shadows are flipped. Notice the shadow cast by the small cube on to the large cube. Here is an example:
Trying out your code on my system (with a few minor modifications, such as placing the camera at the position and orientation shown in your post), the shadows seem to be as expected, quite unlike your screenshot.
What version of Panda are you using? If you’re perhaps using a version older than 1.10.6, then perhaps it’s worth upgrading and seeing whether this is the result of some now-fixed engine-bug.
Hmm, very odd. What are you system specs, if I may ask? And would you please post the rest of your code–perhaps something there is interfering with the shadows in this way.
Very strange indeed: I quickly installed 1.11 (specifically, 1.11.0.dev1736), and I’m still not getting the anomalous behaviour that you’re seeing.
If you’re not already using the version that I just referenced, I’d suggest trying that–perhaps it’s a regression of some sort between versions.
What happens if you run the sample programs that cover shadows? Do either of those produce correct-looking shadows?
Two more thoughts:
Have you updated your video-drivers?
If I’m inferring correctly, you have both an NVidia graphics card and an Intel one; are you sure that the NVidia card is set to handle the rendering of such programs as this?
My best ideas right now remain as I posted above. I suggest the following, in no particular order:
Try Panda version 1.11.0.dev1736, if you’re not already using that specific version.
Try the shadow-casting sample-programs, and see whether they look correct.
Check whether your video drivers might perhaps be updated
Check that your NVidia card is indeed the one being applied to the program, and not your Intel one.
Two more thoughts:
Try running (an API-based–i.e. not a distributable build–version of) the program from the command-line, and see whether there’s any error output.
If you’re using the Nouveau drivers for your NVidia card, perhaps try the NVidia-sourced open-source ones. (I’m using the driver labelled “410”, I believe.)