summaryrefslogtreecommitdiffstats
path: root/dev/a6-harold/shaders/artsy.frag
diff options
context:
space:
mode:
authorKT <tran0563@umn.edu>2021-09-06 19:07:33 -0500
committerKT <tran0563@umn.edu>2021-09-06 19:07:33 -0500
commitcccd3186305915d92b1751dc616979d64116a4aa (patch)
tree5dd4834daef547cd45fc0b643f44a10b581de0ad /dev/a6-harold/shaders/artsy.frag
parentAdded missing images for the A6 worksheet (diff)
downloadcsci4611-cccd3186305915d92b1751dc616979d64116a4aa.tar
csci4611-cccd3186305915d92b1751dc616979d64116a4aa.tar.gz
csci4611-cccd3186305915d92b1751dc616979d64116a4aa.tar.bz2
csci4611-cccd3186305915d92b1751dc616979d64116a4aa.tar.lz
csci4611-cccd3186305915d92b1751dc616979d64116a4aa.tar.xz
csci4611-cccd3186305915d92b1751dc616979d64116a4aa.tar.zst
csci4611-cccd3186305915d92b1751dc616979d64116a4aa.zip
Upload a1
Diffstat (limited to '')
-rw-r--r--dev/a6-harold/shaders/artsy.frag29
1 files changed, 0 insertions, 29 deletions
diff --git a/dev/a6-harold/shaders/artsy.frag b/dev/a6-harold/shaders/artsy.frag
deleted file mode 100644
index 403009d..0000000
--- a/dev/a6-harold/shaders/artsy.frag
+++ /dev/null
@@ -1,29 +0,0 @@
-#version 330
-
-in vec3 Position;
-in vec3 Normal;
-
-out vec4 color;
-
-uniform vec3 lightPosition;
-uniform vec4 Ia, Id, Is;
-
-uniform vec4 ka, kd, ks;
-uniform float s;
-
-uniform sampler2D diffuseRamp;
-uniform sampler2D specularRamp;
-
-
-void main() {
- vec3 l = normalize(lightPosition.xyz - Position);
- vec3 n = normalize(Normal);
- vec3 e = normalize(-Position);
- vec3 h = normalize(e + l);
- float diffuse = (dot(l,n) + 1)/2;
- float specular = pow(max(dot(n,h),0), s);
- color = ka*Ia
- + kd*Id*texture(diffuseRamp, vec2(diffuse,0))
- + ks*Is*texture(specularRamp, vec2(specular,0));
- color.a = 1;
-}