I’ve been trying to integrate the shader-based shadows from the shadows sample program into my code [0]. With just copying that code and adapting the shader file paths, I observe strange behaviour: the light camera (LCam in code) moves with the real camera as if it was attached to it, although this never happens in code. At least thats what I’m concluding from the color map view, which is the LCam’s perspective as far as I understand the sample code. Can you tell me what is going wrong there?
I’ve put up a mostly minimal example that still sits on my code base which makes it easier to move around. If you want to run it, I can prepare a tarball.
Hey, one of the shadow examples works out of the box on my Intel GM45 now
I encountered this problem a while back - I think the fix is to make a new PerspectiveLens for the shadow camera instead of cloning the actual camera. I could be wrong, but IIRC that’s what worked for me.
http://pastebin.com/H5XieK14 and http://pastebin.com/tPAYXLXn contains the code for the fixed Tut-Shadow-Advanced.py example - I never submitted the changes (which revolved around GraphicsOutput.RTPDepth malfunctioning - it works now) to rdb, so I doubt the patches made their way into Panda.
When I get the chance, I’ll compare your code to what I wrote, and see if I can find any differences.
After fiddling a little with the camera I have … shadows. They just appear about 1 unit below the ground, getting visible when I jump over things with the vehicle. And my models are pitch black, just the GeomipTerrain is lighted more or less as expected. Very interesting. Seems like its time to learn a little Cg myself…