point.frag 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
  3. *
  4. * @author Alexander Rose <alexander.rose@weirdbyte.de>
  5. */
  6. precision highp float;
  7. precision highp int;
  8. #pragma glslify: import('./chunks/common-frag-params.glsl')
  9. #pragma glslify: import('./chunks/color-frag-params.glsl')
  10. #ifdef dPointFilledCircle
  11. uniform float uPointEdgeBleach;
  12. #endif
  13. const vec2 center = vec2(0.5);
  14. const float radius = 0.5;
  15. void main(){
  16. #pragma glslify: import('./chunks/assign-material-color.glsl')
  17. #if defined(dColorType_objectPicking) || defined(dColorType_instancePicking) || defined(dColorType_groupPicking)
  18. gl_FragColor = material;
  19. #else
  20. gl_FragColor = material;
  21. #ifdef dPointFilledCircle
  22. float dist = distance(gl_PointCoord, center);
  23. float alpha = 1.0 - smoothstep(radius - uPointEdgeBleach, radius, dist);
  24. if (alpha < 0.0001) discard;
  25. gl_FragColor.a *= alpha;
  26. #endif
  27. #pragma glslify: import('./chunks/apply-marker-color.glsl')
  28. #pragma glslify: import('./chunks/apply-fog.glsl')
  29. #endif
  30. }