| 1 |
#version 450 |
| 2 |
|
| 3 |
layout(set = 0, binding = 0) uniform Matrices |
| 4 |
{ |
| 5 |
mat4 vpMatrix; |
| 6 |
mat4 wMatrix; |
| 7 |
mat4x3 wMatrix4x3; |
| 8 |
mat3x4 wMatrix3x4; |
| 9 |
}; |
| 10 |
|
| 11 |
layout(location = 0) in vec3 InPos; |
| 12 |
layout(location = 1) in vec3 InNormal; |
| 13 |
|
| 14 |
layout(location = 0) out vec3 OutNormal; |
| 15 |
layout(location = 1) out vec4 OutWorldPos[4]; |
| 16 |
|
| 17 |
void main() |
| 18 |
{ |
| 19 |
gl_Position = vpMatrix * wMatrix * vec4(InPos, 1); |
| 20 |
OutWorldPos[0] = wMatrix * vec4(InPos, 1); |
| 21 |
OutWorldPos[1] = vec4(InPos, 1) * wMatrix; |
| 22 |
OutWorldPos[2] = wMatrix3x4 * InPos; |
| 23 |
OutWorldPos[3] = InPos * wMatrix4x3; |
| 24 |
OutNormal = (wMatrix * vec4(InNormal, 0)).xyz; |
| 25 |
} |