Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-05-08 00:33:20 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-05-08 00:33:20 +0300
commitc6cda3c09cd09a283502d953f45631b9a4ca1d88 (patch)
treefba563254b80b630941509c18c26002337f631e1
parent04c04b6f4d31b92521d43020a5c8a9841397dc25 (diff)
parente6dd29ce6ebfca2a66f0d5bb103dccfa43a03774 (diff)
Merge branch 'blender-v2.83-release'
-rw-r--r--source/blender/draw/engines/overlay/overlay_wireframe.c5
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c20
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c3
3 files changed, 20 insertions, 8 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_wireframe.c b/source/blender/draw/engines/overlay/overlay_wireframe.c
index 4749bfe1d48..63a1a72c9a6 100644
--- a/source/blender/draw/engines/overlay/overlay_wireframe.c
+++ b/source/blender/draw/engines/overlay/overlay_wireframe.c
@@ -73,8 +73,9 @@ void OVERLAY_wireframe_cache_init(OVERLAY_Data *vedata)
DRWState state = DRW_STATE_FIRST_VERTEX_CONVENTION | DRW_STATE_WRITE_COLOR |
DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL;
DRWPass *pass;
- GPUTexture **depth_tx = (pd->xray_enabled || pd->xray_opacity > 0.0f) ? &txl->temp_depth_tx :
- &txl->dummy_depth_tx;
+ GPUTexture **depth_tx = ((pd->xray_enabled || pd->xray_opacity > 0.0f) && DRW_state_is_fbo()) ?
+ &txl->temp_depth_tx :
+ &txl->dummy_depth_tx;
if (xray == 0) {
DRW_PASS_CREATE(psl->wireframe_ps, state | pd->clipping_state);
diff --git a/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c
index 11b1b98ea12..04b93f35681 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c
@@ -126,6 +126,8 @@ static void button2d_draw_intern(const bContext *C,
const bool highlight)
{
ButtonGizmo2D *button = (ButtonGizmo2D *)gz;
+ float viewport[4];
+ GPU_viewport_size_get_f(viewport);
const int draw_options = RNA_enum_get(gz->ptr, "draw_options");
if (button->is_init == false) {
@@ -158,11 +160,10 @@ static void button2d_draw_intern(const bContext *C,
bool is_3d = (gz->parent_gzgroup->type->flag & WM_GIZMOGROUPTYPE_3D) != 0;
if ((select == false) && (draw_options & ED_GIZMO_BUTTON_SHOW_HELPLINE)) {
- float matrix_final_no_offset[4][4], viewport[4];
+ float matrix_final_no_offset[4][4];
WM_gizmo_calc_matrix_final_no_offset(gz, matrix_final_no_offset);
uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR);
- GPU_viewport_size_get_f(viewport);
immUniform2fv("viewportSize", &viewport[2]);
immUniform1f("lineWidth", gz->line_width * U.pixelsize);
immUniformColor4fv(color);
@@ -205,9 +206,18 @@ static void button2d_draw_intern(const bContext *C,
GPU_line_smooth(true);
GPU_polygon_smooth(false);
for (uint i = 0; i < ARRAY_SIZE(button->shape_batch) && button->shape_batch[i]; i++) {
- /* Invert line color for wire. */
- GPU_batch_program_set_builtin(button->shape_batch[i], GPU_SHADER_2D_UNIFORM_COLOR);
+ const bool do_wires = (i == 1);
+ if (do_wires) {
+ GPU_batch_program_set_builtin(button->shape_batch[i],
+ GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR);
+ GPU_batch_uniform_2fv(button->shape_batch[i], "viewportSize", &viewport[2]);
+ GPU_batch_uniform_1f(button->shape_batch[i], "lineWidth", gz->line_width * U.pixelsize);
+ }
+ else {
+ GPU_batch_program_set_builtin(button->shape_batch[i], GPU_SHADER_2D_UNIFORM_COLOR);
+ }
+ /* Invert line color for wire. */
if (draw_options & ED_GIZMO_BUTTON_SHOW_BACKDROP) {
/* If we have a backdrop already,
* draw a contrasting shape over it instead of drawing it the same color.
@@ -222,7 +232,7 @@ static void button2d_draw_intern(const bContext *C,
GPU_batch_uniform_4f(button->shape_batch[i], "color", UNPACK4(color));
}
- // GPU_batch_draw(button->shape_batch[i]);
+ GPU_batch_draw(button->shape_batch[i]);
if (draw_options & ED_GIZMO_BUTTON_SHOW_OUTLINE) {
color[0] = 1.0f - color[0];
diff --git a/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c
index 9c95f82eaf2..374b7b1f6a2 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c
@@ -106,7 +106,8 @@ static void move_geom_draw(const wmGizmo *gz,
wm_gizmo_geometryinfo_draw(&wm_gizmo_geom_data_move3d, select);
#else
const int draw_style = RNA_enum_get(gz->ptr, "draw_style");
- const bool filled = ((draw_options & (select ? (ED_GIZMO_MOVE_DRAW_FLAG_FILL |
+ const bool filled = (draw_style != ED_GIZMO_MOVE_STYLE_CROSS_2D) &&
+ ((draw_options & (select ? (ED_GIZMO_MOVE_DRAW_FLAG_FILL |
ED_GIZMO_MOVE_DRAW_FLAG_FILL_SELECT) :
ED_GIZMO_MOVE_DRAW_FLAG_FILL)));