aboutsummaryrefslogtreecommitdiffstats
path: root/shader.frag
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-10-15 09:08:13 -0400
committerClyne Sullivan <tullivan99@gmail.com>2015-10-15 09:08:13 -0400
commit42da2e6dd95c29c723ee5377241d97e29e251903 (patch)
treeef0395bb9f4d73422b974fa1838c44c62a284eb1 /shader.frag
parent5c2179bc9afa809fa3b915bea0d75f62f90f0644 (diff)
parentef74ae83db1d3049e4e890df77d25ac6e1f7719f (diff)
quest fixes
Diffstat (limited to 'shader.frag')
-rw-r--r--shader.frag13
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