scales on y-change

This commit is contained in:
Rakarake 2025-12-27 14:18:23 +01:00
parent 5f412e825c
commit 69d3319a4e

View file

@ -23,14 +23,6 @@ uint xxhash32(uvec2 p) {
return h32^(h32 >> 16);
}
//const uint k = 1103515245U;
//
//vec3 hash33( uvec3 x ) {
// x = ((x >> 8U) ^ x.yzx) * k;
// x = ((x >> 8U) ^ x.yzx) * k;
// x = ((x >> 8U) ^ x.yzx) * k;
// return vec3(x) * (1.0 / float(0xffffffffU));
//}
float rand(vec2 v, vec2 offset) {
uint hash = xxhash32(uvec2(v * 10000.0 + offset * 10000.0));
@ -58,9 +50,12 @@ float fade(float t) {
void main() {
// We'll make origin in the top-left.
vec2 uv = gl_FragCoord.xy / WindowSize;
// We'll make origin in the top-left.
uv.y = 1.0 - uv.y;
float frac = WindowSize.x / WindowSize.y;
uv.x *= frac;
vec2 grid_edge_offset = mod(uv, cell_size);
// c: corner
vec2 c_tl = uv - grid_edge_offset;