godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.56k stars 20.08k forks source link

SpotLight3D shadows don't affect Volumetric Fog #80039

Open dreadlocks-dude opened 1 year ago

dreadlocks-dude commented 1 year ago

Godot version

v4.1.1.stable.official [bd6af8e0e]

System information

Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4070 Ti (NVIDIA; 31.0.15.3667) - 13th Gen Intel(R) Core(TM) i5-13600K (20 Threads)

Issue description

SpotLight3D shadow option has no effect on FogVolume. image

Omni Light and directional light work fine: image image Also default energy of SpotLight3D affects fog light way less than other light sources, you have to set Energy to 8 or even 10 to get same brightness as Omnilight with 1

Steps to reproduce

Create FogVolume with any shape and default settings Light it with SpotLight3D, shadows on Put an occluding object in front of the light

Minimal reproduction project

SpotLight3DShadowIssue.zip

clayjohn commented 1 year ago

Can you please compare the results with 4.0.3 to see if they are the same? I remember we had a few important fixes to spotlight shadows early in 4.0.x, so I suspect something has regressed in 4.1.x

dreadlocks-dude commented 1 year ago

Can you please compare the results with 4.0.3 to see if they are the same? I remember we had a few important fixes to spotlight shadows early in 4.0.x, so I suspect something has regressed in 4.1.x

I tried 4.0.3 - Same. Both the light strength and absence of shadows.

Calinou commented 1 year ago
bitsawer commented 12 months ago

Looks like increasing the SpotLight Range fixes the shadow issue, the shadow starts to appear as the range increases. You can actually see this very, very faint SpotLight shadow in the first post picture. Might have been indirectly fixed by https://github.com/godotengine/godot/pull/73919 or something else, although I'm not sure why increasing the range helps. Maybe there is some fade calculation etc. involved and it needs some room to kick in? There might still be a bug somewhere in the calculation, but at least it looks like this works as a workaround.

spot