GPencil: Fix missing fills

For some reason stroke_id needs to be the triangle index, not the vertex
index.
This commit is contained in:
Clément Foucault
2022-10-24 21:09:40 +02:00
parent 954b834053
commit e2d06eb68a
2 changed files with 2 additions and 2 deletions

View File

@@ -536,7 +536,7 @@ static void gpencil_stroke_cache_populate(bGPDlayer *gpl,
gpencil_drawcall_add(iter, geom, vfirst, vcount);
}
iter->stroke_index_last = gps->runtime.vertex_start + gps->totpoints + 1;
iter->stroke_index_last = gps->runtime.stroke_start + gps->totpoints + 1;
}
static void gpencil_sbuffer_cache_populate_fast(GPENCIL_Data *vedata, gpIterPopulateData *iter)

View File

@@ -319,7 +319,7 @@ static void gpencil_buffer_add_point(GPUIndexBufBuilder *ibo,
vert->strength = (round_cap0) ? pt->strength : -pt->strength;
vert->u_stroke = pt->uv_fac;
vert->stroke_id = gps->runtime.vertex_start;
vert->stroke_id = gps->runtime.stroke_start;
vert->point_id = v;
vert->thickness = max_ff(0.0f, gps->thickness * pt->pressure) * (round_cap1 ? 1.0f : -1.0f);
/* Tag endpoint material to -1 so they get discarded by vertex shader. */