Hello,
I am trying to get shadows with panda3d-simplepbr in my project but I am having issues with the result and I don’t understand what is happening.
Maybe you can help me on this!
Here are the shadows-related parts of my code:
simplepbr.init(env_map=self.get_cubemap_path(cubemap=self.config_json["defaults"]["cubemap"]),
use_occlusion_maps=True,
use_emission_maps=True,
use_normal_maps=True,
enable_shadows=True,
use_330=True)
slight = direct.showbase.ShowBase.Spotlight("ShadowLight")
slight.setAttenuation((0, 0, 0.025))
slight.set_shadow_caster(True, 1024, 1024)
slight.setColor((1, 1, 1, 1))
lens = direct.showbase.ShowBase.PerspectiveLens(170, 170)
slight.setLens(lens)
slnp = self.render.attachNewNode(slight)
slnp.setPos(0, 0, 7)
slnp.lookAt(0, 0, 0)
self.ground.set_light(light=slnp)
If I run the code above, I have the following result with glitches in the shadows:
If it helps, if I change the PerspectiveLens parameters as follows:
lens = direct.showbase.ShowBase.PerspectiveLens(180, 180)
I have no shadows, no glitches but the following warnings:
:linmath(warning): Tried to invert singular LMatrix4.
:linmath(warning): Tried to invert singular LMatrix4.
Do you know what causes these glitches and how to fix them?
I tried everything I possibly could but I don’t get what is happening.
Thanks for your help!