Fix #31500: Displacement Baking from Multires doesn't work

Issue was caused by wrong calculation of grid coordinates when switching
from low resolution mesh to high resolution mesh. Somehow was affected only
for face U or V equals to 1.0f.

Checked fix using all test files used during initial implementation of
multires baker and tested sample file from bug/ Seems everything is OK.
This commit is contained in:
Sergey Sharybin 2012-05-22 07:06:48 +00:00
parent 72f38b4f09
commit acd468f2b3

@ -534,7 +534,7 @@ static void get_ccgdm_data(DerivedMesh *lodm, DerivedMesh *hidm, const int *orig
int grid_index = origindex[face_index];
int loc_offs = face_index % (1 << (2 * lvl));
int cell_index = loc_offs % ((side - 1) * (side - 1));
int cell_side = grid_size / (side - 1);
int cell_side = (grid_size - 1) / (side - 1);
int row = cell_index / (side - 1);
int col = cell_index % (side - 1);