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
path: root/source
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-08-05 20:19:05 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-08-05 20:19:05 +0300
commit4140312c36f2f3a691072b1a60d0b9b05c09ac17 (patch)
treeedc6b740c65f3426481ee137834461d061ef6800 /source
parent02f553cc7a399767b0466cb92a071db885570443 (diff)
OpenSubdiv: Make sure normals passed to OSD are all up to date
Solves shading artifacts with animated characters.
Diffstat (limited to 'source')
-rw-r--r--source/blender/modifiers/intern/MOD_subsurf.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c
index 08c0df335be..c3bc5ce20c4 100644
--- a/source/blender/modifiers/intern/MOD_subsurf.c
+++ b/source/blender/modifiers/intern/MOD_subsurf.c
@@ -170,6 +170,16 @@ static DerivedMesh *applyModifierEM(ModifierData *md, Object *UNUSED(ob),
return result;
}
+static bool dependsOnNormals(ModifierData *md)
+{
+#ifdef WITH_OPENSUBDIV
+ SubsurfModifierData *smd = (SubsurfModifierData *) md;
+ if (smd->use_opensubdiv && md->next == NULL) {
+ return true;
+ }
+#endif
+ return false;
+}
ModifierTypeInfo modifierType_Subsurf = {
/* name */ "Subsurf",
@@ -196,7 +206,7 @@ ModifierTypeInfo modifierType_Subsurf = {
/* updateDepgraph */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ NULL,
- /* dependsOnNormals */ NULL,
+ /* dependsOnNormals */ dependsOnNormals,
/* foreachObjectLink */ NULL,
/* foreachIDLink */ NULL,
/* foreachTexLink */ NULL,