3const vec2 OFFSETS[6] = vec2[](
12layout(location = 0) out vec2 fragOffset;
15 vec4 position; // ignore w
16 vec4 color; // w is intensity
20layout(set = 0, binding = 0) uniform GlobalUbo {
24 vec4 ambientLightColor; // w is intensity
25 PointLight pointLights[10];
29layout(push_constant) uniform Push {
36 fragOffset = OFFSETS[gl_VertexIndex];
37 vec3 cameraRightWorld = vec3(ubo.view[0][0], ubo.view[1][0], ubo.view[2][0]);
38 vec3 cameraUpWorld = vec3(ubo.view[0][1], ubo.view[1][1], ubo.view[2][1]);
40 vec3 positionWorld = push.position.xyz
41 + push.radius * fragOffset.x * cameraRightWorld
42 + push.radius * fragOffset.y * cameraUpWorld;
44 gl_Position = ubo.projection * ubo.view * vec4(positionWorld, 1.0);