Update ant compute shader for material IDs

This commit is contained in:
Jared Miller 2026-03-11 13:50:10 -04:00
parent e210ebc72d
commit e6af97f402
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C

View file

@ -32,21 +32,21 @@ vec2 roundUvToCellCenter(vec2 uv) {
}
bool tryGetFood(vec2 pos) {
float value = texture(tWorld, roundUvToCellCenter(pos)).x;
float materialId = texture(tWorld, roundUvToCellCenter(pos)).x;
return (int(value) & 1) == 1;
return int(materialId) == MAT_FOOD;
}
bool tryDropFood(vec2 pos) {
float value = texture(tWorld, roundUvToCellCenter(pos)).x;
float materialId = texture(tWorld, roundUvToCellCenter(pos)).x;
return ((int(value) & 2) >> 1) == 1;
return int(materialId) == MAT_HOME;
}
bool isObstacle(vec2 pos) {
float value = texture(tWorld, roundUvToCellCenter(pos)).x;
float materialId = texture(tWorld, roundUvToCellCenter(pos)).x;
return ((int(value) & 4) >> 2) == 1;
return int(materialId) == MAT_ROCK;
}
float smell(vec2 pos, float isCarrying) {