diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-03-19 23:59:29 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-03-20 00:05:34 +0300 |
commit | eccb0b222e3465baa71430223c5ee2f0206a7b02 (patch) | |
tree | 1b8888acea69d78466a2a727aac93b3fb1ea2e8f /source/blender/draw/intern/draw_cache_impl_gpencil.c | |
parent | 36b02c3815af8f76aa9d7ce017fd00b66e8b1965 (diff) |
GPencil: Port main object shader to ShaderCreateInfo
This is quite a huge cleanup. Making use of the `common_gpencil_lib.glsl`
to share more codes and use more consistent codestyle.
The gpencil engine specifics are now out of the `gpencil_vertex()`
function making it easier to add more features.
There should be no regression as all workarounds are kept as is.
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_gpencil.c')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_gpencil.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_gpencil.c b/source/blender/draw/intern/draw_cache_impl_gpencil.c index 08c33555b71..a4465b9aed4 100644 --- a/source/blender/draw/intern/draw_cache_impl_gpencil.c +++ b/source/blender/draw/intern/draw_cache_impl_gpencil.c @@ -28,6 +28,8 @@ #include "draw_cache.h" #include "draw_cache_impl.h" +#include "../engines/gpencil/gpencil_defines.h" + #define BEZIER_HANDLE (1 << 3) #define COLOR_SHIFT 5 @@ -321,7 +323,7 @@ static void gpencil_buffer_add_point(gpStrokeVert *verts, 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. */ - vert->mat = (is_endpoint) ? -1 : (gps->mat_nr % GP_MATERIAL_BUFFER_LEN); + vert->mat = (is_endpoint) ? -1 : (gps->mat_nr % GPENCIL_MATERIAL_BUFFER_LEN); float aspect_ratio = gps->aspect_ratio[0] / max_ff(gps->aspect_ratio[1], 1e-8); |