1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Fix lightmap dynamic objects with physical lights

This commit is contained in:
Juan Manuel Costello
2025-07-17 20:58:03 -03:00
parent f92f1ce9c0
commit 5dc25db6da
3 changed files with 3 additions and 3 deletions

View File

@@ -2104,7 +2104,7 @@ void main() {
c3 * lightmap_captures[6].rgb * (3.0 * wnormal.z * wnormal.z - 1.0) + c3 * lightmap_captures[6].rgb * (3.0 * wnormal.z * wnormal.z - 1.0) +
c2 * lightmap_captures[7].rgb * wnormal.x * wnormal.z + c2 * lightmap_captures[7].rgb * wnormal.x * wnormal.z +
c4 * lightmap_captures[8].rgb * (wnormal.x * wnormal.x - wnormal.y * wnormal.y)) * c4 * lightmap_captures[8].rgb * (wnormal.x * wnormal.x - wnormal.y * wnormal.y)) *
scene_data.emissive_exposure_normalization; scene_data.IBL_exposure_normalization;
} }
#else #else
#ifdef USE_LIGHTMAP #ifdef USE_LIGHTMAP

View File

@@ -1719,7 +1719,7 @@ void fragment_shader(in SceneData scene_data) {
c[3] * lightmap_captures.data[index].sh[6].rgb * (3.0 * wnormal.z * wnormal.z - 1.0) + c[3] * lightmap_captures.data[index].sh[6].rgb * (3.0 * wnormal.z * wnormal.z - 1.0) +
c[2] * lightmap_captures.data[index].sh[7].rgb * wnormal.x * wnormal.z + c[2] * lightmap_captures.data[index].sh[7].rgb * wnormal.x * wnormal.z +
c[4] * lightmap_captures.data[index].sh[8].rgb * (wnormal.x * wnormal.x - wnormal.y * wnormal.y)) * c[4] * lightmap_captures.data[index].sh[8].rgb * (wnormal.x * wnormal.x - wnormal.y * wnormal.y)) *
scene_data.emissive_exposure_normalization; scene_data.IBL_exposure_normalization;
} else if (bool(instances.data[instance_index].flags & INSTANCE_FLAGS_USE_LIGHTMAP)) { // has actual lightmap } else if (bool(instances.data[instance_index].flags & INSTANCE_FLAGS_USE_LIGHTMAP)) { // has actual lightmap
bool uses_sh = bool(instances.data[instance_index].flags & INSTANCE_FLAGS_USE_SH_LIGHTMAP); bool uses_sh = bool(instances.data[instance_index].flags & INSTANCE_FLAGS_USE_SH_LIGHTMAP);

View File

@@ -1628,7 +1628,7 @@ void main() {
half(0.429043) // l2p2 sqrt(15.0/(16.0*PI))* PI*1.0/4.0 half(0.429043) // l2p2 sqrt(15.0/(16.0*PI))* PI*1.0/4.0
); );
half norm = half(scene_data.emissive_exposure_normalization); half norm = half(scene_data.IBL_exposure_normalization);
ambient_light += c[0] * hvec3(lightmap_captures.data[index].sh[0].rgb) * norm; ambient_light += c[0] * hvec3(lightmap_captures.data[index].sh[0].rgb) * norm;
ambient_light += c[1] * hvec3(lightmap_captures.data[index].sh[1].rgb) * wnormal.y * norm; ambient_light += c[1] * hvec3(lightmap_captures.data[index].sh[1].rgb) * wnormal.y * norm;
ambient_light += c[1] * hvec3(lightmap_captures.data[index].sh[2].rgb) * wnormal.z * norm; ambient_light += c[1] * hvec3(lightmap_captures.data[index].sh[2].rgb) * wnormal.z * norm;