Initial Grease Pencil 3.0 stage #106848
|
@ -257,6 +257,13 @@ class MaterialModule {
|
||||||
material.alignment_rot[0] = cosf(gp_style->alignment_rotation);
|
material.alignment_rot[0] = cosf(gp_style->alignment_rotation);
|
||||||
material.alignment_rot[1] = sinf(gp_style->alignment_rotation);
|
material.alignment_rot[1] = sinf(gp_style->alignment_rotation);
|
||||||
|
|
||||||
|
if (gp_style->flag & GP_MATERIAL_STROKE_SHOW) {
|
||||||
|
material.flag |= GP_SHOW_STROKE;
|
||||||
|
}
|
||||||
|
if (gp_style->flag & GP_MATERIAL_FILL_SHOW) {
|
||||||
|
material.flag |= GP_SHOW_FILL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Stroke Style */
|
/* Stroke Style */
|
||||||
if ((gp_style->stroke_style == GP_MATERIAL_STROKE_STYLE_TEXTURE) && (gp_style->sima)) {
|
if ((gp_style->stroke_style == GP_MATERIAL_STROKE_STYLE_TEXTURE) && (gp_style->sima)) {
|
||||||
material.flag |= texture_sync(
|
material.flag |= texture_sync(
|
||||||
|
|
|
@ -36,6 +36,8 @@ enum gpMaterialFlag {
|
||||||
GP_FILL_TEXTURE_CLIP = (1u << 12u),
|
GP_FILL_TEXTURE_CLIP = (1u << 12u),
|
||||||
GP_FILL_GRADIENT_USE = (1u << 13u),
|
GP_FILL_GRADIENT_USE = (1u << 13u),
|
||||||
GP_FILL_GRADIENT_RADIAL = (1u << 14u),
|
GP_FILL_GRADIENT_RADIAL = (1u << 14u),
|
||||||
|
GP_SHOW_STROKE = (1u << 15u),
|
||||||
|
GP_SHOW_FILL = (1u << 16u),
|
||||||
GP_FILL_FLAGS = (GP_FILL_TEXTURE_USE | GP_FILL_TEXTURE_PREMUL | GP_FILL_TEXTURE_CLIP |
|
GP_FILL_FLAGS = (GP_FILL_TEXTURE_USE | GP_FILL_TEXTURE_PREMUL | GP_FILL_TEXTURE_CLIP |
|
||||||
GP_FILL_GRADIENT_USE | GP_FILL_GRADIENT_RADIAL | GP_FILL_HOLDOUT),
|
GP_FILL_GRADIENT_USE | GP_FILL_GRADIENT_RADIAL | GP_FILL_HOLDOUT),
|
||||||
};
|
};
|
||||||
|
|
|
@ -178,6 +178,13 @@ vec4 gpencil_vertex(vec4 viewport_size,
|
||||||
vec4 out_ndc;
|
vec4 out_ndc;
|
||||||
|
|
||||||
if (gpencil_is_stroke_vertex()) {
|
if (gpencil_is_stroke_vertex()) {
|
||||||
|
bool show_stroke = flag_test(material_flags, GP_SHOW_STROKE);
|
||||||
|
if (!show_stroke) {
|
||||||
|
/* We set the vertex at the camera origin to generate 0 fragments. */
|
||||||
|
out_ndc = vec4(0.0, 0.0, -3e36, 0.0);
|
||||||
|
return out_ndc;
|
||||||
|
}
|
||||||
|
|
||||||
bool is_dot = flag_test(material_flags, GP_STROKE_ALIGNMENT);
|
bool is_dot = flag_test(material_flags, GP_STROKE_ALIGNMENT);
|
||||||
bool is_squares = !flag_test(material_flags, GP_STROKE_DOTS);
|
bool is_squares = !flag_test(material_flags, GP_STROKE_DOTS);
|
||||||
|
|
||||||
|
@ -329,6 +336,14 @@ vec4 gpencil_vertex(vec4 viewport_size,
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* Fill vertex. */
|
/* Fill vertex. */
|
||||||
|
|
||||||
|
bool show_fill = flag_test(material_flags, GP_SHOW_FILL);
|
||||||
|
if (!show_fill) {
|
||||||
|
/* We set the vertex at the camera origin to generate 0 fragments. */
|
||||||
|
out_ndc = vec4(0.0, 0.0, -3e36, 0.0);
|
||||||
|
return out_ndc;
|
||||||
|
}
|
||||||
|
|
||||||
out_P = transform_point(ModelMatrix, pos1.xyz);
|
out_P = transform_point(ModelMatrix, pos1.xyz);
|
||||||
out_ndc = point_world_to_ndc(out_P);
|
out_ndc = point_world_to_ndc(out_P);
|
||||||
out_uv = uv1.xy;
|
out_uv = uv1.xy;
|
||||||
|
|
Loading…
Reference in New Issue