KuraiAndras / IFSRenderer

3D IFS fractal renderer and editor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Planned:

  • Animations
  • More intuitive coloring methods
  • Crossplatform CLI (Command-line interface)
  • A better name & logo
  • Add Your Ideas

📀 Installation

Minimum Requirements

  • Windows 10
  • .NET Desktop Runtime 6 (installed on demand)
  • 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.

🕹️ 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


⚖️ License

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

Contributors

bezo97 (Creator & Maintainer)
Contributors: AliBee, Rychveldir, Sekkmer, Add Your Name

About

3D IFS fractal renderer and editor

License:GNU General Public License v3.0


Languages

Language:C# 92.2%Language:GLSL 7.8%