Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/uvedit/uvedit_draw.c
| Show First 20 Lines • Show All 362 Lines • ▼ Show 20 Lines | switch (sima->dt_uv) { | ||||
| GPU_batch_uniform_1i(edges, "colors_len", 2); /* "advanced" mode */ | GPU_batch_uniform_1i(edges, "colors_len", 2); /* "advanced" mode */ | ||||
| GPU_batch_uniform_1f(edges, "dash_width", 4.0f); | GPU_batch_uniform_1f(edges, "dash_width", 4.0f); | ||||
| GPU_batch_uniform_1f(edges, "dash_factor", 0.5f); | GPU_batch_uniform_1f(edges, "dash_factor", 0.5f); | ||||
| GPU_batch_draw(edges); | GPU_batch_draw(edges); | ||||
| break; | break; | ||||
| } | } | ||||
| case SI_UVDT_BLACK: | case SI_UVDT_BLACK: | ||||
| case SI_UVDT_WHITE: { | case SI_UVDT_WHITE: { | ||||
| glProvokingVertex(GL_FIRST_VERTEX_CONVENTION); | |||||
| UI_GetThemeColor4fv(TH_WIRE_EDIT, col1); | |||||
| UI_GetThemeColor4fv(TH_EDGE_SELECT, col2); | |||||
| GPU_batch_program_set_builtin( | |||||
| edges, (interpedges) ? GPU_SHADER_2D_UV_EDGES_SMOOTH : GPU_SHADER_2D_UV_EDGES); | |||||
| GPU_depth_test(true); | |||||
| GPU_line_width(1.0f); | GPU_line_width(1.0f); | ||||
| GPU_batch_program_set_builtin(edges, GPU_SHADER_2D_UNIFORM_COLOR); | |||||
| if (sima->dt_uv == SI_UVDT_WHITE) { | if (sima->dt_uv == SI_UVDT_WHITE) { | ||||
| GPU_batch_uniform_4f(edges, "color", 1.0f, 1.0f, 1.0f, 1.0f); | GPU_batch_uniform_4f(edges, "edgeColor", 1.0f, 1.0f, 1.0f, 1.0f); | ||||
| } | } | ||||
| else { | else { | ||||
| GPU_batch_uniform_4f(edges, "color", 0.0f, 0.0f, 0.0f, 1.0f); | GPU_batch_uniform_4f(edges, "edgeColor", 0.0f, 0.0f, 0.0f, 1.0f); | ||||
| } | } | ||||
| GPU_batch_uniform_4f(edges, "selectColor", col2[0], col2[1], col2[2], 1.0f); | |||||
| GPU_batch_draw(edges); | GPU_batch_draw(edges); | ||||
| GPU_depth_test(false); | |||||
| glProvokingVertex(GL_LAST_VERTEX_CONVENTION); | |||||
| break; | break; | ||||
| } | } | ||||
| case SI_UVDT_OUTLINE: { | case SI_UVDT_OUTLINE: { | ||||
| /* We could modify the vbo's data filling | /* We could modify the vbo's data filling | ||||
| * instead of modifying the provoking vert. */ | * instead of modifying the provoking vert. */ | ||||
| glProvokingVertex(GL_FIRST_VERTEX_CONVENTION); | glProvokingVertex(GL_FIRST_VERTEX_CONVENTION); | ||||
| UI_GetThemeColor4fv(TH_WIRE_EDIT, col1); | UI_GetThemeColor4fv(TH_WIRE_EDIT, col1); | ||||
| ▲ Show 20 Lines • Show All 121 Lines • Show Last 20 Lines | |||||