Fix T67523: Incorrect UV's for grid primitive

This commit is contained in:
matc 2019-07-29 14:26:39 +10:00 committed by Campbell Barton
parent a49838ccb0
commit a542f50b51
Notes: blender-bot 2023-02-14 11:34:30 +01:00
Referenced by issue #67523, UVs offsets when using displace-modifier
1 changed files with 2 additions and 1 deletions

View File

@ -807,6 +807,7 @@ void BM_mesh_calc_uvs_grid(BMesh *bm,
const float dx = 1.0f / (float)(x_segments - 1);
const float dy = 1.0f / (float)(y_segments - 1);
const float dx_wrap = 1.0 - (dx / 2.0f);
float x = 0.0f;
float y = dy;
@ -844,7 +845,7 @@ void BM_mesh_calc_uvs_grid(BMesh *bm,
}
x += dx;
if (x >= 1.0f) {
if (x >= dx_wrap) {
x = 0.0f;
y += dy;
}