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( mix(
SKY_DUSK_TOP, SKY_DUSK_TOP,
SKY_NIGHT_TOP, SKY_NIGHT_TOP,
max(pow(sun_dir.z, 0.2), 0) pow(max(sun_dir.z, 0.0), 0.2)
) + star, ) + star,
SKY_DAY_TOP, SKY_DAY_TOP,
max(-sun_dir.z, 0) 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( vec3 sky_mid = mix(
mix( SKY_DUSK_MID, mix( SKY_DUSK_MID,
SKY_NIGHT_MID, SKY_NIGHT_MID,
max(pow(sun_dir.z, 0.1), 0) pow(max(sun_dir.z, 0.0), 0.1)
), ),
SKY_DAY_MID, SKY_DAY_MID,
max(-sun_dir.z, 0) max(-sun_dir.z, 0)
@ -447,7 +447,7 @@ vec3 get_sky_light(vec3 dir, float time_of_day, bool with_stars) {
mix( mix(
SKY_DUSK_BOT, SKY_DUSK_BOT,
SKY_NIGHT_BOT, SKY_NIGHT_BOT,
max(pow(sun_dir.z, 0.2), 0) pow(max(sun_dir.z, 0.0), 0.2)
), ),
SKY_DAY_BOT, SKY_DAY_BOT,
max(-sun_dir.z, 0) max(-sun_dir.z, 0)