Initial Grease Pencil 3.0 stage #106848

Merged
Falk David merged 224 commits from filedescriptor/blender:grease-pencil-v3 into main 2023-05-30 11:14:22 +02:00
2 changed files with 14 additions and 7 deletions
Showing only changes of commit 8ae7836a7f - Show all commits

View File

@ -321,6 +321,10 @@ static void grease_pencil_drawing_calculate_fill_triangles(GreasePencilDrawing &
for (int curve_i : curves.curves_range()) {
IndexRange points = points_by_curve[curve_i];
if (points.size() < 3) {
continue;
}
int tot_verts = points.size();
int tot_tris = tot_verts - 2;

View File

@ -305,18 +305,21 @@ static void grease_pencil_batches_ensure(GreasePencil &grease_pencil, int cfra)
IndexRange points = points_by_curve[curve_i];
const bool is_cyclic = cyclic[curve_i];

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.

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.
const int v_start = v;
const int num_triangles = points.size() - 2;
int num_triangles = 0;
/* First point is not drawn. */
verts[v].mat = -1;
v++;
for (const int tri_i : IndexRange(num_triangles)) {
uint3 tri = drawing.runtime->triangles_cache[t + tri_i];
GPU_indexbuf_add_tri_verts(&ibo,
(v + tri.x) << GP_VERTEX_ID_SHIFT,
(v + tri.y) << GP_VERTEX_ID_SHIFT,
(v + tri.z) << GP_VERTEX_ID_SHIFT);
if (points.size() > 3) {
num_triangles = points.size() - 2;
for (const int tri_i : IndexRange(num_triangles)) {
uint3 tri = drawing.runtime->triangles_cache[t + tri_i];
GPU_indexbuf_add_tri_verts(&ibo,
(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) {