lights or shadows have odd lines in them

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By tproper

I’m trying to make a map that’s pretty dark, lit mostly by torches and a little bit coming from the sky.

I have an odd problem and was wondering if anyone else has had anything like this. I have lines going across the screen that move when I move and also remain there when still. I’m new to Godot and may be doing something wrong. Possibly I don’t have the right camera settings, or light settings, or shadow settings or maybe my map is just too big. I have no clue.

Here’s a picture of it. Any help would be greatly appreciated!

:bust_in_silhouette: Reply From: SIsilicon

Those lines (I’m pretty sure you meant those blocks in the shadow) are caused by insufficient shadow map size and quality. There are a couple of ways to change the way Omni lights, and other light sources, make there shadows. You can look over here for a look at this ways. But simply put it-

  1. Change the shadow map atlas size in project settings.
  2. Change the shadow filter also in project settings.
  3. Change the way Omni lights render shadows (dual-parabloid or cube-mapped).
  4. Changing the bias.

Increasing the map atlas size and changing the omni light to dual-paraboloid helped. I still have some of those lines but they aren’t from the torches, they seem to be from the skybox. Any suggestions on that? I’m also having some issues with no shadows at all from the skybox. Thanks for the quick answer!

tproper | 2018-09-25 00:50

Skyboxes don’t produce shadows. Do you mean ambient light? If so then playing around with the ambient light settings in the WorldEnvironment nose should do the trick. I don’t really know about those lines you speak of. Could you send another screenshot?

SIsilicon | 2018-09-25 01:38

I ended up changing the ambient light to be lower which means the ambient shadows aren’t really seen. Instead, I’ll be using other lighting means to light the environment. Thanks for your help!

tproper | 2018-09-25 14:15

:bust_in_silhouette: Reply From: Calinou

This is called “shadow acne” and is caused by the bias value being too low. It becomes especially noticeable if the OmniLight is close to a surface (i.e. when the light’s incidence angle is very low). There are two ways to fix it:

  • Increase the bias value. However, this may result in shadows being detached from the object casting them (“peter-panning”).
  • Enable the Reverse Cull Face property on the light’s shadow and set a negative bias value such as -0.005 or -0.01. This may result in small shadow patches displaying in otherwise lit areas, but should eliminate issues related to shadow acne and peter-panning.