Fix startup world init and inverted sand gravity

This commit is contained in:
Jared Miller 2026-03-11 14:55:40 -04:00
parent 8909dc6390
commit 7003e074c5
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C
2 changed files with 2 additions and 1 deletions

View file

@ -31,6 +31,7 @@ export default new (class App {
constructor() { constructor() {
this.initScenes(); this.initScenes();
this.resetRenderer();
window.addEventListener("resize", () => this.resize()); window.addEventListener("resize", () => this.resize());

View file

@ -36,7 +36,7 @@ void main() {
float behaviors[4]; float behaviors[4];
float densities[4]; float densities[4];
for (int i = 0; i < 4; i++) { 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); cells[i] = texelFetch(uWorld, p, 0);
vec4 props = texelFetch(uMaterialProps, ivec2(int(cells[i].r), 0), 0); vec4 props = texelFetch(uMaterialProps, ivec2(int(cells[i].r), 0), 0);
behaviors[i] = props.r; behaviors[i] = props.r;