Spotlight artifacts help

Hello, this is my first time asking for help here. Please look at pic related regarding my issue.


I think it is self explanatory.
Basically I am using a spotlight and getting weird artifacts for some reason.
The code I used is this:
self.slight = globs.gPlayerObj.node.attachNewNode(Spotlight(“slight”))
self.slight.setColor(VBase4(1,1,1,1))
self.slight.node().setLens(PerspectiveLens())
self.slight.node().showFrustum()
self.slight.setPos(10,10,30)
self.slight.node().setShadowCaster(True)
self.slight.node().getLens().setNearFar(20, 100)
# self.slight.node().getLens().setFilmSize(200)
self.slight.node().getLens().setFov(40)
self.slight.node().setScene(self.render)
self.slight.lookAt(globs.gPlayerObj.node)
self.render.setLight(self.slight)

Any help on this would be appreciated.
I also do self.render.setShaderAuto() later down in the script. I am not sure what I am doing wrong here. The spotlight moves with the character.

Hi! We’ve actually seen you before in 2014, but welcome back! :slight_smile:

Is your geometry single-sided or double-sided? I suspect that the floor has double-sided polygons, which can cause such self-shadowing issues.

Yes those polygons are two sided.
Also I don’t remember posting in 2014 but this engine was in my sight for a long time.
Edit: I’d like to add that adding self.level.setDepthOffset(1) disables shadow casting on my polygons. self.level is the variable holding the model