Can someone explain the math in this example to me?
https://github.com/regl-project/regl/blob/gh-pages/example/texture.js
specifically the gl_Position = vec4(1.0 - 2.0 * position, 0, 1);
I don't get what this magic 1.0-2.0* position
is doing
1.0 - 2.0 * position
becomes 1 - 2 X 0 = 1 when position is 0, or 1 - 2 X 1 = -1 when position is 1.
flipY
when loading the texture.
gl_FragColor = texture2D(tex, uv);