Hi,
I try to add shadows and to achieve this I do the following:
render.setShaderAuto()
…
directionalLight = DirectionalLight(‘directionalLight’)
directionalLight.setColor(VBase4(0.8, 0.8, 0.8, 1))
directionalLight.setShadowCaster(True, 512, 512)
directionalLight.getLens().setNearFar(50,400)
directionalLight.showFrustum();
directionalLightNP = render.attachNewNode(directionalLight)
directionalLightNP.setHpr(0, -60, 0)
render.setLight(directionalLightNP)
But there are no shadows to be seen and I get the following error:
:gobj(error): Shader encountered an error.
:gobj(error): created-shader: Invalid type for a k-parameter (uniform in unknown k_dlighttex0)
This is caused by the directionalLight.setShadowCaster(True, 512, 512) statement. (The error disappears when I leave this out).
I know this has been mentioned before in this forum and in these cases this was sometimes linked to the version of Panda. But I tested it with versions 1-7-0, 1-7-1 and 1-7-2, and in all cases the error was the same. I also tested if it was linked to something in my database and models. But it also occurs if I use, for example, models/environment.egg which is part of the panda distribution.
Could it be related to my graphics board ? I use an Nvidia GeForce 7900 GT.