uniform beatmupSampler image;
varying mediump vec2 texCoord;
varying mediump vec2 maskCoord;
uniform highp vec2 borderProfile;
uniform highp float slope;
uniform highp float border;
uniform highp float cornerRadius;
uniform mediump vec4 modulationColor;
uniform mediump vec4 bgColor;
void main() {
highp vec2 cornerCoords = vec2(cornerRadius -
min(maskCoord.x, 1.0 - maskCoord.x) * borderProfile.x, cornerRadius -
min(maskCoord.y, 1.0 - maskCoord.y) * borderProfile.y);
if (cornerRadius > 0.0 && cornerCoords.x > 0.0 && cornerCoords.y > 0.0)
r = length(cornerCoords / cornerRadius) * cornerRadius;
else
r =
max(cornerCoords.x, cornerCoords.y);
if (texCoord.x < 0.0 || texCoord.y < 0.0 || texCoord.x >= 1.0 || texCoord.y >= 1.0)
gl_FragColor = bgColor;
else
gl_FragColor = beatmupTexture(image, texCoord.xy).rgba;
gl_FragColor = gl_FragColor * clamp((cornerRadius - border -
r) / (slope + 0.00098), 0.0, 1.0) * modulationColor;
}
)
CustomPoint< numeric > min(const CustomPoint< numeric > &a, const CustomPoint< numeric > &b)
CustomPoint< numeric > max(const CustomPoint< numeric > &a, const CustomPoint< numeric > &b)