diff --git a/sjplayer/src/sjplayer/PostEffect.d b/sjplayer/src/sjplayer/PostEffect.d index ad218ed..3a356a7 100644 --- a/sjplayer/src/sjplayer/PostEffect.d +++ b/sjplayer/src/sjplayer/PostEffect.d @@ -12,9 +12,9 @@ class PostEffect { struct Instance { public: /// - align(1) vec2 clip_lefttop = vec2(1, 1); + align(1) vec2 clip_lefttop = vec2(0, 0); /// - align(1) vec2 clip_rightbottom = vec2(1, 1); + align(1) vec2 clip_rightbottom = vec2(0, 0); } /// @@ -115,10 +115,10 @@ class PostEffectProgram { pixel_ = texture(fb, fb_size * tex_uv); pixel_.a *= - step(-instance.clip_lefttop.x, uv_.x) * - (1-step(instance.clip_rightbottom.x, uv_.x)) * - (1-step(instance.clip_lefttop.y, uv_.y)) * - step(-instance.clip_rightbottom.y, uv_.x); + step(-1+instance.clip_lefttop.x, uv_.x) * + (1-step(1-instance.clip_rightbottom.x, uv_.x)) * + (1-step(1-instance.clip_lefttop.y, uv_.y)) * + step(-1+instance.clip_rightbottom.y, uv_.y); } }; diff --git a/sjplayer/standalone/main.d b/sjplayer/standalone/main.d index f81259c..ca78a5d 100644 --- a/sjplayer/standalone/main.d +++ b/sjplayer/standalone/main.d @@ -51,6 +51,7 @@ int main(string[] args) { "nearness: %f (%f)".writefln(dmg.nearness, beat); } + gl.Clear(GL_COLOR_BUFFER_BIT); context.StartDrawing(); context.DrawBackground();