this is what I have to introduce lights/shadow mapping:
#__Lights___________________
slight = Spotlight('slight')
slight.setColor(VBase4(1, 1, 1, 1))
slight.setShadowCaster (True, 512,512)
lens = PerspectiveLens()
slight.setLens(lens)
slnp = render.attachNewNode(slight)
slnp.setPos(0, 0, 20)
slight.getLens().setFov(25)
slight.getLens().setNearFar(10,18)
slight.getLens().setFilmSize(50,50)
slnp.lookAt(0,0,0)
slight.showFrustum()
render.setLight(slnp)
alight = AmbientLight('alight')
alight.setColor(VBase4(0.2, 0.2, 0.2, 0.5))
alnp = render.attachNewNode(alight)
render.setLight(alnp)
render.setShaderAuto()
Which results in this (notice the lack of the cubes casting shadows on each other or the floor)
I’ve tried a lot of stuff, including creating dummy spotlights, using directional lights, playing with nearfar and fov
IF THE DEFAULT SHADOW MAPPING is only for shading object sides and not shadow casting, please let me know.
Also, if that is the case, I would greatly appreciate help with a shader that allowed me to keep my tiled textures. The demo program (shadowmapping-advanced) uses a shader that achieves the desired results with shadows, but stretches the texture out over the entire surface… I would fix it, but I am NOT familiar with C++ and really dont know whats going on in those .sha files at all.
[/code]