mirror of
https://github.com/allemangD/toddcox-visualize.git
synced 2025-11-10 12:02:47 -05:00
drawable to "slice" and add builder factory method
This commit is contained in:
@@ -64,14 +64,6 @@ void main() {
|
||||
normal = cross(sect[1].xyz - sect[0].xyz, sect[2].xyz - sect[0].xyz);
|
||||
normal = normalize(normal);
|
||||
|
||||
float r = dot(normal, sect[0].xyz);
|
||||
|
||||
if (abs(r) < 0.001)
|
||||
r = dot(normal, sect[0].xyz + vec3(0, 0, 1));
|
||||
|
||||
if (r < 0)
|
||||
normal *= -1;
|
||||
|
||||
for (int s = 0; s < S; ++s) {
|
||||
emit(sect[s]);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user