Properly account for negative sun_dir.z in pow use in sky shaders

This commit is contained in:
Imbris 2021-04-27 18:40:08 -04:00 committed by Avi Weinstock
parent 8d4bbed6c9
commit e8874b18c9

View File

@ -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)