gaussian-density.vert 880 B

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * Copyright (c) 2018-2019 mol* contributors, licensed under MIT, See LICENSE file for more info.
  3. *
  4. * @author Alexander Rose <alexander.rose@weirdbyte.de>
  5. * @author Michael Krone <michael.krone@uni-tuebingen.de>
  6. */
  7. precision highp float;
  8. attribute vec3 aPosition;
  9. attribute float aRadius;
  10. varying vec3 vPosition;
  11. varying float vRadiusSqInv;
  12. #if defined(dCalcType_groupId)
  13. attribute float aGroup;
  14. varying float vGroup;
  15. #endif
  16. uniform vec3 uBboxSize;
  17. uniform vec3 uBboxMin;
  18. uniform float uCurrentSlice;
  19. uniform float uResolution;
  20. void main() {
  21. vRadiusSqInv = 1.0 / (aRadius * aRadius);
  22. #if defined(dCalcType_groupId)
  23. vGroup = aGroup;
  24. #endif
  25. gl_PointSize = floor(((aRadius * 4.0) / uResolution) + 0.5);
  26. vPosition = (aPosition - uBboxMin) / uResolution;
  27. gl_Position = vec4(((aPosition - uBboxMin) / uBboxSize) * 2.0 - 1.0, 1.0);
  28. }