Update ant compute shader for material IDs
This commit is contained in:
parent
e210ebc72d
commit
e6af97f402
1 changed files with 6 additions and 6 deletions
|
|
@ -32,21 +32,21 @@ vec2 roundUvToCellCenter(vec2 uv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool tryGetFood(vec2 pos) {
|
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) {
|
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) {
|
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) {
|
float smell(vec2 pos, float isCarrying) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue