From 549b5e1222fcda5ca9b7d1892ca4d05e2c62c066 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 20 Mar 2011 13:35:35 +0000 Subject: Fix/change in normal computation, now the viewport uses the same angle weighted normals as the render engine, and the render engine will copy normals from the mesh rather than always recalculating them. Subsurf/multires still use regular vertex normals, but they are expected to be sufficiently high resolution to not need this. This means that normal maps displayed in the viewport actually match the render engine exactly and don't have artifacts due to this discrepancy. It of course also avoids unexpected surprises where your render normals look different than your viewport normals. Subversion bumped to 4 for version patch to recalculate normals. Patch by Morten Mikkelsen, with some small changes. --- source/blender/blenloader/intern/readfile.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/blenloader/intern') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 35aeb756274..9fe5fbb2a60 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -11551,6 +11551,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } + if (main->versionfile < 256 || (main->versionfile == 256 && main->subversionfile <4)){ + Mesh *me; + + for(me= main->mesh.first; me; me= me->id.next) + mesh_calc_normals(me->mvert, me->totvert, me->mface, me->totface, NULL); + } + /* put compatibility code here until next subversion bump */ { -- cgit v1.2.3