gl01/internal/asset/shader/world.vert
2022-01-20 21:58:50 +08:00

29 lines
576 B
GLSL

#version 330
uniform mat4 projection;
uniform mat4 view;
uniform mat4 model;
uniform mat4 lightspace;
layout (location = 0) in vec3 vert;
layout (location = 1) in vec3 normal;
layout (location = 2) in vec2 vertTexCoord;
layout (location = 3) in float light;
out vec4 fragPos;
out vec4 fragPosLightspace;
out vec2 fragTexCoord;
out vec3 fragNormal;
void main() {
fragTexCoord = vertTexCoord;
fragNormal = normalize(normal);
gl_Position = projection * view * model * vec4(vert, 1);
fragPos = model * vec4(vert, 1);
fragPosLightspace = lightspace * fragPos;
}