diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2015-10-15 09:08:13 -0400 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2015-10-15 09:08:13 -0400 |
commit | 42da2e6dd95c29c723ee5377241d97e29e251903 (patch) | |
tree | ef0395bb9f4d73422b974fa1838c44c62a284eb1 /shader.frag | |
parent | 5c2179bc9afa809fa3b915bea0d75f62f90f0644 (diff) | |
parent | ef74ae83db1d3049e4e890df77d25ac6e1f7719f (diff) |
quest fixes
Diffstat (limited to 'shader.frag')
-rw-r--r-- | shader.frag | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/shader.frag b/shader.frag new file mode 100644 index 0000000..7627a12 --- /dev/null +++ b/shader.frag @@ -0,0 +1,13 @@ +#version 140
+
+uniform vec2 lightLocation;
+uniform vec3 lightColor;
+uniform float screenHeight;
+
+void main(){
+ float distance = length(lightLocation - gl_FragCoord.xy);
+ float attenuation = 1.0 / distance;
+ vec4 color = vec4(attenuation, attenuation, attenuation, pow(attenuation, 3)) * vec4(lightColor, 1);
+
+ gl_FragColor = color;
+}
\ No newline at end of file |