multipart rendering

This commit is contained in:
2020-03-11 19:33:38 -04:00
parent be6f0f90d9
commit e6ba81a424
2 changed files with 55 additions and 44 deletions

View File

@@ -1,12 +1,15 @@
#version 430
layout(location=2) uniform vec4 c;
layout(location=2) uniform vec4 col;
in vec4 pos;
layout(location=2) in vec3 normal;
out vec4 color;
void main() {
float d = smoothstep(-2, 2, pos.z);
color = vec4(c.xyz * d, c.w);
float bright = dot(normal, normalize(vec3(-0.6, 1, 2)));
bright = .6 + .3 * bright;
color = col;
color.xyz *= bright;
}