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