Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vulkan: Volumetric fog looks incorrect for SpotLight3D with shadow enabled, depending on the camera angle #57722

Closed
Calinou opened this issue Feb 6, 2022 · 5 comments · Fixed by #73919

Comments

@Calinou
Copy link
Member

Calinou commented Feb 6, 2022

Godot version

4.0.alpha (9d1626b)

System information

Fedora 34, GeForce GTX 1080 (NVIDIA 495.46)

Issue description

Volumetric fog looks incorrect for SpotLight3D with shadow enabled, depending on the camera angle. This does not affect OmniLight3D, which looks correct after reloading the scene if shadows were enabled for the first time after enabling volumetric fog. (That issue should be reported separately, but I haven't been able to reproduce it consistently yet.)

When reaching a "broken" camera angle, very little fog albedo will be lit (if any). It flickers on and off depending on the camera angle and position.

Left (green): OmniLight3D with shadow enabled, right (red): SpotLight3D with shadow enabled

Shadows disabled

2022-02-06_20 13 03

Shadows enabled with working camera angle

2022-02-06_20 13 28

Shadows enabled with broken camera angle

2022-02-06_20 14 26

See also this video:

simplescreenrecorder-2022-02-06_20.16.15.mp4

Steps to reproduce

  • Place some MeshInstances for the light to cast a shadow.
  • Enable Shadow in the SpotLight3D.
  • Enable Volumetric Fog in the Environment resource.

Minimal reproduction project

test_volumetric_fog_point_shadows.zip

@Calinou
Copy link
Member Author

Calinou commented Sep 1, 2022

As a workaround, use a FogVolume with a Cone shape parented to the SpotLight3D node. It won't be able to have shadows though (but the light itself will still be able to cast shadows).

@SilentPenguin
Copy link

SilentPenguin commented Nov 10, 2022

I've noticed that the range of a spotlight also influences interaction with fog volumes as well as viewing angle. For a spotlight which visibly interacts with fog, extending the range reduces the visible effect of this issue, including making the artifacting easier to see at range.

image
image

The above pictures show these effects with a spotlight with a range of 2k, from two different viewing angles.

It's worth noting that even with shadows enabled, the projected effect doesn't interact with cast shadows at all.
Below is setup illustrating an omni light top and a spotlight bottom, both with range 30 and shadows enabled.

image

Hopefully these observations make it easier to locate a root cause.

@Saul2022
Copy link

Saul2022 commented Jan 24, 2023

Yea i can reproduce this issue in beta 14

Captura de pantalla 2023-01-24 180746

not sure if this pr fixes it #71832 f

@clayjohn
Copy link
Member

not sure if this pr fixes it #71832

Unfortunately #71832 does not fix this issue

@clayjohn clayjohn modified the milestones: 4.0, 4.x Feb 23, 2023
@akien-mga akien-mga modified the milestones: 4.x, 4.1 Mar 2, 2023
@akien-mga
Copy link
Member

Fixed by #73919.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants