direct-volume.vert 775 B

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * Copyright (c) 2017-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 mat4 aTransform;
  10. attribute float aInstance;
  11. varying vec3 unitCoord;
  12. varying vec3 origPos;
  13. varying float instance;
  14. uniform vec3 uBboxSize;
  15. uniform vec3 uBboxMin;
  16. uniform vec3 uBboxMax;
  17. uniform mat4 uModelView;
  18. uniform mat4 uProjection;
  19. void main() {
  20. unitCoord = aPosition + vec3(0.5);
  21. vec4 mvPosition = uModelView * vec4(unitCoord * uBboxSize + uBboxMin, 1.0);
  22. origPos = unitCoord * uBboxSize + uBboxMin;
  23. instance = aInstance;
  24. gl_Position = uProjection * mvPosition;
  25. }