Experimentation using Vulkan.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

29 lines
689 B

// Copyright 2022 Simon Boyé
#version 450
layout(location = 1) in vec3 in_normal;
layout(location = 2) in vec3 in_color;
layout(location = 3) in vec3 in_edge_dist;
layout(location = 0) out vec4 out_color;
void main() {
vec3 edge_dist = vec3(0.75) - in_edge_dist;
float edge = clamp(
max(edge_dist[0], max(edge_dist[1], edge_dist[2])),
0.0, 1.0
);
vec3 edge_color = vec3(1.0);
vec3 light_dir = normalize(vec3(-0.2, -0.1, -1.0));
vec3 color = in_color;
// vec3 normal = normalize(in_normal);
// color *= clamp(
// dot(normal, light_dir),
// 0.0, 1.0
// );
out_color = vec4(mix(color, edge_color, edge), 1.0);
}