source:
network-game/graphics_library/SimpleTransform.vertexshader
| Last change on this file was 2ce5154, checked in by , 12 years ago | |
|---|---|
|
|
| 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.
![(please configure the [header_logo] section in trac.ini)](/medieval/chrome/site/your_project_logo.png)