Merge pull request #94707 from clayjohn/GLES3-linear-modulate

Remove linearization of canvas modulate in GLES3 backend
This commit is contained in:
Rémi Verschelde 2024-07-24 21:13:16 +02:00 committed by GitHub
commit d3427dcd0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;