diff --git a/assets/voxygen/shaders/include/random.glsl b/assets/voxygen/shaders/include/random.glsl index 240d17e50a..7d217d858e 100644 --- a/assets/voxygen/shaders/include/random.glsl +++ b/assets/voxygen/shaders/include/random.glsl @@ -1,5 +1,5 @@ float hash(vec4 p) { - p = fract(p * 0.3183099 + 0.1); + p = fract(p * 0.3183099 + 0.1) - fract(p + 23.22121); p *= 17.0; return (fract(p.x * p.y * p.z * p.w * (p.x + p.y + p.z + p.w)) - 0.5) * 2.0; } diff --git a/assets/voxygen/shaders/include/sky.glsl b/assets/voxygen/shaders/include/sky.glsl index 6fd726230b..fe12499086 100644 --- a/assets/voxygen/shaders/include/sky.glsl +++ b/assets/voxygen/shaders/include/sky.glsl @@ -94,10 +94,10 @@ float is_star_at(vec3 dir) { vec3 pos = (floor(dir * star_scale) - 0.5) / star_scale; // Noisy offsets - pos += (3.0 / star_scale) * rand_perm_3(pos); + pos += (3.0 / star_scale) * (1.0 + hash(pos.yxzz) * 0.85); // Find distance to fragment - float dist = length(normalize(pos) - dir); + float dist = length(pos - dir); // Star threshold if (dist < 0.0015) {