Harbor

branch main
showing the latest snapshot on main
basic_fragment.glsl 434 B · Plain text
gpu/shader/tests/golden/basic_fragment.glsl 0644 Raw
#version 450

layout(set = 0, binding = 0) uniform sampler2D material_tex;

layout(location = 0) in vec2 in_uv;
layout(location = 1) in vec3 in_normal;
layout(location = 0) out vec4 out__value;

void main() {
	vec4 albedo = texture(material_tex, in_uv);
	vec3 n = normalize(in_normal);
	vec3 light_dir = normalize(vec3(1.0, 1.0, 0.5));
	float light = max(dot(n, light_dir), 0.0);
	out__value = vec4((albedo.rgb * light), albedo.a);
}