diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-05-15 03:31:34 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-05-15 03:31:34 +0200 |
commit | 442c8cdeffac21482540aeecefb9e7564166e681 (patch) | |
tree | 0ae920419eb7e6a7099692d5586b774bf694b83c | |
parent | 75bfa35a6d2f4e727f011e178a1d47d43f8ede71 (diff) |
Anti aliasing, change shading
-rw-r--r-- | flag.glsl | 3 | ||||
-rw-r--r-- | src/main.cpp | 5 |
2 files changed, 4 insertions, 4 deletions
@@ -10,9 +10,8 @@ void main() { uv.y += offset*uv.x*2.0 - 0.25; vec4 col = texture2D(texture, uv*2.0); - //col.rgb *= (1.0 + (0.0 + 0.5*(offset+0.04)*50.0)); col.rgb *= 0.9; - col.rgb += 0.1 * -sine; + col.rgb += (0.1 * sine*(uv.x*2.0)); if(uv.x < 0.0 || uv.x > 0.5 || uv.y < 0.0 || uv.y > 0.5) col.a = 0.0; diff --git a/src/main.cpp b/src/main.cpp index 0359622..12ac8eb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -13,7 +13,7 @@ int main() { texture.setSmooth(true); sf::Vector2u window_size = texture.getSize(); - sf::RenderWindow window(sf::VideoMode(window_size.x, window_size.y), "SFML works!", 0); + sf::RenderWindow window(sf::VideoMode(window_size.x, window_size.y), "SFML works!", 0, sf::ContextSettings(0, 0, 4)); window.setVerticalSyncEnabled(false); window.setFramerateLimit(0); @@ -65,7 +65,7 @@ int main() { sf::Image output_image; output_image.create(flag_width, flag_height, sf::Color::Transparent); - const float playtime_sec = 2.0f; + const float playtime_sec = 1.78f; const float frame_time = 1000.0 / (double)fps / 1000.0; double elapsed_frame_time = 0.0; @@ -93,6 +93,7 @@ int main() { break; } + window.close(); running = false; work_thread.join(); system("ffmpeg -i \"frames/%d.png\" -framerate 24 -filter_complex \"fps=24,split=2[palette_in][gif];[palette_in]palettegen[palette_out];[gif]fifo[gif_fifo]; [gif_fifo][palette_out]paletteuse\" -y output.gif"); |