Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c
| Show First 20 Lines • Show All 211 Lines • ▼ Show 20 Lines | if (button->shape_batch[0] != NULL) { | ||||
| const bool do_wires = (i == 1); | const bool do_wires = (i == 1); | ||||
| if (do_wires) { | if (do_wires) { | ||||
| GPU_batch_program_set_builtin(button->shape_batch[i], | GPU_batch_program_set_builtin(button->shape_batch[i], | ||||
| GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR); | GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR); | ||||
| GPU_batch_uniform_2fv(button->shape_batch[i], "viewportSize", &viewport[2]); | 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); | GPU_batch_uniform_1f(button->shape_batch[i], "lineWidth", gz->line_width * U.pixelsize); | ||||
| } | } | ||||
| else { | else { | ||||
| GPU_batch_program_set_builtin(button->shape_batch[i], GPU_SHADER_2D_UNIFORM_COLOR); | GPU_batch_program_set_builtin(button->shape_batch[i], GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| } | } | ||||
| /* Invert line color for wire. */ | /* Invert line color for wire. */ | ||||
| if (draw_options & ED_GIZMO_BUTTON_SHOW_BACKDROP) { | if (draw_options & ED_GIZMO_BUTTON_SHOW_BACKDROP) { | ||||
| /* If we have a backdrop already, | /* If we have a backdrop already, | ||||
| * draw a contrasting shape over it instead of drawing it the same color. | * draw a contrasting shape over it instead of drawing it the same color. | ||||
| * Use a low value instead of 50% so some darker primary colors | * Use a low value instead of 50% so some darker primary colors | ||||
| * aren't considered being close to black. */ | * aren't considered being close to black. */ | ||||
| ▲ Show 20 Lines • Show All 206 Lines • Show Last 20 Lines | |||||