aboutsummaryrefslogtreecommitdiffstats
path: root/shader.frag
diff options
context:
space:
mode:
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