diff options
author | Luca Rood <dev@lucarood.com> | 2017-07-10 15:43:57 +0300 |
---|---|---|
committer | Luca Rood <dev@lucarood.com> | 2017-07-10 15:43:57 +0300 |
commit | 45897f12f8c35a455d5a33dbb9a8c0589d04e8b9 (patch) | |
tree | 13161449b27a4df1c0f9a71b3739123921fa8a37 /source/blender/blenkernel | |
parent | d33cacf7e46deb12713e058fff4c1096f8113469 (diff) |
Fix T51931: VBO not updating when UVs are added to shader node tree
UVs need specific data in the VBO, which is not computed unless the
shaders assigned to the mesh actually use UVs. When adding UVs to the
shader, the VBOs were not being recomputed to include the required data.
This adds a DEG relation between the shader and the mesh, and recomputes
the required data if the shader changed.
Thanks Sergey, for all the DEG stuff...
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_mesh.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_object.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object_update.c | 8 |
3 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index cba0927d0f8..e6893dca928 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -406,6 +406,7 @@ enum { BKE_MESH_BATCH_DIRTY_ALL = 0, BKE_MESH_BATCH_DIRTY_SELECT, BKE_MESH_BATCH_DIRTY_NOCHECK, + BKE_MESH_BATCH_DIRTY_SHADING, }; void BKE_mesh_batch_cache_dirty(struct Mesh *me, int mode); void BKE_mesh_batch_cache_free(struct Mesh *me); diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index 2aa7829c9df..c3de20d7089 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -200,6 +200,8 @@ void BKE_object_eval_cloth(struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *object); +void BKE_object_eval_update_shading(struct EvaluationContext *eval_ctx, + struct Object *object); void BKE_object_handle_data_update(struct EvaluationContext *eval_ctx, struct Scene *scene, diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c index 70e1f434388..50502115edc 100644 --- a/source/blender/blenkernel/intern/object_update.c +++ b/source/blender/blenkernel/intern/object_update.c @@ -401,3 +401,11 @@ void BKE_object_eval_cloth(EvaluationContext *UNUSED(eval_ctx), Scene *scene, Ob DEBUG_PRINT("%s on %s\n", __func__, object->id.name); BKE_ptcache_object_reset(scene, object, PTCACHE_RESET_DEPSGRAPH); } + +void BKE_object_eval_update_shading(EvaluationContext *UNUSED(eval_ctx), Object *object) +{ + DEBUG_PRINT("%s on %s\n", __func__, object->id.name); + if (object->type == OB_MESH) { + BKE_mesh_batch_cache_dirty(object->data, BKE_MESH_BATCH_DIRTY_SHADING); + } +} |