Much improved version. + Now this allows much larger sample size * screen resolution. (sample size * screen resolution can exeed integer number upper limit). (800*600)*5000=2 400 000 000 when largest possible integer is +2 147 483 647.
(added extra loop, so that nested loop calculates fractal in 12 parts thus 2 400 000 000/12=200 000 000 (<< 2 147 483 647) so allowing integer math.)
+ Better zooming as it woun't loose so much density by puting hits on pixels outside of screen.
+ More formulas and colour switches.
(some from Fractint Ogfrom, alsou Perpendicular Mandelbrot, and looking in mmf and slightly modifying some formulas found that z=formula*iterations*0.05+c can create cool cosmic deities.
Colours nicely improves when going throught sine, becouse all white regions with colour values >1 ar turned back to colours.)
+ Tweaked the coefficients.
+ Removed excess internal variables.
+ You can put lucky number and see, how different random seeds picks different orbits. Standart random numbers aren't too much random, but this nonrandomness allows to show specific orbits, and with same seed they always 'll be the same orbits.
Still haven't managed to implement class switch, becouse it needs formula(z, c) which don't use #pixel variable. Standart class switch uses formula(z) with #pixel inside of pluggin class. But buddhabrot is calculated in global section before programm reads #pixel. Any tips? But I think, now this in enought good condition to be finalised, just need to write some explanations.
This is slightly different from buddhabrot and antibuddhabrot algorithms that it don't divides escaping and non escaping points, so it is both a buddhabrot and antibudhabrot, anyway, most interesting are region in between and so it needs fewer samples to create final shape what is pretty handy if you are dependent on outside aplication and don't want to look on clock too much. Alsou this do not reiterate formula. And colours here are calculated differently than of standart nebulabrot with 3 iteration numbers, colours still depends on how much times pixel is hit by orbit, but colours are calculated as smooth growing curve so that RGB have different curves. Probably last thing pronounces first notable orbits.
Fractal1 {
::+IviZjn2lNVTPuJMQ07Ix/BEnaPssYSgQalPsJra6ltqa3D9Y1EbDYVjN12sJp/67YgkGpKk
QMf8ezb+gGLw8g6TxRJJepXJopfZ2FJN5kk77o155JdCZbnnWhfqgLCrjSCIYWBX6d00ncco
/zkiHxncSRac0UaT0ygBv0opp7A2vatmRNPNxMAMp/ClgM6tg2NAWh2TvIcxR9wwgU3OjG9K
s08si8yVlbIrX9YeSP0qpks1xRNGb/oCmStHOLD5G4sRqEaoHbn38gmDWe2YTfaCym9CN97y
zCFqSp2J5i5uPoiGEu2oFxRmR//HSJ1CweH5vYcdSozc0a8ZjM1tCcfg0AHD/0B9DKxzCskY
jjjyc05VNXMZ5E48UPM6pPUPDap/o77EHv46Ev/0Zjy4VYoBzpAwAMPYnt2gWjap/dBzbs0H
yzKn5BXoSHw5UCa87Rg3ATZUkVGIQ+Hhjhpobxx62gHL7HTb/F8o9XnvBWHKNoEeP2/PLtYl
S2jaa0ioTDpeS6ZdveYH9bTTyAco/oMsezzIFTS35bwLi6HSeDHp7NO89LyzJfYQYlGuk9xA
TqQBfFBta7iKQNC2gnqyrxPgWb3eL4BsBuFbXogl3jN4ZVcUrF4BBNted9GD2p4pXiUzFnp5
JMshs06Nkqi66FvhzqZ/kKSBpuscJAu7muUnituqcLZJwq/hosCPpmv5vvmaztSe9PiiSUw/
FglkokN=
}
Moshiahobrot.ucl:Moshiahobrot {
; This is different from standart Buddhabrot in that
; colours are calculated from progressive curves
; using Wave Trichrome method, who actualy are inspired by RGB Buddhabrots and needs fewer iterations.
; As it don't tests for insdes or outsides of fractal, but mixes buddhabrot and antibuddhabrot.
; source code for this mostly is taken from Susan D. Chambless buddhabrot.
; and one more loop.
;By Edgar Malinovsky 02.12.2012.
::Z/BUlin2luxavtNyxPbD4/DDkveVPsktssTcOdqwh5hODkkm6krtBHSAoIXJxGKSdkU2SC3P
+OzsP4uUkJHaNQkEndmZndetzsLzJH/Dv8Vv+u39K4l3d/rexHP54Fxpz8j/pTOeecqfBElE
kJ8zFZTuQDyPpIKOaxyi7nM88bl/6gxmaGb6Bj5ZGz7kjBcKKgchIEmAwt0PiSWvpgGBAJlh
+F+4kVF00DB5RgkAJ2u+xIitFZbSCafK+QxyOWjucRR5oLFkExDT/b8IwPLzfXOMPNDufKLq
yJad027/NHeemLP+MSOkOfeOq7EJQ0K/FCHyn+/H5e/PQOvmC8jD2E7XIgZbCDX6DxpprhV+
J7gioVicj5YzaRGNmUDzgiDS3kUIyAyTggGkuads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14B
O6ZfjNqk3z9B8RCvCjey1NzI9/BTs4jMUuOJ6ZfXJqOOVjMNcw3TkcTYR5UqViGe93TiqhR1
qkGZzo/LPj+IhA==
}
Moshiahobrot {
; This is different from standart Buddhabrot in that
; colours are calculated from progressive curves
; using Wave Trichrome method, who actualy are inspired by RGB Buddhabrots and needs fewer iterations.
; As it don't tests for insdes or outsides of fractal, but mixes buddhabrot and antibuddhabrot.
; source code for this mostly is taken from Susan D. Chambless buddhabrot.
; and one more loop.
;By Edgar Malinovsky 02.12.2012.
$DEFINE DIRECT
global:
float increaser=0
float antilightR=1/@lightR
float antilightG=1/@lightG
float antilightB=1/@lightB
int seed = @seedinput
float dataR=1
float dataG=1
float dataB=1
int pwid = trunc(#width)
int phgt = trunc(#height)
;3 arrays for RGB
float pixR[trunc(#width),trunc(#height)] ; offscreen image
float pixG[trunc(#width),trunc(#height)] ; offscreen image
float pixB[trunc(#width),trunc(#height)] ; offscreen image
;calculate buddha loop many times
int superloop=1
int slcounter =0
complex locations[@maxiter] ; collect locations
int cnt = 0 ; Loop counters
float colourcnt = 0 ;colourcounter
int x = 0, int y = 0 ; Loop counters & integer coords
float xc = real(#center) ; Scaling constants
float yc = -imag(#center)
float sina = sin(#angle)
float cosa = cos(#angle)
float srcMinX = - (@srcWidth * 0.5)
float srcMinY = - (@srcHeight * 0.5)
float scale = (#height * #magn) / 3*(@sizescaling)
float nsamples =0
;float tenth =0
int irandX1 =0
int irandY1 =0
float srcX1 =0
float srcY1 =0
complex z =0
complex c =0
int iter =0
int locindex =0
float dx =0
float dy =0
; Initialize arrays of RGB pixels with neutral colour.
while x < #width
y = 0
while y < #height
pixR[x, y] = @ambient
pixG[x, y] = @ambient
pixB[x, y] = @ambient
y = y + 1
endwhile
x = x + 1
endwhile
; Main buddha iteration loop
nsamples = round(#width * #height* #magn)
cnt = 0
;if sample number is too large, divide single
;loop in many small. 12 divides better than 10.
IF @sampleDensity > 41472
nsamples = trunc(nsamples/144)
superloop=144
ELSEIF @sampleDensity > 3456
nsamples = trunc(nsamples/12)
superloop=12
ENDIF
nsamples = nsamples * @sampleDensity
;tenth = round(nsamples / 10)
while slcounter < superloop ; superloop
while cnt < nsamples ;main buddha loop
; generate random integers (-#randomrange to #randomrange)
irandX1 = seed = random(seed)
irandY1 = seed = random(seed)
; convert to random float numbers
srcX1 = (abs(irandX1) / #randomrange)*@srcWidth + srcMinX
srcY1 = (abs(irandY1) / #randomrange)*@srcHeight + srcMinY
; Mbrot set with random c value
z = 0
c = srcX1 + flip(srcY1)
; iteration count and modulus, this don't need large bailout
iter = 0
while (cabs(z) < 4) && (iter < @maxIter) ;fractal formula loop
IF (@formula ==0)
;Mandelbrot
z= z^@power +c
ELSEIF (@formula ==1)
;Talis
z= z^@power/(z^(@power-1) + @talisadd) +c
ELSEIF (@formula ==2)
;Starbrot
z= z*0.5 - z^@starpower + c
ELSEIF (@formula ==3)
;Tricorn
z= conj(z^@power)+c
ELSEIF (@formula ==4)
;BurningSihp
z=abs(z^@power)+c
ELSEIF (@formula ==5)
;8th modulus Mbrot
z=sqr(z)
z=(z^8+z^8)^0.125+c
ELSEIF (@formula ==6)
;Unit Vector - Mbrot
z=z^@power+c
z= z/cabs(z)*@unitvector +z
ELSEIF (@formula ==7)
;Quadratic General
z= sqr(real(z)) + sqr(imag(z))+ flip(real(z)*imag(z)*@quadfactor) + c
ELSEIF (@formula ==8)
;Celtic Mandelbrot
z = z^@power
z = z - real(z) + abs(real(z)) - c
ELSEIF (@formula ==9)
;Rotated Mandelbrot
z=z^@power+c
z=sqr(z)/cabs(z)
ELSEIF (@formula ==10)
;Chebyshev4Axolotl
z = (sqr(z)*(35 * sqr(z) - 30) + 3) / 8 + c
ELSEIF (@formula ==11)
;Mbrot*iters
z=z^@power*iter*0.05 +c
ELSEIF (@formula ==12)
;Talis*iters
z=z^@power*(z^(@power-1)+iter*0.05)+c
ELSEIF (@formula ==13)
;Tricorn*iters
z= conj(z^@power*iter*0.05)+c
ELSEIF (@formula ==14)
;BurningShip*iters
z= abs(z^@power*iter*0.05)+c
ELSEIF (@formula ==15)
;QuadGen*iters
z= (sqr(real(z)) + sqr(imag(z))+ flip(real(z)*imag(z)*@quadfactor) )*iter*0.05 + c
ELSEIF (@formula ==16)
;Trotsky Dragon
z = sqr(z) + sqr(z)*(z+c) - sin(z+@talisadd) + c
ELSEIF (@formula ==17)
;Multipowerbrot Odd
z= ((((z^3*c+1i)^3)+1i)^3)+1i
ELSEIF (@formula ==18)
;Magnetic
z=(z^real(z)+c)/(real(z)-c)
ELSEIF (@formula ==19)
;ChebyshevT4
z = c*(sqr(z)*(sqr(z)*8+8)+1)
ELSEIF (@formula ==20)
;PerpendicularMbrot
z=sqr(real(z)) - sqr(imag(z)) -flip(2*imag(z)*abs(real(z))) + c
ENDIF
locations[iter] = z
iter = iter + 1
endwhile ;end fractal formula loop
locindex = 1 ;for background contrast starts with 1.
while( locIndex < iter ) ;colour loop
cnt = cnt+1
dx = real( locations[locIndex] ) - xc
dy = imag( locations[locIndex] ) - yc
; Scale to image
x = round((dx*cosa - dy*sina) * scale + pwid*0.5)
y = round((dx*sina + dy*cosa) * scale + phgt*0.5)
; Plot the point only if inside image
if x >= 0 && x < pwid && y >= 0 && y < phgt
;colours calculated as RGB curves
colourcnt=colourcnt+1
increaser=recip(sqrt(colourcnt))
dataR = (dataR + increaser )/( @scalarR + abs(pixR[x, y])*antilightR)
dataG = (dataG + increaser )/( @scalarG + abs(pixG[x, y])*antilightG)
dataB = (dataB + increaser )/( @scalarB + abs(pixB[x, y])*antilightB)
pixR[x, y] = pixR[x, y] + dataR
pixG[x, y] = pixG[x, y] + dataG
pixB[x, y] = pixB[x, y] + dataB
endif
locIndex = locIndex + 1
; if (@progress==true && cnt%tenth == 0)
;$define DEBUG
; print(round(cnt/nsamples*100), " percent")
; endif
endwhile ;end colour loop
endwhile ;end main buddha loop
;change random seed, increase superloop counter,
;set main loop to 0 and go throught next cycle.
cnt=0
slcounter = slcounter+1
seed = @seedinput + slcounter
endwhile ;end superloop
;now formula will go throught pixels by fractal generator.
init:
int xcrd = 0
int ycrd = 0
float resultR = 0
float resultG = 0
float resultB = 0
float resultAlpha=0
final:
xcrd = #x
ycrd = #y
resultR = abs(pixR[xcrd, ycrd])
resultG = abs(pixG[xcrd, ycrd])
resultB = abs(pixB[xcrd, ycrd])
IF (@postfn==0)
;nothing
ELSEIF (@postfn==1)
resultR=sin(resultR)
resultG=sin(resultG)
resultB=sin(resultB)
ELSEIF (@postfn==2)
resultR=1- resultR
resultG=1- resultG
resultB=1- resultB
ELSEIF (@postfn==3)
resultR=sqr(resultR)
resultG=sqr(resultG)
resultB=sqr(resultB)
ELSEIF (@postfn==4)
resultR=cos(resultR)
resultG=cos(resultG)
resultB=cos(resultB)
ELSEIF (@postfn==5)
float sumR = resultR
float sumG = resultG
float sumB = resultB
resultR=abs(resultR -sqrt(sumG*sumB)*0.5)
resultG=abs(resultG -sqrt(sumR*sumB)*0.5)
resultB=abs(resultB -sqrt(sumR*sumG)*0.5)
ELSEIF (@postfn==6)
resultR= abs( resultR -round(resultR) )
resultG= abs( resultG -round(resultG) )
resultB= abs( resultB -round(resultB) )
ELSEIF (@postfn==7)
resultR=tanh(resultR)
resultG=tanh(resultG)
resultB=tanh(resultB)
ELSEIF (@postfn==8)
resultR=sin((resultR) )*cos((resultG))
resultG=sin((resultG) )*cos((resultR))
resultB=sin((resultB) )*cos((resultR))
ELSEIF (@postfn==9)
resultR=sqr(sin(#pi*resultR))
resultG=sqr(sin(#pi*resultG))
resultB=sqr(sin(#pi*resultB))
ENDIF
; switching colour channels.
IF (@switchRGB==0)
;nothing
ELSEIF (@switchRGB==1)
resultAlpha=resultG
resultG=resultR
resultR=resultAlpha
ELSEIF (@switchRGB==2)
resultAlpha=resultB
resultB=resultR
resultR=resultAlpha
ELSEIF (@switchRGB==3)
resultAlpha=resultB
resultB=resultG
resultG=resultAlpha
ENDIF
;colour mode: direct, using palette, or mixed.
IF (@palette==0)
#color = rgb(resultR, resultG, resultB)
ELSEIF (@palette==1)
#color = gradient(resultG)
ELSEIF (@palette==2)
;gradient is by arithmetic mean of RGB
color gradcolor=gradient( (resultR+resultG+resultB)*0.333333333333333 )
;harmonic of gradient and RGB
resultR=2/( recip (red(gradcolor))+ recip(resultR) )
resultG=2/( recip (green(gradcolor))+ recip(resultG) )
resultB=2/( recip (blue(gradcolor))+ recip(resultB) )
resultAlpha=alpha(gradcolor)
#color = rgba(resultR, resultG, resultB,resultAlpha)
ELSEIF (@palette==3)
; colour mode like of Fractal Explorer.
; uses pallete, but each chanell is calculated seperately.
resultR=red(gradient(resultR))
resultG=green(gradient(resultG))
resultB=blue(gradient(resultB))
resultAlpha=alpha(gradient( resultG))
#color = rgba(resultR, resultG, resultB, resultAlpha)
ELSEIF (@palette==4)
;all waves included.
#color=gradient(3/(recip(resultR) + recip(resultG) + recip(resultB) ) )
ENDIF
default:
title = "Moshiahobrot"
render = false
heading
caption = "Use with Pixel aka No Formula."
endheading
heading
caption = "Buddha Block"
endheading
int param sampleDensity
caption = "Sample density/incrse"
default = 100
hint="Main variable. The larger value, the more points hits image, the more detailed will be image. Put relatively small value for fast first calculation, then increase for smooth pic."
endparam
;bool param progress
;caption = "Show Progress"
;hint = "Shows how rendering is progressing. So you can see, that it is working or not."
;default = false
;endparam
int param maxiter
caption = "Max Iterations"
default = 200
hint = "Maxiter for fractal. Long orbits will stay in certain alredy dense region, but small maxiter will make this too blury."
endparam
int param seedinput
caption = "Lucky Number"
default = -8
hint="Random seed used to calculate random numbers who realy aren't that random. Different seeds marks different firstfound orbits."
endparam
heading
caption = "Formula Block"
endheading
param formula
caption="Fractal Formula"
default=0
enum= "Mandelbrot" "Talis" "Starbrot" "Tricorn" "BurningSihp" "8th modulus Mbrot" "Unit Vector - Mbrot" "Quadratic General" "Celtic Mandelbrot" "Rotated Mandelbrot" "ChebyshevAxolotl" "Mbrot*iters" "Talis+iters" "Tricorn*iters" "BurningShip*iters" "QuadGen*iters" "Trotsky Dragon" "Multipowerbrot Odd" "Magnetic" "ChebyshevT4" "PerpendicularMbrot"
hint= "Fractal formula used for calculation. Mbrot here stands fro Mandelbrot."
endparam
float param power
caption="Power"
default=2
visible = (@formula == 0||@formula == 1||@formula == 3||@formula == 4||@formula == 6||@formula == 8||@formula == 9||@formula == 11||@formula == 12||@formula == 13||@formula == 14)
endparam
int param starpower
caption="Star Power"
default=7
hint="Star sides = power-1"
visible = (@formula == 2)
endparam
float param unitvector
caption="Unit vector amount"
default=-0.5
hint="Coefficient N for z=z+N*z/|z|"
visible = (@formula == 6)
endparam
float param talisadd
caption="Talis addition"
default=1
hint="Adds value to z"
visible = (@formula == 1||@formula ==16)
endparam
float param quadfactor
caption="Factor of x*y"
default=2.5
hint="2 is very celtic and 2 is very cosmic."
visible = (@formula == 7||@formula ==15)
endparam
heading
caption = "Pixel input Block"
endheading
float param sizescaling
caption = "Size Scale"
default = 1
hint="Scaling here works as zooming in or out."
endparam
float param srcWidth
caption = "Pixel source Width"
default = 5.0
endparam
float param srcHeight
caption = "Pixel source Height"
default = 4.0
endparam
heading
caption = "Colour Block"
endheading
param palette
caption = "Colour Mode"
enum= "Direct Colouring" "Gradient Based" "Mixed Harmonic" "Fractal Explorer like" "Gradient by Harmonic"
default=0
hint= "Gradient Based is gradient calculated from green channel, gradient harmonic is gradient calc from mean of all channels. Mixed is harmonic mean between gradient colour (by mean of RGB) and RGB channels. Fractal Explorer like is RGB values calculated seperately from gradient. All exept direct colouring uses gradient and alpha channel."
endparam
param switchRGB
caption = "Switch Colours"
enum ="None" "Switch Red and Green" "Switch Red and Blue" "Switch Green and Blue"
default=0
hint= "Switch colour channels to change image tones, so that don't need to change light and scalar of RGB."
endparam
float param ambient
caption = "Ambient Light"
default = 0.12
hint="Greyscale colour value of uniterated pixel. Result then is added / substracted from this."
endparam
param postfn
caption = "Transfer Function"
enum = "0- None" "1- Sin (periodic)" "2- Inverted" "3- Square Power (sharper)" "4- Cos (Inv periodic)" "5- Accentuate RGB" "6- Solarisation (periodic)" "7- Hyperbolic Tangent" "8- SineCosineMix (periodic)" "9- Haversine (periodic)"
default = 0
hint="The same as UF, but applied before colour mode, and works with direct colour. Periodic will colour white regions."
endparam
heading
caption = "RGB block"
endheading
float param lightR
caption = "Red light"
default = 0.39
endparam
float param scalarR
caption = "Red scalar"
default = 0.65
endparam
float param lightG
caption = "Green light"
default = 0.99
endparam
float param scalarG
caption = "Green scalar"
default = 1.5
endparam
float param lightB
caption = "Blue light"
default = 0.15
endparam
float param scalarB
caption = "Blue scalar"
default = 0.3
endparam
}
[/size]
p.s.
If there are someone who are making another Buddhabrot aplication, I think, this could have some ideas what to do.