From 966a61ad4216bb470668924591c448893ed30259 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 27 Jan 2020 01:03:55 +0000 Subject: [PATCH 1/3] Stopped stars popping into existence --- assets/voxygen/shaders/include/sky.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/voxygen/shaders/include/sky.glsl b/assets/voxygen/shaders/include/sky.glsl index 447b90ef62..91d6237534 100644 --- a/assets/voxygen/shaders/include/sky.glsl +++ b/assets/voxygen/shaders/include/sky.glsl @@ -115,7 +115,7 @@ vec3 get_sky_color(vec3 dir, float time_of_day, vec3 origin, vec3 f_pos, float q // Add white dots for stars. Note these flicker and jump due to FXAA float star = 0.0; - if (with_stars && sun_dir.z > 0.0) { + if (with_stars) { star = is_star_at(dir); } From 115ecf15d3f6f0beb4b0069ba3e9ecaf6d74a3a7 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 27 Jan 2020 01:22:07 +0000 Subject: [PATCH 2/3] Made stars spin with sun and moon --- assets/voxygen/shaders/include/sky.glsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/voxygen/shaders/include/sky.glsl b/assets/voxygen/shaders/include/sky.glsl index 91d6237534..dcc1733bd0 100644 --- a/assets/voxygen/shaders/include/sky.glsl +++ b/assets/voxygen/shaders/include/sky.glsl @@ -116,7 +116,8 @@ vec3 get_sky_color(vec3 dir, float time_of_day, vec3 origin, vec3 f_pos, float q // Add white dots for stars. Note these flicker and jump due to FXAA float star = 0.0; if (with_stars) { - star = is_star_at(dir); + vec3 star_dir = normalize(sun_dir * dir.z + cross(sun_dir, vec3(0, 1, 0)) * dir.x + vec3(0, 1, 0) * dir.y); + star = is_star_at(star_dir); } // Sun From d2e0445b34d35429b0492ab684820a5db93ca8a5 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 27 Jan 2020 01:47:23 +0000 Subject: [PATCH 3/3] Added point light ambiance --- assets/voxygen/shaders/include/light.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/voxygen/shaders/include/light.glsl b/assets/voxygen/shaders/include/light.glsl index 6a9109fead..7c81b95c35 100644 --- a/assets/voxygen/shaders/include/light.glsl +++ b/assets/voxygen/shaders/include/light.glsl @@ -48,7 +48,7 @@ vec3 light_at(vec3 wpos, vec3 wnorm) { // Multiply the vec3 only once vec3 color = srgb_to_linear(L.light_col.rgb) * (strength * L.light_col.a); - light += color * (max(0, dot(normalize(difference), wnorm)) + LIGHT_AMBIENCE); + light += color * (max(0, dot(normalize(difference), wnorm) + 0.15) + LIGHT_AMBIENCE); } return light; }