Fractals/ultrafractal

From Wikibooks, open books for an open world
Jump to navigation Jump to search

UltraFractal is a program by Frederik Slijkerman

licence[edit]

Copyright © 1997-2017 Frederik Slijkerman

install[edit]

Linux[edit]

use wine

Help[edit]

  • file types[1]
  • Fractal Forum [2]

formula[edit]

outside coloring[edit]

ExponentialSmoothing[edit]



ExponentialSmoothing {
; from Standard.ucl
; This coloring method provides smooth iteration
; colors for all fractal types, convergent or
; divergent (or both).  It combines the two methods
; developed by Ron Barnett.  It doesn't map
; precisely to iterations, but it's close.
;
; Written by Damien M. Jones
;
init:
  float sum = 0.0
  float sum2 = 0.0
  complex zold = (0,0)
  
loop:
  IF (@diverge)
    sum = sum + exp(-cabs(#z))
  ENDIF
  IF (@converge)
    sum2 = sum2 + exp(-1/cabs(zold-#z))
  ENDIF
  zold = #z

final:
  IF (|#z - zold| < 0.5)	; convergent bailout.
    IF (@converge)
      #index = sum2
    ELSE
      #index = 0
    ENDIF
    
  ELSE				; divergent bailout.
    IF (@diverge)
      #index = sum * @divergescale
    ELSE
      #index = 0
    ENDIF
  ENDIF
  
default:
  title = "Exponential Smoothing"
  helpfile = "Uf*.chm"
  helptopic = "Html/coloring/standard/exponentialsmoothing.html"
$IFDEF VER50
  rating = recommended
$ENDIF

  param diverge
    caption = "Color Divergent"
    default = FALSE
    hint = "If checked, points which escape to infinity will be \
            colored."
  endparam
  param converge
    caption = "Color Convergent"
    default = TRUE
    hint = "If checked, points which collapse to one value will be \
            colored."
  endparam
  param divergescale
    caption = "Divergent Density"
    default = 1.0
$IFDEF VER40
    exponential = true
$ENDIF
    hint = "Sets the divergent coloring density, relative to the \
            convergent coloring. If set to 1.0, they will use \
       	    the same color density."
  endparam
}

smooth[edit]

Smooth(OUTSIDE) {
; from Standard.ucl
; This coloring method provides smooth iteration
; colors for Mandelbrot and other z^2 formula types
; (Phoenix, Julia).  Results on other types may be
; unpredictable, but might be interesting.
;
; Thanks to F. Slijkerman for some tweaks.
; Thanks to Linas Vepstas for the math.
;
; Written by Damien M. Jones
;
init:
  complex il = 1/log(@power)		; Inverse log (power).
  float lp = log(log(@bailout))		; log(log bailout).

final:
  #index = 0.05 * real(#numiter + il*lp - il*log(log(cabs(#z))))

default:
  title = "Smooth (Mandelbrot)"
  helpfile = "Uf*.chm"
  helptopic = "Html/coloring/standard/smooth.html"
$IFDEF VER50
  rating = recommended
$ENDIF

  param power
    caption = "Exponent"
    default = (2,0)
    hint = "This should be set to match the exponent of the \
            formula you are using. For Mandelbrot, this is usually 2."
  endparam
  param bailout
    caption = "Bail-out value"
    default = 128.0
    min = 1
    hint = "This should be set to match the bail-out value in \
            the Formula tab. This formula works best with bail-out \
            values higher than 100."
  endparam
}

binary decomposition[edit]

comment {

  This file contains standard coloring algorithms for Ultra Fractal 3.
  Many of the coloring algorithms here were written by other formula
  authors, as noted in the comments with each formula. All formulas
  have been edited and simplified by Frederik Slijkerman.
  
}

BinaryDecomposition {
; from standard.ucl
; Classic binary decomposition. Can give quite abstract effects.
; Use low bail-out values in the fractal formula (if possible) for
; best effects. This coloring algorithm uses just two colors from
; the gradient: one from the left end and one from the middle.
;
final:
  if @type == "Type 1"
    if real(#z) * imag(#z) >= 0 
      #index = 0.5
    else
      #index = 0
    endif
  else
    if atan2(#z) > 0
      #index = 0.5
    else
      #index = 0
    endif
  endif  
default:
  title = "Binary Decomposition"
  helpfile = "Uf3.chm"
  helptopic = "Html/coloring/standard/binarydecomposition.html"
  param type
    caption = "Decomposition Type"
    enum = "Type 1" "Type 2"
    default = 0
    hint = "Toggles between two types of binary decomposition. Type 2 \
            reproduces the coloring used with many images in the classic \
            Beauty of Fractals book."
  endparam
}

slope[edit]

// http://www.fractalforums.com/mandel-machine/maybe-perturbation-could-go-with-a-slope/	
	
mbrot2_slope {
fractal:
  title="mbrot2_slope" width=1024 height=400 layers=1
  credits="Alef;12/4/2014;Frederik;7/23/2010"
layer:
  caption="Background" opacity=100
mapping:
  center=-0.61777095064903/0.6790465094562 magn=19180.711
  angle=156.5545
formula:
  maxiter=1000 filename="Standard.ufm" entry="SlopeMandel" p_start=0/0
  p_power=2/0 p_bailout=1.0E20 p_offset=0.000000000000001
  p_zmode=potential p_xfer=linear p_zscale=1.0 p_zscale2=0.005
  p_everyiter=no
inside:
  transfer=none
outside:
  transfer=linear filename="Standard.ucl" entry="Decomposition"
gradient:
  comments="slightly changed standart. IMHO good sky." smooth=no
  rotation=1 index=0 color=6303744 index=64 color=12085789 index=168
  color=16777197 index=257 color=33023 index=343 color=512
opacity:
  smooth=no index=0 opacity=255
}


mbrot3_slope {
; copyright Kerry Mitchell 15sep98
;  
; sample image to illustrate
; embossing effect
fractal:
  title="mbrot3_slope" width=1024 height=512 layers=1
  credits="Alef;12/4/2014;Kerry Mitchell;9/15/1998"
layer:
  caption="Layer 1" opacity=100 method=linear
mapping:
  center=-0.81810721128409/0.19884197484006 magn=4118.0018
  angle=34.1619
formula:
  maxiter=1000 percheck=off filename="Standard.ufm"
  entry="SlopeMandel" p_start=0/0 p_power=2/0 p_bailout=1.0E20
  p_offset=0.000000000000001 p_zmode="distance estimator"
  p_xfer=linear p_zscale=1.0 p_zscale2=0.005 p_everyiter=no
inside:
  transfer=none
outside:
  transfer=linear filename="Standard.ucl" entry="Decomposition"
gradient:
  comments="slightly changed standart. IMHO good sky." smooth=no
  rotation=1 index=0 color=6303744 index=64 color=12085789 index=168
  color=16777197 index=257 color=33023 index=343 color=512
opacity:
  smooth=no index=0 opacity=255
} 

field lines[edit]

"There's a later version of my formula for field lines - though somewhat extended to include smooth iteration, distance estimation and distance estimation angles in my class formulas for UF - mmf.ulb called "MMF Field Estimator" It's a UF class formula so not quite so easy to follow but I think it should be clear enough. I boiled down "corrections" to field lines that work in most places but at the moment require manual adjustment to work properly - these are the two parameters that can be modified by the user to fix errors in the field lines, unfortunately you can't always fix them everywhere in view even then but this is about as close as you can get I think. I tried including the MMF Field Lines code here but unfortunately it's too long, it's in mmf.ulb in te Ultra Fractal Formula database at: http://formulas.ultrafractal.com/ " David Makin

MMF3-FieldLines {
;
; This version of calculating field lines will work reasonably well with both
; Mandelbrot and Julia Sets for divergent fractals with a divergence that is
; close to being a positive integer >=2 but can also produce quite interesting
; results with fractals that do not fit that criteria - just not rendering the
; field lines correctly in other cases :-)
;
; Thanks to Chris Hayton for showing me how to fix the "off-by-one" problems.
;  http://www.fractalforums.com/programming/smooth-external-angle-of-mandelbrot-set/
; David Makin
; Here's my code from mmf3.ucl for Ultra Fractal:
; 
global:
  float twopi = 2.0*#pi
  float dtwopi = 0.5/#pi
  float dp = 1.0/@power
  float m = @power*dtwopi
  float dp2 = 1.0/(2.0+@power) ; Changed from originally trying 1/power
init:
  complex zv[#maxiter]
  int i = 0
  float a = 0.0
  float b = 0.0
  float c = 0.0
  float s = 0.0
  if @julia
    zv[i] = #z
    i = i + 1
  endif
loop:
  zv[i] = #z
  i = i + 1
final:
  if (s = atan2(#z))<0
    s = s + twopi
  endif
  while i > @skipiter
    i = i - 1
    if @version==0
      b = (@power*atan2(zv[i]))%twopi
    else
      b = atan2(zv[i]^@power)
    endif
    if b < 0.0
      b = b + twopi
    endif
    c = c + b - s
    if c >= #pi
      s = s + twopi
      if @fixit || @accident
        c = c - twopi
      endif
    elseif c < -#pi
      s = s - twopi
      if @fixit || @accident
        c = c + twopi
      endif
    endif
    if @fixit
      c = dp2*c
    elseif !@accident
      c = 0.0
    endif
    if (a = atan2(zv[i])) < 0.0
      a = a + twopi
    endif
    s = dp*(s + twopi*floor(a*m))
  endwhile
  s = s*dtwopi
  if @fixskip
    while s<0.0
      s = s + 1.0
    endwhile
    while s>=1.0
      s = s - 1.0
    endwhile
  endif
  #index = s
default:
  title = "MMF3 Field Lines (use high bailouts)"
  heading
    caption = "Information"
;    text = "This colouring is a little touchy around certain values, if you \
;            get obvious lines or dots that shouldn't be there but the 'Degree \
;            of Divergence' is set properly for the main formula and you are \
;            using a high bailout of say 1e20 or higher then try \
;            adjusting the location very slightly. For example if vertical \
;            lines appear on an unrotated fractal then try changing the x \
;            (real) location very slightly, if horizontal lines appear then try \
;            changing the y (imag) location very slightly."
  endheading
  heading
  endheading
  param version
    caption = "Version"
    enum = "Original" "Alternative"
    default = 1
    hint = "Allows you to modify one of the calculations in the formula that \
            is particularly sensitive to small errors. Ideally both methods \
            should produce identical results but they don't, so if you get \
            visible errors using one method then try the other (assuming you \
            have the divergence set correctly and are using a high bailout)."
  endparam
  param power
    caption = "Degree of divergence"
    default = 2.0
    hint = "This is an estimate of the divergence of the main formula, e.g. 2 \
            for z^2+c, 3 for z^3+c etc."
  endparam
  param julia
    caption = "Julia ?"
    default = false
    hint = "Enable for correct rendering of Julia Sets."
  endparam
  param skipiter
    caption = "'Start' iteration"
    default = 0
    min = 0
    hint = "You can use this to attempt to get better detail at higher \
            iteration depths, note that it only works as intended with 'Color \
            Density' as a whole integer >=1."
  endparam
  param fixskip
    caption = "Fix 'Start' iteration"
    default = false
    hint = "Fixes a problem when the start iteration is non-zero and maybe in \
            other cases - specifically if you get solid areas of palette \
            colour zero when the Transfer Function is Linear this may fix the \
            problem."
  endparam
  param fixit
    caption = "Fix Field Lines"
    default = false
    hint = "Enable this to make the formula much more accurate at rendering \
            the field lines correctly. It's a fudge produced after trial and \
            error but is quite effective at correcting some areas."
  endparam
  param accident
    caption = "Happy Accident"
    default = false
    hint = "You may find the colouring useful when this is enabled. This \
            is available as I found the results when initially adding the \
            'Fix it' option quite interesting."
    visible = !@fixit
  endparam
}

images[edit]

files[edit]

  • ufr : Fractal Files *.ufr
  • upr : Displays parameter files (*.upr)
  • par : Older Fractint parameter files (*.par)
  • ugr : Displays gradient files (*.ugr)
  • ual : Older gradient files (*.ual)
  • map : Fractint palette files (*.map)
  • uxf : Displays transformation files (*.uxf)
  • ufm : Displays fractal formula files (*.ufm). Fractal formula files contain multiple fractal formulas. Older Fractint formula files (*.frm) are also shown. See Fractal formulas.
  • ucl : Displays coloring algorithm files (*.ucl). See also writing coloring algorithm
  • ulb : Displays plug-in library files (*.ulb)

gradient[edit]

references[edit]

  1. ultrafractal file formats
  2. Fractalforum : ultrafractal