From 4d33c37c9eb4fc46482f7b2a7227b54c5cfda07a Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Fri, 13 Nov 2015 21:57:00 +0100 Subject: Fix T46726 shading issues in sculpt mode. This fixes two issues: * Normals were not being recalculated correctly when not using optimized drawing for CDDerivedMesh (Multires actually handles that correctly). * Loop normals (autosmooth option) were also not being calculated. Doing this calculation is not desirable, since it can't be done correctly without a severe performance hit. This is easy to test by doing a dependency flush on the mesh after each scuplt stroke step. Instead they are now disabled during sculpting. --- source/blender/blenkernel/intern/subsurf_ccg.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/blenkernel/intern/subsurf_ccg.c') diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index a2c625a7ec3..5814a06bb9f 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -1912,6 +1912,10 @@ static void ccgDM_buffer_copy_normal( int shademodel; int start = 0; + /* we are in sculpt mode, disable loop normals (since they won't get updated) */ + if (ccgdm->pbvh) + lnors = NULL; + CCG_key_top_level(&key, ss); for (i = 0; i < totface; i++) { -- cgit v1.2.3