diff --git a/sjplayer/src/sjplayer/ShapeElementProgram.d b/sjplayer/src/sjplayer/ShapeElementProgram.d index 39d0f27..b6a917e 100644 --- a/sjplayer/src/sjplayer/ShapeElementProgram.d +++ b/sjplayer/src/sjplayer/ShapeElementProgram.d @@ -131,7 +131,7 @@ struct ShapeElementProgramInstance { /// align(1) float weight = 1; /// - align(1) float smooth = 0.001; + align(1) float smooth = 0.01; /// align(1) vec4 color = vec4(0, 0, 0, 0); } diff --git a/sjplayer/src/sjplayer/SquareElement.d b/sjplayer/src/sjplayer/SquareElement.d index b712497..e7d6cd4 100644 --- a/sjplayer/src/sjplayer/SquareElement.d +++ b/sjplayer/src/sjplayer/SquareElement.d @@ -58,8 +58,8 @@ alias SquareElementProgram = ShapeElementProgram!(q{ float w = 1-weight_; float s = smooth_; return clamp( - smoothstep(w-s, w, abs(uv_.x)) + - smoothstep(w-s, w, abs(uv_.y)), 0, 1); + smoothstep(w-s, w, abs(uv_.x))*(1-smoothstep(1-s, 1, abs(uv_.x))) + + smoothstep(w-s, w, abs(uv_.y))*(1-smoothstep(1-s, 1, abs(uv_.y))), 0, 1); }); ///