aboutsummaryrefslogtreecommitdiffstats
path: root/shader.frag
blob: 6f90a5f9cea2503751c9650318a7313e7a6e11bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#version 130

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 = lightStrength / distance;
	vec4 color = vec4(0, 0, 0, 0.8f - pow(attenuation, 3)) * vec4(lightColor, 1);
	
	gl_FragColor = color;
}