Fix world texture sampling

This commit is contained in:
vHawk 2022-07-11 02:19:01 +03:00
parent 9e80ac2c96
commit a3c03cafef
2 changed files with 2 additions and 2 deletions

View file

@ -24,7 +24,7 @@
}, },
"scripts": { "scripts": {
"build": "webpack --config ./webpack.config.js --mode=production", "build": "webpack --config ./webpack.config.js --mode=production",
"dev": "webpack serve --config ./webpack.config.js --mode=development", "start": "webpack serve --config ./webpack.config.js --mode=development",
"gh-pages": "npm run build && push-dir --dir=build --branch=gh-pages" "gh-pages": "npm run build && push-dir --dir=build --branch=gh-pages"
}, },
"author": "", "author": "",

View file

@ -24,7 +24,7 @@ float rand(vec2 co) {
} }
vec2 roundUvToCellCenter(vec2 uv) { vec2 roundUvToCellCenter(vec2 uv) {
return floor(uv * WORLD_SIZE) / WORLD_SIZE; return floor(uv * WORLD_SIZE) / WORLD_SIZE + cellSize * 0.5;
} }
bool tryGetFood(vec2 pos) { bool tryGetFood(vec2 pos) {