| 1 |
#version 450 |
| 2 |
|
| 3 |
layout(location = 0) in vec3 vertexPosition; |
| 4 |
layout(location = 1) in vec2 vertexTexCoord; |
| 5 |
|
| 6 |
layout(location = 0) out vec3 position; |
| 7 |
layout(location = 1) out vec2 texCoord; |
| 8 |
|
| 9 |
layout(std140, binding = 0) uniform qt3d_render_view_uniforms { |
| 10 |
mat4 viewMatrix; |
| 11 |
mat4 projectionMatrix; |
| 12 |
mat4 uncorrectedProjectionMatrix; |
| 13 |
mat4 clipCorrectionMatrix; |
| 14 |
mat4 viewProjectionMatrix; |
| 15 |
mat4 inverseViewMatrix; |
| 16 |
mat4 inverseProjectionMatrix; |
| 17 |
mat4 inverseViewProjectionMatrix; |
| 18 |
mat4 viewportMatrix; |
| 19 |
mat4 inverseViewportMatrix; |
| 20 |
vec4 textureTransformMatrix; |
| 21 |
vec3 eyePosition; |
| 22 |
float aspectRatio; |
| 23 |
float gamma; |
| 24 |
float exposure; |
| 25 |
float time; |
| 26 |
}; |
| 27 |
|
| 28 |
layout(std140, binding = 1) uniform qt3d_command_uniforms { |
| 29 |
mat4 modelMatrix; |
| 30 |
mat4 inverseModelMatrix; |
| 31 |
mat4 modelView; |
| 32 |
mat3 modelNormalMatrix; |
| 33 |
mat4 inverseModelViewMatrix; |
| 34 |
mat4 mvp; |
| 35 |
mat4 inverseModelViewProjectionMatrix; |
| 36 |
}; |
| 37 |
|
| 38 |
layout(std140, binding = 2) uniform qt3d_custom_uniforms { |
| 39 |
mat3 texCoordTransform; |
| 40 |
}; |
| 41 |
|
| 42 |
void main() |
| 43 |
{ |
| 44 |
vec3 tt = texCoordTransform * vec3(vertexTexCoord, 1.0); |
| 45 |
texCoord = (tt / tt.z).xy; |
| 46 |
position = vec3( modelView * vec4( vertexPosition, 1.0 ) ); |
| 47 |
|
| 48 |
gl_Position = mvp * vec4( vertexPosition, 1.0 ); |
| 49 |
} |