kale/shaders/scene.frag

25 lines
750 B
GLSL

#version 460
layout(location = 0) in vec4 v_color;
layout(location = 1) in vec2 v_uv;
layout(location = 2) in vec3 v_normal_vs;
layout(location = 0) out vec4 out_color;
layout(set = 2, binding = 0) uniform sampler2D atlas;
void main() {
vec3 light_dir = normalize(vec3(0.5, 1.0, 0.8));
float ambient = 0.2;
float diffuse = max(dot(v_normal_vs, light_dir), 0.0);
float lighting = ambient + (1.0 - ambient) * diffuse;
vec2 uv = vec2(v_uv.x, 1.0-v_uv.y);
out_color = texture(atlas, uv);// + v_color;
//out_color = v_color * vec4(v_normal_vs,1.0);
//out_color = vec4(v_color.rgb * lighting, v_color.a);
//out_color = vec4(1.0);
//out_color = vec4(viz(v_normal_vs), 1.0);
//out_color = vec4(lighting);
}