Open hidemat opened 2 years ago
This is caused by soft shadow dithering, which is enabled by default. The fix is to set the soft shadow to Hard in the Project Settings, which will also improve performance:
Remember to also do this with the Soft Shadow Quality setting, which affects point light shadows.
We can document this caveat of soft shadow filtering in the shader reference in godot-docs (as well as the 3D Lights and shadows page).
PS: When opening the project on master
3639c27cf, this is what I see:
https://user-images.githubusercontent.com/180032/163887308-31498bc8-d524-4834-867e-d9de1eff997c.mp4
If I decrease the DirectionalLight's Shadow Max Distance property to increase shadow texel density, it looks like this:
The Shadow Max Distance property you're using in the project (100
) is likely too high. It looks even worse when the player scene is opened directly as Godot uses a Shadow Max Distance of 250 by default (at least until https://github.com/godotengine/godot/pull/49736 is merged).
agree
Godot version
Godot 4 alpha 6
System information
Windows 10 NVIDIA GeForce GTX 1050
Issue description
When creating custom lighting in a shader, the attenuation looks very grainy. I've been trying to implement a toon shader in godot 4. Everything looks good until I enable attenuation. I wish I was able to obtain a clean line on the shadow attenuation, since this is a toon shader.
I decided to report this as an issue, because it is definitely something that would deter me from using godot 4 in future projects, since I'm a big fan of cel shaders.
Without ATTENUATION:
With ATTENUATION:
This is the shader code:
Steps to reproduce
Open the minimal reproduction project and check it out.
Minimal reproduction project
First3D.zip