/*
 * This file copies sigma/examples/custom-rendering/programs/node.border.vert.glsl, but with a some
 * difference: added calculation of v_borderRadius using a_borderSize variable
 */
export var vertexShaderSource = "\nattribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\nattribute float a_borderSize;\nattribute float a_inactive;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\n\nvarying vec4 v_color;\nvarying float v_border;\nvarying float v_borderRadius;\nvarying float v_inactive;\n\nconst float bias = 255.0 / 254.0;\nconst float radius = 0.5;\n\nvoid main() {\n    gl_Position = vec4((u_matrix * vec3(a_position, 1)).xy, 0, 1);\n\n    // Multiply the point size twice:\n    //  - x SCALING_RATIO to correct the canvas scaling\n    //  - x 2 to correct the formulae\n    gl_PointSize = a_size * u_ratio * u_scale * 2.0;\n\n    v_border = (1.0 / u_ratio) * (0.5 / a_size);\n    v_borderRadius = radius - (radius * a_borderSize / a_size); // border radius in node's size (full size is 1)\n\n    // Extract the color:\n    v_color = a_color;\n    v_color.a *= bias;\n\n    // Pass inactive property\n    v_inactive = a_inactive;\n}";
