vertexMapShaderText :: JSString
vertexMapShaderText =
    [jsstring|
      precision mediump float;
      attribute vec4 aVertexPosition;
      attribute vec2 aTextureCoord;
      uniform mat4 uViewM;
      uniform mat4 uProjM;
      uniform float uClippingDist;
      varying vec3 vDist;
      varying vec2 vTextureCoord;
      void main(void) {
        vec4 globalPos = uViewM * aVertexPosition;
        gl_Position = uProjM * globalPos;
        vDist = globalPos.xyz/(globalPos.w*uClippingDist*#{x});
        vTextureCoord = aTextureCoord;
      }
    |]
  where
    x = toJSString . show $ 1 / sqrt fadeConst
vertexMapShaderText :: JSString
vertexMapShaderText =
    [jsstring|
      precision mediump float;
      attribute vec4 aVertexPosition;
      attribute vec2 aTextureCoord;
      uniform mat4 uViewM;
      uniform mat4 uProjM;
      uniform float uClippingDist;
      varying vec3 vDist;
      varying vec2 vTextureCoord;
      void main(void) {
        vec4 globalPos = uViewM * aVertexPosition;
        gl_Position = uProjM * globalPos;
        vDist = globalPos.xyz/(globalPos.w*uClippingDist*#{x});
        vTextureCoord = aTextureCoord;
      }
    |]
  where
    x = toJSString . show $ 1 / sqrt fadeConst
vertexMapShaderText =
    [jsstring|
      precision mediump float;
      attribute vec4 aVertexPosition;
      attribute vec2 aTextureCoord;
      uniform mat4 uViewM;
      uniform mat4 uProjM;
      uniform float uClippingDist;
      varying vec3 vDist;
      varying vec2 vTextureCoord;
      void main(void) {
        vec4 globalPos = uViewM * aVertexPosition;
        gl_Position = uProjM * globalPos;
        vDist = globalPos.xyz/(globalPos.w*uClippingDist*#{x});
        vTextureCoord = aTextureCoord;
      }
    |]
  where
    x = toJSString . show $ 1 / sqrt fadeConst