big noise

This commit is contained in:
Rakarake 2025-12-13 19:52:23 +01:00
parent fee1878113
commit 5943b483ce

View file

@ -32,8 +32,8 @@ uint xxhash32(uvec2 p) {
// return vec3(x) * (1.0 / float(0xffffffffU));
//}
float rand(vec2 v, float seed) {
uint hash = xxhash32(uvec2(v * 10000.0 + seed * 10000.0));
float rand(vec2 v, vec2 offset) {
uint hash = xxhash32(uvec2(v * 10000.0 + offset * 10000.0));
return float(hash) * (1.0/float(0xffffffffu));
}
@ -43,7 +43,7 @@ float cell_size = 0.01;
// whatever that corner contributes
float c_dot(vec2 point, vec2 corner) {
vec2 c = vec2(ivec2(round(corner * 100.0)));
float angle = rand(c, 0.0) * 2.0*PI;
float angle = rand(c, vec2(0.0, 0.0)) * 2.0*PI;
vec2 random_corner_vec = vec2(cos(angle), sin(angle));
vec2 offset = (point - corner) / cell_size;
float dot_product = dot(random_corner_vec, offset);
@ -82,11 +82,6 @@ void main() {
//float v = tile_uv.y;
float val = lerp(lerp(c_tl_dot, c_bl_dot, v), lerp(c_tr_dot, c_br_dot, v), u);
float out_val = val /2.0 + 0.5;
//uvec3 p = uvec3(uint(round(uv.x * 500.0)), uint(round(uv.y * 500.0)), 1);
//color = vec4( hash33(p), 1.0 );
//float lel = noise(vec3(uv * 10.0, 1.0));
//float lel = gold_noise(uv, time * 100.0);
//float lel = random( uv.x * 100.0 );
float lel = rand(uv, 0.0);
color = vec4(lel, lel, lel, 1.0);
//float out_val = rand(uv , vec2(1.0, 1.0));
color = vec4(out_val, out_val, out_val, 1.0);
}