Files
comaps/shaders/GL/user_mark.fsh.glsl
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
2025-05-08 21:10:51 +07:00

21 lines
710 B
GLSL

// Warning! Beware to use this shader. "discard" command may significally reduce performance.
// Unfortunately some CG algorithms cannot be implemented on OpenGL ES 2.0 without discarding
// fragments from depth buffer.
uniform sampler2D u_colorTex;
uniform float u_opacity;
varying vec4 v_texCoords;
varying vec4 v_maskColor;
void main()
{
vec4 color = texture2D(u_colorTex, v_texCoords.xy);
vec4 bgColor = texture2D(u_colorTex, v_texCoords.zw) * vec4(v_maskColor.xyz, 1.0);
vec4 finalColor = mix(color, mix(bgColor, color, color.a), bgColor.a);
finalColor.a = clamp(color.a + bgColor.a, 0.0, 1.0) * u_opacity * v_maskColor.w;
if (finalColor.a < 0.01)
discard;
gl_FragColor = finalColor;
}