/** * Copyright (c) 2019-2026 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose * @author Gianluca Tomasello */ export declare const text_vert = "\nprecision highp float;\nprecision highp int;\n\n#include common\n#include read_from_texture\n#include common_vert_params\n#include color_vert_params\n#include size_vert_params\n#include common_clip\n\nuniform mat4 uModelView;\n\nattribute vec3 aPosition;\nattribute vec2 aMapping;\nattribute float aDepth;\nattribute vec2 aTexCoord;\nattribute mat4 aTransform;\nattribute float aInstance;\nattribute float aGroup;\n\nuniform float uOffsetX;\nuniform float uOffsetY;\nuniform float uOffsetZ;\n\nuniform float uIsOrtho;\nuniform float uPixelRatio;\nuniform vec4 uViewport;\nuniform mat4 uInvHeadRotation;\nuniform bool uHasHeadRotation;\nuniform mat4 uModelViewEye;\nuniform mat4 uInvModelViewEye;\nuniform bool uHasEyeCamera;\n\nvarying vec2 vTexCoord;\n\nvoid main(void){\n int vertexId = VertexID;\n\n #include assign_group\n #include assign_color_varying\n #include assign_marker_varying\n #include assign_clipping_varying\n #include assign_size\n\n vTexCoord = aTexCoord;\n\n float scale = uModelScale;\n\n float offsetX = uOffsetX * scale;\n float offsetY = uOffsetY * scale;\n float offsetZ = (uOffsetZ + aDepth * 0.95) * scale;\n\n vec4 position4 = vec4(aPosition, 1.0);\n vec4 mvPosition = uHasEyeCamera\n ? uModelViewEye * aTransform * position4\n : uModelView * aTransform * position4;\n\n vModelPosition = (uModel * aTransform * position4).xyz; // for clipping in frag shader\n\n // TODO\n // #ifdef FIXED_SIZE\n // if (ortho) {\n // scale /= pixelRatio * ((uViewport.w / 2.0) / -uCameraPosition.z) * 0.1;\n // } else {\n // scale /= pixelRatio * ((uViewport.w / 2.0) / -mvPosition.z) * 0.1;\n // }\n // #endif\n\n vec4 mvCenter = vec4(mvPosition.xyz, 1.0);\n\n if (vTexCoord.x == 10.0) { // indicates background plane\n // move a bit to the back, taking distance to camera into account to avoid z-fighting\n offsetZ -= 0.001 * distance(uCameraPosition, (uProjection * mvCenter).xyz);\n }\n\n // apply Z offset in view space\n if (!uHasEyeCamera) {\n if (uIsOrtho == 1.0) {\n mvCenter.z += offsetZ;\n } else {\n mvCenter.xyz += normalize(-mvCenter.xyz) * offsetZ;\n }\n }\n\n if (uHasEyeCamera) {\n mvCenter = uModelView * uInvModelViewEye * mvCenter;\n }\n\n // project center to clip space\n vec4 clip = uProjection * mvCenter;\n\n // compute corner offset in screen-space units\n vec2 cornerOffset = aMapping * size * scale;\n cornerOffset.x += offsetX;\n cornerOffset.y += offsetY;\n\n if (uHasHeadRotation) {\n vec3 rotatedOffset = (uInvHeadRotation * vec4(cornerOffset, 0.0, 0.0)).xyz;\n clip += uProjection * vec4(rotatedOffset, 0.0);\n } else {\n // apply offset in clip space to avoid perspective distortion on the quad\n clip.xy += vec2(uProjection[0][0], uProjection[1][1]) * cornerOffset;\n }\n\n gl_Position = clip;\n\n vViewPosition = -mvCenter.xyz;\n\n #include clip_instance\n}\n";