Skip to content

The shadow_enabled property on Light3D turns off baked shadowmasks as well #103567

@ArtyIF

Description

@ArtyIF

Tested versions

  • Reproducible in 4.4-dev7 and later
  • Not reproducible in 4.4-dev6 and earlier as those don't have shadowmasks

System information

Godot v4.4.stable - Arch Linux #1 ZEN SMP PREEMPT_DYNAMIC Thu, 27 Feb 2025 18:09:27 +0000 on Wayland - X11 display driver, Multi-window, 1 monitor - Vulkan (Forward+) - dedicated AMD Radeon RX 570 Series (RADV POLARIS10) - AMD Ryzen 5 2600 Six-Core Processor (12 threads)

Issue description

Currently, turning off the shadow_enabled property turns off the shadowmask as well. This goes against the property's documentation, which says that it only affects real-time shadows.

Image

Turning off real-time shadows while keeping shadowmasks on is useful for optimization purposes. Currently, the two ways to achieve a similar effect would be:

  • Setting the shadow resolution to lowest and the max distance to 0.1 (0.0 sets it to the camera's far plane). This doesn't give as much performance benefits as it can, since the real-time shadow texture still needs to be drawn
  • Setting the light baking mode to static. This approach (in its current implementation) disables specular lighting, which can affect the scene's look quite a lot (example from my game No Downforce):

Static light baking:

Image

Dynamic light baking with shadowmasks and real-time shadows "disabled" with the first method:
Image

Steps to reproduce

  1. Open MRP
  2. Disable shadows on DirectionalLight3D
  3. The shadowmask will be gone as well

Minimal reproduction project (MRP)

shadowmarkmrp.zip

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