Skip to content

Commit 8173f43

Browse files
committed
Apply luminance multiplier in copy_cubemap_to_panorama
1 parent cb7cd81 commit 8173f43

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
@@ -401,6 +401,8 @@ void CopyEffects::copy_cubemap_to_panorama(RID p_source_cube, RID p_dest_panoram
401401
copy.push_constant.target[1] = 0;
402402
copy.push_constant.camera_z_far = p_lod;
403403

404+
copy.push_constant.luminance_multiplier = prefer_raster_effects ? 2.0 : 1.0;
405+
404406
// setup our uniforms
405407
RID default_sampler = material_storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED);
406408

servers/rendering/renderer_rd/effects/copy_effects.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class CopyEffects {
138138
int32_t section[4];
139139
int32_t target[2];
140140
uint32_t flags;
141-
uint32_t pad;
141+
float luminance_multiplier;
142142
// Glow.
143143
float glow_strength;
144144
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)