Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/drawgpencil.c
| Show First 20 Lines • Show All 730 Lines • ▼ Show 20 Lines | static void gp_draw_stroke_3d(tGPDdraw *tgpw, short thickness, const float ink[4], bool cyclic) | ||||
| GPU_line_width(max_ff(curpressure * thickness, 1.0f)); | GPU_line_width(max_ff(curpressure * thickness, 1.0f)); | ||||
| immBeginAtMost(GPU_PRIM_LINE_STRIP_ADJ, totpoints + cyclic_add + 2); | immBeginAtMost(GPU_PRIM_LINE_STRIP_ADJ, totpoints + cyclic_add + 2); | ||||
| const bGPDspoint *pt = points; | const bGPDspoint *pt = points; | ||||
| for (int i = 0; i < totpoints; i++, pt++) { | for (int i = 0; i < totpoints; i++, pt++) { | ||||
| /* first point for adjacency (not drawn) */ | /* first point for adjacency (not drawn) */ | ||||
| if (i == 0) { | if (i == 0) { | ||||
| gp_set_point_varying_color(points, ink, attr_id.color); | gp_set_point_varying_color(points, ink, attr_id.color); | ||||
| if ((cyclic) && (totpoints > 2)) { | if ((cyclic) && (totpoints > 2)) { | ||||
| immAttr1f(attr_id.thickness, max_ff((points + totpoints - 1)->pressure * thickness, 1.0f)); | immAttr1f(attr_id.thickness, max_ff((points + totpoints - 1)->pressure * thickness, 1.0f)); | ||||
| mul_v3_m4v3(fpt, tgpw->diff_mat, &(points + totpoints - 1)->x); | mul_v3_m4v3(fpt, tgpw->diff_mat, &(points + totpoints - 1)->x); | ||||
| } | } | ||||
| else { | else { | ||||
| immAttr1f(attr_id.thickness, max_ff((points + 1)->pressure * thickness, 1.0f)); | immAttr1f(attr_id.thickness, max_ff((points + 1)->pressure * thickness, 1.0f)); | ||||
| mul_v3_m4v3(fpt, tgpw->diff_mat, &(points + 1)->x); | mul_v3_m4v3(fpt, tgpw->diff_mat, &(points + 1)->x); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,015 Lines • Show Last 20 Lines | |||||