declare const _default: "\n attribute vec2 aPosition;\n\n // three texels per element: offset, size, aspect, rotation; color, auto rotate; flare, layer\n uniform highp sampler2D lensFlareElements;\n\n // one texel per flare: the measured visibility of its source\n uniform sampler2D lensFlareVisibility;\n\n // two per flare: xy source NDC, z fade, w scale; rgb color\n uniform vec4 lensFlareData[64];\n\n // x: aspect ratio of the screen (height / width)\n uniform vec4 lensFlareParams;\n\n varying vec2 vUv0;\n varying vec3 vColor;\n varying float vLayer;\n\n vec4 lensFlareFetchElement(int element, int part) {\n int texel = element * 3 + part;\n return texelFetch(lensFlareElements, ivec2(texel % 1536, texel / 1536), 0);\n }\n\n void main(void) {\n int element = gl_InstanceID;\n vec4 e0 = lensFlareFetchElement(element, 0);\n vec4 e1 = lensFlareFetchElement(element, 1);\n vec4 e2 = lensFlareFetchElement(element, 2);\n int flare = int(e2.x + 0.5);\n vec4 f0 = lensFlareData[flare * 2];\n vec4 f1 = lensFlareData[flare * 2 + 1];\n float visibility = texelFetch(lensFlareVisibility, ivec2(flare, 0), 0).r;\n\n float fade = f0.z * visibility;\n vColor = e1.rgb * f1.rgb * fade;\n vLayer = e2.y;\n vUv0 = aPosition * 0.5 + 0.5;\n\n // nothing to draw: collapse the quad off screen\n if (fade <= 0.0001) {\n gl_Position = vec4(2.0, 2.0, 0.0, 1.0);\n return;\n }\n\n // work in screen heights, where a unit is half the screen height - the aspect ratio\n // corrects x, so that the rotation and the size are not distorted\n float aspect = lensFlareParams.x;\n vec2 source = vec2(f0.x / aspect, f0.y);\n vec2 center = source * (1.0 - e0.x);\n\n float rotation = e0.w;\n if (e1.w > 0.5) {\n rotation += atan(-source.y, -source.x);\n }\n float c = cos(rotation);\n float s = sin(rotation);\n vec2 p = aPosition * vec2(e0.y * e0.z, e0.y) * f0.w;\n p = vec2(p.x * c - p.y * s, p.x * s + p.y * c);\n\n gl_Position = vec4((center.x + p.x) * aspect, center.y + p.y, 0.0, 1.0);\n }\n"; export default _default;