aboutsummaryrefslogtreecommitdiffstats
path: root/shader.frag
diff options
context:
space:
mode:
authordrumsetmonkey <abelleisle@roadrunner.com>2015-11-02 08:50:39 -0500
committerdrumsetmonkey <abelleisle@roadrunner.com>2015-11-02 08:50:39 -0500
commit822d9d5b5ef34c3ec2b5ebaded5744bdba8bade1 (patch)
tree856a40ce0b43d44394923181e128eca2cb6f4c1b /shader.frag
parent59a2fce5a1149b076fdf49701ad729e9536c7eee (diff)
Added new project for lighting test
Diffstat (limited to 'shader.frag')
-rw-r--r--shader.frag11
1 files changed, 9 insertions, 2 deletions
diff --git a/shader.frag b/shader.frag
index 83c8bdc..6f90a5f 100644
--- a/shader.frag
+++ b/shader.frag
@@ -2,12 +2,19 @@
uniform vec2 lightLocation;
uniform vec3 lightColor;
+uniform float lightStrength;
uniform float screenHeight;
+uniform vec2 rayStart;
+uniform vec2 rayEnd;
+
+uniform sampler2D tex;
+uniform vec2 resolution;
+
void main(){
float distance = length(lightLocation - gl_FragCoord.xy);
- float attenuation = 3.0 / distance;
- vec4 color = vec4(attenuation, attenuation, attenuation, pow(attenuation, 3)) * vec4(lightColor, 1);
+ float attenuation = lightStrength / distance;
+ vec4 color = vec4(0, 0, 0, 0.8f - pow(attenuation, 3)) * vec4(lightColor, 1);
gl_FragColor = color;
} \ No newline at end of file