1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#version 450
layout(constant_id = 0) const int NUM_LIGHTS = 4;
layout(constant_id = 1) const float BRIGHTNESS = 1.0;
layout(constant_id = 2) const bool USE_GAMMA = true;
layout(set = 0, binding = 0) uniform uniforms_Block {
vec3 base_color;
float ambient;
} uniforms;
layout(location = 0) in vec3 in_position;
void main() {
gl_Position = vec4(in_position, 1.0);
}
layout(location = 0) in vec4 in_frag_coord;
layout(location = 0) out vec4 out_color;
void main() {
vec3 color = (uniforms.base_color * uniforms.ambient);
int i = 0;
while ((i < NUM_LIGHTS)) {
color = (color + vec3(0.1, 0.1, 0.1));
i = (i + 1);
}
color = (color * BRIGHTNESS);
out_color = vec4(color, 1.0);
}