3layout(location = 0) in vec3 position;
4layout(location = 1) in vec3 color;
5layout(location = 2) in vec3 normal;
6layout(location = 3) in vec2 uv;
8layout(location = 0) out vec3 fragColor;
9layout(location = 1) out vec3 fragPosWorld;
10layout(location = 2) out vec3 fragNormalWorld;
11layout(location = 3) out vec2 fragUv;
14 vec4 position; // ignore w
15 vec4 color; // w is intensity
19layout(set = 0, binding = 0) uniform GlobalUbo {
23 vec4 ambientLightColor; // w is intensity
24 PointLight pointLights[10];
28layout(set = 1, binding = 0) uniform ObjectBufferData {
33layout(push_constant) uniform Push {
39 vec4 positionWorld = object.modelMatrix * vec4(position, 1.0);
40 gl_Position = ubo.projection * ubo.view * positionWorld;
41 fragNormalWorld = normalize(mat3(object.normalMatrix) * normal);
42 fragPosWorld = positionWorld.xyz;