Skip to content

Fog not being affected by light projector #77384

Description

@Arulek

Godot version

4.0.3 (steam version)

System information

Windows 10, Ryzen 3600x, Nvidia 3080 ti, Vulkan Forward+

Issue description

I have a light with a image texture (godot icon) pointing to a wall with a volumetric fog, and the fog isn't being affected by the projector image, doesn't change color or shape
imagen

Expected Behavior:
the fog should be taking the colors of the image and being affected more in the clear parts of the image, as in a foggy movie theater

Steps to reproduce

  1. add a SpotLight3D
  2. add a MeshInstance whit a BoxMesh as a wall
  3. drag the icon.svg to the projector property of the SpotLight3D
  4. point the light at the wall
  5. add an environment
  6. active volumetric fog in the environment and set density to 0
  7. add a FogVolume to the scene covering the ligth and the wall with density 0.1

Minimal reproduction project

Lights2.zip

Activity

  1. Calinou commented on May 23, 2023

    @Calinou
    Member
  2. HaSa1002 commented on Sep 10, 2024

    @HaSa1002
    Contributor

    Bumping this with less emphasis on the colour and more on the shape issue. Without the shape support you cannot really use the light projection feature with fog.
    Also valid in Godot 4.3

  3. RachelfTech commented on Sep 6, 2025

    @RachelfTech

    I addressed this issue for my recent video on procedural stained glass.

    You can see the engine changes I made to enable this here

    Image Image

    It works for both spotlights and omni lights. Since I'm not very familiar with the engine code, I wanted to check to see if this is something that would be desired as a PR and if there are any other things that would need to be addressed first.

    The logic for this is mostly copied from where projectors are handled in scene_forward_lights_inc.glsl.

    One thing I'm unsure of is if the sc_projector_use_mipmaps() check and related code would be relevant for the volumetric_fog_process.glsl version or not.

  4. Calinou commented on Dec 21, 2025

    @Calinou
    Member

    @RachelfTech I missed the above comment earlier, so I figure I'd reply now (sorry for the delay).

    There is an area light PR that supports volumetric fog, but it would still make sense to support this for other light types.

    There's a pull request that implements volumetric fog projectors for all light types, including DirectionalLight3D as it depends on another PR that implements projectors in DirectionalLight3D.

    Note that we are currently in feature freeze for 4.6, so feature PR reviews are going to take more time until 4.6.stable is released.

    One thing I'm unsure of is if the sc_projector_use_mipmaps() check and related code would be relevant for the volumetric_fog_process.glsl version or not.

    I'm not sure. While it would be more optimal1, implementing SCs in the volumetric fog shader would also increase codebase complexity. #106294 doesn't use specialization constants for the volumetric fog part either (only the directional light projectors in the standard lighting shader).

    Footnotes

    1. Specialization constants make it so the excluded part is completely ignored by the GPU, and not just skipped over. ↩

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions