Hi, I am learning Panda3d and was trying to render a model with shadows. So I added a directional light, setup lens and frustum and enabled shader. However, although it created the shadows, but there are strange black circular patterns everywhere. Here is my code and a snapshot of the output
class MyApp(ShowBase):
def __init__(self):
ShowBase.__init__(self)
props = WindowProperties()
props.setTitle('Test')
self.win.requestProperties(props)
self.scene = self.loader.loadModel("Bar_1.dae")
self.scene.reparentTo(self.render)
self.scene.setScale(1.0)
self.scene.setPos(0, 0, 0)
# Adding a directional light
dLight = DirectionalLight("dLight")
dLight.setColorTemperature(10000)
dLight.setColor((1.0, 1.0, 1.0, 4))
dLight_node = self.render.attachNewNode(dLight)
dLight_node.setPos(30, 20, -5)
dLight_node.lookAt(0, 0, 0)
self.render.setLight(dLight_node)
# Setting up lens nd frustum.
dLight.getLens().setNearFar(10, 50)
dLight.getLens().setFilmSize(20, 20)
dLight.showFrustum()
dLight.setShadowCaster(True, 4096, 4096)
# Enable shader.
self.render.setShaderAuto()
app = MyApp()
app.run()
However, with render.setShaderAuto() disabled there is no such patterns but obviously no shadows. I have tried with different buffer and film sizes. But every time those patterns reappearing. I have tried the same code with an egg file (although not the same environment). In that case. no problem at all for creating shadows.
What is the reason for this.
Thanks in advance.