Fractals/fragmentarium

Fragmentarium is an open source, cross-platform IDE by Mikael Hvidtfeldt Christensen [1] for exploring pixel based graphics on the GPU. It is inspired by Adobe's Pixel Bender, but uses GLSL, and is created specifically with fractals and generative systems in mind."

Features:

Multi-tabbed IDE, with GLSL syntax highlighting

User widgets to manipulate parameter settings.

Different 'mouse to GLSL' mapping schemes

Modular GLSL programming - include other fragments

Includes simple raytracer for distance estimated systems

Many examples including Mandelbulb, Mandelbox, Kaleidoscopic IFS, and Julia Quaternion.

Licensed and distributed under the LPGL or GPL license.

Notice: some fragment (GLSL) shaders are copyright by other authors, and may carry other licenses. Please check the fragment file header before redistributing.

Go to the ~/Fragmentarium-master/Fragmentarium-Source directory, then run Gui program :

cd ~/Fragmentarium-master/Fragmentarium-Source
./Fragmentarium-Source

Note: at this point it would be a good idea to move the Examples, Icons and Misc folders with the Fragmentarium executable into a suitable working folder and change the name of the Fragmentarium-Source.exe file.

Windows users can download the 6.0M Fragmentarium Installer and run it by navigating to your Downloads folder and clicking the installer icon.

This will install the Windows Executable + Examples Includes and Misc folders + Qt 5.6.2 runtime DLLs + GUI translation files into a working folder in your home folder with startmenu shortcuts to the executable and the Maintenance program.

This will build OpenEXR and the Fragmentarium project and install the executable with support files to C:/Fragmentarium-1.0.31-3Dickulus/Fragmentarium folder, this folder can then be relocated to wherever you like.

The archive can be extracted anywhere and the standard development environment with Qt5 OpenGL and OpenEXR should suffice.

cd <wherever>/Fragmentarium-1.0.31-3Dickulus/
sh ./mklinux.sh

This will build OpenEXR and the Fragmentarium project and install the executable and support files to <wherever>/Fragmentarium-1.0.31-3Dickulus/Fragmentarium folder, this folder can then be relocated to wherever you like.

Install git and the latest CMake and CMake-GUI programs along with ECM (Extra CMake Modules) and the standard development environment for Qt5 and OpenEXR

git clone https://github.com/3Dickulus/FragM
cd FragM/Fragmentarium-Source
mkdir build
cd build
cmake-gui .. (note: set USE_OPEN_EXR=OFF when OpenEXR is not available/desired)
make -j4
make install (note: set the install prefix in cmake-gui before running make install, it will install to /usr/local by default, user home folder is OK.)

Run from the desktop by clicking the icon for the executable file. You can drag and drop .frag , .fragparams and .png screenshot files onto the main window and Fragmentarium will open a new tab for a .frag file or apply the parameter settings to the current fragment. Settings are stored in screen shot png files in a chunk named "frAg" and are automatically recognized by Fragmentarium.

Contains options files for the video encoders, this folder is also intended for tool scripts like mkcombined.sh and the glsl.xml that describes highlighting for the code editor, at the end of glsl.xml there are places for user selectable colors and style hints so one can customize the highlighting to their own tastes.

New : Creates a new tab with a simple DE function.
Open : Creates a new tab and loads the selected fragment file.
Save : Writes the currently active tab to file.
Save As : Writes the currently active tab to filename selected by user.
Recent files list : History.
Close Tab : Closes the currently active tab and associated windows.
Exit Application : Quits Framentarium, user will be prompted if there are unsaved changes.

Build Systems : Compiles the shaders.
High Resolution and Animation Render : Opens the rendering dialog.
Output Preprocessed Script (debug) : Creates a new tab with the main fragment script after parsing all included files.
Full Screen (ESC key toggle) : Switch to full screen mode.
Save Screen Shot : Saves the current GL area. When image format is png the settings are saved in the "fRAg" chunk, Fragmentarium will recognize this chunk if the screen shot png file is dragged and dropped onto the main window and will attempt to apply those settings to the current fragment.
Edit Command Script : Opens a simple editor and allows creating, loading and running a .fqs file, see fqScript folder for examples.
Video Encoding : Opens a dialog where the user can select mencoder or ffmpeg to create videos from a folder of generated images.

Reset All : Resets all uniforms to their specified default values.
Copy Settings : Copies all variable settings to the clipboard.
Copy Group : Copies a single group (variable editor tab) to the clipboard.
Paste from Clipboard : Pastes clipbaord contents into variable editor.
Paste Selected Text : Pastes the selected text (usually from a preset in the code window) into the variable editor.
Save to File : Creates a parameters file.
Load from File : Loads a parameters file.

When OpenEXR is installed on your system this menu should be populated with these commands. Selecting a command from this menu will display a usage help dialog, these are all commandline programs and only information about the command is shown here.

High Resolution and Animation Render : Opens the render dialog. Here you can render a single image or a range of images for animation.
Easing Curves : This dialog represents the easing options available for the currently selected slider.
Timeline : A crude representation of keframes and easing curves, still under development.
Preferences : Main program global options.
Video Encoding : To setup mencoder or ffmpeg, some example options files are in the Misc folder.

Sets the number of row and column tiles, this value squared = total tiles.

void setSubFrames(int);

Sets the number of frames to accumulate.

void setOutputBaseFileName(String);

Sets the filename for saved image, if script has total control this must be set by the script for every frame, if animation is using frag file settings, keyframes etc., then this only needs to be set once to basename and Fragmentarium will add an index padded to 5 digits.

void setFps(int);

Sets the frames per second for rendering.

void setStartFrame(int);

Sets the start frame number for rendering a range of frames.

void setEndFrame(int);

Sets the end frame number for rendering a range of frames.

void setAnimation(bool);

FALSE sets animation to script control exclusively. TRUE enables control from keyframes and easing curves.

void setPreview(bool);

TRUE will preview frames in a window on the desktop instead of saving image files.

Simply includes the referenced file. If the filename is a relative filename, Fragmentarium first searches for the file relative to the location of the current executing file (if it is saved), otherwise the paths specified in the 'include path' preference are searched.

#camera 3D

Tells Fragmentarium to setup a 3D camera model, making it possible to adjust the camera using the mouse on the canvas.

#camera 2D

Tells Fragmentarium to setup a 2D camera model.

#group parameter group name

Makes it possible to order GUI elements in groups.

#info "hello there"

Outputs info when compiling the fragment. Useful for attributions.

#includeonly "some.frag"

Experimental. Includes 'some.frag', but will ignore any 'include' commands in that file.

#replace "before" "after"

Experimental. Replaces the given patterns in all subsequent read lines (not in previously parsed lines).

#donotrun

Tells Fragmentarium that it should not attempt to run this file - it is meant be included from another file.

#preset name

Marks the beginning of a section with parameter settings. These will appear in a drop-down combobox in the parameter editor window.

The line: uniform float Angle; slider[45.00,0,360] in the GLSL editor will make a simple variable editor widget appear.

To create widgets for other types of uniforms...

uniformtypename ; widget[min,default,max]locktype

The keyword uniform must always be present at the beginning of the line.locktype can be one of locked notlocked notlockable alwayslocked defaults to notlocked
In the Menu/Edit/Preferences dialog you can select the behavior of lock handling. "Locked" uniforms can be interpreted as "#define"s or as "const"s in the final GLSL code the gets sent to the GPU.

type and widget can be one of these GLSL valid types and corresponding Fragmentarium widgets...

1 #include "2D.frag" 2 3 // The simplest way to draw something in Fragmentarium, 4 // is to include the "2D.frag" header. 5 // 6 // Now, we can implement a simple 'color' function, 7 // which for each point in the plane returns a RGB color. 8 // 9 // Notice, that you can zoom using the mouse or the keyboard.10 // (A,S,D,W,Q,E,1,3)11 12 vec3color(vec2c){13 returnvec3(cos(c.x),sin(c.y),sin(c.x*c.y));14 }

1 #include "2D.frag" 2 3 // It is easy to create custom variables, 4 // and tie them to sliders in the user interface. 5 // 6 // Hint: use the context menu to quickly 7 // insert templates for different variable types. 8 // Here you can also see the different types 9 // of variables.10 11 // Organize controls by grouping them 12 #group MySystem13 14 // Creates a floating point variable,15 // with a slider with minimum = 0,16 // default = 1, and maximum 10.17 uniformfloatX;slider[0,1,10]18 uniformfloatY;slider[0,1,10]19 20 // Use the variable like any other in the code21 // (But don't assign to them)22 vec3color(vec2c){23 returnvec3(cos(c.x*X)+sin(c.y*Y),24 sin(c.x*Y)+cos(c.y*X),25 sin(c.x*c.y));26 }27 28 // It is possible to store one or more user variable29 // settings in a Preset.30 //31 // Preset are parsed at build time, and will32 // appear in the drop-down box in the Parameter 33 // window, where they can be quickly applied.34 35 // Presets with the name 'Default'36 // will be automatically assigned,37 // when the system is built the first time.38 #preset Default39 Center=-0.221053,0.48818940 Zoom=0.18690741 AntiAliasScale=142 AntiAlias=143 X=1.297744 #endpreset45 46 // Create presets by using the47 // 'Copy to Clipboard' button in the 48 // Parameter window.49 #preset Preset 250 Center=-0.221053,0.48818951 Zoom=0.33565852 AntiAliasScale=153 AntiAlias=154 X=6.870255 Y=0.305356 Y=6.335957 #endpreset

Add this line to your frag code, preferably in the "Camera" group if the AutoFocus widget doesn't already exist...

uniform bool AutoFocus; checkbox[false]

Now you can enable/disable focal plane target tracking, the focal plane default maximum distance is 5,

if you need more than that open the .frag file that contains the "FocalPlane" widget and edit the maximum...

uniform float FocalPlane; slider[0,1,5]

to what ever you need like...

uniform float FocalPlane; slider[0,1,50]

keep in mind that the target floats around at some distance from the camera, dynamically adjusted (sometimes a lot) as you navigate, it is generally beyond what you are looking at and will need to be set before you create a keyframe or they will need to be adjusted by hand in the keyframe presets.

NOTE:Mid Mouse Button Click on the fractal object should set the target at the surface of the fractal where you click.

These settings can be saved by using "Range" in the preset name like "#preset Range-100-200", the frame numbers have no impact on the easing curve values and are ignored, they are so the human can be reminded of what this range covers, allows for unique names like "Range-fogIn" "Range-fogOut" etc., these ranges can also be applied via fqScript eg: applyPresetByName("Range-fogIn")

These can be placed in the "Default" preset so that when a frag is loaded from cmdline eg:remote machine, they will be active immediately.

Much of the inspiration and formulas for Fragmentarium came from the community at FractalForums.com, including Tom Beddard, Jan Kadlec, Iñigo Quilez, Buddhi, Jesse, and others. Special thanks goes out to Knighty and Kali for their great fragments. All fragments should include information about their origins - please notify me, if I made any mis-attributions.

The icons used are part of the Everaldo: Crystal project.

Fragmentarium is built using the Qt cross-platform GUI framework.

Translations by Fractal Forums users:

Russian SCORPION

Russian Crist-JRoger

German Sabine

Dutch Sabine

Contributors, This means allmost everyone at FractalForums.com over the last 7 years? This list is not complete.

3Dickulus

Adam Majewski

bermarte

Buddhi

cKleinhuis

Claude

Crist-JRodger

DarkBeam

Eiffie

Íñigo Quílez

Jesse

Kali

Knighty

M Benesi

mclarekin

Patryk Kizny

Stefan Gustavson

Sabine

SCORPION

Syntopia

SubBlue

tglad

Tryptophan

Vinz

_revers_

...just to name a few, if anyone can add to this list it would be a great help. If you contributed an idea or fix to the GUI or source code then I think your user/name deserves mention here too.