github.com/cybriq/giocore@v0.0.7-0.20210703034601-cfb9cb5f3900/gpu/headless/shaders/simple.vert (about)

     1  #version 310 es
     2  
     3  // SPDX-License-Identifier: Unlicense OR MIT
     4  
     5  precision highp float;
     6  
     7  void main() {
     8  	float x, y;
     9  	if (gl_VertexIndex == 0) {
    10  		x = 0.0;
    11  		y = .5;
    12  	} else if (gl_VertexIndex == 1) {
    13  		x = .5;
    14  		y = -.5;
    15  	} else {
    16  		x = -.5;
    17  		y = -.5;
    18  	}
    19  	gl_Position = vec4(x, y, 0.5, 1.0);
    20  }