diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-03-20 16:35:35 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-03-20 16:35:35 +0300 |
commit | 549b5e1222fcda5ca9b7d1892ca4d05e2c62c066 (patch) | |
tree | f69a4a833a3eb092530bb0d7959e43cf05ca0362 /source/blender/blenlib/BLI_math_geom.h | |
parent | a50cdf713a800c07629495f0d5e7124cddbbc2c9 (diff) |
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.
Diffstat (limited to 'source/blender/blenlib/BLI_math_geom.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_geom.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h index 8d2f9ffa38b..3174c65beac 100644 --- a/source/blender/blenlib/BLI_math_geom.h +++ b/source/blender/blenlib/BLI_math_geom.h @@ -169,6 +169,12 @@ void box_minmax_bounds_m4(float min[3], float max[3], void map_to_tube(float *u, float *v, float x, float y, float z); void map_to_sphere(float *u, float *v, float x, float y, float z); +/********************************** Normals **********************************/ + +void accumulate_vertex_normals(float n1[3], float n2[3], float n3[3], + float n4[3], const float f_no[3], const float co1[3], const float co2[3], + const float co3[3], const float co4[3]); + /********************************* Tangents **********************************/ typedef struct VertexTangent { |