aboutsummaryrefslogtreecommitdiffstats
path: root/shader.frag
diff options
context:
space:
mode:
authordrumsetmonkey <abelleisle@roadrunner.com>2015-11-04 08:42:23 -0500
committerdrumsetmonkey <abelleisle@roadrunner.com>2015-11-04 08:42:23 -0500
commitb3c87a7b30a7faf0f4366a01ed7e9b07b60370d0 (patch)
tree6689919933e0d56cba79d982868a67600c758cf8 /shader.frag
parent6b7dd6a9c031fd2129676500bc8e8633d3fcf234 (diff)
Made ray casting example
Diffstat (limited to 'shader.frag')
-rw-r--r--shader.frag8
1 files changed, 1 insertions, 7 deletions
diff --git a/shader.frag b/shader.frag
index 857c6b9..55527a1 100644
--- a/shader.frag
+++ b/shader.frag
@@ -5,16 +5,10 @@ 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 = lightStrength / distance;
- vec4 color = vec4(0, 0, 0, 0.8f - pow(attenuation, 3)) * vec4(lightColor, 1);
+ vec4 color = vec4(attenuation, attenuation, attenuation, (pow(attenuation, 3)) * vec4(lightColor, 2))+.5;
gl_FragColor = color;
}