Skip to content

Commit 0400b70

Browse files
committed
Merge pull request #111577 from Kaleb-Reid/fix-lightmap-luminance
Apply luminance multiplier in copy_cubemap_to_panorama
2 parents 9cdf3ff + 8173f43 commit 0400b70

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

servers/rendering/renderer_rd/effects/copy_effects.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,8 @@ void CopyEffects::copy_cubemap_to_panorama(RID p_source_cube, RID p_dest_panoram
412412
copy.push_constant.target[1] = 0;
413413
copy.push_constant.camera_z_far = p_lod;
414414

415+
copy.push_constant.luminance_multiplier = prefer_raster_effects ? 2.0 : 1.0;
416+
415417
// setup our uniforms
416418
RID default_sampler = material_storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
417419

servers/rendering/renderer_rd/effects/copy_effects.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class CopyEffects {
139139
int32_t section[4];
140140
int32_t target[2];
141141
uint32_t flags;
142-
uint32_t pad;
142+
float luminance_multiplier;
143143
// Glow.
144144
float glow_strength;
145145
float glow_bloom;

servers/rendering/renderer_rd/shaders/effects/copy.glsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ layout(push_constant, std430) uniform Params {
2020
ivec4 section;
2121
ivec2 target;
2222
uint flags;
23-
uint pad;
23+
float luminance_multiplier;
2424
// Glow.
2525
float glow_strength;
2626
float glow_bloom;
@@ -276,7 +276,7 @@ void main() {
276276
#else
277277
vec4 color = textureLod(source_color, vec4(normal, params.camera_z_far), 0.0); //the biggest the lod the least the acne
278278
#endif
279-
imageStore(dest_buffer, pos + params.target, color);
279+
imageStore(dest_buffer, pos + params.target, color * params.luminance_multiplier);
280280
#endif // defined(MODE_CUBEMAP_TO_PANORAMA) || defined(MODE_CUBEMAP_ARRAY_TO_PANORAMA)
281281

282282
#ifdef MODE_SET_COLOR

0 commit comments

Comments
 (0)