Topic was automatically imported from the old Question2Answer platform.
Asked By
halcaponey
Old Version
Published before Godot 3 was released.
Hi
I’m new to godot and i have some difficulties with shadows
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
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!
Godot 3.0 will likely use something like Variance Shadow Mapping for rendering shadows. Of course, with filtering, anti-aliasing and possibly blurring.
Calinou | 2016-03-04 10:20
Thanks, after some tweking, I now have a correct result.
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.