[fix] Fixed an issue that Actor wasn't drawn.

This commit is contained in:
falsycat 2019-10-08 00:00:00 +00:00
parent 8b4e4535a1
commit 37a1a122e5

View File

@ -56,15 +56,17 @@ class ActorProgram {
out vec4 pixel_;
float line(float ux, float px, float a) {
float line(float u, float p, float a) {
return
(1 - smoothstep(0, 0.003, abs(ux - px)));
(1-smoothstep(0, 0.003, abs(u-p)));
}
void main() {
float alpha =
line(uv_.x, pos.x, accel.x) +
line(uv_.y, pos.y, accel.y);
pixel_ = color;
pixel_.a *=
clamp(0, 1, line(uv_.y, pos.y, accel.y) + line(uv_.x, pos.x, accel.x));
pixel_.a *= clamp(alpha, 0, 1);
}
};