From: John Tsiombikas Date: Mon, 17 Oct 2022 12:46:35 +0000 (+0300) Subject: fixed fog regression X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=voxscape;a=commitdiff_plain;h=ef75bad26f83c81ee777ca28f38dc181014a5b00 fixed fog regression --- diff --git a/src/main.c b/src/main.c index bcf2250..daa03bf 100644 --- a/src/main.c +++ b/src/main.c @@ -133,8 +133,6 @@ void display(void) { update(); - memset(fb, 0, sizeof fb); - vox_render(vox); vox_sky_grad(vox, COLOR_HORIZON, COLOR_ZENITH); diff --git a/src/voxscape.c b/src/voxscape.c index bcd3abf..7d39a8b 100644 --- a/src/voxscape.c +++ b/src/voxscape.c @@ -287,7 +287,7 @@ void vox_render_slice(struct voxscape *vox, int n) uint32_t *fbptr; if(vox->zfog > 0 && n > vox->zfog) { - fog = ((n - vox->zfog) << 8) / (vox->zfar - vox->zfog); + fog = ((n - vox->zfog) << 16) / (vox->zfar - vox->zfog); } else { fog = 0; }