From 7003e074c5015c4512fe64c1269a1ce549d3196a Mon Sep 17 00:00:00 2001 From: Jared Miller Date: Wed, 11 Mar 2026 14:55:40 -0400 Subject: [PATCH] Fix startup world init and inverted sand gravity --- src/App.ts | 1 + src/shaders/sandPhysics.frag | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/App.ts b/src/App.ts index 2b53119..ec7c290 100644 --- a/src/App.ts +++ b/src/App.ts @@ -31,6 +31,7 @@ export default new (class App { constructor() { this.initScenes(); + this.resetRenderer(); window.addEventListener("resize", () => this.resize()); diff --git a/src/shaders/sandPhysics.frag b/src/shaders/sandPhysics.frag index a6df7f9..db32fc8 100644 --- a/src/shaders/sandPhysics.frag +++ b/src/shaders/sandPhysics.frag @@ -36,7 +36,7 @@ void main() { float behaviors[4]; float densities[4]; for (int i = 0; i < 4; i++) { - ivec2 p = blockBase + ivec2(i % 2, i / 2); + ivec2 p = blockBase + ivec2(i % 2, 1 - i / 2); cells[i] = texelFetch(uWorld, p, 0); vec4 props = texelFetch(uMaterialProps, ivec2(int(cells[i].r), 0), 0); behaviors[i] = props.r;