Bugfix #3862
authorTon Roosendaal <ton@blender.org>
Sun, 9 Apr 2006 17:14:55 +0000 (17:14 +0000)
committerTon Roosendaal <ton@blender.org>
Sun, 9 Apr 2006 17:14:55 +0000 (17:14 +0000)
Wire render normals were exactly opposite to the normals for solid faces.
This caused displacement to work inverse too. Flipped them.
(Note; for shading normals are corrected to point towards viewer)

source/blender/render/intern/source/convertblender.c

index e7322ca981b25c357b12311200008d3bf318099d..12bfdbfeb4cccfd9d4573864cc5f5d93680c50c7 100644 (file)
@@ -1843,9 +1843,9 @@ static void init_render_mesh(Render *re, Object *ob, int only_verts)
                                                        use_mesh_edge_lookup(re, me, dlm, medge, vlr, edgetable, totedge);
                                                }
                                                
                                                        use_mesh_edge_lookup(re, me, dlm, medge, vlr, edgetable, totedge);
                                                }
                                                
-                                               xn= (v0->no[0]+v1->no[0]);
-                                               yn= (v0->no[1]+v1->no[1]);
-                                               zn= (v0->no[2]+v1->no[2]);
+                                               xn= -(v0->no[0]+v1->no[0]);
+                                               yn= -(v0->no[1]+v1->no[1]);
+                                               zn= -(v0->no[2]+v1->no[2]);
                                                /* transpose ! */
                                                vlr->n[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn;
                                                vlr->n[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn;
                                                /* transpose ! */
                                                vlr->n[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn;
                                                vlr->n[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn;