noise test

This commit is contained in:
Joshua Ashton 2023-04-08 00:52:10 +01:00
parent 66a5170264
commit 04c39a4438
1 changed files with 22 additions and 0 deletions

View File

@ -41,6 +41,12 @@ vec3 pqToNits(vec3 pq)
return 10000.0 * pow(num / den, vec3(oo_m1));
}
float gold_noise(vec2 xy, float seed)
{
const float PHI = 1.61803398874989484820459;
return fract(tan(distance(xy*PHI, xy)*seed)*xy.x);
}
void main()
{
outColor = vec4(0.0, 0.0, 0.0, 1.0);
@ -123,4 +129,20 @@ void main()
outColor = vec4(nitsToPq(vec3(0, 0, value)), 1.0);
}
else if (test == 10)
{
const float seed = fract(time);
vec3 value = vec3(gold_noise(coords.xy, seed + 0.2));
outColor = vec4(nitsToPq(value), 1.0);
}
else if (test == 11)
{
const float seed = fract(time);
vec3 value = vec3(gold_noise(coords.xy, seed + 0.1), gold_noise(coords.xy, seed + 0.2), gold_noise(coords.xy, seed + 0.2));
outColor = vec4(nitsToPq(value), 1.0);
}
}