Skip to content

valflrt/fractal_rndr

Repository files navigation

Fractal Renderer

This is a program used to render fractals using a RON parameter file. It also has a very simple gui for an easier navigation.

Table of contents

How to install

If you have cargo installed:

cargo install fractal_rndr

Otherwise, you can download the latest executable from the releases tab.

How to use

Create a RON parameter file with the following structure (see parameter file reference and preset renders):

Frame((
    img_width: 1920,
    img_height: 1080,

    zoom: 0.000053,
    center_x: -0.1159076,
    center_y: -0.000022,
    fractal: ThirdDegreeRecWithGrowingExponent,

    max_iter: 2000,

    coloring_mode: MinMaxNorm(
        min: Custom(200),
        max: Custom(750),
        map: Linear,
    ),
    sampling: (
        level: Ultra,
        random_offsets: true,
    ),
))

Note

If the parameter file doesn't exist, it will be created automatically with default values.

Then, either ...

  • ... render the fractal:

    fractal_rndr path/to/param_file.ron path/to/output_image.png
    

    Alternatively, if you have rust installed and downloaded this repository:

    cargo run -r -- fractal.ron fractal.png
    
  • ... start the gui using the --gui option:

    fractal_rndr path/to/param_file.ron path/to/output_image.png --gui
    

    The app looks like this:

    gui

Note

Supported image formats are png and jpg (the extension is used to guess the format)

Preset renders

These are preset renders I like, you can access their parameter files by clicking on the title. There are some more in presets/.

The renders found in presets/ are licensed under CC BY 4.0

Fractal: ThirdDegreeRecWithGrowingExponent

cyggmf.png

Fractal: ThirdDegreeRecWithGrowingExponent

ukhbrp.png

Fractal: ThirdDegreeRecWithGrowingExponent

ebidxr.png

Fractal: SecondDegreeRecWithGrowingExponent

mzfyje.png

Fractal: SecondDegreeRecWithGrowingExponentParam

ecwfwb.mp4

Fractal: SecondDegreeRecWithGrowingExponent

xvebhd.png

Fractal: Iigdzh

quhuap.png

Fractal: Mandelbrot

iabppp.png

Fractal: Mjygzr

ajwrkx.png

Fractal: Vshqwj

wztpft.png

Fractal: Iigdzh

dvzrjn.png

Fractal: SecondDegreeThirtySevenBlend

ckvjjj.png

Fractal: Wmriho(a_re: -0.1, a_im: 0)

phgzbz.png

Fractal: ComplexLogisticMapLike

gqwzzr.mp4

Fractal: SecondDegreeRecAlternating1WithGrowingExponent

dmgtyz.png

Fractal: SecondDegreeRecWithGrowingExponent

datgdv.png

Ideas

  • use wgpu to perform calculations ? see this and especially this
  • use opencl to perform calculations ? see this
  • Make a new program using this one that is a purely gui program with progressive rendering
    • Progressive rendering ? Save a global raw_image and sample continuously from another thread to improve image quality
      • How to sample ? Use Low or Medium for first pass then do other passes with High (as the number of passes increases, the value of each pixel gets more and more accurate)
      • Careful: The average between new passes and the current values must be weighted: (sampling_point_count_from_start * stored_value + sampling_point_count_for_current_pass * new_value) / (sampling_point_count_from_start + sampling_point_count_for_current_pass)

Notes

  • To create a video from the frames:
    ffmpeg -framerate <fps> -pattern_type glob -i 'frames/*.png' -c:v libx264 -pix_fmt yuv420p video.mp4