Fixed smooth layer at z=434 (and a few other)

This commit is contained in:
AldanTanneo 2021-06-23 21:13:15 +02:00
parent 87c86b919b
commit f1b83962bd

View File

@ -7,22 +7,20 @@ layout(set = 0, binding = 2) uniform sampler s_noise;
float hash(vec4 p) {
p = fract(p * 0.3183099 + 0.1) - fract(p + 23.22121);
p *= 17.0;
return (fract(p.x * p.y * p.z * p.w * (p.x + p.y + p.z + p.w)) - 0.5) * 2.0;
return (fract(p.x * p.y * (1.0 - p.z) * p.w * (p.x + p.y + p.z + p.w)) - 0.5) * 2.0;
}
#define M1 1597334677U //1719413*929
#define M2 3812015801U //140473*2467*11
#define M3 2741598923U
float hash_one(uint q)
{
float hash_one(uint q) {
uint n = ((M3 * q) ^ M2) * M1;
return float(n) * (1.0 / float(0xffffffffU));
}
float hash_fast(uvec3 q)
{
float hash_fast(uvec3 q) {
q *= uvec3(M1, M2, M3);
uint n = (q.x ^ q.y ^ q.z) * M1;