godotengine / godot

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

OmniLight3D Won't Cast Shadows Past a Distance of ~171 Units #96361

Open The-Raphie opened 2 months ago

The-Raphie commented 2 months ago

Tested versions

System information

Godot v4.3.stable - EndeavourOS #1 SMP PREEMPT_DYNAMIC Thu, 15 Aug 2024 00:25:30 +0000 - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1660 Ti (nvidia; 555.58.02) - Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz (12 Threads)

Issue description

When casting a shadow with an OmniLight3D with a distance more than ~171 units from the object being casted on, and an omni_attenuation of 0, the shadow becomes too unclear to the point of it not being able to be seen. With an omni_attenuation greater than 0, the shadow becomes unclear with an even shorter distance from the object. image

Steps to reproduce

  1. Create a 3D scene.
  2. Add a MeshInstance3D node as a child of root with its mesh being a PlaneMesh.
  3. Add another MeshInstance3D node as a child of root with its position being (0,1,0), and its mesh being a BoxMesh.
  4. Add an OmniLight3D node as a child of root with its omni_range being 300, its omni_attenuation being 0, its position being (0,171,0), and its shadow_enabled property toggled on.
  5. Toggle off preview sunlight in the scene.

Minimal reproduction project (MRP)

godot-issue.zip

passivestar commented 2 months ago

Related: https://github.com/godotengine/godot/issues/92551

The-Raphie commented 2 months ago

Which version should this bug be patched by?

AThousandShips commented 2 months ago

We don't know what's wrong yet and haven't identified a solution so we don't know yet

The-Raphie commented 1 month ago

Wait, could it have anything to do with the limited size of shadow maps? If so, what could be possible solution without having to crank up rendering/lights_and_shadows/positional_shadow/atlas_size to a crazy high amount?