aboutsummaryrefslogtreecommitdiffstats
path: root/shader.frag
blob: 83c8bdcb2eec9f8063b98158622488395c584a15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#version 130

uniform vec2 lightLocation;
uniform vec3 lightColor;
uniform float screenHeight;

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);
	
	gl_FragColor = color;
}