Skip to content

bezo97/IFSRenderer

Repository files navigation

IFSRenderer     


3D IFS fractal renderer and editor

DemoWikiDownload

release library dotnet

help license

IFSRenderer started as a weekend project to help me understand how the fractal flame algorithm works. My initial goal was to just implement it in 3D, but it has grown into a passion project and then into my master's thesis. I'm releasing it as an open-source project in the hope that it will be useful to the fractal artist community.

🗸 Features

  • Render 3D IFS (Iterated Function System) fractals
  • Real-time interaction
  • Node-based editor
  • Mutation-style generator
  • Extendable with Plug-Ins
  • Animations
  • Fisheye projection, ideal for planetarium dome masters

Planned:

  • Gradient editor
  • Animation curve editor
  • More intuitive coloring methods
  • Add Your Ideas

📀 Installation

Minimum Requirements

  • Windows 10 or later
  • OpenGL 4.5 capable graphics card

Downloads

Get the latest installer or portable version HERE.
Previous versions can be found on the Releases tab.

Build instructions

You may build the project yourself using Visual Studio 2022 (with .NET Desktop Development workload). Since the default transforms are hosted in a separate repo, use the --recurse-submodules switch when cloning:

git clone --recurse-submodules https://github.com/bezo97/IFSRenderer.git

The Setup project uses a VS extension, which is not required to build the portable IFSRenderer executable. You can ignore the "unsupported" warning and keep the Setup project unloaded.

Contributing

Please follow the .editorconfig file in the root of the repository. If you submit a pr it must have the right formatting, otherwise the PR fails. You can fix the formatting by using the cleanup found in Visual Studio / Visual Studio Code / Rider, which will respect the editorconfig.

To fix the formatting through the CLI run the following in the root of the project:

# You only need to restore the first time, or when the tools change
dotnet tool restore

dotnet dotnet-format

🕹️ Usage

Using the editor

Beginners should start with the Getting Started Guide. See the Wiki for more.

Using the library

Add the latest NuGet package to your project. Here are some getting-started snippets.

Show snippets

Generate a random fractal:

//Initialize
using RendererGL renderer = new(graphicsContext);
renderer.Initialize(loadedTransforms);
Generator generator = new(loadedTransforms);
//Generate fractal
IFS fractal = generator.GenerateOne(new GeneratorOptions{ });
fractal.ImageResolution = new Size(1920, 1080);
//Render
renderer.LoadParams(fractal);
renderer.DispatchCompute();
renderer.RenderImage();
//Save HDR image
var histogramData = await renderer.ReadHistogramData();
using var fstream = File.Create(path);
OpenEXR.WriteStream(fstream, histogramData);

Modify a fractal programmatically:

//Load from file
IFS myFractal1 = IfsSerializer.LoadJson("myFractal1.ifsjson", loadedTransforms, true);
//Change params
Iterator selected = myFractal1.Iterators.First(i => i.Opacity == 0);
Iterator duplicated = myFractal1.DuplicateIterator(selected);
duplicated.Opacity = 1;
duplicated.TransformVariables["Strength"] = 10.0;
//Save to file
IfsSerializer.SaveJson(myFractal1, "myFractal1.ifsjson");

Render images:

for (double i = 0.0; i <= 1.0; i += 0.1)
{
    selectedIterator.TransformVariables["weight"] = i;
    renderer.InvalidateParams();
    renderer.DispatchCompute();
    renderer.RenderImage();
    var image = await renderer.ReadPixelData();
    myRenderedImages.Add(image);
}

Alternatively, image data can be written directly to a bitmap:

await renderer.CopyPixelDataToBitmap(myBitmapPtr);

❔ Support

Acknowledgements

Below is a list of awesome people who contributed to IFSRenderer, thank you! I'd like to also mention people who indirectly helped the project succeed through teachings/mentorship/advices/etc.: ancientc, BenceKovari, drecouse, lycium, tibitoth

Contributors

bezo97 (Creator & Maintainer), AliBee, KuraiAndras, Rychveldir, Sekkmer, Bastitron, Add Your Name


⚖️ License

Copyright (C) 2021-2024 Dócs Zoltán & contributors
IFSRenderer is licensed under GPLv3.