summaryrefslogtreecommitdiffstats
path: root/dev/a5-artrender/shaders/outline.vert
diff options
context:
space:
mode:
authorMatt Strapp <matt@mattstrapp.net>2021-11-24 09:18:24 -0600
committerMatt Strapp <matt@mattstrapp.net>2021-11-24 09:18:24 -0600
commit843308f07547b969c97efc23848f4e81b50a5b24 (patch)
treeb709343d4b06880dbd0b06776bc2aa8a57fd9602 /dev/a5-artrender/shaders/outline.vert
parentMerge branch 'support-code' of https://github.umn.edu/umn-csci-4611-f21/share... (diff)
downloadcsci4611-843308f07547b969c97efc23848f4e81b50a5b24.tar
csci4611-843308f07547b969c97efc23848f4e81b50a5b24.tar.gz
csci4611-843308f07547b969c97efc23848f4e81b50a5b24.tar.bz2
csci4611-843308f07547b969c97efc23848f4e81b50a5b24.tar.lz
csci4611-843308f07547b969c97efc23848f4e81b50a5b24.tar.xz
csci4611-843308f07547b969c97efc23848f4e81b50a5b24.tar.zst
csci4611-843308f07547b969c97efc23848f4e81b50a5b24.zip
Do a5
Diffstat (limited to 'dev/a5-artrender/shaders/outline.vert')
-rw-r--r--dev/a5-artrender/shaders/outline.vert10
1 files changed, 9 insertions, 1 deletions
diff --git a/dev/a5-artrender/shaders/outline.vert b/dev/a5-artrender/shaders/outline.vert
index 302cfeb..58e1308 100644
--- a/dev/a5-artrender/shaders/outline.vert
+++ b/dev/a5-artrender/shaders/outline.vert
@@ -18,5 +18,13 @@ layout(location = 2) in vec3 left_normal;
layout(location = 3) in vec3 right_normal;
void main() {
- gl_Position = proj_matrix * model_view_matrix * vec4(vertex,1);
+ vec3 e = (model_view_matrix * vec4(vertex, 1.0)).xyz;
+ vec3 n_vertex = vertex;
+ vec3 ln = (normal_matrix * vec4(left_normal, 1.0)).xyz;
+ vec3 rn = (normal_matrix * vec4(right_normal, 1.0)).xyz;
+ if (dot(ln, e) * dot(rn, e) < 0.0) {
+ n_vertex = vertex + thickness * normal;
+ }
+
+ gl_Position = proj_matrix * model_view_matrix * vec4(n_vertex,1);
}