src/extras/shaders/gl3/skybox.vert
raw| 1 | #version 330 |
| 2 | |
| 3 | in vec3 vertexPosition; |
| 4 | out vec3 texCoord0; |
| 5 | |
| 6 | uniform mat4 modelMatrix; |
| 7 | uniform mat4 viewMatrix; |
| 8 | uniform mat4 projectionMatrix; |
| 9 | |
| 10 | void main() |
| 11 | { |
| 12 | texCoord0 = vertexPosition.xyz; |
| 13 | // Converting the viewMatrix to a mat3, then back to a mat4 |
| 14 | // removes the translation component from it |
| 15 | gl_Position = vec4(projectionMatrix * mat4(mat3(viewMatrix)) * modelMatrix * vec4(vertexPosition, 1.0)).xyww; |
| 16 | } |