export declare enum Location { BARYCENTRIC = 0, POSITION = 1 } export declare const vert = "\nlayout(std140) uniform SceneUniforms {\n mat3 u_ProjectionMatrix;\n mat3 u_ViewMatrix;\n mat3 u_ViewProjectionInvMatrix;\n vec4 u_BackgroundColor;\n vec4 u_GridColor;\n float u_ZoomScale;\n float u_CheckboardStyle;\n};\n\n\n#ifdef USE_WIREFRAME\n layout(location = 0) in vec3 a_Barycentric;\n out vec3 v_Barycentric;\n#endif\n\nlayout(location = 1) in vec2 a_Position;\n\nlayout(std140) uniform ShapeUniforms {\n mat3 u_ModelMatrix;\n vec4 u_FillColor;\n vec4 u_StrokeColor;\n vec4 u_ZIndexStrokeWidth;\n vec4 u_Opacity;\n};\n\nvoid main() {\n \n#ifdef USE_WIREFRAME\n v_Barycentric = a_Barycentric;\n#endif\n\n\n mat3 model;\n vec4 fillColor;\n vec4 strokeColor;\n float zIndex;\n float strokeWidth;\n float strokeAlignment;\n float sizeAttenuation;\n model = u_ModelMatrix;\n fillColor = u_FillColor;\n strokeColor = u_StrokeColor;\n zIndex = u_ZIndexStrokeWidth.x;\n strokeWidth = u_ZIndexStrokeWidth.y;\n strokeAlignment = u_ZIndexStrokeWidth.w;\n sizeAttenuation = u_Opacity.w;\n\n float scale = 1.0;\n if (sizeAttenuation > 0.5) {\n scale = 1.0 / u_ZoomScale;\n }\n\n gl_Position = vec4((u_ProjectionMatrix \n * u_ViewMatrix\n * model \n * vec3(a_Position * scale, 1)).xy, zIndex, 1);\n}\n"; export declare const frag = "\nlayout(std140) uniform SceneUniforms {\n mat3 u_ProjectionMatrix;\n mat3 u_ViewMatrix;\n mat3 u_ViewProjectionInvMatrix;\n vec4 u_BackgroundColor;\n vec4 u_GridColor;\n float u_ZoomScale;\n float u_CheckboardStyle;\n};\n\nlayout(std140) uniform ShapeUniforms {\n mat3 u_ModelMatrix;\n vec4 u_FillColor;\n vec4 u_StrokeColor;\n vec4 u_ZIndexStrokeWidth;\n vec4 u_Opacity;\n};\n\n\n#ifdef USE_WIREFRAME\n in vec3 v_Barycentric;\n\n float edgeFactor() {\n float u_WireframeLineWidth = 1.0;\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * u_WireframeLineWidth, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n }\n#endif\n\n\nout vec4 outputColor;\n\nfloat epsilon = 0.000001;\n\nvoid main() {\n float strokeWidth;\n vec4 fillColor;\n vec4 strokeColor;\n float opacity;\n float fillOpacity;\n float strokeOpacity;\n float cornerRadius;\n float strokeAlignment;\n \n fillColor = u_FillColor;\n strokeColor = u_StrokeColor;\n strokeWidth = u_ZIndexStrokeWidth.y;\n opacity = u_Opacity.x;\n fillOpacity = u_Opacity.y;\n strokeOpacity = u_Opacity.z;\n cornerRadius = u_ZIndexStrokeWidth.z;\n strokeAlignment = u_ZIndexStrokeWidth.w;\n\n // based on the target alpha compositing mode.\n fillColor.a *= fillOpacity;\n strokeColor.a *= strokeOpacity;\n \n outputColor = fillColor;\n outputColor.a *= opacity;\n\n \n#ifdef USE_WIREFRAME\n vec3 u_WireframeLineColor = vec3(0.0, 0.0, 0.0);\n\n outputColor.xyz = mix(outputColor.xyz, u_WireframeLineColor, (1.0 - edgeFactor()));\n if (any(lessThan(v_Barycentric, vec3(0.01)))) {\n outputColor.a = 0.95;\n }\n#endif\n\n\n #ifndef USE_STENCIL\n if (outputColor.a < epsilon)\n discard;\n #endif\n}\n";