vulkano/examples/teapot/vert.glsl

19 lines
432 B
Plaintext
Raw Normal View History

#version 450
layout(location = 0) in vec3 position;
layout(location = 1) in vec3 normal;
layout(location = 0) out vec3 v_normal;
layout(set = 0, binding = 0) uniform Data {
mat4 world;
mat4 view;
mat4 proj;
} uniforms;
void main() {
mat4 worldview = uniforms.view * uniforms.world;
v_normal = transpose(inverse(mat3(worldview))) * normal;
gl_Position = uniforms.proj * worldview * vec4(position, 1.0);
}