Fix pcg::lazy_perlin normalization

This commit is contained in:
Nikita Lisitsa 2022-06-30 23:08:44 +03:00
parent f574850621
commit 079157f201

View file

@ -53,7 +53,8 @@ namespace psemek::pcg
values[mask] = smootherstep(values[mask], values[mask | (1 << i)], t[i]);
}
return 0.5 * (1. + std::sqrt(2.) * values[0]);
static auto const max = std::sqrt(T(N) / T(4));
return 0.5 * (1. + values[0] / max);
}
}