points.frag.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * Copyright (c) 2018-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
  3. *
  4. * @author Alexander Rose <alexander.rose@weirdbyte.de>
  5. */
  6. export default `
  7. precision highp float;
  8. precision highp int;
  9. #include common
  10. #include common_frag_params
  11. #include color_frag_params
  12. #include common_clip
  13. #include wboit_params
  14. #ifdef dPointFilledCircle
  15. uniform float uPointEdgeBleach;
  16. #endif
  17. const vec2 center = vec2(0.5);
  18. const float radius = 0.5;
  19. void main(){
  20. #include clip_pixel
  21. float fragmentDepth = gl_FragCoord.z;
  22. bool interior = false;
  23. #include assign_material_color
  24. #if defined(dRenderVariant_pick)
  25. #include check_picking_alpha
  26. gl_FragColor = material;
  27. #elif defined(dRenderVariant_depth)
  28. gl_FragColor = material;
  29. #elif defined(dRenderVariant_color)
  30. gl_FragColor = material;
  31. #ifdef dPointFilledCircle
  32. float dist = distance(gl_PointCoord, center);
  33. float alpha = 1.0 - smoothstep(radius - uPointEdgeBleach, radius, dist);
  34. if (alpha < 0.0001) discard;
  35. gl_FragColor.a *= alpha;
  36. #endif
  37. #include apply_marker_color
  38. #include apply_fog
  39. #include wboit_write
  40. #endif
  41. }
  42. `;