Files
toddcox-visualize/vis/shaders/solid.fs.glsl
David Allemang 53fe3104db ENH: Dynamically enable and color tilings
Use multidraw and command buffer
2023-02-10 16:12:04 -05:00

17 lines
358 B
GLSL

#version 430
layout(location=0) in vec3 pos;
layout(location=1) in vec3 col;
layout(location=2) in vec3 normal;
out vec4 color;
void main() {
float depth = .1 + .9 * smoothstep(-2, 2, pos.z);
float bright = abs(dot(normal, normalize(vec3(-0.6, 1, 2))));
bright = .6 + .3 * bright * depth;
color = vec4(col, 1);
color.xyz *= bright;
}