This commit is contained in:
numzero 2025-01-11 16:40:25 +03:00
parent 99b8d5eeeb
commit f6c7e65286
2 changed files with 4 additions and 3 deletions

View File

@ -15,6 +15,6 @@ fn on_vertex(@builtin(vertex_index) vi: u32) -> Varying {
@fragment @fragment
fn on_fragment(in: Varying) -> @location(0) vec4f { fn on_fragment(in: Varying) -> @location(0) vec4f {
let pos = vec2u(in.screen.xy); let pos = vec2u(in.screen.xy);
let state = textureLoad(field, pos, 0).xyz; let state = textureLoad(field, pos, 0).xy;
return vec4(vec3f(state), 1.); return vec4(vec2f(state), 0., 1.);
} }

View File

@ -37,7 +37,8 @@ fn on_fragment(in: Varying) -> @location(0) vec4u {
let z = daynight(state.z, n.z); let z = daynight(state.z, n.z);
let x = life(state.x, n.x + n.z); let x = life(state.x, n.x + n.z);
return vec4(x, 0, z, 0u); let y = life(state.y, n.y + 8u - n.x);
return vec4(x, y, z, 0u);
} }
fn life(state: u32, n: u32) -> u32{ fn life(state: u32, n: u32) -> u32{