Fix perlin noise normalization
This commit is contained in:
parent
6d7dbcdffe
commit
1d71954394
1 changed files with 3 additions and 1 deletions
|
|
@ -122,7 +122,9 @@ namespace psemek::pcg
|
|||
values[mask] = smoothstep(values[mask], values[mask | (1 << i)], t[i]);
|
||||
}
|
||||
|
||||
return 0.5 * (1. + std::sqrt(2.) * values[0]);
|
||||
auto const M = std::sqrt(T(N) / T(4));
|
||||
|
||||
return 0.5 * (1. + values[0] / M);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue