Repository: godotengine/godot (language: cpp)

Issue:
LightmapGI appears too saturated with static colored lights since 4.4.beta1
### Tested versions

- Reproducible in: 4.4.beta1, 4.4.beta2
- Not reproducible in: 4.3.stable, 4.4.dev7

### System information

Godot v4.4.beta (cb460ad42) - Fedora Linux 41 (KDE Plasma) on X11 - X11 display driver, Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 (nvidia; 565.77) - 13th Gen Intel(R) Core(TM) i9-13900K (32 threads)

### Issue description

Lightmaps appear too saturated when baking colored lights that have the **Static** global illumination mode:

### 4.3.stable up to 4.4.dev7

![Image](https://github.com/user-attachments/assets/f8ec7300-2107-42e7-88b2-1ae85f3f1f90)

### 4.4.beta1 onwards

![Image](https://github.com/user-attachments/assets/8cf1fae6-1200-4368-b8c1-88da0375cf6f)

This affects both directional and non-directional lightmaps, regardless of their texture's compression mode (i.e. it's not caused by VRAM compression). Maybe a sRGB/linear conversion is missing somewhere?

I bisected the regression to cb460ad421977082fa987fcc90ac1d6b63cd0376. cc @Geometror 

### Steps to reproduce

- Bake lightmaps with colored lights that have the **Static** global illumination mode.

### Minimal reproduction project (MRP)

[test_lightmap_directional_compress.zip](https://github.com/user-attachments/files/16882023/test_lightmap_directional_compress.zip)

LightmapGI nodes are in `static.tscn` and `static_directional.tscn`.


Discussion / hints:
Changed the hundred trees MRP in order to have a reduced VRAM footprint while baking: 

[playble_terrain.zip](https://github.com/user-attachments/files/18628995/playble_terrain.zip)

There is indeed something wrong with static light colors, they are more saturated on 4.4.beta1:

| 4.3 | 4.4.dev7 | 4.4.beta1 |
|-----|----------|-----------|
| ![Image](https://github.com/user-attachments/assets/4f85fcaf-4390-4b07-9e8f-0d417ab3090d) | ![Image](https://github.com/user-attachments/assets/cb23e7e8-df69-4120-a656-882afb9fea51) | ![Image](https://github.com/user-attachments/assets/f76deeaf-b1c3-4666-824d-1ba9b5c0f84b)

Not only colors, there's also something wrong with the shadows. If I bake with Shadowmask enabled and dynamic DirectionalLight, the shadows are a way more detailed and easier to see. But with static DirectionalLight, shadows are barely noticeable and look like a blob:

| Dynamic DirectionalLight + Shadowmask | Static DirectionalLight|
|-------------------------|---------------------------------------|
| ![Image](https://github.com/user-attachments/assets/8b024b6e-0161-44e1-bd9a-b63734503216) | ![Image](https://github.com/user-attachments/assets/95fef1ac-6821-470f-95ff-6ed0b19e42d3) |

Edit: Shadow comparison with Static DirectionalLight between dev7 and beta1

| 4.4.dev7 | 4.4.beta1 |
|----------|-----------|
| ![Image](https://github.com/user-attachments/assets/6e3a1f86-a7c2-46d1-a224-c2f69bc68d3f) | ![Image](https://github.com/user-attachments/assets/9507241a-6039-469d-ba0a-bada5d6d2ebe) |

Fix patch:
diff --git a/modules/lightmapper_rd/lm_compute.glsl b/modules/lightmapper_rd/lm_compute.glsl
index ea7044c57109..9c05b42e8e72 100644
--- a/modules/lightmapper_rd/lm_compute.glsl
+++ b/modules/lightmapper_rd/lm_compute.glsl
@@ -648,7 +648,7 @@ void trace_direct_light(vec3 p_position, vec3 p_normal, uint p_light_index, bool
 	}
 
 	r_shadow = penumbra;
-	r_light = light_data.color * light_data.energy * attenuation * penumbra * penumbra_color;
+	r_light = light_data.energy * attenuation * penumbra * penumbra_color;
 }
 
 #endif


Test patch: