mirror of
https://github.com/godotengine/godot.git
synced 2024-11-10 14:12:51 +00:00
Fix LCD font AA modulation in RendererRD.
This commit is contained in:
parent
42e5b3ac2d
commit
4790e12f66
@ -509,11 +509,16 @@ void RendererCanvasRenderRD::_render_item(RD::DrawListID p_draw_list, RID p_rend
|
||||
current_repeat = RenderingServer::CanvasItemTextureRepeat::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED;
|
||||
}
|
||||
|
||||
Color modulated = rect->modulate * base_color;
|
||||
if (use_linear_colors) {
|
||||
modulated = modulated.srgb_to_linear();
|
||||
}
|
||||
|
||||
//bind pipeline
|
||||
if (rect->flags & CANVAS_RECT_LCD) {
|
||||
RID pipeline = pipeline_variants->variants[light_mode][PIPELINE_VARIANT_QUAD_LCD_BLEND].get_render_pipeline(RD::INVALID_ID, p_framebuffer_format);
|
||||
RD::get_singleton()->draw_list_bind_render_pipeline(p_draw_list, pipeline);
|
||||
RD::get_singleton()->draw_list_set_blend_constants(p_draw_list, rect->modulate);
|
||||
RD::get_singleton()->draw_list_set_blend_constants(p_draw_list, modulated);
|
||||
} else {
|
||||
RID pipeline = pipeline_variants->variants[light_mode][PIPELINE_VARIANT_QUAD].get_render_pipeline(RD::INVALID_ID, p_framebuffer_format);
|
||||
RD::get_singleton()->draw_list_bind_render_pipeline(p_draw_list, pipeline);
|
||||
@ -582,11 +587,6 @@ void RendererCanvasRenderRD::_render_item(RD::DrawListID p_draw_list, RID p_rend
|
||||
push_constant.flags |= FLAGS_USE_LCD;
|
||||
}
|
||||
|
||||
Color modulated = rect->modulate * base_color;
|
||||
if (use_linear_colors) {
|
||||
modulated = modulated.srgb_to_linear();
|
||||
}
|
||||
|
||||
push_constant.modulation[0] = modulated.r;
|
||||
push_constant.modulation[1] = modulated.g;
|
||||
push_constant.modulation[2] = modulated.b;
|
||||
|
Loading…
Reference in New Issue
Block a user