Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2021-05-19 13:17:23 +0300
committerClément Foucault <foucault.clem@gmail.com>2021-05-19 13:17:23 +0300
commit81e3d904dbe7bf5b07658d5bf7b60a80c61ce940 (patch)
treedcd2816358842d6e1560b8d4e7fa0a1bb60396dc
parent7adb415070394707eec418f058005ebde0158eb2 (diff)
parenta294670bacb1db66ca0aad29df5752b10b8ba7fd (diff)
Merge branch 'blender-v2.93-release'
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c28
-rw-r--r--source/blender/gpu/shaders/material/gpu_shader_material_geometry.glsl5
2 files changed, 24 insertions, 9 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
index a2f35c8e575..cc79810d2a2 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@ -194,6 +194,24 @@ static bool isDisabled(GpencilModifierData *md, int UNUSED(userRenderParams))
return isModifierDisabled(md);
}
+static void add_this_collection(Collection *c,
+ const ModifierUpdateDepsgraphContext *ctx,
+ const int mode)
+{
+ FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN (c, ob, mode) {
+ if (ELEM(ob->type, OB_MESH, OB_MBALL, OB_CURVE, OB_SURF, OB_FONT)) {
+ if (ob->lineart.usage != OBJECT_LRT_EXCLUDE) {
+ DEG_add_object_relation(ctx->node, ob, DEG_OB_COMP_GEOMETRY, "Line Art Modifier");
+ DEG_add_object_relation(ctx->node, ob, DEG_OB_COMP_TRANSFORM, "Line Art Modifier");
+ }
+ }
+ if (ob->type == OB_EMPTY && (ob->transflag & OB_DUPLICOLLECTION)) {
+ add_this_collection(ob->instance_collection, ctx, mode);
+ }
+ }
+ FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_END;
+}
+
static void updateDepsgraph(GpencilModifierData *md,
const ModifierUpdateDepsgraphContext *ctx,
const int mode)
@@ -208,15 +226,7 @@ static void updateDepsgraph(GpencilModifierData *md,
ctx->node, lmd->source_object, DEG_OB_COMP_TRANSFORM, "Line Art Modifier");
}
else {
- FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN (ctx->scene->master_collection, ob, mode) {
- if (ELEM(ob->type, OB_MESH, OB_MBALL, OB_CURVE, OB_SURF, OB_FONT)) {
- if (ob->lineart.usage != OBJECT_LRT_EXCLUDE) {
- DEG_add_object_relation(ctx->node, ob, DEG_OB_COMP_GEOMETRY, "Line Art Modifier");
- DEG_add_object_relation(ctx->node, ob, DEG_OB_COMP_TRANSFORM, "Line Art Modifier");
- }
- }
- }
- FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_END;
+ add_this_collection(ctx->scene->master_collection, ctx, mode);
}
DEG_add_object_relation(
ctx->node, ctx->scene->camera, DEG_OB_COMP_TRANSFORM, "Line Art Modifier");
diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_geometry.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_geometry.glsl
index 4db27c3049d..a14ff5021bf 100644
--- a/source/blender/gpu/shaders/material/gpu_shader_material_geometry.glsl
+++ b/source/blender/gpu/shaders/material/gpu_shader_material_geometry.glsl
@@ -37,8 +37,13 @@ void node_geometry(vec3 I,
normal = (toworld * vec4(N, 0.0)).xyz;
true_normal = normal;
# endif
+
+# ifdef HAIR_SHADER
+ tangent = -hairTangent;
+# else
tangent_orco_z(orco, orco);
node_tangent(N, orco, objmat, tangent);
+# endif
parametric = vec3(barycentric, 0.0);
backfacing = (gl_FrontFacing) ? 0.0 : 1.0;