quad.vert 474 B

12345678910111213141516171819
  1. /**
  2. * Copyright (c) 2019 mol* contributors, licensed under MIT, See LICENSE file for more info.
  3. *
  4. * @author Alexander Rose <alexander.rose@weirdbyte.de>
  5. */
  6. precision mediump float;
  7. attribute vec2 aPosition;
  8. // the output UV coordinate for each fragment
  9. varying vec2 vCoordinate;
  10. const vec2 scale = vec2(0.5, 0.5);
  11. void main(void) {
  12. vCoordinate = aPosition * scale + scale; // scale vertex attribute to [0,1] range
  13. gl_Position = vec4(aPosition, 0.0, 1.0);
  14. }