engine/assets/shaders/mesh.vert.glsl
sergeypdev b749d43415 Multiple meshes + 1 point light
almost went crazy debuggging issue with multiple UBOs block bindings :)))))

Turns out if you specify layout(binding=X) in shader and later call glUniformBlockBinding (cause you don't know what you're doing)
it will mess up all your bindings, and your camera UBO will be fed to a lights array ubo and good luck debugging that.
2024-02-12 03:56:36 +04:00

22 lines
506 B
GLSL

#version 450 core
layout(location = 0) in vec3 aPos;
layout(location = 1) in vec3 aNorm;
layout(location = 0) out vec3 position;
layout(location = 1) out vec3 normal;
layout(std140, binding = 0) uniform Matrices {
mat4 projection;
mat4 view;
};
layout(location = 1) uniform mat4 model;
void main() {
gl_Position = projection * view * model * vec4(aPos.xyz, 1.0);
vec4 posWorld = model * vec4(aPos, 1.0);
position = posWorld.xyz / posWorld.w;
normal = aNorm;
}