| 1 |
#version 450 |
| 2 |
|
| 3 |
layout(location = 0) in vec3 vertexPosition; |
| 4 |
layout(location = 1) in vec3 vertexNormal; |
| 5 |
layout(location = 2) in vec4 vertexColor; |
| 6 |
|
| 7 |
layout(location = 0) out vec3 worldPosition; |
| 8 |
layout(location = 1) out vec3 worldNormal; |
| 9 |
layout(location = 2) out vec4 color; |
| 10 |
|
| 11 |
layout(std140, binding = 1) uniform qt3d_command_uniforms { |
| 12 |
mat4 modelMatrix; |
| 13 |
mat4 inverseModelMatrix; |
| 14 |
mat4 modelViewMatrix; |
| 15 |
mat3 modelNormalMatrix; |
| 16 |
mat4 inverseModelViewMatrix; |
| 17 |
mat4 mvp; |
| 18 |
mat4 inverseModelViewProjectionMatrix; |
| 19 |
}; |
| 20 |
|
| 21 |
void main() |
| 22 |
{ |
| 23 |
worldNormal = normalize( modelNormalMatrix * vertexNormal ); |
| 24 |
worldPosition = vec3( modelMatrix * vec4( vertexPosition, 1.0 ) ); |
| 25 |
color = vertexColor; |
| 26 |
|
| 27 |
gl_Position = mvp * vec4( vertexPosition, 1.0 ); |
| 28 |
} |