From 37a1a122e5967d23febbb2c18924af4dc18c233a Mon Sep 17 00:00:00 2001 From: falsycat Date: Tue, 8 Oct 2019 00:00:00 +0000 Subject: [PATCH] [fix] Fixed an issue that Actor wasn't drawn. --- sjplayer/src/sjplayer/Actor.d | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sjplayer/src/sjplayer/Actor.d b/sjplayer/src/sjplayer/Actor.d index 6862f5b..2bdf5dd 100644 --- a/sjplayer/src/sjplayer/Actor.d +++ b/sjplayer/src/sjplayer/Actor.d @@ -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); } };