diff options
author | KT <tran0563@umn.edu> | 2021-09-06 19:07:33 -0500 |
---|---|---|
committer | KT <tran0563@umn.edu> | 2021-09-06 19:07:33 -0500 |
commit | cccd3186305915d92b1751dc616979d64116a4aa (patch) | |
tree | 5dd4834daef547cd45fc0b643f44a10b581de0ad /dev/a6-harold/shaders/artsy.frag | |
parent | Added missing images for the A6 worksheet (diff) | |
download | csci4611-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.frag | 29 |
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; -} |