summaryrefslogtreecommitdiffstats
path: root/drivers/gles3
diff options
context:
space:
mode:
authorclayjohn <claynjohn@gmail.com>2024-07-24 10:27:25 -0700
committerclayjohn <claynjohn@gmail.com>2024-07-24 10:27:25 -0700
commit7eac9e855bbff62443862bac91da1034b8a208c3 (patch)
tree7b15c9f2b8153693f4eb5f469ca8535deadc533c /drivers/gles3
parent91eb688e178fe32f28aebfbec01137abefd75413 (diff)
downloadredot-engine-7eac9e855bbff62443862bac91da1034b8a208c3.tar.gz
Remove linearization of canvas modulate in GLES3 backend
The GLES3 renderer is always in sRGB space, even when using an HDR format
Diffstat (limited to 'drivers/gles3')
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp
index 8e9b0c2f29..941b1a1b28 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.cpp
+++ b/drivers/gles3/rasterizer_canvas_gles3.cpp
@@ -341,15 +341,10 @@ void RasterizerCanvasGLES3::canvas_render_items(RID p_to_render_target, Item *p_
normal_transform.columns[2] = Vector2();
_update_transform_2d_to_mat4(normal_transform, state_buffer.canvas_normal_transform);
- bool use_linear_colors = texture_storage->render_target_is_using_hdr(p_to_render_target);
- Color modulate = p_modulate;
- if (use_linear_colors) {
- modulate = p_modulate.srgb_to_linear();
- }
- state_buffer.canvas_modulate[0] = modulate.r;
- state_buffer.canvas_modulate[1] = modulate.g;
- state_buffer.canvas_modulate[2] = modulate.b;
- state_buffer.canvas_modulate[3] = modulate.a;
+ state_buffer.canvas_modulate[0] = p_modulate.r;
+ state_buffer.canvas_modulate[1] = p_modulate.g;
+ state_buffer.canvas_modulate[2] = p_modulate.b;
+ state_buffer.canvas_modulate[3] = p_modulate.a;
Size2 render_target_size = texture_storage->render_target_get_size(p_to_render_target);
state_buffer.screen_pixel_size[0] = 1.0 / render_target_size.x;