Why do my shadows look so jagged?

Godot Version

v4.4.stable.official [4c311cbee]

Question

just started learning Godot, making a test game (following a guide by Brackeys) and i noticed increasing the size of an OmniLight3D causes the shadows to look all jagged:

is there a way to fix this (to get soft shadows)?

im guessing the solution is super obvious but i started a week ago and i tried playing with every slider and switch - to no avail.
any help is appreciated and thank you in advance!! <3

You can try adjusting the parameters for Directional Shadow and Positional Shadow in Project Settings > General > Rendering > Light and Shadows. However, be careful - overly complex shadows can negatively impact performance.

1 Like

thank you so much for the answer!!

already played around with all the settings there, the jaggedness is still there (aka the shadows aren’t uniformly soft).

Yes, increasing the Light3D.light_size will affect the blur of the shadow borders as it tries to simulate area lights. You generally don’t want to modify this property.

godot uses dither on shadows for performance. if you want smooth shadows you need to bake them using a lightmapGI, and then they will be static.

but. you only want to increase size slightly, shadows should still be hard near the light source and get softer with distance.
as for solutions, the only solution is to use a form of upscaling. dithering works on a pixel size, so upscaling will make the pixels smaller, thus bluring them, while downscaling will blur the final image, also making them disappear. unreal uses a form of upscaling by default, called nano.
upscaling is the more expensive option while downscaling will make the game run faster.

so if i understand you correctly:

  • using LightmapGI will give me soft shadows, but these are baked - static
  • to get dynamic shadows that react to objects moving around in a scene i have to use one of the three Light3D nodes, however those shadows will not be soft (unless i dont increase their size, but that only gives sharp shadows)
  • the only way to get soft dynamic shadows in Godot is to use upscaling

pause.
after writing all of that out - am i basically asking how to get RTX in Godot? or is my question actually reasonable? (this is my first ever experience with game development so i am incredibly grateful for your patience and explanations)

yes.

I mean, godot does the dithering, but other games have used buffer shadows without dithering. maybe there’s a way to do it or it could be added in a later version.

looking at some github issues and PR, apparently the shadow dither can be improved by enabling TAA in project settings.
TAA works best with high frame rate.

optionally, using FXAA or FSR can also help.

another option is to increase the shadow filter quality in project settings for omnilights, but it is heavier.

that I can think of right now. maybe something can be done with a form of GI.
I’ve created real-time dynamic shadows through a VoxelGI, setting a meshinstance3D to dynamic. it creates oddly blob shadows but they are soft. it is however not very good on performance, so must be limited to few objects. it is also limited by size, the bigger the map, the bigger the VoxelGI, and the lower the quality.
we could also wait for HDDAGI or try SDFGI, but the quality is also kinda bad.

we could also try SSR and SSIL, these are much cheaper and can create some soft shadows, but do not interact with lights directly.

there’s also SSAO, this will give you dark spots.

all rendering systems have their advantages and disadvantages. RTX too, it has good quality but you need a powerful PC.
it depends on the scene and what you need it for, sometimes we make “sacrifices” because a detail is not important, other times we can fake it for the final look, like with a light cookie. and other times we can force the engine to render something at max quality, if it’s something really important.

don’t worry about asking questions, we’ve all been there, you have to start from somewhere.

oh my god i figured it out. i feel very dumb.
to sum up, i had my gut telling me something was off, but i was looking for the wrong solution to the wrong problem.

  1. SSAO is absolutely it. i didnt need softer shadows, i needed the shadowed space to not feel as contrasting. which means that it turns out:
  2. what i was really looking for was the bias slider in the shadows tab. i do not know how i missed it the first time.

i am incredibly grateful for everybodys answers, especially yours @jesusemora. it helped me stumble onto the actual problem i was trying to solve. and your answers will surely prove instrumental to solving questions i just know ill get once i start my big dream project of a game.

thank you again so so so much <3

1 Like