+2 votes

Hi

I'm new to godot and i have some difficulties with shadows

enter image description here
I use a directionalLight for lighting, the textures you see on the image are sprite3d with a fixedMaterial, in the fixed material Textures of "Diffues" and "Emission" are set to the same texture as the sprite3D

Problems are :

  • the shadows don't touch the walls, incrissing the Z Offset on the directionalLight makes it worse

  • shadows ouline are blocky changing values of "Esm Multiplier" and "Blur Passes" on the directionalLight donesn't change a thing

in Engine by (24 points)
recategorized by

3 Answers

+1 vote
Best answer

I am using a single directional light with a shadow with my game. After much fiddling, the best settings I could get were by using the PSSM 4 split mode.

If you look in the project settings > Rasterizer you can select the "debug shadow maps" option which will show you in the editor/game how the shadow is being laid out. This will give you an idea of the difference between , for instance, the PSSM4 split and PSSM2 split modes.

In the project settings >Rasterizer options you can adjust the shadow map size (you may need to go up to 2048px) as well as the filter type. I am using the PCF5 filter and a 2048 map and getting quite good results for my topdown shooter. AFAIK the Esm multiplier and Blur passes only effect the shadow if you have selected the Esm filter in the project settings. They won't do anything for the PCF modes.

There is a fairly major hit to using just one shadow when using my Intel integrated card on my laptop(a HD4000), it goes from 200fps to <60fps. When using the mobile Nvidia card on the same laptop, the fps is much better and it never really goes under 60fps. The Open GL drivers on these integrated GPU's are pretty iffy, so not much you can do here. There will be a refresh to GLES3 for Godot later this year, so hopefully we get much better shadow quality and performance with it!

by (268 points)
edited by

Godot 3.0 will likely use something like Variance Shadow Mapping for rendering shadows. Of course, with filtering, anti-aliasing and possibly blurring.

Thanks, after some tweking, I now have a correct result.

0 votes

did you try changing the directional light mode?

by (576 points)

Yes, it's currently in PSSM 4 Splits mode
The others don't give a better result

+1 vote

It is well known by the developers that the 3D part of Godot has some weak points as of present (to the point where they plan on a complete rewrite of the graphics renderer).

This won't be done until version 3 though (and the next version will be 2.1). You might want to check back later this year as work begins on the new engine.

by (138 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.