[update] Implemented smoothing of SquareElement.
This commit is contained in:
parent
13782e3176
commit
acb898ad9b
@ -131,7 +131,7 @@ struct ShapeElementProgramInstance {
|
|||||||
///
|
///
|
||||||
align(1) float weight = 1;
|
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);
|
align(1) vec4 color = vec4(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
@ -58,8 +58,8 @@ alias SquareElementProgram = ShapeElementProgram!(q{
|
|||||||
float w = 1-weight_;
|
float w = 1-weight_;
|
||||||
float s = smooth_;
|
float s = smooth_;
|
||||||
return clamp(
|
return clamp(
|
||||||
smoothstep(w-s, w, abs(uv_.x)) +
|
smoothstep(w-s, w, abs(uv_.x))*(1-smoothstep(1-s, 1, abs(uv_.x))) +
|
||||||
smoothstep(w-s, w, abs(uv_.y)), 0, 1);
|
smoothstep(w-s, w, abs(uv_.y))*(1-smoothstep(1-s, 1, abs(uv_.y))), 0, 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
///
|
///
|
||||||
|
Reference in New Issue
Block a user