Skip to content

NaN diffuse lighting artifacts on lights with very high Attenuation values #68464

@Calinou

Description

@Calinou

Related to #65497.

Godot version

4.0.beta (282e50a)

System information

Fedora 36, AMD Radeon RX 6900 XT, KDE + KWin

Issue description

Lights with high Attenuation values result in black light appearing. This is most likely due to a NaN computation result. The black part is visible even if the light is located inside the solid surface. Here, one of the OmniLight3Ds is inside the cube, and the other one is outside on the left:

2022-11-09_23 30 16

If using the Lambert Wrap diffuse mode, the light becomes visible while the light is located inside the solid surface (this is expected):

2022-11-09_23 31 02

Changing the specular mode to Disabled does not hide this NaN issue, so the issue is in the diffuse light computation.

The issue occurs with both Vulkan Clustered and Mobile backends. However, with the Mobile backend, the issue appears differently:

image

With the OpenGL backend, a similar issue occurs, but the Attenuation value on the lights must be toned down from 70 back to 40 in the MRP for it to be visible:

image

Steps to reproduce

  • Add a OmniLight3D node with a low range and position it near a solid surface.
  • Increase the OmniLight's attenuation to a value of 40 or more.

Minimal reproduction project

test_light_attenuation.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions