From e8874b18c9eab417ecf84cba2dc7a327389022e1 Mon Sep 17 00:00:00 2001 From: Imbris Date: Tue, 27 Apr 2021 18:40:08 -0400 Subject: [PATCH] Properly account for negative sun_dir.z in pow use in sky shaders --- assets/voxygen/shaders/include/sky.glsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/voxygen/shaders/include/sky.glsl b/assets/voxygen/shaders/include/sky.glsl index 43a773f7cc..b44c95d522 100644 --- a/assets/voxygen/shaders/include/sky.glsl +++ b/assets/voxygen/shaders/include/sky.glsl @@ -428,7 +428,7 @@ vec3 get_sky_light(vec3 dir, float time_of_day, bool with_stars) { mix( SKY_DUSK_TOP, SKY_NIGHT_TOP, - max(pow(sun_dir.z, 0.2), 0) + pow(max(sun_dir.z, 0.0), 0.2) ) + star, SKY_DAY_TOP, max(-sun_dir.z, 0) @@ -437,7 +437,7 @@ vec3 get_sky_light(vec3 dir, float time_of_day, bool with_stars) { vec3 sky_mid = mix( mix( SKY_DUSK_MID, SKY_NIGHT_MID, - max(pow(sun_dir.z, 0.1), 0) + pow(max(sun_dir.z, 0.0), 0.1) ), SKY_DAY_MID, max(-sun_dir.z, 0) @@ -447,7 +447,7 @@ vec3 get_sky_light(vec3 dir, float time_of_day, bool with_stars) { mix( SKY_DUSK_BOT, SKY_NIGHT_BOT, - max(pow(sun_dir.z, 0.2), 0) + pow(max(sun_dir.z, 0.0), 0.2) ), SKY_DAY_BOT, max(-sun_dir.z, 0)