You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
440 B
C
20 lines
440 B
C
#ifdef GL_ES
|
|
precision mediump float;
|
|
#endif
|
|
|
|
varying vec2 v_Position;
|
|
varying vec4 v_Colour;
|
|
|
|
uniform vec2 flashlightPos;
|
|
uniform vec2 flashlightSize;
|
|
|
|
uniform float flashlightLightness;
|
|
|
|
const float smoothness = 1.1;
|
|
|
|
vec4 getColourAt(vec2, vec2, vec4);
|
|
|
|
void main(void)
|
|
{
|
|
gl_FragColor = mix(vec4(0.0, 0.0, 0.0, 1.0), getColourAt(flashlightPos - v_Position, flashlightSize, v_Colour), flashlightLightness);
|
|
} |