Add powder material deposit logic for surface placement
This commit is contained in:
parent
43d3e56aee
commit
34bd1e95c2
1 changed files with 15 additions and 0 deletions
|
|
@ -246,6 +246,21 @@ void main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// deposit carried powder material when standing on air with solid ground below
|
||||||
|
if (isCarrying == 1. && int(cargoMaterialId) != MAT_FOOD) {
|
||||||
|
float cellMatId = texture(tWorld, roundUvToCellCenter(pos)).x;
|
||||||
|
if (int(cellMatId) == MAT_AIR) {
|
||||||
|
vec2 belowPos = pos - vec2(0., cellSize);
|
||||||
|
float belowMatId = texture(tWorld, roundUvToCellCenter(belowPos)).x;
|
||||||
|
if (int(belowMatId) != MAT_AIR || belowPos.y <= 0.) {
|
||||||
|
isCarrying = 0.;
|
||||||
|
// keep cargoMaterialId set so discretize can read it this frame
|
||||||
|
angle += PI;
|
||||||
|
storage = getMaxScentStorage(vUv);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FragColor = vec4(
|
FragColor = vec4(
|
||||||
pos.x,
|
pos.x,
|
||||||
pos.y,
|
pos.y,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue