drawable to "slice" and add builder factory method

This commit is contained in:
2020-03-14 00:36:46 -04:00
parent 0300e1bfc3
commit f06f92bd9b
3 changed files with 66 additions and 88 deletions

View File

@@ -2,13 +2,15 @@
layout(location=2) uniform vec4 col;
layout(location=0) in vec3 pos;
layout(location=2) in vec3 normal;
out vec4 color;
void main() {
float bright = dot(normal, normalize(vec3(-0.6, 1, 2)));
bright = .6 + .3 * bright;
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 = col;
color.xyz *= bright;