Giter Site home page Giter Site logo

futswirl's Introduction

futswirl

Build Status

Screenshot

futswirl is a small framework for working with IFS fractals.

Requires Futhark and SDL2 and SDL2-ttf libraries with associated header files.

Building and running

Run make run to build and run in a window. Adjust settings in settings.fut.

Rendering approaches

futswirl supports two ways of rendering fractals:

  • scalarloop: Every point is calculated efficiently without any intermediate memory accesses. This approach also allows rendering more points that can be manifested in memory, as the mapping over all points is fused with the later pixel rendering phase.

  • cullbranches (default): When zoomed in, this approach will choose to not calculate branches whose points are not shown. This allows for much further zooming, but needs to loop over arrays, not scalars, and as such has more memory accesses than the scalarloop approach. Note: You might run out of memory if you don't watch out. Also, fractals have varying levels of locality, so this approach will not always be able to cull a lot (the printed "rotated square radius" value needs to be low).

Controls

  • ESC: Exit the program.
  • F1: Toggle the text in the upper-left corner.
  • 1: Generate a new random fractal (shown when the default fractal random is picked).
  • 2, 3, 4: Do the same as r, but limit the kind of random fractals to 2, 3, or 4 transforms per iteration.
  • 0: Toggle auto mode. When enabled, futswirl will automatically generate new random fractals (when the default random is picked) once in a while.
  • r: Toggle between the two rendering approaches.
  • d: Toggle between 2D fractals and 3D fractals.
  • f: Toggle between 32-bit floats and 64-bit floats.
  • Left/right: Change which fractal to show.
  • Down/up: Adjust the number of iterations for the current kind of fractal (only affects the scalarloop rendering approach).
  • PageUp/PageDown: Zoom in/out.
  • Home: Reset viewport.
  • Left click and drag: Adjust the viewport.
  • Mouse wheel scroll: Zoom in/out.
  • Right click: Automatic zoom.
  • Right click and mouse wheel scroll: Adjust automatic zoom speed.
  • Shift+Left/Right/Down/Up: Adjust the viewport.
  • Space: Pause/unpause.

Time moves slower when zoomed in. This keeps the fractal movement at a manageable pace even when the viewport is small.

Adding new fractals

Define your fractals in swirl/fractals_2d.fut and swirl/fractals_3d.fut.

License

futswirl is free software under the terms of the GNU General Public License version 3 (or any later version). Copyright (C) 2019 Niels G. W. Serup.

futswirl's People

Contributors

nqpz avatar athas avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.