12 lines
356 B
Plaintext
12 lines
356 B
Plaintext
|
|
||
|
extern vec2 stars[30];
|
||
|
|
||
|
vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords)
|
||
|
{
|
||
|
float dist = 1000;
|
||
|
for (int i = 0; i<30; i++) {
|
||
|
dist = min(dist, pow(stars[i].x - screen_coords.x, 2) + pow(stars[i].y - screen_coords.y, 2));
|
||
|
}
|
||
|
return max(Texel(texture, texture_coords), vec4(1.0,1.0,1.0,1.0)/sqrt(dist));
|
||
|
}
|