Harbor

branch main
showing the latest snapshot on main
spec_constant.glsl 691 B · Plain text
shader/tests/golden/spec_constant.glsl 0644 Raw
#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);
}