Why my render gets stripy shadows when rendering in panda3d?

329 Views Asked by At

I'm using Panda3D to render .obj files for a project related to 3D printing. For the project I need to parse a GCODE (a file that 3d printers use to print a model) and generate a .obj with that file. I have successfully achieved generating the .obj/ However, when I render the .obj with a panda sightly modified example (https://docs.panda3d.org/1.10/python/more-resources/samples/shadows) I get some weird shadow stripes:

Shadow Stripes with generated obj

I guess part of the problem might be related with the obj having multiple layers:

Same obj but zoomed at the top part (generated by displacing the panda3D camera)

Any idea on how to prevent these stripes? The stripes move and are less obvious when I change the position of the camera, but I need to fix the camera at the position of the first image.

1

There are 1 best solutions below

0
On

This is called "shadow acne". In this case it happens because your model has double-sided surfaces, so parts of the inside are casting a shadow on the outside (due to imprecision of the shadow buffer). The easiest way to resolve this would be to ensure that your models aren't double-sided, but it also helps to ensure your light frustum is as small as possible and to increase the resolution and depth bits of the shadow buffer.

Alternatively, you can apply a depth offset in Panda3D to help alleviate this issue.