Fix for distortion happens when flipping mesh normals

Issue was caused by missing X/Y displacement components
flip when flipping the normals (flipping the normals changes
the tangent space apparently and displacement vectors need
to be modified to correspond to new space).

Reported by Jonathan Williamson in IRC.
This commit is contained in:
Sergey Sharybin 2013-06-11 08:06:59 +00:00
parent c730ae0921
commit 401eaa448b

@ -791,7 +791,10 @@ static bool bm_loop_reverse_loop(BMesh *bm, BMFace *f
for (x = 0; x < sides; x++) {
for (y = 0; y < x; y++) {
swap_v3_v3(co[y * sides + x], co[sides * x + y]);
SWAP(float, co[y * sides + x][0], co[y * sides + x][1]);
SWAP(float, co[x * sides + y][0], co[x * sides + y][1]);
}
SWAP(float, co[x * sides + x][0], co[x * sides + x][1]);
}
}
}