Minor pcg::lazy_perlin fix

This commit is contained in:
Nikita Lisitsa 2024-03-20 20:57:17 +03:00
parent 83f92ae9cb
commit b26849e689

View file

@ -42,10 +42,10 @@ namespace psemek::pcg
values[mask] = geom::dot(grid_at(ii), tt); values[mask] = geom::dot(grid_at(ii), tt);
} }
auto smootherstep = [](float x0, float x1, float t) auto smootherstep = [](T x0, T x1, T t)
{ {
auto const s = t * t * t * (10. + t * (-15. + 6. * t)); auto const s = t * t * t * (T(10) + t * (-T(15) + T(6) * t));
return x0 * (1 - s) + x1 * s; return x0 * (T(1) - s) + x1 * s;
}; };
for (std::size_t i = N; i --> 0;) for (std::size_t i = N; i --> 0;)