When I add more than 5 lights / setShaderAuto() with shadows enabled, then I get some sort of Cg compilation error:
I tested this both with AMD / radeon driver (Fedora Linux) and Intel / i915 driver (Fedora Linux), so this doesn’t seem to be a special hardware-specific limitation related to one of my GPUs. The shadow map size doesn’t seem to matter and setting it to something absolutely tiny doesn’t avoid this limit either: light.node().setShadowCaster(True, 64, 64)
Is this limit per design? For my game I’d need up to ~20 lights at the same time with often just a small resolution so the framerate shouldn’t take too much of a hit - but this hard limit prevents me from doing that.
For anyone who wants to try for themselves, I changed the basic.py shadows example code to add exactly 6 lights and this prompts the described error. As soon as the amount is lowered to 5, the error goes away.
basic.py (7.11 KB)