Last change
on this file since ace001a was 2ce5154, checked in by dportnoy <dmp1488@…>, 11 years ago |
new OpenGL program added, that might replace the client's 2D graphics someday
|
-
Property mode
set to
100644
|
File size:
670 bytes
|
Line | |
---|
1 | #version 330 core
|
---|
2 |
|
---|
3 | // Input vertex data, different for all executions of this shader.
|
---|
4 | layout(location = 0) in vec3 vertexPosition_modelspace;
|
---|
5 |
|
---|
6 | // Notice that the "1" here equals the "1" in glVertexAttribPointer
|
---|
7 | layout(location = 1) in vec3 vertexColor;
|
---|
8 |
|
---|
9 | // Output data ; will be interpolated for each fragment.
|
---|
10 | out vec3 fragmentColor;
|
---|
11 | // Values that stay constant for the whole mesh.
|
---|
12 | uniform mat4 MVP;
|
---|
13 |
|
---|
14 | void main(){
|
---|
15 |
|
---|
16 | // Output position of the vertex, in clip space : MVP * position
|
---|
17 | gl_Position = MVP * vec4(vertexPosition_modelspace,1);
|
---|
18 |
|
---|
19 | // The color of each vertex will be interpolated
|
---|
20 | // to produce the color of each fragment
|
---|
21 | fragmentColor = vertexColor;
|
---|
22 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.