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;