From b3c87a7b30a7faf0f4366a01ed7e9b07b60370d0 Mon Sep 17 00:00:00 2001 From: drumsetmonkey Date: Wed, 4 Nov 2015 08:42:23 -0500 Subject: Made ray casting example --- shader.frag | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'shader.frag') 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; } -- cgit v1.2.3