From 15dda0115c783805753119984decb4d9249b1f01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Mon, 22 Jun 2020 19:57:53 +0200 Subject: UI: Widget: Replace geometry by fragment shader drawing This means all the antiailasing is done inside the fragment shader. We use a Signed Distance Field to draw the 2D rounded boxes. This ensure the best quality for AA. This reduce the averge Batch for widget to 16 verts instead of ~600 and reduce overshading a lot. Theme Emboss alpha and tria alpha needs to be changed after this refactor. The shadow drawing is left unchanged and still use geometry. Reviewed By: Severin Differential Revision: https://developer.blender.org/D7833 --- source/blender/editors/interface/interface_intern.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/interface/interface_intern.h') diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 6cd990ec2b0..fac78808a9a 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -848,6 +848,8 @@ typedef struct uiWidgetBaseParameters { * The absolute value itself is the discard factor. * Initialize value to 1.0.f if you don't want discard */ float alpha_discard; + float tria_type; + float _pad[3]; } uiWidgetBaseParameters; enum { @@ -861,8 +863,7 @@ enum { ROUNDBOX_TRIA_MAX, /* don't use */ }; -struct GPUBatch *ui_batch_roundbox_get(bool filled, bool antialiased); -struct GPUBatch *ui_batch_roundbox_widget_get(int tria); +struct GPUBatch *ui_batch_roundbox_widget_get(void); struct GPUBatch *ui_batch_roundbox_shadow_get(void); void ui_draw_anti_tria_rect(const rctf *rect, char dir, const float color[4]); -- cgit v1.2.3