gaussian-density.vert 913 B

123456789101112131415161718192021222324252627282930313233343536
  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. * @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 vRadius;
  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 vec3 uBboxMax;
  19. uniform vec3 uGridDim;
  20. uniform float uCurrentSlice;
  21. void main() {
  22. vRadius = aRadius;
  23. #if defined(dCalcType_groupId)
  24. vGroup = aGroup;
  25. #endif
  26. float scale = max(uBboxSize.z, max(uBboxSize.x, uBboxSize.y));
  27. gl_PointSize = (vRadius / scale) * max(uGridDim.x, uGridDim.y) * 6.0;
  28. vPosition = (aPosition - uBboxMin) / uBboxSize;
  29. gl_Position = vec4(vPosition * 2.0 - 1.0, 1.0);
  30. }