smoothstep for the horizon
authorJohn Tsiombikas <nuclear@mutantstargoat.com>
Tue, 26 Jul 2016 18:59:22 +0000 (21:59 +0300)
committerJohn Tsiombikas <nuclear@mutantstargoat.com>
Tue, 26 Jul 2016 18:59:22 +0000 (21:59 +0300)
sdr/skydome.p.glsl
src/main.cc

index 62a3475..d774adc 100644 (file)
@@ -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;
        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;
 
        gl_FragColor.rgb = color;
        gl_FragColor.a = 1.0;
index 942db47..7e700a6 100644 (file)
@@ -18,7 +18,7 @@ int main(int argc, char **argv)
        }
 
        SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
        }
 
        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;
        SDL_GL_SetAttribute(SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, 1);
 
        int x = SDL_WINDOWPOS_UNDEFINED;