mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix #109302: baking UDIM displacement normalization wrong
Since UDIM baking support in 6787cc13d4, the normalization of
diplacement heights was always based on the min/max height detected in
the _last_ tile, which could lead to clipping if the last tile had very
subtle (or no) displacement.
Now getting the min/max is spread across all images.
This also takes the first thread into account for getting the min/max (which for some reason was skipped).
Pull Request: https://projects.blender.org/blender/blender/pulls/109409
This commit is contained in:
parent
fdd8568a7d
commit
0976c7bdfe
1 changed files with 5 additions and 5 deletions
|
|
@ -581,11 +581,7 @@ static void do_multires_bake(MultiresBakeRender *bkr,
|
|||
do_multires_bake_thread(&handles[0]);
|
||||
}
|
||||
|
||||
/* construct bake result */
|
||||
result->height_min = handles[0].height_min;
|
||||
result->height_max = handles[0].height_max;
|
||||
|
||||
for (i = 1; i < tot_thread; i++) {
|
||||
for (i = 0; i < tot_thread; i++) {
|
||||
result->height_min = min_ff(result->height_min, handles[i].height_min);
|
||||
result->height_max = max_ff(result->height_max, handles[i].height_max);
|
||||
}
|
||||
|
|
@ -1432,6 +1428,10 @@ static void bake_images(MultiresBakeRender *bkr, MultiresBakeResult *result)
|
|||
{
|
||||
LinkData *link;
|
||||
|
||||
/* construct bake result */
|
||||
result->height_min = FLT_MAX;
|
||||
result->height_max = -FLT_MAX;
|
||||
|
||||
for (link = bkr->image.first; link; link = link->next) {
|
||||
Image *ima = (Image *)link->data;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue