第 1 课:Vertex Shader - Vertex
我的解:没什么区别
我的解
attribute int index;
void main() {
vec2 positions[3];
positions[0] = vec2(-0.5, -0.5); // Vertex 0
positions[1] = vec2( 0.5, -0.5); // Vertex 1
positions[2] = vec2( 0.0, 0.5); // Vertex 2
gl_Position = vec4(positions[index], 0.0, 1.0);
}
复盘笔记
- 没什么区别