Initial Grease Pencil 3.0 stage #106848
|
@ -321,6 +321,10 @@ static void grease_pencil_drawing_calculate_fill_triangles(GreasePencilDrawing &
|
||||||
for (int curve_i : curves.curves_range()) {
|
for (int curve_i : curves.curves_range()) {
|
||||||
IndexRange points = points_by_curve[curve_i];
|
IndexRange points = points_by_curve[curve_i];
|
||||||
|
|
||||||
|
if (points.size() < 3) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
int tot_verts = points.size();
|
int tot_verts = points.size();
|
||||||
int tot_tris = tot_verts - 2;
|
int tot_tris = tot_verts - 2;
|
||||||
|
|
||||||
|
|
|
@ -305,18 +305,21 @@ static void grease_pencil_batches_ensure(GreasePencil &grease_pencil, int cfra)
|
||||||
IndexRange points = points_by_curve[curve_i];
|
IndexRange points = points_by_curve[curve_i];
|
||||||
const bool is_cyclic = cyclic[curve_i];
|
const bool is_cyclic = cyclic[curve_i];
|
||||||
|
|||||||
const int v_start = v;
|
const int v_start = v;
|
||||||
const int num_triangles = points.size() - 2;
|
int num_triangles = 0;
|
||||||
|
|
||||||
/* First point is not drawn. */
|
/* First point is not drawn. */
|
||||||
verts[v].mat = -1;
|
verts[v].mat = -1;
|
||||||
v++;
|
v++;
|
||||||
|
|
||||||
for (const int tri_i : IndexRange(num_triangles)) {
|
if (points.size() > 3) {
|
||||||
uint3 tri = drawing.runtime->triangles_cache[t + tri_i];
|
num_triangles = points.size() - 2;
|
||||||
GPU_indexbuf_add_tri_verts(&ibo,
|
for (const int tri_i : IndexRange(num_triangles)) {
|
||||||
(v + tri.x) << GP_VERTEX_ID_SHIFT,
|
uint3 tri = drawing.runtime->triangles_cache[t + tri_i];
|
||||||
(v + tri.y) << GP_VERTEX_ID_SHIFT,
|
GPU_indexbuf_add_tri_verts(&ibo,
|
||||||
(v + tri.z) << GP_VERTEX_ID_SHIFT);
|
(v + tri.x) << GP_VERTEX_ID_SHIFT,
|
||||||
|
(v + tri.y) << GP_VERTEX_ID_SHIFT,
|
||||||
|
(v + tri.z) << GP_VERTEX_ID_SHIFT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const int point_i : points) {
|
for (const int point_i : points) {
|
||||||
|
|
Loading…
Reference in New Issue
Add details about TODO. Something that helps others to pick up a task, or to understand that specific case is not expected to be yet working.