1 uniform sampler2D uTexGarbage;
10 const vec3 uCamera = vec3(0.0);
12 #include "light_clearskies_stddef.glsl"
13 #include "common_world.glsl"
14 #include "motion_vectors_fs.glsl"
16 float stars1( vec3 rd, float rr, float size ){
19 float a = atan(co.y, length(co.xz)) + 4.0 * PI;
21 float spaces = 1.0 / rr;
22 size = (rr * 0.0015) * fwidth(a) * 1000.0 * size;
23 a -= mod(a, spaces) - spaces * 0.5;
25 float count = floor(sqrt(pow(rr, 2.0) * (1.0 - pow(sin(a), 2.0))) * 3.0);
27 float plane = atan(co.z, co.x) + 4.0 * PI;
28 plane = plane - mod(plane, PI / count);
30 vec2 delta = rand33(vec3(plane, a, 0.0)).xy;
32 float level = sin(a + spaces * (delta.y - 0.5) * (1.0 - size)) * rr;
33 float ydist = sqrt(rr * rr - level * level);
34 float angle = plane + (PI * (delta.x * (1.0-size) + size * 0.5) / count);
35 vec3 center = vec3(cos(angle) * ydist, level, sin(angle) * ydist);
36 float star = smoothstep(size, 0.0, distance(center, co));
41 compute_motion_vectors();
43 vec3 rd = -normalize(aNorm);
46 for( float j = 1.0; j <= 4.1; j += 1.0 ){
47 float m = mix(0.6, 0.9, smoothstep(1.0, 2.0, j));
48 star += stars( rd, 1.94 * pow( 1.64, j ), m ) * (1.0 / pow(4.0, j));
51 oColour = vec4( vec3(star*20.0), 1.0);