From 65fa35533b5f8e26b57a31d5972a7649d71ad684 Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Tue, 26 Jul 2016 21:59:22 +0300 Subject: [PATCH] smoothstep for the horizon --- sdr/skydome.p.glsl | 2 +- src/main.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdr/skydome.p.glsl b/sdr/skydome.p.glsl index 62a3475..d774adc 100644 --- a/sdr/skydome.p.glsl +++ b/sdr/skydome.p.glsl @@ -14,7 +14,7 @@ void main() vec3 color = sky_grad(ty, mid_point); float horiz = ty + fbm(tx * horiz_scale, 4, horiz_scale) * 0.035; - color = mix(fog_color, color, step(0.035, horiz)); + color = mix(fog_color, color, smoothstep(0.034, 0.035, horiz)); gl_FragColor.rgb = color; gl_FragColor.a = 1.0; diff --git a/src/main.cc b/src/main.cc index 942db47..7e700a6 100644 --- a/src/main.cc +++ b/src/main.cc @@ -18,7 +18,7 @@ int main(int argc, char **argv) } SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); - SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 1); + SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4); SDL_GL_SetAttribute(SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, 1); int x = SDL_WINDOWPOS_UNDEFINED; -- 1.7.10.4