comment { dmj3.ucl 3.0 Coloring methods for Ultra Fractal 3 by Damien M. Jones February 26, 2003 For more information about this formula collection, please visit its home page: http://www.fractalus.com/ultrafractal/dmj3-pub-uf.htm Of course that documentation may not be fully complete when you look at it. Many of these coloring algorithms are general-purpose tools which work with a variety of fractals. A few are more specialized. Huge portions of this compilation build upon the techniques explored by others. } dmj3-OrbitTraps { ; ; This is the new Orbit Traps coloring for UF3. It ; replaces both the Orbit Traps and Twin Traps colorings ; written for UF2. ; ; This single coloring contains a broad family of orbit ; trap coloring techniques. The essential idea is to mark ; a section of the complex plane as a "trap", and watch ; the interaction between the orbit and the trap shape. ; ; Many variations exist; so many, that there are two levels ; of working with the formula. "Basic" mode shows a reduced ; set of options that is easier for beginners; "expert" ; mode will show all parameters. If you're wondering where ; all the options went, you probably need to switch to ; "expert" mode. ; ; This formula has evolved over the years and has ideas ; from many different people. A partial list is here: ; ; Cliff Pickover ; Phil Pickard ; Paul Carlson ; Kerry Mitchell ; Luke Plant ; Stephen Ferguson ; Earl Hinrichs ; Janet Parke ; Mark Townsend ; Paul DeCelle ; Ken Perlin & Ken Musgrave (fBm) ; Edward Perry ; ; This is a partial list only because I have undoubtedly ; forgotten someone! ; init: ; working values arrays ; float distances[3]; distance variables for each trap complex points[4]; tracks closest points to traps int iterations[2]; tracks iteration values at closest approach iterations[0] = 0 iterations[1] = 0 float closest[2]; tracks closest distances to traps closest[0] = 1e38 closest[1] = 1e38 float fBmcolors[2]; tracks fBm color fBmcolors[0] = 0.0 fBmcolors[1] = 0.0 float d = 0.0; distance to current trap float d2 = 0.0; secondary distance to current trap float previousd = 0.0; previous distance complex z2 = (0,0); holds transformed z complex z3 = (0,0); alterable z for trap shapes int iter = 0; counts current iteration float fiter = @trapstart; counts iterations left before applying traps BOOL done = false; flag indicating whether trap calculation can stop early BOOL trapping = false; flag indicating whether traps are being applied ; trap shape arrays ; int trapshapes[3]; holds trap center shapes trapshapes[0] = @trap1shape trapshapes[1] = @trap2shape trapshapes[2] = @trap3shape float trapeggseps[3]; holds trap egg separation values trapeggseps[0] = @trap1eggseparation trapeggseps[1] = @trap2eggseparation trapeggseps[2] = @trap3eggseparation float trapegginesses[3]; holds trap egginess values trapegginesses[0] = @trap1egginess trapegginesses[1] = @trap2egginess trapegginesses[2] = @trap3egginess float trappowers[3]; holds trap astroid powers trappowers[0] = @trap1astroidpower trappowers[1] = @trap2astroidpower trappowers[2] = @trap3astroidpower int trapmirrors[3]; holds trap wave mirrors trapmirrors[0] = @trap1wavemirrors trapmirrors[1] = @trap2wavemirrors trapmirrors[2] = @trap3wavemirrors int trapgridmodes[3]; holds trap grid modes trapgridmodes[0] = @trap1gridmode trapgridmodes[1] = @trap2gridmode trapgridmodes[2] = @trap3gridmode float trapfreqs1[3]; holds primary trap frequencies trapfreqs1[0] = @trap1frequency1 trapfreqs1[1] = @trap2frequency1 trapfreqs1[2] = @trap3frequency1 float trapamps1[3]; holds primary trap amplitudes trapamps1[0] = @trap1amplitude1 trapamps1[1] = @trap2amplitude1 trapamps1[2] = @trap3amplitude1 float trapphases1[3]; holds primary trap phases trapphases1[0] = @trap1phase1 * #pi/180 trapphases1[1] = @trap2phase1 * #pi/180 trapphases1[2] = @trap3phase1 * #pi/180 float trapfreqs2[3]; holds secondary trap frequencies trapfreqs2[0] = @trap1frequency2 trapfreqs2[1] = @trap2frequency2 trapfreqs2[2] = @trap3frequency2 float trapamps2[3]; holds secondary trap amplitudes trapamps2[0] = @trap1amplitude2 trapamps2[1] = @trap2amplitude2 trapamps2[2] = @trap3amplitude2 float trapphases2[3]; holds secondary trap phases trapphases2[0] = @trap1phase2 * #pi/180 trapphases2[1] = @trap2phase2 * #pi/180 trapphases2[2] = @trap3phase2 * #pi/180 float trappetals[3]; holds trap petal counts trappetals[0] = @trap1petals trappetals[1] = @trap2petals trappetals[2] = @trap3petals float traptightnesses[3]; holds trap spiral tightnesses traptightnesses[0] = @trap1tightness traptightnesses[1] = @trap2tightness traptightnesses[2] = @trap3tightness complex trapheartrots[3]; holds trap heart rotation vectors trapheartrots[0] = (0,1) ^ (@trap1heartrot / 90.0) trapheartrots[1] = (0,1) ^ (@trap2heartrot / 90.0) trapheartrots[2] = (0,1) ^ (@trap3heartrot / 90.0) float trapheartsizes[3]; holds trap heart sizes trapheartsizes[0] = @trap1heartsize trapheartsizes[1] = @trap2heartsize trapheartsizes[2] = @trap3heartsize complex trapheartskews[3]; holds trap heart skews trapheartskews[0] = (0,1) ^ (@trap1heartskew / 90.0) trapheartskews[1] = (0,1) ^ (@trap2heartskew / 90.0) trapheartskews[2] = (0,1) ^ (@trap3heartskew / 90.0) float trapaspects[3]; holds trap aspect ratios trapaspects[0] = @trap1aspect trapaspects[1] = @trap2aspect trapaspects[2] = @trap3aspect float trapdiameters1[3]; holds primary trap diameters trapdiameters1[0] = @trap1diameter1 trapdiameters1[1] = @trap2diameter1 trapdiameters1[2] = @trap3diameter1 float trapdiameters2[3]; holds secondary trap diameters trapdiameters2[0] = @trap1diameter2 trapdiameters2[1] = @trap2diameter2 trapdiameters2[2] = @trap3diameter2 float trapinvertexponents[3]; holds trap inversion exponents trapinvertexponents[0] = @trap1invertexponent trapinvertexponents[1] = @trap2invertexponent trapinvertexponents[2] = @trap3invertexponent complex trapinvertoffsets[3]; holds trap inversion center offsets trapinvertoffsets[0] = @trap1invertoffset trapinvertoffsets[1] = @trap2invertoffset trapinvertoffsets[2] = @trap3invertoffset float trapfades[3]; holds trap fade amounts trapfades[0] = @trap1fade trapfades[1] = @trap2fade trapfades[2] = @trap3fade complex trapfadeoffsets[3]; holds trap fade offsets trapfadeoffsets[0] = @trap1fadeoffset trapfadeoffsets[1] = @trap2fadeoffset trapfadeoffsets[2] = @trap3fadeoffset int trapfademodes[3]; holds trap fade modes trapfademodes[0] = @trap1fademode trapfademodes[1] = @trap2fademode trapfademodes[2] = @trap3fademode ; trap location/orientation arrays ; BOOL trapreusepositions[3]; holds trap relative position flags trapreusepositions[0] = false; this one is ALWAYS false trapreusepositions[1] = @trap2reuseposition trapreusepositions[2] = @trap3reuseposition complex trapcenters[3]; holds trap center locations trapcenters[0] = @trap1center trapcenters[1] = @trap2center trapcenters[2] = @trap3center IF (@trap1centermoves); apply trap center moves trapcenters[0] = trapcenters[0] + #pixel ENDIF IF (@trap2centermoves) trapcenters[1] = trapcenters[1] + #pixel ENDIF IF (@trap3centermoves) trapcenters[2] = trapcenters[2] + #pixel ENDIF complex trapdrifts[3]; holds trap drift amounts trapdrifts[0] = @trap1drift trapdrifts[1] = @trap2drift trapdrifts[2] = @trap3drift float traprots[3]; holds trap rotations traprots[0] = @trap1rot / 90.0 traprots[1] = @trap2rot / 90.0 traprots[2] = @trap3rot / 90.0 float traprotsteps[3]; holds trap rotation steps traprotsteps[0] = @trap1rotstep / 90.0 traprotsteps[1] = @trap2rotstep / 90.0 traprotsteps[2] = @trap3rotstep / 90.0 float trapskews[3]; holds trap skews trapskews[0] = @trap1skew / 90.0 trapskews[1] = @trap2skew / 90.0 trapskews[2] = @trap3skew / 90.0 float trapskewsteps[3]; holds trap skew steps trapskewsteps[0] = @trap1skewstep / 90.0 trapskewsteps[1] = @trap2skewstep / 90.0 trapskewsteps[2] = @trap3skewstep / 90.0 ; trap repeat arrays ; float traprepeatspacings[3]; holds trap repeat spacings traprepeatspacings[0] = @trap1repeatspacing traprepeatspacings[1] = @trap2repeatspacing traprepeatspacings[2] = @trap3repeatspacing complex traprepeatcenters[3]; holds trap repeat centers traprepeatcenters[0] = @trap1repeatcenter traprepeatcenters[1] = @trap2repeatcenter traprepeatcenters[2] = @trap3repeatcenter complex traprepeatangles[3]; holds trap repeat angles traprepeatangles[0] = (0,1) ^ (@trap1repeatangle / 90.0) traprepeatangles[1] = (0,1) ^ (@trap2repeatangle / 90.0) traprepeatangles[2] = (0,1) ^ (@trap3repeatangle / 90.0) float trapradialspacings[3]; holds trap radial spacings trapradialspacings[0] = @trap1radialspacing trapradialspacings[1] = @trap2radialspacing trapradialspacings[2] = @trap3radialspacing float trapconcentricspacings[3]; holds trap concentric spacings trapconcentricspacings[0] = @trap1concentricspacing trapconcentricspacings[1] = @trap2concentricspacing trapconcentricspacings[2] = @trap3concentricspacing complex trapradialcenters[3]; holds trap radial centers trapradialcenters[0] = @trap1radialcenter trapradialcenters[1] = @trap2radialcenter trapradialcenters[2] = @trap3radialcenter int trapradialmodes[3]; holds trap radial modes trapradialmodes[0] = @trap1radialmode trapradialmodes[1] = @trap2radialmode trapradialmodes[2] = @trap3radialmode ; trap transfer arrays ; int trapdistancetransfers[3]; holds trap distance transfer functions trapdistancetransfers[0] = @trap1distancetransfer trapdistancetransfers[1] = @trap2distancetransfer trapdistancetransfers[2] = @trap3distancetransfer float trapdistanceprescales[3]; holds trap distance pre-transfer multipliers trapdistanceprescales[0] = @trap1distanceprescale trapdistanceprescales[1] = @trap2distanceprescale trapdistanceprescales[2] = @trap3distanceprescale float trapdistancepostscales[3]; holds trap distance post-transfer multipliers trapdistancepostscales[0] = @trap1distancepostscale trapdistancepostscales[1] = @trap2distancepostscale trapdistancepostscales[2] = @trap3distancepostscale BOOL trapnonegdistances[3]; flags indicating whether negative distances are allowed trapnonegdistances[0] = @trap1nonegdistance trapnonegdistances[1] = @trap2nonegdistance trapnonegdistances[2] = @trap3nonegdistance ; trap fBm arrays ; BOOL trapfBmenables[3]; flags indicating whether fBm is enabled for a trap trapfBmenables[0] = @trap1shape == "fBm" || ((@trap1fBmuseasdistort || @trap1fBmuseasadder || @trap2fBmdistortionstyle == "chained fBm") && @trap1fBmenable) || (@trapcolor == "fBm" && @trapcolorfBmset == 0 && @trapcolorfBmmode != "trap") trapfBmenables[1] = @trap2shape == "fBm" || ((@trap2fBmuseasdistort || @trap2fBmuseasadder || @trap3fBmdistortionstyle == "chained fBm") && @trap2fBmenable) || (@trapcolor == "fBm" && @trapcolorfBmset == 1 && @trapcolorfBmmode != "trap") trapfBmenables[2] = @trap3shape == "fBm" || ((@trap3fBmuseasdistort || @trap3fBmuseasadder ) && @trap3fBmenable) || (@trapcolor == "fBm" && @trapcolorfBmset == 2 && @trapcolorfBmmode != "trap") BOOL trapfBmenables1[3]; flags indicating actual fBm enabled setting in user interface trapfBmenables1[0] = @trap1fBmenable trapfBmenables1[1] = @trap2fBmenable trapfBmenables1[2] = @trap3fBmenable BOOL trapfBmenables2[3]; flags indicating whether fBm is enabled for a trap, in pseudo-coordinate mode trapfBmenables2[0] = @trapcolor == "fBm" && @trapcolorfBmset == 0 && @trapcolorfBmmode == "trap" trapfBmenables2[1] = @trapcolor == "fBm" && @trapcolorfBmset == 1 && @trapcolorfBmmode == "trap" trapfBmenables2[2] = @trapcolor == "fBm" && @trapcolorfBmset == 2 && @trapcolorfBmmode == "trap" BOOL trapfBmuseasdistorts[3]; flags indicating whether fBm is used for distortion trapfBmuseasdistorts[0] = @trap1fBmuseasdistort trapfBmuseasdistorts[1] = @trap2fBmuseasdistort trapfBmuseasdistorts[2] = @trap3fBmuseasdistort int trapfBmdistortionstyles[3]; holds fBm distortion styles trapfBmdistortionstyles[0] = @trap1fBmdistortionstyle trapfBmdistortionstyles[1] = @trap2fBmdistortionstyle trapfBmdistortionstyles[2] = @trap3fBmdistortionstyle float trapfBmdistortionstrengths[3]; holds fBm distortion strengths trapfBmdistortionstrengths[0] = @trap1fBmdistortionstrength trapfBmdistortionstrengths[1] = @trap2fBmdistortionstrength trapfBmdistortionstrengths[2] = @trap3fBmdistortionstrength float trapfBmdistortionangles[3]; holds fBm distortion angles trapfBmdistortionangles[0] = @trap1fBmdistortionangle / 90.0 trapfBmdistortionangles[1] = @trap2fBmdistortionangle / 90.0 trapfBmdistortionangles[2] = @trap3fBmdistortionangle / 90.0 float trapfBmdistortionvariances[3]; holds fBm rotation variances trapfBmdistortionvariances[0] = 0 trapfBmdistortionvariances[1] = @trap2fBmdistortionvariance / 90.0 trapfBmdistortionvariances[2] = @trap3fBmdistortionvariance / 90.0 complex trapfBmdistortioncenters[3]; holds fBm distortion center offsets trapfBmdistortioncenters[0] = @trap1fBmdistortioncenter trapfBmdistortioncenters[1] = @trap2fBmdistortioncenter trapfBmdistortioncenters[2] = @trap3fBmdistortioncenter BOOL trapfBmuseasadders[3]; flags indicating whether fBm is used for coloring trapfBmuseasadders[0] = @trap1fBmuseasadder trapfBmuseasadders[1] = @trap2fBmuseasadder trapfBmuseasadders[2] = @trap3fBmuseasadder float trapfBmadderscales[3]; holds fBm adder scales trapfBmadderscales[0] = @trap1fBmadderscale trapfBmadderscales[1] = @trap2fBmadderscale trapfBmadderscales[2] = @trap3fBmadderscale int trapfBmadderstages[3]; holds fBm adder usage stage trapfBmadderstages[0] = @trap1fBmadderstage trapfBmadderstages[1] = @trap2fBmadderstage trapfBmadderstages[2] = @trap3fBmadderstage complex trapfBmtransforms[3]; holds fBm transformation modes trapfBmtransforms[0] = @trap1fBmtransform trapfBmtransforms[1] = @trap2fBmtransform trapfBmtransforms[2] = @trap3fBmtransform complex trapfBmoffsets[3]; holds fBm offsets trapfBmoffsets[0] = @trap1fBmoffset trapfBmoffsets[1] = @trap2fBmoffset trapfBmoffsets[2] = @trap3fBmoffset float trapfBmscales[3]; holds fBm scales trapfBmscales[0] = @trap1fBmscale trapfBmscales[1] = @trap2fBmscale trapfBmscales[2] = @trap3fBmscale float trapfBmbiases[3]; holds fBm biases trapfBmbiases[0] = @trap1fBmbias trapfBmbiases[1] = @trap2fBmbias trapfBmbiases[2] = @trap3fBmbias float trapfBmaspects[3]; holds fBm aspects trapfBmaspects[0] = @trap1fBmaspect trapfBmaspects[1] = @trap2fBmaspect trapfBmaspects[2] = @trap3fBmaspect float trapfBmrots[3]; holds fBm rotations trapfBmrots[0] = @trap1fBmangle / 90.0 trapfBmrots[1] = @trap2fBmangle / 90.0 trapfBmrots[2] = @trap3fBmangle / 90.0 float trapfBmrotitersteps[3]; holds fBm rotation steps for each fractal iteration trapfBmrotitersteps[0] = @trap1fBmangleiterstep / 90.0 trapfBmrotitersteps[1] = @trap2fBmangleiterstep / 90.0 trapfBmrotitersteps[2] = @trap3fBmangleiterstep / 90.0 float trapfBmscalesteps[3]; holds fBm scale steps trapfBmscalesteps[0] = @trap1fBmscalestep trapfBmscalesteps[1] = @trap2fBmscalestep trapfBmscalesteps[2] = @trap3fBmscalestep float trapfBmrotsteps[3]; holds fBm rotation steps for each fBm iteration trapfBmrotsteps[0] = @trap1fBmanglestep / 90.0 trapfBmrotsteps[1] = @trap2fBmanglestep / 90.0 trapfBmrotsteps[2] = @trap3fBmanglestep / 90.0 int trapfBmoctaves[3]; holds fBm octaves trapfBmoctaves[0] = @trap1fBmoctaves trapfBmoctaves[1] = @trap2fBmoctaves trapfBmoctaves[2] = @trap3fBmoctaves float trapfBmpowers[3]; holds fBm noise exponents trapfBmpowers[0] = @trap1fBmpower trapfBmpowers[1] = @trap2fBmpower trapfBmpowers[2] = @trap3fBmpower BOOL trapfBmslopes[3]; holds fBm slope flags trapfBmslopes[0] = @trap1fBmslope trapfBmslopes[1] = @trap2fBmslope trapfBmslopes[2] = @trap3fBmslope float trapfBmslopeseparations[3]; holds fBm slope separation distances trapfBmslopeseparations[0] = @trap1fBmslopeseparation trapfBmslopeseparations[1] = @trap2fBmslopeseparation trapfBmslopeseparations[2] = @trap3fBmslopeseparation float trapfBmslopeangles[3]; holds fBm slope lighting angles trapfBmslopeangles[0] = @trap1fBmslopeangle trapfBmslopeangles[1] = @trap2fBmslopeangle trapfBmslopeangles[2] = @trap3fBmslopeangle float trapfBmslopeelevations[3]; holds fBm slope lighting elevations trapfBmslopeelevations[0] = @trap1fBmslopeelevation trapfBmslopeelevations[1] = @trap2fBmslopeelevation trapfBmslopeelevations[2] = @trap3fBmslopeelevation float trapfBmslopescales[3]; holds fBm slope elevation scales trapfBmslopescales[0] = @trap1fBmslopescale trapfBmslopescales[1] = @trap2fBmslopescale trapfBmslopescales[2] = @trap3fBmslopescale ; miscellaneous other variables ; complex rots[3]; holds complex multipliers to perform rotations rots[0] = (0,1) ^ traprots[0] rots[1] = (0,1) ^ traprots[1] rots[2] = (0,1) ^ traprots[2] complex skews[3]; holds complex multipliers to perform skews skews[0] = (0,1) ^ trapskews[0] skews[1] = (0,1) ^ trapskews[1] skews[2] = (0,1) ^ trapskews[2] complex fBmrots[3]; holds complex multipliers to perform rotations for fBm fBmrots[0] = (0,1) ^ trapfBmrots[0] fBmrots[1] = (0,1) ^ trapfBmrots[1] fBmrots[2] = (0,1) ^ trapfBmrots[2] complex fBmoctaverots[3]; holds complex multipliers to perform rotations for fBm fBmoctaverots[0] = (0,1) ^ trapfBmrotsteps[0] fBmoctaverots[1] = (0,1) ^ trapfBmrotsteps[1] fBmoctaverots[2] = (0,1) ^ trapfBmrotsteps[2] complex fBmdistortrots[3]; holds complex multipliers to perform rotations for fBm fBmdistortrots[0] = (0,1) ^ trapfBmdistortionangles[0] fBmdistortrots[1] = (0,1) ^ trapfBmdistortionangles[1] fBmdistortrots[2] = (0,1) ^ trapfBmdistortionangles[2] float fBmcolor = 0.0 float fBmresults[3]; fBm results for each trap shape float fBmsloperesults[3]; fBm results for each slope point float d2r = #pi/180; degrees to radians conversion factor complex r0 = (0,0); work rotation vector in spiral shape calculation IF (@traptype == "farthest" || @traptype == "sum" || \ @traptype == "average" || @traptype == "sign average" || \ @traptype == "alternating average" || @traptype == "alternating average 2" || \ @traptype == "inverted sum" || @traptype == "exponential average" || \ @traptype == "average change" || @traptype == "inverted sum squared" || \ @traptype == "trap only"); last, sum, average, sign average closest[0] = 0.0 ELSEIF (@traptype == "product"); product closest[0] = 1.0 ELSEIF (@traptype == "second farthest" || @traptype == "two farthest"); second/two farthest closest[0] = 0.0 closest[1] = 0.0 ENDIF BOOL usesolid = true; assume a solid color int j = 0; loop variable WHILE (j < 4); clear arrays points[j] = (0,0) j = j + 1 ENDWHILE loop: iter = iter + 1; iteration counter IF (@trapalliterations == "some iterations"); we are skipping some iterations fiter = fiter - 1; one less to go before we trap WHILE (fiter < 0.0); iterations all used up IF (trapping); we are currently trapping trapping = false; so stop fiter = fiter + @trapskip; skip this many iterations ELSE; we aren't currently trapping trapping = true; so start fiter = fiter + @trapiter; do this many iterations ENDIF ENDWHILE ENDIF IF (@trapalliterations == "all iterations" || trapping) ; if we're checking for traps... j = 0; start with first trap WHILE (j <= @trapcount); still need to evaluate a trap ; ; MAIN LOOP START: Evaluate one trap. ; ; adjust rotation/skew/trapcenter IF (traprotsteps[j] != 0); changing rotation angle. rots[j] = (0,1) ^ (traprots[j]+traprotsteps[j]*(iter-1)); recompute rotation vector ENDIF IF (trapskewsteps[j] != 0); changing skew angle. skews[j] = (0,1) ^ (trapskews[j]+trapskewsteps[j]*(iter-1)); recompute skewing vector ENDIF IF (trapdrifts[j] != (0,0)); changing trap center trapcenters[j] = trapcenters[j] + trapdrifts[j] ENDIF ; get current pixel coordinate for transformation IF (@traptype == "trap only"); trap only, work on unadulterated pixel z2 = #pixel ELSEIF (!trapreusepositions[j]); other trap mode, and not re-using previous position z2 = #z ENDIF ; see if we need to calculate fBm for this trap IF (trapfBmenables[j]); yes, fBm is enabled int fBmloop = 1 IF (trapfBmslopes[j]); calculating in slope mode fBmloop = 3; calculate three points ENDIF WHILE (fBmloop > 0) fBmloop = fBmloop - 1 IF (fBmloop == 0) complex fBmpointstart = z2 ELSEIF (fBmloop == 1) complex fBmpointstart = z2 + trapfBmslopeseparations[j] ELSE complex fBmpointstart = z2 + flip(trapfBmslopeseparations[j]) ENDIF IF (trapfBmtransforms[j] == 0); rectangular coordinates complex fBmpoint = fBmpointstart * trapfBmscales[j] * fBmrots[j] + trapfBmoffsets[j] ELSEIF (trapfBmtransforms[j] == 1) ; polar coordinates complex fBmpoint = (cabs(fBmpointstart) + flip(atan2(fBmpointstart))) * trapfBmscales[j] * fBmrots[j] + trapfBmoffsets[j] ENDIF IF (trapfBmdistortionstyles[j] == 2); chained fBm complex v = (0,1) ^ (trapfBmdistortionangles[j] + fBmresults[j-1]*trapfBmdistortionvariances[j]) IF (trapfBmaspects[j] != 1.0); aspect adjustment required fBmpoint = fBmpoint * v fBmpoint = real(fBmpoint) + flip(imag(fBmpoint) * trapfBmaspects[j]); apply aspect fBmpoint = fBmpoint * conj(v) ENDIF ELSEIF (trapfBmaspects[j] != 1.0); aspect adjustment required fBmpoint = real(fBmpoint) + flip(imag(fBmpoint) * trapfBmaspects[j]); apply aspect ENDIF float fBmsum = 0.0 float fBmweight = 1.0 int k = trapfBmoctaves[j] WHILE (k > 0) ; determine integer coordinate for corners of square ; surrounding p float bx0 = floor(real(fBmpoint)) % 256 float by0 = floor(imag(fBmpoint)) % 256 IF (bx0 < 0) bx0 = bx0 + 256 ENDIF IF (by0 < 0) by0 = by0 + 256 ENDIF float bx1 = (bx0 + 1) % 256 float by1 = (by0 + 1) % 256 float rx0 = real(fBmpoint) - floor(real(fBmpoint)) float ry0 = imag(fBmpoint) - floor(imag(fBmpoint)) float rx1 = rx0 - 1 float ry1 = ry0 - 1 ; create a "random" index for each corner ; (this is where Intel's version differs from Perlin's; ; I used Intel's version because it doesn't require a ; pre-computed random table, which is difficult to manage ; in UF.) float b00 = (bx0^trapfBmpowers[j] % 65536 + by0)^trapfBmpowers[j] % 65536 float b10 = (bx1^trapfBmpowers[j] % 65536 + by0)^trapfBmpowers[j] % 65536 float b01 = (bx0^trapfBmpowers[j] % 65536 + by1)^trapfBmpowers[j] % 65536 float b11 = (bx1^trapfBmpowers[j] % 65536 + by1)^trapfBmpowers[j] % 65536 ; produce a "random" vector for each corner float g_b00_0 = (b00)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b10_0 = (b10)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b01_0 = (b01)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b11_0 = (b11)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b00_1 = (b00+1)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b10_1 = (b10+1)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b01_1 = (b01+1)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b11_1 = (b11+1)^trapfBmpowers[j]*0.25 % 512 - 256 ; normalize each vector float d = 0.0; d = 1 / sqrt(sqr(g_b00_0) + sqr(g_b00_1)) g_b00_0 = g_b00_0 * d g_b00_1 = g_b00_1 * d d = 1 / sqrt(sqr(g_b10_0) + sqr(g_b10_1)) g_b10_0 = g_b10_0 * d g_b10_1 = g_b10_1 * d d = 1 / sqrt(sqr(g_b01_0) + sqr(g_b01_1)) g_b01_0 = g_b01_0 * d g_b01_1 = g_b01_1 * d d = 1 / sqrt(sqr(g_b11_0) + sqr(g_b11_1)) g_b11_0 = g_b11_0 * d g_b11_1 = g_b11_1 * d ; produce colors for each corner float u1 = rx0 * g_b00_0 + ry0 * g_b00_1 float v1 = rx1 * g_b10_0 + ry0 * g_b10_1 float u2 = rx0 * g_b01_0 + ry1 * g_b01_1 float v2 = rx1 * g_b11_0 + ry1 * g_b11_1 ; interpolate between corners using ; bilinear filtering float sx = sqr(rx0) * (3 - rx0*2) float sy = sqr(ry0) * (3 - ry0*2) float a = u1 + sx*(v1-u1) float b = u2 + sx*(v2-u2) fBmsum = fBmsum + (a + sy*(b-a))*fBmweight fBmweight = fBmweight * trapfBmscalesteps[j] fBmpoint = fBmpoint * fBmoctaverots[j] / trapfBmscalesteps[j] k = k - 1 ENDWHILE fBmsum = fBmsum + trapfBmbiases[j]; add bias fBmsloperesults[fBmloop] = fBmsum ENDWHILE IF (trapfBmslopes[j]) float e1 = fBmsloperesults[0] * trapfBmslopescales[j] float e2 = fBmsloperesults[1] * trapfBmslopescales[j] float e3 = fBmsloperesults[2] * trapfBmslopescales[j] ; create vector for light direction float lx = cos(trapfBmslopeangles[j]*d2r) * cos(trapfBmslopeelevations[j]*d2r) float ly = sin(trapfBmslopeangles[j]*d2r) * cos(trapfBmslopeelevations[j]*d2r) float lz = sin(trapfBmslopeelevations[j]*d2r) ; determine surface normal ; that is, the normal to the surface defined by: ; (real(c1), imag(c1), e1) ; (real(c2), imag(c2), e2) ; (real(c3), imag(c3), e3) float vx = e2-e1 float vy = e3-e1 float vz = trapfBmslopeseparations[j] ; normalize vector float vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd fBmsum = lx*vx + ly*vy + lz*vz ENDIF ELSE float fBmsum = 0.0 ENDIF ; apply fBm distortion IF (trapfBmuseasdistorts[j] && trapfBmenables1[j]) ; using this trap's fBm to distort IF (trapfBmdistortionstyles[j] == 0); radial distortion complex v = (z2-trapfBmdistortioncenters[j]-trapcenters[j])/cabs(z2-trapfBmdistortioncenters[j]-trapcenters[j]) * fBmdistortrots[j] ; use vector based on angle to distortion center ELSEIF (trapfBmdistortionstyles[j] == 1); linear distortion complex v = fBmdistortrots[j]; just use rotation vector ;ELSEIF (trapfBmdistortionstyles[j] == 2); chained fBm distortion ; complex v = (0,1) ^ (trapfBmdistortionangles[j] + fBmresults[j-1]*trapfBmdistortionvariances[j]) ENDIF z2 = z2 + v * fBmsum * 0.5 * trapfBmdistortionstrengths[j] ENDIF ; rotate/squash/skew/repeat z ; 1. radially repeat IF (trapconcentricspacings[j] > 0 && trapradialspacings[j] == 0); concentrically repeating trap, but not radial z2 = z2 - trapradialcenters[j]; offset to trap radial center d = cabs(z2); extract just the distance from it d = ((d / trapconcentricspacings[j]) - round(d / trapconcentricspacings[j])) * trapconcentricspacings[j] ; get ratio of old distance to new distance z2 = z2 * d / cabs(z2) + trapradialcenters[j]; force distance to new distance ENDIF IF (trapradialspacings[j] > 0.0); radially repeating trap z2 = z2 - trapradialcenters[j]; offset to trap radial center d = cabs(z2); extract the distance d2 = atan2(z2); and the angle d2 = d2 / (#pi*2); convert this range to +/-0.5 (instead of +/-pi) d2 = ((d2 * trapradialspacings[j]) - round(d2 * trapradialspacings[j])) / trapradialspacings[j] * #pi*2; apply radial spacing IF (trapconcentricspacings[j] > 0); concentrically repeating trap d = ((d / trapconcentricspacings[j]) - round(d / trapconcentricspacings[j])) * trapconcentricspacings[j]; apply concentric spacing ENDIF IF (trapradialmodes[j] == 0); standard radial repeat mode z2 = cos(d2)*d + flip(sin(d2)*d) + trapradialcenters[j]; convert polar coordinates back to rectangular ELSEIF (trapradialmodes[j] == 1); unwrap mode z2 = d + flip(d2); interpret polar coordinates as rectangular (no conversion) ENDIF ENDIF ; 2. grid repeat IF (traprepeatspacings[j] > 0); repeating trap z2 = (z2 - traprepeatcenters[j]) * traprepeatangles[j]; offset to trap repeat center and rotate z2 = ((z2 / traprepeatspacings[j]) - round(z2 / traprepeatspacings[j])) * traprepeatspacings[j]; apply repeat spacing z2 = (z2 + traprepeatcenters[j]) * conj(traprepeatangles[j]); restore angle and offset to repeat center ENDIF ; 3. rotate z2 = (z2 - trapcenters[j]) * rots[j]; rotate ; 4. apply aspect IF (trapaspects[j] != 1.0); aspect adjustment required z2 = real(z2) + flip(imag(z2) * trapaspects[j]); apply aspect ENDIF ; 5. skew z2 = real(z2 * skews[j]) + flip(imag(z2)); apply skew ; determine distance from trap--different for each shape IF (trapshapes[j] == 0); point d = cabs(z2) ELSEIF (trapshapes[j] == 1); egg d = (cabs(z2-flip(trapeggseps[j])) + cabs(z2)*trapegginesses[j]) ELSEIF (trapshapes[j] == 2); hyperbola d = imag(z2) * real(z2) ELSEIF (trapshapes[j] == 3); hypercross d = abs(imag(z2) * real(z2)) ELSEIF (trapshapes[j] == 4); cross d = abs(real(z2)) d2 = abs(imag(z2)) IF (d2 < d) d = d2 ENDIF ELSEIF (trapshapes[j] == 5); astroid d = abs(real(z2))^trappowers[j] + abs(imag(z2))^trappowers[j] IF (trappowers[j] < 0) d = 1/d ENDIF ELSEIF (trapshapes[j] == 6); rectangle d = abs(real(z2)) d2 = abs(imag(z2)) IF (d2 > d) d = d2 ENDIF ELSEIF (trapshapes[j] == 7); lines d = abs(imag(z2)) ELSEIF (trapshapes[j] == 8); linear wave IF (trapmirrors[j] == 0); no mirroring d = abs(imag(z2) + sin((real(z2)+trapphases1[j])*trapfreqs1[j])*trapamps1[j] + sin((real(z2)+trapphases2[j])*trapfreqs2[j])*trapamps2[j]) ELSEIF (trapmirrors[j] == 1); half mirroring d = abs(imag(z2)) + sin((real(z2)+trapphases1[j])*trapfreqs1[j])*trapamps1[j] + sin((real(z2)+trapphases2[j])*trapfreqs2[j])*trapamps2[j] IF (trapdiameters1[j] == 0.0); we have no diameter, thus no abs() applied later d = abs(d); force abs(). note that this is technically redundant as the ; nonegdistances parameter can force this; this is a usability ; issue, in that it's more consistent with no mirroring this way. ENDIF ELSEIF (trapmirrors[j] == 2); full mirroring d2 = sin((real(z2)+trapphases1[j])*trapfreqs1[j])*trapamps1[j] + sin((real(z2)+trapphases2[j])*trapfreqs2[j])*trapamps2[j] d = abs(abs(imag(z2)) - d2); distance to each wave d2 = abs(abs(imag(z2)) + d2) IF (d2 < d) d = d2 ENDIF ENDIF ELSEIF (trapshapes[j] == 9); radial waves d2 = atan2(z2) d = cabs(z2) * (1 - sin((d2+trapphases1[j])*trapfreqs1[j])*trapamps1[j]*0.5 - sin((d2+trapphases2[j])*trapfreqs2[j])*trapamps2[j]*0.5) ELSEIF (trapshapes[j] == 10); ring ripples d = cabs(z2) d = cos((d+trapphases1[j])*trapfreqs1[j])*trapamps1[j] + cos((d+trapphases2[j])*trapfreqs2[j])*trapamps2[j] ELSEIF (trapshapes[j] == 11); grid ripples IF (trapgridmodes[j] == 0); diagonal mode d = (cos((real(z2)+trapphases1[j])*trapfreqs1[j])*trapamps1[j] + cos((real(z2)+trapphases2[j])*trapfreqs2[j])*trapamps2[j]) + \ (cos((imag(z2)+trapphases1[j])*trapfreqs1[j])*trapamps1[j] + cos((imag(z2)+trapphases2[j])*trapfreqs2[j])*trapamps2[j]) ELSEIF (trapgridmodes[j] == 1); straight mode d = (cos((real(z2)+trapphases1[j])*trapfreqs1[j])*trapamps1[j] + cos((real(z2)+trapphases2[j])*trapfreqs2[j])*trapamps2[j]) * \ (cos((imag(z2)+trapphases1[j])*trapfreqs1[j])*trapamps1[j] + cos((imag(z2)+trapphases2[j])*trapfreqs2[j])*trapamps2[j]) ENDIF ELSEIF (trapshapes[j] == 12); radial ripples d = atan2(z2) d = cos((d+trapphases1[j])*trapfreqs1[j])*trapamps1[j] + cos((d+trapphases2[j])*trapfreqs2[j])*trapamps2[j] ELSEIF (trapshapes[j] == 13); pinch d2 = atan2(z2) IF (d2 < 0) d2 = d2 + 2*#pi ENDIF d = sqrt(cabs(z2)) / abs(sin(d2*trappetals[j]*0.5)) ELSEIF (trapshapes[j] == 14); spiral d = 1/(cabs(z2)) * traptightnesses[j] r0 = (0,1) ^ d z3 = z2 * r0 d = atan(abs(imag(z3)/real(z3))) ELSEIF (trapshapes[j] == 15); heart r0 = real(z2) + flip(abs(imag(z2))) r0 = r0*trapheartrots[j] * 3 / trapheartsizes[j] d = abs(real(r0) - sqr(imag(r0)) + 3) ELSEIF (trapshapes[j] == 16); heart 2 z3 = real(abs(z2)) + flip(imag(z2)) z3 = real(z3 * trapheartskews[j]) + flip(imag(z3)) d = cabs(z3) ELSEIF (trapshapes[j] == 17); fBm d = fBmsum ENDIF ; apply diameter(s) IF (trapdiameters1[j] != 0.0); a diameter was provided d = abs(trapdiameters1[j] - d); apply it IF (trapdiameters2[j] != 0.0); a second diameter was provided d = abs(trapdiameters2[j] - d); apply it ENDIF ENDIF ; apply fBm texture IF (trapfBmuseasadders[j] && trapfBmadderstages[j] == 0 && trapfBmenables1[j]) d = d + fBmsum * trapfBmadderscales[j] ENDIF ; apply fade IF (trapfades[j] != 0); we have a fade radius d2 = cabs(#z - trapcenters[j] - trapfadeoffsets[j]) IF (trapfademodes[j] == 0); additive d = d + sqr(d2/trapfades[j]); add a fade value to the trap distance ELSEIF (trapfademodes[j] == 1); multiplicative IF (d2 > trapfades[j]); outside fade radius d = 0; so the fade multiplier is zero; this makes the distance zero ELSE; inside the fade radius d = d * sqr(1-d2/trapfades[j]); apply quadratic fade multiplier ENDIF ENDIF ENDIF ; apply fBm texture IF (trapfBmuseasadders[j] && trapfBmadderstages[j] == 1 && trapfBmenables1[j]) d = d + fBmsum * trapfBmadderscales[j] ENDIF ; apply trap transfer function ; a function is not used because these are floats ; and not all functions apply to floats d = d * trapdistanceprescales[j] IF (trapdistancetransfers[j] == 1); log d = log(d) ELSEIF (trapdistancetransfers[j] == 2); sqrt d = sqrt(d) ELSEIF (trapdistancetransfers[j] == 3); cuberoot d = (d)^(1/3) ELSEIF (trapdistancetransfers[j] == 4); exp d = exp(d) ELSEIF (trapdistancetransfers[j] == 5); sqr d = sqr(d) ELSEIF (trapdistancetransfers[j] == 6); cube d = (d)^3 ELSEIF (trapdistancetransfers[j] == 7); sin d = sin(d) ELSEIF (trapdistancetransfers[j] == 8); cos d = cos(d) ELSEIF (trapdistancetransfers[j] == 9); tan d = tan(d) ELSEIF (trapdistancetransfers[j] == 10); sinc (modified form) IF (d == 0) d = 1 ELSE d = sin(#pi*d)/d ENDIF ENDIF d = d * trapdistancepostscales[j] ; apply fBm texture IF (trapfBmuseasadders[j] && trapfBmadderstages[j] == 2 && trapfBmenables1[j]) d = d + fBmsum * trapfBmadderscales[j] ENDIF ; eliminate negative distances IF (trapnonegdistances[j]); absolute value only d = abs(d) ENDIF distances[j] = d; save computed distance to trap ; see if we need to calculate fBm for this trap, as a color, using trap pseudo-coordinate IF (trapfBmenables2[j]); yes, fBm is enabled int fBmloop = 1 IF (trapfBmslopes[j]); calculating in slope mode fBmloop = 3; calculate three points ENDIF WHILE (fBmloop > 0) fBmloop = fBmloop - 1 IF (fBmloop == 0) complex fBmpointstart = z2 ELSEIF (fBmloop == 1) complex fBmpointstart = z2 + trapfBmslopeseparations[j] ELSE complex fBmpointstart = z2 + flip(trapfBmslopeseparations[j]) ENDIF complex fBmpoint = (d + flip(atan2(fBmpointstart))) * trapfBmscales[j] * fBmrots[j] + trapfBmoffsets[j] IF (trapfBmaspects[j] != 1.0); aspect adjustment required fBmpoint = real(fBmpoint) + flip(imag(fBmpoint) * trapfBmaspects[j]); apply aspect ENDIF float fBmsum = 0.0 float fBmweight = 1.0 int k = trapfBmoctaves[j] WHILE (k > 0) ; determine integer coordinate for corners of square ; surrounding p float bx0 = floor(real(fBmpoint)) % 256 float by0 = floor(imag(fBmpoint)) % 256 IF (bx0 < 0) bx0 = bx0 + 256 ENDIF IF (by0 < 0) by0 = by0 + 256 ENDIF float bx1 = (bx0 + 1) % 256 float by1 = (by0 + 1) % 256 float rx0 = real(fBmpoint) - floor(real(fBmpoint)) float ry0 = imag(fBmpoint) - floor(imag(fBmpoint)) float rx1 = rx0 - 1 float ry1 = ry0 - 1 ; create a "random" index for each corner ; (this is where Intel's version differs from Perlin's; ; I used Intel's version because it doesn't require a ; pre-computed random table, which is difficult to manage ; in UF.) float b00 = (bx0^trapfBmpowers[j] % 65536 + by0)^trapfBmpowers[j] % 65536 float b10 = (bx1^trapfBmpowers[j] % 65536 + by0)^trapfBmpowers[j] % 65536 float b01 = (bx0^trapfBmpowers[j] % 65536 + by1)^trapfBmpowers[j] % 65536 float b11 = (bx1^trapfBmpowers[j] % 65536 + by1)^trapfBmpowers[j] % 65536 ; produce a "random" vector for each corner float g_b00_0 = (b00)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b10_0 = (b10)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b01_0 = (b01)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b11_0 = (b11)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b00_1 = (b00+1)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b10_1 = (b10+1)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b01_1 = (b01+1)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b11_1 = (b11+1)^trapfBmpowers[j]*0.25 % 512 - 256 ; normalize each vector float d = 0.0; d = 1 / sqrt(sqr(g_b00_0) + sqr(g_b00_1)) g_b00_0 = g_b00_0 * d g_b00_1 = g_b00_1 * d d = 1 / sqrt(sqr(g_b10_0) + sqr(g_b10_1)) g_b10_0 = g_b10_0 * d g_b10_1 = g_b10_1 * d d = 1 / sqrt(sqr(g_b01_0) + sqr(g_b01_1)) g_b01_0 = g_b01_0 * d g_b01_1 = g_b01_1 * d d = 1 / sqrt(sqr(g_b11_0) + sqr(g_b11_1)) g_b11_0 = g_b11_0 * d g_b11_1 = g_b11_1 * d ; produce colors for each corner float u1 = rx0 * g_b00_0 + ry0 * g_b00_1 float v1 = rx1 * g_b10_0 + ry0 * g_b10_1 float u2 = rx0 * g_b01_0 + ry1 * g_b01_1 float v2 = rx1 * g_b11_0 + ry1 * g_b11_1 ; interpolate between corners using ; bilinear filtering float sx = sqr(rx0) * (3 - rx0*2) float sy = sqr(ry0) * (3 - ry0*2) float a = u1 + sx*(v1-u1) float b = u2 + sx*(v2-u2) fBmsum = fBmsum + (a + sy*(b-a))*fBmweight fBmweight = fBmweight * trapfBmscalesteps[j] fBmpoint = fBmpoint * fBmoctaverots[j] / trapfBmscalesteps[j] k = k - 1 ENDWHILE fBmsum = fBmsum + trapfBmbiases[j]; add bias fBmsloperesults[j] = fBmsum ENDWHILE IF (trapfBmslopes[j]) float e1 = fBmsloperesults[0] * trapfBmslopescales[j] float e2 = fBmsloperesults[1] * trapfBmslopescales[j] float e3 = fBmsloperesults[2] * trapfBmslopescales[j] ; create vector for light direction float lx = cos(trapfBmslopeangles[j]*d2r) * cos(trapfBmslopeelevations[j]*d2r) float ly = sin(trapfBmslopeangles[j]*d2r) * cos(trapfBmslopeelevations[j]*d2r) float lz = sin(trapfBmslopeelevations[j]*d2r) ; determine surface normal ; that is, the normal to the surface defined by: ; (real(c1), imag(c1), e1) ; (real(c2), imag(c2), e2) ; (real(c3), imag(c3), e3) float vx = e2-e1 float vy = e3-e1 float vz = trapfBmslopeseparations[j] ; normalize vector float vd = 1/sqrt(sqr(vx)+sqr(vy)+sqr(vz)) vx = vx*vd vy = vy*vd vz = vz*vd fBmsum = lx*vx + ly*vy + lz*vz ENDIF ENDIF fBmresults[j] = fBmsum; save fBm result IF (j == @trapcolorfBmset); this is the fBm color calculation fBmcolor = fBmsum; save it ENDIF j = j + 1; ready to move to next trap ; ; END MAIN LOOP ; ENDWHILE ; Now merge trap distances to get a single distance. ; IF (@trapcount >= 1) IF (@trap1weightfunc == "A") ; ELSEIF (@trap1weightfunc == "-A") distances[0] = -distances[0] ELSEIF (@trap1weightfunc == "|A|") distances[0] = abs(distances[0]) ELSEIF (@trap1weightfunc == "A*A") distances[0] = sqr(distances[0]) ELSEIF (@trap1weightfunc == "-A*A") distances[0] = -sqr(distances[0]) ELSEIF (@trap1weightfunc == "A*A*A") distances[0] = sqr(distances[0])*distances[0] ELSEIF (@trap1weightfunc == "-A*A*A") distances[0] = -sqr(distances[0])*distances[0] ELSEIF (@trap1weightfunc == "|A*A*A|") distances[0] = abs(sqr(distances[0])*distances[0]) ELSEIF (@trap1weightfunc == "log(A)") distances[0] = log(distances[0]) ELSEIF (@trap1weightfunc == "exp(A)") distances[0] = exp(distances[0]) ENDIF IF (@trap2weightfunc == "B") ; ELSEIF (@trap2weightfunc == "-B") distances[1] = -distances[1] ELSEIF (@trap2weightfunc == "|B|") distances[1] = abs(distances[1]) ELSEIF (@trap2weightfunc == "B*B") distances[1] = sqr(distances[1]) ELSEIF (@trap2weightfunc == "-B*B") distances[1] = -sqr(distances[1]) ELSEIF (@trap2weightfunc == "B*B*B") distances[1] = sqr(distances[1])*distances[1] ELSEIF (@trap2weightfunc == "-B*B*B") distances[1] = -sqr(distances[1])*distances[1] ELSEIF (@trap2weightfunc == "|B*B*B|") distances[1] = abs(sqr(distances[1])*distances[1]) ELSEIF (@trap2weightfunc == "log(B)") distances[1] = log(distances[1]) ELSEIF (@trap2weightfunc == "exp(B)") distances[1] = exp(distances[1]) ENDIF ENDIF IF (@trapcount >= 2) IF (@trap3weightfunc == "C") ; ELSEIF (@trap3weightfunc == "-C") distances[2] = -distances[2] ELSEIF (@trap3weightfunc == "|C|") distances[2] = abs(distances[2]) ELSEIF (@trap3weightfunc == "C*C") distances[2] = sqr(distances[2]) ELSEIF (@trap3weightfunc == "-C*C") distances[2] = -sqr(distances[2]) ELSEIF (@trap3weightfunc == "C*C*C") distances[2] = sqr(distances[2])*distances[2] ELSEIF (@trap3weightfunc == "-C*C*C") distances[2] = -sqr(distances[2])*distances[2] ELSEIF (@trap3weightfunc == "|C*C*C|") distances[2] = abs(sqr(distances[2])*distances[2]) ELSEIF (@trap3weightfunc == "log(C)") distances[2] = log(distances[2]) ELSEIF (@trap3weightfunc == "exp(C)") distances[2] = exp(distances[2]) ENDIF ENDIF IF (@trapcount == 0); just one trap d = distances[0]; therefore only one distance ELSEIF (@trapcount == 1); two traps IF (@trapmerging2 == "min(A,B)") IF (distances[0] < distances[1]) d = distances[0] ELSE d = distances[1] ENDIF ELSEIF (@trapmerging2 == "max(A,B)") IF (distances[0] > distances[1]) d = distances[0] ELSE d = distances[1] ENDIF ELSEIF (@trapmerging2 == "A+B") d = distances[0] + distances[1] ELSEIF (@trapmerging2 == "A*B") d = distances[0] * distances[1] ELSEIF (@trapmerging2 == "A/B") d = distances[0] / distances[1] ELSEIF (@trapmerging2 == "B/A") d = distances[1] / distances[0] ELSEIF (@trapmerging2 == "1/(A*B)") d = 1 / (distances[0] * distances[1]) ELSEIF (@trapmerging2 == "A^B") d = distances[0] ^ distances[1] ELSEIF (@trapmerging2 == "B^A") d = distances[1] ^ distances[0] ELSEIF (@trapmerging2 == "A") d = distances[0] ELSEIF (@trapmerging2 == "B") d = distances[1] ELSEIF (@trapmerging2 == "|A-B|") d = abs(distances[0] - distances[1]) ELSEIF (@trapmerging2 == "A AND B") IF (distances[0] < @threshold && distances[1] < @threshold) d = distances[0] ELSE d = @threshold ENDIF ELSEIF (@trapmerging2 == "B AND A") IF (distances[1] < @threshold && distances[0] < @threshold) d = distances[1] ELSE d = @threshold ENDIF ELSEIF (@trapmerging2 == "A OR B") IF (distances[0] < @threshold) d = distances[0] ELSEIF (distances[1] < @threshold) d = distances[1] ELSE d = @threshold ENDIF ELSEIF (@trapmerging2 == "B OR A") IF (distances[1] < @threshold) d = distances[1] ELSEIF (distances[0] < @threshold) d = distances[0] ELSE d = @threshold ENDIF ELSEIF (@trapmerging2 == "A NOT B") IF (distances[0] < @threshold && distances[1] >= @threshold) d = distances[0] ELSE d = @threshold ENDIF ELSEIF (@trapmerging2 == "B NOT A") IF (distances[1] < @threshold && distances[0] >= @threshold) d = distances[1] ELSE d = @threshold ENDIF ENDIF IF (@trapmerging2abs) d = abs(d) ENDIF ELSEIF (@trapcount == 2); three traps IF (@trapmerging31 == "A") d = distances[0] ELSEIF (@trapmerging31 == "1/A") d = 1/distances[0] ELSEIF (@trapmerging31 == "B") d = distances[1] ELSEIF (@trapmerging31 == "1/B") d = 1/distances[1] ELSEIF (@trapmerging31 == "C") d = distances[2] ELSEIF (@trapmerging31 == "1/C") d = 1/distances[2] ENDIF IF (@trapmerging33 == "A") d2 = distances[0] ELSEIF (@trapmerging33 == "1/A") d2 = 1/distances[0] ELSEIF (@trapmerging33 == "B") d2 = distances[1] ELSEIF (@trapmerging33 == "1/B") d2 = 1/distances[1] ELSEIF (@trapmerging33 == "C") d2 = distances[2] ELSEIF (@trapmerging33 == "1/C") d2 = 1/distances[2] ENDIF IF (@trapmerging32 == "+") d = d + d2 ELSEIF (@trapmerging32 == "*") d = d * d2 ELSEIF (@trapmerging32 == "^") d = d ^ d2 ELSEIF (@trapmerging32 == "min") IF (d2 < d) d = d2 ENDIF ELSEIF (@trapmerging32 == "max") IF (d2 > d) d = d2 ENDIF ELSEIF (@trapmerging32 == "and") IF (d > @threshold || d2 > @threshold) d = @threshold ENDIF ELSEIF (@trapmerging32 == "or") IF (d > @threshold && d2 < @threshold) d = d2 ENDIF ELSEIF (@trapmerging32 == "not") IF (d > @threshold || d2 < @threshold) d = @threshold ENDIF ENDIF IF (@trapmerging35 == "A") d2 = distances[0] ELSEIF (@trapmerging35 == "1/A") d2 = 1/distances[0] ELSEIF (@trapmerging35 == "B") d2 = distances[1] ELSEIF (@trapmerging35 == "1/B") d2 = 1/distances[1] ELSEIF (@trapmerging35 == "C") d2 = distances[2] ELSEIF (@trapmerging35 == "1/C") d2 = 1/distances[2] ENDIF IF (@trapmerging34 == "+") d = d + d2 ELSEIF (@trapmerging34 == "*") d = d * d2 ELSEIF (@trapmerging34 == "^") d = d ^ d2 ELSEIF (@trapmerging34 == "min") IF (d2 < d) d = d2 ENDIF ELSEIF (@trapmerging34 == "max") IF (d2 > d) d = d2 ENDIF ELSEIF (@trapmerging34 == "and") IF (d > @threshold || d2 > @threshold) d = @threshold ENDIF ELSEIF (@trapmerging34 == "or") IF (d > @threshold && d2 < @threshold) d = d2 ENDIF ELSEIF (@trapmerging34 == "not") IF (d > @threshold || d2 < @threshold) d = @threshold ENDIF ENDIF ENDIF ; now adjust closest/point/i as needed IF (@traptype == "closest"); closest IF (d < closest[0]) iterations[0] = iter points[0] = #z points[1] = z2 closest[0] = d fBmcolors[0] = fBmcolor ENDIF IF (d < @threshold) usesolid = false ENDIF ELSEIF (@traptype == "farthest"); farthest (within threshold) IF (d > closest[0] && d < @threshold) iterations[0] = iter points[0] = #z points[1] = z2 closest[0] = d fBmcolors[0] = fBmcolor usesolid = false ENDIF ELSEIF (@traptype == "first"); first (within threshold) IF (d < @threshold && done == false) iterations[0] = iter points[0] = #z points[1] = z2 closest[0] = d fBmcolors[0] = fBmcolor done = true usesolid = false ENDIF ELSEIF (@traptype == "last"); last (within threshold) IF (d < @threshold) iterations[0] = iter points[0] = #z points[1] = z2 closest[0] = d fBmcolors[0] = fBmcolor done = true usesolid = false ENDIF ELSEIF (@traptype == "sum"); sum (within threshold) IF (d < @threshold) iterations[0] = iter points[0] = points[0] + #z points[1] = points[1] + z2 closest[0] = closest[0] + d fBmcolors[0] = fBmcolors[0] + fBmcolor usesolid = false ENDIF ELSEIF (@traptype == "average"); average (within threshold) IF (d < @threshold) iterations[0] = iter iterations[1] = iterations[1] + 1 points[0] = points[0] + #z points[1] = points[1] + z2 closest[0] = closest[0] + d fBmcolors[0] = fBmcolors[0] + fBmcolor usesolid = false ENDIF ELSEIF (@traptype == "product"); product (within threshold) IF (d < @threshold) iterations[0] = iter points[0] = points[0] * #z / @threshold points[1] = points[1] * z2 / @threshold closest[0] = closest[0] * d / @threshold fBmcolors[0] = fBmcolors[0] * fBmcolor usesolid = false ENDIF ELSEIF (@traptype == "sign average") ; sign average IF (d < previousd) iterations[0] = iterations[0] + 1 points[0] = points[0] + #z points[1] = points[1] + z2 closest[0] = closest[0] + 1 fBmcolors[0] = fBmcolors[0] + fBmcolor usesolid = false ELSE iterations[0] = iterations[0] - 1 ENDIF previousd = d ELSEIF (@traptype == "second closest" || @traptype == "two closest") ; second/two closest IF (d < closest[0]) iterations[1] = iterations[0] points[2] = points[0] points[3] = points[1] closest[1] = closest[0] fBmcolors[1] = fBmcolors[0] iterations[0] = iter points[0] = #z points[1] = z2 closest[0] = d fBmcolors[0] = fBmcolor ELSEIF (d < closest[1]) iterations[1] = iter points[2] = #z points[3] = z2 closest[1] = d fBmcolors[1] = fBmcolor ENDIF IF (d < @threshold) usesolid = false ENDIF ELSEIF (@traptype == "second farthest" || @traptype == "two farthest") ; second/two farthest IF (d > closest[0] && d < @threshold) iterations[1] = iterations[0] points[2] = points[0] points[3] = points[1] closest[1] = closest[0] fBmcolors[1] = fBmcolors[0] iterations[0] = iter points[0] = #z points[1] = z2 closest[0] = d fBmcolors[0] = fBmcolor usesolid = false ELSEIF (d > closest[1] && d < @threshold) iterations[1] = iter points[2] = #z points[3] = z2 closest[1] = d fBmcolors[1] = fBmcolor usesolid = false ENDIF ELSEIF (@traptype == "alternating average"); funky average IF (d < @threshold) iterations[0] = iterations[0] + 1 points[0] = #z - points[0] points[1] = z2 - points[1] closest[0] = @threshold - abs(closest[0] - d) fBmcolors[0] = 1 - abs(fBmcolors[0] - fBmcolor) usesolid = false ENDIF ELSEIF (@traptype == "alternating average 2"); funky average 2 IF (d < @threshold) iterations[0] = iterations[0] + 1 points[0] = #z - points[0] points[1] = z2 - points[1] closest[0] = abs(d - @threshold + closest[0]) fBmcolors[0] = abs(fBmcolor - 1 + fBmcolors[0]) usesolid = false ENDIF ELSEIF (@traptype == "inverted sum"); funky average 3 (Luke Plant) IF (d < @threshold) iterations[0] = iterations[0] + 1 d2 = d/@threshold points[0] = #z + (points[0]-#z) * d2 points[1] = z2 + (points[1]-z2) * d2 closest[0] = closest[0] + d fBmcolors[0] = fBmcolors[0] + fBmcolor usesolid = false ENDIF ELSEIF (@traptype == "exponential average"); funky average 4 (exponential average) IF (d < @threshold) iterations[0] = iterations[0] + 1 points[0] = #z - points[0] points[1] = z2 - points[1] closest[0] = closest[0] + exp(-d) usesolid = false ENDIF ELSEIF (@traptype == "average change"); funky average 5 (average distance change) IF (d < previousd) points[0] = points[0] + #z points[1] = points[1] + z2 closest[0] = closest[0] + previousd-d fBmcolors[0] = fBmcolors[0] + fBmcolor usesolid = false ENDIF previousd = d ELSEIF (@traptype == "inverted sum squared"); funky average 6 (Luke Plant, 1/squared) IF (d < @threshold) iterations[0] = iterations[0] + 1 usesolid = false d2 = sqr(d/@threshold) points[0] = #z + (points[0]-#z) * d2 points[1] = z2 + (points[1]-z2) * d2 closest[0] = closest[0] + 1/d2 fBmcolors[0] = fBmcolors[0] + 1/sqr(fBmcolor) ENDIF ELSEIF (@traptype == "trap only"); trap only, do first iteration IF (iter == 1) points[0] = #z points[1] = z2 closest[0] = d/@threshold IF (d < @threshold) usesolid = false ENDIF fBmcolors[0] = fBmcolor ENDIF ENDIF ENDIF final: ; un-fudge anything that was fudged IF (@traptype == "average"); traptype average points[0] = points[0] / iterations[1] points[1] = points[1] / iterations[1] closest[0] = closest[0] / iterations[1] fBmcolors[0] = fBmcolors[0] / iterations[1] ELSEIF (@traptype == "product"); traptype product closest[0] = abs(closest[0]) fBmcolors[0] = abs(fBmcolors[0]) ELSEIF (@traptype == "sign average"); traptype sign average points[0] = points[0] / iter points[1] = points[1] / iter closest[0] = closest[0] / iter fBmcolors[0] = fBmcolors[0] / iter ELSEIF (@traptype == "second closest" || @traptype == "second farthest") ; second closest or farthest iterations[0] = iterations[0] - iterations[1] points[0] = points[0] - points[2] points[1] = points[1] - points[3] closest[0] = abs(closest[0] - closest[1]) fBmcolors[0] = abs(fBmcolors[0] - fBmcolors[1]) ELSEIF (@traptype == "two closest" || @traptype == "two farthest") ; two closest or farthest iterations[0] = round((iterations[0] + iterations[1]) / 2) points[0] = (points[0] + points[2]) / 2 points[1] = (points[1] + points[3]) / 2 closest[0] = (closest[0] + closest[1]) / 2 fBmcolors[0] = (fBmcolors[0] + fBmcolors[1]) / 2 ELSEIF (@traptype == "inverted sum") ; funky average 3 closest[0] = @threshold * iterations[0] - closest[0] fBmcolors[0] = @threshold * iterations[0] - fBmcolors[0] ENDIF ; choose coloring based on method IF (!@solidcolor); solid color not allowed #solid = false ELSE #solid = usesolid ENDIF IF (@trapcolor == "distance"); distance IF (@traptype == "first" || @traptype == "last") ; first or last type #index = closest[0] / @threshold ELSE; any other trap type #index = closest[0] ENDIF ELSEIF (@trapcolor == "magnitude"); magnitude #index = cabs(points[1]) ELSEIF (@trapcolor == "real"); real #index = abs(real(points[1])) ELSEIF (@trapcolor == "imaginary"); imaginary #index = abs(imag(points[1])) ELSEIF (@trapcolor == "angle to trap") ; angle to trap d = atan2(points[1]) IF (d < 0) d = d + #pi * 2 ENDIF #index = d / (#pi * 2) ; ELSEIF (@trapcolor == "angle to trap 2") ; angle to trap 2 (no aspect) ; points[0] = points[0] - trapcenters[0] ; d = atan2(points[0]) ; IF (d < 0) ; d = d + #pi * 2 ; ENDIF ; #index = d / (#pi * 2) ELSEIF (@trapcolor == "angle to origin") ; angle to origin d = atan2(points[0]) IF (d < 0) d = d + #pi * 2 ENDIF #index = d / (#pi * 2) ELSEIF (@trapcolor == "angle to origin 2") ; angle to origin 2 (old ReallyCool) #index = 0.02 * abs(atan(imag(points[0]) / real(points[0])) * 180/#pi) ELSEIF (@trapcolor == "iteration"); iteration d = iterations[0] #index = d / #maxiter ELSEIF (@trapcolor == "fBm"); fBm #index = fBmcolors[0] ENDIF default: title = "Orbit Traps (UF3)" helpfile = "dmj3\dmj3-pub-uf-ot.htm" param expertmode caption = "Show Options" default = 0 enum = "basic" "expert" hint = "This chooses how many options to display. Choose 'basic' for the \ most common options; choose 'expert' to see all options." endparam param trapsversion caption = "Traps Formula Version" default = 300 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam ; Overall parameters ; heading caption = "Overall Parameters" endheading param traptype caption = "Trap Mode" default = 0 enum = "closest" "farthest" "first" "last" "sum" "average" "product" \ "sign average" "second closest" "second farthest" "two closest" \ "two farthest" "alternating average" "alternating average 2" "inverted sum" \ "exponential average" "average change" "inverted sum squared" \ "trap only" hint = "This is how points will be chosen to use for coloring." endparam param trapcolor caption = "Trap Coloring" default = 0 enum = "distance" "magnitude" "real" "imaginary" "angle to trap" \ "angle to origin" "angle to origin 2" "iteration" \ "fBm" hint = "This is the information used to produce a color." endparam param trapcolorfBmset caption = " Use fBm from" default = 0 enum = "trap A" "trap B" "trap C" hint = "This selects which trap's fBm value will be used for coloring." visible = @trapcolor == "fBm" endparam param trapcolorfBmmode caption = " fBm Mapping" default = 0 enum = "normal" "trap" hint = "This selects whether fBm is calculated normally or by using a pseudo-coordinate \ derived from the trap distance and angle. Note, this overrides the fBm Transform \ for the trap shape used for coloring." visible = @trapcolor == "fBm" && @expertmode == "expert" endparam param threshold caption = "Threshold" default = 0.25 min = 0 hint = "This is the width of the trap area trap modes." endparam param solidcolor caption = "Use Solid Color" default = false hint = "If enabled, areas 'outside' the trap area will be colored \ with the 'solid color' on the coloring tab." endparam param trapalliterations caption = "Traps Apply To" default = 0 enum = "all iterations" "some iterations" hint = "This option, if set to 'some iterations', allows you to apply the \ orbit traps to only some iterations (with extra options shown below)." visible = @expertmode == "expert" endparam param trapstart caption = " Start Iteration" default = 0.0 hint = "This is the iteration at which to start watching for \ orbit traps." visible = @trapalliterations == 1 endparam param trapiter caption = " Trap Iterations" default = 10.0 hint = "This is the number of iterations to watch for traps \ in a single block." visible = @trapalliterations == 1 endparam param trapskip caption = " Skip Iterations" default = 10.0 hint = "This is the number of iterations to skip watching for \ traps, after a block of watched iterations." visible = @trapalliterations == 1 endparam param trapcount caption = "Number of Traps" default = 0 enum = "1" "2" "3" hint = "This indicates the number of trap shapes to use. Each \ trap shape includes a full set of parameters." visible = @expertmode == "expert" endparam ; ; Trap Merging Parameters ; heading caption = "Trap Merging" visible = @trapcount >= 1 endheading param trap1weightfunc caption = "Trap A Mode" default = 0 enum = "A" "-A" "|A|" "A*A" "-A*A" "A*A*A" "-A*A*A" "|A*A*A|" "log(A)" "exp(A)" hint = "Sets the mode for this trap, applied before combining it with other traps." visible = @trapcount >= 1 endparam param trap2weightfunc caption = "Trap B Mode" default = 0 enum = "B" "-B" "|B|" "B*B" "-B*B" "B*B*B" "-B*B*B" "|B*B*B|" "log(B)" "exp(B)" hint = "Sets the mode for this trap, applied before combining it with other traps." visible = @trapcount >= 1 endparam param trap3weightfunc caption = "Trap C Mode" default = 0 enum = "C" "-C" "|C|" "C*C" "-C*C" "C*C*C" "-C*C*C" "|C*C*C|" "log(C)" "exp(C)" hint = "Sets the mode for this trap, applied before combining it with other traps." visible = @trapcount >= 2 endparam param trapmerging2 caption = "Merge Mode" default = 0 enum = "min(A,B)" "max(A,B)" "A+B" "A*B" "A/B" "B/A" "1/(A*B)" "A^B" "B^A" \ "|A-B|" "A" "B" "A AND B" "B AND A" "A OR B" "B OR A" "A NOT B" "B NOT A" hint = "Sets the overall merge method for traps, after the individual trap mode is applied." visible = @trapcount == 1 endparam param trapmerging2abs caption = "No Negative Distances" default = false hint = "If set, converts negative combined trap distances to positive." visible = @trapcount == 1 endparam param trapmerging31 caption = "Merge Term 1" default = 0 enum = "A" "1/A" "B" "1/B" "C" "1/C" hint = "Sets the first term in the expression for combining traps." visible = @trapcount == 2 endparam param trapmerging32 caption = " Merge Operator 1" default = 0 enum = "+" "*" "^" "min" "max" "and" "or" "not" hint = "Sets the operator for combining the first two terms in the trap combining expression." visible = @trapcount == 2 endparam param trapmerging33 caption = "Merge Term 2" default = 2 enum = "A" "1/A" "B" "1/B" "C" "1/C" hint = "Sets the second term in the expression for combining traps." visible = @trapcount == 2 endparam param trapmerging34 caption = " Merge Operator 2" default = 0 enum = "+" "*" "^" "min" "max" "and" "or" "not" hint = "Sets the operator for combining the last two terms in the trap combining expression." visible = @trapcount == 2 endparam param trapmerging35 caption = "Merge Term 3" default = 4 enum = "A" "1/A" "B" "1/B" "C" "1/C" hint = "Sets the third term in the expression for combining traps." visible = @trapcount == 2 endparam ; ; Trap 1 Parameters ; heading caption = "Trap Parameters" visible = @trapcount == 0 endheading heading caption = "Trap A Parameters" visible = @trapcount >= 1 endheading ; Shape parameters ; param trap1shape caption = "Trap Shape" default = 0 enum = "point" "egg" "hyperbola" "hypercross" \ "cross" "astroid" "rectangle" "line" \ "linear wave" "radial wave" "ring ripples" \ "grid ripples" "radial ripples" "pinch" "spiral" "heart" \ "heart 2" "fBm" hint = "This is the shape of the orbit trap." visible = @trapcount >= 0 endparam param trap1eggseparation caption = " Stretching" default = 1.0 hint = "Specifies how stretched the egg shape should be." visible = @trapcount >= 0 && @trap1shape == "egg" endparam param trap1egginess caption = " Egginess" default = 0.5 hint = "Specifies how pointy the egg shape should be." visible = @trapcount >= 0 && @trap1shape == "egg" endparam param trap1astroidpower caption = " Squareness" default = 0.666666666666667 hint = "Indicates the squareness of the astroid shape. Values \ less than one produce diamonds; values larger than one \ push the shape closer and closer towards a square." visible = @trapcount >= 0 && @trap1shape == "astroid" endparam param trap1wavemirrors caption = " Mirroring" default = 0 enum = "none" "half" "full" hint = "Chooses the mirroring on the waves. 'Half' will reflect \ one half of the wave, replacing the other half; 'Full' \ reflects both halves of the wave and superimposes them." visible = @trapcount >= 0 && (@trap1shape == "linear wave") endparam param trap1gridmode caption = " Grid Mode" default = 0 enum = "diagonal" "straight" hint = "Chooses the orientation of the grid by selecting between \ addition ('diagonal') and multiplication ('straight') when \ adding wave components for vertical and horizontal values." visible = @trapcount >= 0 && (@trap1shape == "grid ripples") endparam param trap1frequency1 caption = " Frequency 1" default = 1.0 hint = "Specifies the primary frequency of the wave. Higher \ numbers give a more rapidly-oscillating wave." visible = @trapcount >= 0 && (@trap1shape == "linear wave" || \ @trap1shape == "radial wave" || @trap1shape == "ring ripples" || \ @trap1shape == "grid ripples" || @trap1shape == "radial ripples") endparam param trap1amplitude1 caption = " Amplitude 1" default = 1.0 hint = "Specifies the primary amplitude of the wave. Higher \ numbers increase the distance between extremes in the wave." visible = @trapcount >= 0 && (@trap1shape == "linear wave" || \ @trap1shape == "radial wave" || @trap1shape == "ring ripples" || \ @trap1shape == "grid ripples" || @trap1shape == "radial ripples") endparam param trap1phase1 caption = " Phase 1" default = 0.0 hint = "Provides a phase shift for the wave, which can be used to shift the \ wave peaks side-to-side. Phases are specified in degrees, so a phase \ shift of 360 or -360 is equivalent to a phase shift of zero." visible = @trapcount >= 0 && (@trap1shape == "linear wave" || \ @trap1shape == "radial wave" || @trap1shape == "ring ripples" || \ @trap1shape == "grid ripples" || @trap1shape == "radial ripples") endparam param trap1frequency2 caption = " Frequency 2" default = 1.0 hint = "Specifies the secondary frequency of the wave. Higher \ numbers give a more rapidly-oscillating wave." visible = (@trapcount >= 0 && (@trap1shape == "linear wave" || \ @trap1shape == "radial wave" || @trap1shape == "ring ripples" || \ @trap1shape == "grid ripples" || @trap1shape == "radial ripples")) && @expertmode == "expert" endparam param trap1amplitude2 caption = " Amplitude 2" default = 0.0 hint = "Specifies the secondary amplitude of the wave. Higher \ numbers increase the distance between extremes in the wave." visible = (@trapcount >= 0 && (@trap1shape == "linear wave" || \ @trap1shape == "radial wave" || @trap1shape == "ring ripples" || \ @trap1shape == "grid ripples" || @trap1shape == "radial ripples")) && @expertmode == "expert" endparam param trap1phase2 caption = " Phase 2" default = 0.0 hint = "Provides a phase shift for the wave, which can be used to shift the \ wave peaks side-to-side. Phases are specified in degrees, so a phase \ shift of 360 or -360 is equivalent to a phase shift of zero." visible = (@trapcount >= 0 && (@trap1shape == "linear wave" || \ @trap1shape == "radial wave" || @trap1shape == "ring ripples" || \ @trap1shape == "grid ripples" || @trap1shape == "radial ripples")) && @expertmode == "expert" endparam param trap1petals caption = " Petals" default = 4.0 hint = "Specifies the number of petals in the pinch shape." visible = @trapcount >= 0 && @trap1shape == "pinch" endparam param trap1tightness caption = " Tightness" default = 4.0 hint = "Specifies the tightness of the spiral." visible = @trapcount >= 0 && @trap1shape == "spiral" endparam param trap1heartrot caption = " Pointiness" default = 45.0 hint = "Specifies the pointiness of the heart shape." visible = @trapcount >= 0 && @trap1shape == "heart" endparam param trap1heartsize caption = " Size" default = 1.0 hint = "Specifies the size of the heart shape." visible = @trapcount >= 0 && @trap1shape == "heart" endparam param trap1heartskew caption = " Skew" default = 30.0 hint = "Specifies the skew angle, in degrees, of the halves of the heart." visible = @trapcount >= 0 && @trap1shape == "heart 2" endparam param trap1aspect caption = "Aspect Ratio" default = 1.0 min = 0.0 hint = "This is how square the trap is. You can distort the \ trap by using a value other than 1.0." visible = @trapcount >= 0 endparam param trap1diameter1 caption = "Diameter" default = 0.0 hint = "This is the diameter of the trap. Diameters greater than \ zero produce rings, boxes, pairs of traps, etc." visible = @trapcount >= 0 endparam param trap1diameter2 caption = " Second Diameter" default = 0.0 hint = "Just as changing the Diameter 'splits' the trap, you can \ split it again by setting this value greater than zero." visible = (@trapcount >= 0 && @trap1diameter1 != 0.0) && @expertmode == "expert" endparam param trap1invertexponent caption = "Inversion Exponent" default = 1.0 hint = "Sets the inversion exponent. 1.0 gives no inversion, -1.0 \ gives standard inversion." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1invertoffset caption = "Inversion Offset" default = (0,0) hint = "Sets the offset of the inversion center from the trap center." visible = @trapcount >= 0 && @trap1invertexponent != 1.0 endparam param trap1fade caption = "Fade Radius" default = 0.0 hint = "Sets the radius beyond which the trap will 'fade out'. \ A value of zero disables this feature." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1fadeoffset caption = " Fade Offset" default = (0,0) hint = "Sets the offset from the trap center to fade from. You can use \ this to fade the trap unevenly." visible = @trapcount >= 0 && @trap1fade != 0.0 endparam param trap1fademode caption = " Fade Mode" default = 0 enum = "add" "multiply" hint = "Choose the way in which the fade will be applied. 'Add' works \ best for most trap types, but for any ripples type, you may want \ to use 'Multiply'." visible = @trapcount >= 0 && @trap1fade != 0.0 endparam ; Location/orientation Parameters ; param trap1center caption = "Trap Center" default = (0,0) hint = "This is the location of the trap in the complex plane." visible = @trapcount >= 0 endparam param trap1centermoves caption = "Follows pixel location" default = false hint = "If this is enabled, the trap center will follow the pixel \ location, offset by the Trap Center amount. NOTE: If you \ enable this, you will probably want to skip the first iteration." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1drift caption = "Trap Drift" default = (0,0) hint = "This is the amount the trap center will move with each \ iteration." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1rot caption = "Rotation" default = 0.0 hint = "This is the angle, in degrees, that the trap should \ be rotated." visible = @trapcount >= 0 endparam param trap1rotstep caption = "Rotation Step" default = 0.0 hint = "This is the angle, in degrees, that the trap will \ be rotated with each iteration." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1skew caption = "Skew" default = 0.0 hint = "This is the angle, in degrees, to skew the vertical \ axis of the trap shape." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1skewstep caption = "Skew Step" default = 0.0 hint = "This is the angle, in degrees, that the skew angle \ should be increased by with each iteration." visible = @trapcount >= 0 && @expertmode == "expert" endparam ; Repeat Parameters ; param trap1repeatspacing caption = "Repeat Spacing" default = 0.0 min = 0.0 hint = "This is the spacing at which the trap will repeat, \ all across the complex plane. If zero, trap does \ not repeat." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1repeatcenter caption = " Repeat Center" default = (0,0) hint = "This is the center point of grid trap repetition." visible = @trapcount >= 0 && (@trap1repeatspacing > 0.0) endparam param trap1repeatangle caption = " Repeat Rotation" default = 0.0 hint = "This is the angle of the repeat grid." visible = @trapcount >= 0 && (@trap1repeatspacing > 0.0) endparam param trap1radialspacing caption = "Radial Spacing" default = 0.0 min = 0 hint = "This is the number of times the trap will repeat, \ radially around the radial center point. If zero, \ trap does not repeat radially." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1concentricspacing caption = "Concentric Spacing" default = 0.0 min = 0 hint = "This is the distance at which the trap will repeat, \ radially out from the radial center point. If zero, \ trap does not repeat radially out." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1radialcenter caption = " Radial Center" default = (0,0) hint = "This is the center point of radial trap repetition." visible = @trapcount >= 0 && (@trap1radialspacing > 0.0 || @trap1concentricspacing > 0.0) endparam param trap1radialmode caption = " Radial Mode" default = 0 enum = "kaleidoscope" "polar coordinates" hint = "Indicates the type of radial repetition to use. The \ two styles produce very different results." visible = @trapcount >= 0 && (@trap1radialspacing > 0.0) endparam ; Transfer Parameters ; param trap1distancetransfer caption = "Distance Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" \ "sin" "cos" "tan" "sinc" hint = "This function is applied to trap distances at every \ iteration. It can be used to apply some special effects \ to trap shapes." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1distanceprescale caption = "Distance Pre-scale" default = 1.0 hint = "This is a multiplier applied to the trap distance, \ before the Distance Transfer function is applied to it." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1distancepostscale caption = "Distance Post-scale" default = 1.0 hint = "This is a multiplier applied to the trap distance, \ after the Distance Transfer function is applied to it." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1nonegdistance caption = "No Negative Distance" default = false hint = "If enabled, eliminates 'negative' distances by taking \ the absolute value of the distance." visible = @trapcount >= 0 && @expertmode == "expert" endparam ; fBm Parameters ; param trap1fBmenable caption = "Use fBm" default = false hint = "Check this if you want to use fBm to modify this trap shape." enabled = @trapcount >= 0 && (@trap1shape != "fBm" && (@trapcolor != "fBm" || @trapcolorfBmset != 0)) endparam heading caption = "Trap fBm Parameters" visible = @trapcount == 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) endheading heading caption = "Trap A fBm Parameters" visible = @trapcount >= 1 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) endheading param trap1fBmuseasdistort caption = "Use to Distort" default = false hint = "Check this if you want fBm to distort the trap shape." visible = @trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) endparam param trap1fBmdistortionstyle caption = "Style" default = 0 enum = "radial" "linear" hint = "Chooses the kind of distortion. Radial distorts radially around a \ point, linear distorts back-and-forth across a line." visible = @trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) && @trap1fBmuseasdistort endparam param trap1fBmdistortionstrength caption = "Strength" default = 1.0 hint = "Sets the strength of the distortion. Larger strengths will push the \ trap shape more." visible = @trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) && @trap1fBmuseasdistort endparam param trap1fBmdistortionangle caption = "Angle" default = 0.0 hint = "Sets the angle, in degrees, of the distortion, relative to the center of \ distortion (for radial) or the horizontal axis (for linear)." visible = @trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) && @trap1fBmuseasdistort endparam param trap1fBmdistortioncenter caption = "Offset" default = (0,0) hint = "Sets the offset from the trap center for the distortion." visible = @trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) && @trap1fBmuseasdistort && @trap1fBmdistortionstyle == "radial" endparam param trap1fBmuseasadder caption = "Use to Texturize" default = false hint = "Check this if you want fBm to texturize the trap shape." visible = @trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) endparam param trap1fBmadderscale caption = "Intensity" default = 1.0 hint = "Sets how much the intensity of the fBm pattern will affect the trap." visible = @trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) && @trap1fBmuseasadder endparam param trap1fBmadderstage caption = "Apply" default = 0 enum = "immediately" "after fade" "after transfer" hint = "Sets when when fBm is added to the trap distance." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) && @trap1fBmuseasadder) && @expertmode == "expert" endparam param trap1fBmtransform caption = "fBm Transform" default = 0 enum = "rectangular" "polar" hint = "Selects the transform mode for orbit values used in fBm calculations." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0))) && @expertmode == "expert" endparam param trap1fBmoffset caption = "fBm Offset" default = (0,0) hint = "Sets the offset of the fBm pattern." visible = @trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) endparam param trap1fBmscale caption = "fBm Scale" default = 1.0 hint = "Sets the scale of the fBm pattern. Larger values give a finer grain." visible = @trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) endparam param trap1fBmbias caption = "fBm Bias" default = 0.0 hint = "This constant is added to the result of the fBm noise. fBm noise typically produces \ values from -0.5 to 0.5; in some cases negative values will be a problem, so you can use \ this setting (try 1) to bias the results and always get a positive value." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0))) && @expertmode == "expert" endparam param trap1fBmaspect caption = "fBm Aspect" default = 1.0 hint = "Sets the aspect ratio of the fBm pattern. You can use this to stretch \ or squeeze the fBm pattern." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0))) && @expertmode == "expert" endparam param trap1fBmangle caption = "fBm Rotation" default = 0.0 hint = "Sets the angle, in degrees, of the fBm pattern." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0))) && @expertmode == "expert" endparam param trap1fBmangleiterstep caption = "fBm Rot. Step" default = 0.0 hint = "This is the angle, in degrees, that the fBm pattern will rotate with \ each fractal iteration." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0))) && @expertmode == "expert" endparam param trap1fBmscalestep caption = "fBm Scale Iter." default = 0.5 hint = "This is the amount the fBm pattern is scaled by with each fBm iteration." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0))) && @expertmode == "expert" endparam param trap1fBmanglestep caption = "fBm Rot. Iter." default = 37.0 hint = "This is the angle, in degrees, the fBm pattern is scaled by with each \ fBm iteration." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0))) && @expertmode == "expert" endparam param trap1fBmoctaves caption = "fBm Octaves" default = 3 min = 1 max = 16 hint = "This sets the number of fBm iterations to perform with each fractal \ iteration. Increasing this number can drastically affect rendering \ speed, but gives a more detailed fBm texture." visible = @trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) endparam param trap1fBmpower caption = "fBm Exponent" default = 2.0 hint = "This is an exponent used in the random number generator. Different \ values will give different noise patterns. Try using values near 2.0." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0))) && @expertmode == "expert" endparam param trap1fBmslope caption = "Calculate Slope" default = FALSE hint = "If checked, calculate the slope of the fBm and use that instead \ of using the fBm value directly." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0))) && @expertmode == "expert" endparam param trap1fBmslopeseparation caption = "Separation" default = 0.0001 hint = "Sets the separation of points used to calculate the slope." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0))) && @expertmode == "expert" && @trap1fBmslope endparam param trap1fBmslopeangle caption = "Light Angle" default = 30 hint = "Sets the lighting angle." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0))) && @expertmode == "expert" && @trap1fBmslope endparam param trap1fBmslopeelevation caption = "Light Elevation" default = 30 hint = "Sets the elevation of the light." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0))) && @expertmode == "expert" && @trap1fBmslope endparam param trap1fBmslopescale caption = "Height Scale" default = 1.0 hint = "Scales the height of the fBm before calculating the slope." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0))) && @expertmode == "expert" && @trap1fBmslope endparam ; ; Trap 2 Parameters ; heading caption = "Trap B Parameters" visible = @trapcount >= 1 endheading ; Shape parameters ; param trap2shape caption = "Trap Shape" default = 0 enum = "point" "egg" "hyperbola" "hypercross" \ "cross" "astroid" "rectangle" "line" \ "linear wave" "radial wave" "ring ripples" \ "grid ripples" "radial ripples" "pinch" "spiral" "heart" \ "heart 2" "fBm" hint = "This is the shape of the orbit trap." visible = @trapcount >= 1 endparam param trap2eggseparation caption = " Stretching" default = 1.0 hint = "Specifies how stretched the egg shape should be." visible = @trapcount >= 1 && @trap2shape == "egg" endparam param trap2egginess caption = " Egginess" default = 4.0 hint = "Specifies how pointy the egg shape should be." visible = @trapcount >= 1 && @trap2shape == "egg" endparam param trap2astroidpower caption = " Squareness" default = 0.666666666666667 hint = "Indicates the squareness of the astroid shape. Values \ less than one produce diamonds; values larger than one \ push the shape closer and closer towards a square." visible = @trapcount >= 1 && @trap2shape == "astroid" endparam param trap2wavemirrors caption = " Mirroring" default = 0 enum = "none" "half" "full" hint = "Chooses the mirroring on the waves. 'Half' will reflect \ one half of the wave, replacing the other half; 'Full' \ reflects both halves of the wave and superimposes them." visible = @trapcount >= 1 && (@trap2shape == "linear wave") endparam param trap2gridmode caption = " Grid Mode" default = 0 enum = "diagonal" "straight" hint = "Chooses the orientation of the grid by selecting between \ addition ('diagonal') and multiplication ('straight') when \ adding wave components for vertical and horizontal values." visible = @trapcount >= 1 && (@trap2shape == "grid ripples") endparam param trap2frequency1 caption = " Frequency 1" default = 1.0 hint = "Specifies the primary frequency of the wave. Higher \ numbers give a more rapidly-oscillating wave." visible = @trapcount >= 1 && (@trap2shape == "linear wave" || \ @trap2shape == "radial wave" || @trap2shape == "ring ripples" || \ @trap2shape == "grid ripples" || @trap2shape == "radial ripples") endparam param trap2amplitude1 caption = " Amplitude 1" default = 1.0 hint = "Specifies the primary amplitude of the wave. Higher \ numbers increase the distance between extremes in the wave." visible = @trapcount >= 1 && (@trap2shape == "linear wave" || \ @trap2shape == "radial wave" || @trap2shape == "ring ripples" || \ @trap2shape == "grid ripples" || @trap2shape == "radial ripples") endparam param trap2phase1 caption = " Phase 1" default = 0.0 hint = "Provides a phase shift for the wave, which can be used to shift the \ wave peaks side-to-side. Phases are specified in degrees, so a phase \ shift of 360 or -360 is equivalent to a phase shift of zero." visible = @trapcount >= 1 && (@trap2shape == "linear wave" || \ @trap2shape == "radial wave" || @trap2shape == "ring ripples" || \ @trap2shape == "grid ripples" || @trap2shape == "radial ripples") endparam param trap2frequency2 caption = " Frequency 2" default = 1.0 hint = "Specifies the secondary frequency of the wave. Higher \ numbers give a more rapidly-oscillating wave." visible = @trapcount >= 1 && (@trap2shape == "linear wave" || \ @trap2shape == "radial wave" || @trap2shape == "ring ripples" || \ @trap2shape == "grid ripples" || @trap2shape == "radial ripples") endparam param trap2amplitude2 caption = " Amplitude 2" default = 1.0 hint = "Specifies the secondary amplitude of the wave. Higher \ numbers increase the distance between extremes in the wave." visible = @trapcount >= 1 && (@trap2shape == "linear wave" || \ @trap2shape == "radial wave" || @trap2shape == "ring ripples" || \ @trap2shape == "grid ripples" || @trap2shape == "radial ripples") endparam param trap2phase2 caption = " Phase 2" default = 0.0 hint = "Provides a phase shift for the wave, which can be used to shift the \ wave peaks side-to-side. Phases are specified in degrees, so a phase \ shift of 360 or -360 is equivalent to a phase shift of zero." visible = @trapcount >= 1 && (@trap2shape == "linear wave" || \ @trap2shape == "radial wave" || @trap2shape == "ring ripples" || \ @trap2shape == "grid ripples" || @trap2shape == "radial ripples") endparam param trap2petals caption = " Petals" default = 4.0 hint = "Specifies the number of petals in the pinch shape." visible = @trapcount >= 1 && @trap2shape == "pinch" endparam param trap2tightness caption = " Tightness" default = 4.0 hint = "Specifies the tightness of the spiral." visible = @trapcount >= 1 && @trap2shape == "spiral" endparam param trap2heartrot caption = " Pointiness" default = 45.0 hint = "Specifies the pointiness of the heart shape." visible = @trapcount >= 1 && @trap2shape == "heart" endparam param trap2heartsize caption = " Size" default = 1.0 hint = "Specifies the size of the heart shape." visible = @trapcount >= 1 && @trap2shape == "heart" endparam param trap2heartskew caption = " Skew" default = 30.0 hint = "Specifies the skew angle, in degrees, of the halves of the heart." visible = @trapcount >= 1 && @trap2shape == "heart 2" endparam param trap2aspect caption = "Aspect Ratio" default = 1.0 min = 0.0 hint = "This is how square the trap is. You can distort the \ trap by using a value other than 1.0." visible = @trapcount >= 1 endparam param trap2diameter1 caption = "Diameter" default = 0.0 hint = "This is the diameter of the trap. Diameters greater than \ zero produce rings, boxes, pairs of traps, etc." visible = @trapcount >= 1 endparam param trap2diameter2 caption = " Second Diameter" default = 0.0 hint = "Just as changing the Diameter 'splits' the trap, you can \ split it again by setting this value greater than zero." visible = @trapcount >= 1 && @trap2diameter1 != 0.0 endparam param trap2invertexponent caption = "Inversion Exponent" default = 1.0 hint = "Sets the inversion exponent. 1.0 gives no inversion, -1.0 \ gives standard inversion." visible = @trapcount >= 1 endparam param trap2invertoffset caption = "Inversion Offset" default = (0,0) hint = "Sets the offset of the inversion center from the trap center." visible = @trapcount >= 1 && @trap2invertexponent != 1.0 endparam param trap2fade caption = "Fade Radius" default = 0.0 hint = "Sets the radius beyond which the trap will 'fade out'. \ A value of zero disables this feature." visible = @trapcount >= 1 endparam param trap2fadeoffset caption = " Fade Offset" default = (0,0) hint = "Sets the offset from the trap center to fade from. You can use \ this to fade the trap unevenly." visible = @trapcount >= 1 && @trap2fade != 0.0 endparam param trap2fademode caption = " Fade Mode" default = 0 enum = "add" "multiply" hint = "Choose the way in which the fade will be applied. 'Add' works \ best for most trap types, but for any ripples type, you may want \ to use 'Multiply'." visible = @trapcount >= 1 && @trap2fade != 0.0 endparam ; Location/orientation Parameters ; param trap2reuseposition caption = "Re-use Trap 1 position" default = false hint = "If checked, this trap's position is relative to the \ position of the previous trap." visible = @trapcount >= 1 endparam param trap2center caption = "Trap Center" default = (0,0) hint = "This is the location of the trap in the complex plane." visible = @trapcount >= 1 endparam param trap2centermoves caption = "Follows pixel location" default = false hint = "If this is enabled, the trap center will follow the pixel \ location, offset by the Trap Center amount. NOTE: If you \ enable this, you will probably want to skip the first iteration." visible = @trapcount >= 1 endparam param trap2drift caption = "Trap Drift" default = (0,0) hint = "This is the amount the trap center will move with each \ iteration." visible = @trapcount >= 1 endparam param trap2rot caption = "Rotation" default = 0.0 hint = "This is the angle, in degrees, that the trap should \ be rotated." visible = @trapcount >= 1 endparam param trap2rotstep caption = "Rotation Step" default = 0.0 hint = "This is the angle, in degrees, that the trap will \ be rotated with each iteration." visible = @trapcount >= 1 endparam param trap2skew caption = "Skew" default = 0.0 hint = "This is the angle, in degrees, to skew the vertical \ axis of the trap shape." visible = @trapcount >= 1 endparam param trap2skewstep caption = "Skew Step" default = 0.0 hint = "This is the angle, in degrees, that the skew angle \ should be increased by with each iteration." visible = @trapcount >= 1 endparam ; Repeat Parameters ; param trap2repeatspacing caption = "Repeat Spacing" default = 0.0 min = 0.0 hint = "This is the spacing at which the trap will repeat, \ all across the complex plane. If zero, trap does \ not repeat." visible = @trapcount >= 1 endparam param trap2repeatcenter caption = " Repeat Center" default = (0,0) hint = "This is the center point of grid trap repetition." visible = @trapcount >= 1 && (@trap2repeatspacing > 0.0) endparam param trap2repeatangle caption = " Repeat Rotation" default = 0.0 hint = "This is the angle of the repeat grid." visible = @trapcount >= 1 && (@trap2repeatspacing > 0.0) endparam param trap2radialspacing caption = "Radial Spacing" default = 0.0 min = 0 hint = "This is the number of times the trap will repeat, \ radially around the radial center point. If zero, \ trap does not repeat radially." visible = @trapcount >= 1 endparam param trap2concentricspacing caption = "Concentric Spacing" default = 0.0 min = 0 hint = "This is the distance at which the trap will repeat, \ radially out from the radial center point. If zero, \ trap does not repeat radially out." visible = @trapcount >= 1 endparam param trap2radialcenter caption = " Radial Center" default = (0,0) hint = "This is the center point of radial trap repetition." visible = @trapcount >= 1 && (@trap2radialspacing > 0.0 || @trap2concentricspacing > 0.0) endparam param trap2radialmode caption = " Radial Mode" default = 0 enum = "kaleidoscope" "polar coordinates" hint = "Indicates the type of radial repetition to use. The \ two styles produce very different results." visible = @trapcount >= 1 && (@trap2radialspacing > 0.0) endparam ; Transfer Parameters ; param trap2distancetransfer caption = "Distance Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" \ "sin" "cos" "tan" "sinc" hint = "This function is applied to trap distances at every \ iteration. It can be used to apply some special effects \ to trap shapes." visible = @trapcount >= 1 endparam param trap2distanceprescale caption = "Distance Pre-scale" default = 1.0 hint = "This is a multiplier applied to the trap distance, \ before the Distance Transfer function is applied to it." visible = @trapcount >= 1 endparam param trap2distancepostscale caption = "Distance Post-scale" default = 1.0 hint = "This is a multiplier applied to the trap distance, \ after the Distance Transfer function is applied to it." visible = @trapcount >= 1 endparam param trap2nonegdistance caption = "No Negative Distance" default = false hint = "If enabled, eliminates 'negative' distances by taking \ the absolute value of the distance." visible = @trapcount >= 1 endparam ; fBm Parameters ; param trap2fBmenable caption = "Use fBm" default = false hint = "Check this if you want to use fBm to modify this trap shape." enabled = @trapcount >= 1 && (@trap2shape != "fBm" && (@trapcolor != "fBm" || @trapcolorfBmset != 1)) visible = @trapcount >= 1 endparam heading caption = "Trap B fBm Parameters" visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endheading param trap2fBmuseasdistort caption = "Use to Distort" default = false hint = "Check this if you want fBm to distort the trap shape." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmdistortionstyle caption = "Style" default = 0 enum = "radial" "linear" "chained fBm" hint = "Chooses the kind of distortion. Radial distorts radially around a \ point, linear distorts back-and-forth across a line, and chained \ fBm uses trap 1 fBm to control the distortion angle." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) && @trap2fBmuseasdistort endparam param trap2fBmdistortionvariance caption = "Rotation variance" default = 90.0 hint = "Specifies the variance in distortion angles possible, in degrees." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) && @trap2fBmuseasdistort && @trap2fBmdistortionstyle == "chained fBm" endparam param trap2fBmdistortionstrength caption = "Strength" default = 1.0 hint = "Sets the strength of the distortion. Larger strengths will push the \ trap shape more." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) && @trap2fBmuseasdistort endparam param trap2fBmdistortionangle caption = "Angle" default = 0.0 hint = "Sets the angle, in degrees, of the distortion, relative to the center of \ distortion (for radial) or the horizontal axis (for linear)." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) && @trap2fBmuseasdistort endparam param trap2fBmdistortioncenter caption = "Offset" default = (0,0) hint = "Sets the offset from the trap center for the distortion." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) && @trap2fBmuseasdistort && @trap2fBmdistortionstyle == "radial" endparam param trap2fBmuseasadder caption = "Use to Texturize" default = false hint = "Check this if you want fBm to texturize the trap shape." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmadderscale caption = "Intensity" default = 1.0 hint = "Sets how much the intensity of the fBm pattern will affect the trap." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) && @trap2fBmuseasadder endparam param trap2fBmadderstage caption = "Apply" default = 0 enum = "immediately" "after fade" "after transfer" hint = "Sets when when fBm is added to the trap distance." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) && @trap2fBmuseasadder endparam param trap2fBmtransform caption = "fBm Transform" default = 0 enum = "rectangular" "polar" hint = "Selects the transform mode for orbit values used in fBm calculations." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmoffset caption = "fBm Offset" default = (0,0) hint = "Sets the offset of the fBm pattern." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmscale caption = "fBm Scale" default = 1.0 hint = "Sets the scale of the fBm pattern. Larger values give a finer grain." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmbias caption = "fBm Bias" default = 0.0 hint = "This constant is added to the result of the fBm noise. fBm noise typically produces \ values from -0.5 to 0.5; in some cases negative values will be a problem, so you can use \ this setting (try 1) to bias the results and always get a positive value." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmaspect caption = "fBm Aspect" default = 1.0 hint = "Sets the aspect ratio of the fBm pattern. You can use this to stretch \ or squeeze the fBm pattern." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmangle caption = "fBm Rotation" default = 0.0 hint = "Sets the angle, in degrees, of the fBm pattern." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmangleiterstep caption = "fBm Rot. Step" default = 0.0 hint = "This is the angle, in degrees, that the fBm pattern will rotate with \ each fractal iteration." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmscalestep caption = "fBm Scale Iter." default = 0.5 hint = "This is the amount the fBm pattern is scaled by with each fBm iteration." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmanglestep caption = "fBm Rot. Iter." default = 37.0 hint = "This is the angle, in degrees, the fBm pattern is scaled by with each \ fBm iteration." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmoctaves caption = "fBm Octaves" default = 3 min = 1 max = 16 hint = "This sets the number of fBm iterations to perform with each fractal \ iteration. Increasing this number can drastically affect rendering \ speed, but gives a more detailed fBm texture." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmpower caption = "fBm Exponent" default = 2.0 hint = "This is an exponent used in the random number generator. Different \ values will give different noise patterns. Try using values near 2.0." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmslope caption = "Calculate Slope" default = FALSE hint = "If checked, calculate the slope of the fBm and use that instead \ of using the fBm value directly." visible = (@trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1))) && @expertmode == "expert" endparam param trap2fBmslopeseparation caption = "Separation" default = 0.0001 hint = "Sets the separation of points used to calculate the slope." visible = (@trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1))) && @expertmode == "expert" && @trap2fBmslope endparam param trap2fBmslopeangle caption = "Light Angle" default = 30 hint = "Sets the lighting angle." visible = (@trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1))) && @expertmode == "expert" && @trap2fBmslope endparam param trap2fBmslopeelevation caption = "Light Elevation" default = 30 hint = "Sets the elevation of the light." visible = (@trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1))) && @expertmode == "expert" && @trap2fBmslope endparam param trap2fBmslopescale caption = "Height Scale" default = 1.0 hint = "Scales the height of the fBm before calculating the slope." visible = (@trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1))) && @expertmode == "expert" && @trap2fBmslope endparam ; ; Trap 3 Parameters ; heading caption = "Trap C Parameters" visible = @trapcount >= 2 endheading ; Shape parameters ; param trap3shape caption = "Trap Shape" default = 0 enum = "point" "egg" "hyperbola" "hypercross" \ "cross" "astroid" "rectangle" "line" \ "linear wave" "radial wave" "ring ripples" \ "grid ripples" "radial ripples" "pinch" "spiral" "heart" \ "heart 2" "fBm" hint = "This is the shape of the orbit trap." visible = @trapcount >= 2 endparam param trap3eggseparation caption = " Stretching" default = 1.0 hint = "Specifies how stretched the egg shape should be." visible = @trapcount >= 2 && @trap3shape == "egg" endparam param trap3egginess caption = " Egginess" default = 4.0 hint = "Specifies how pointy the egg shape should be." visible = @trapcount >= 2 && @trap3shape == "egg" endparam param trap3astroidpower caption = " Squareness" default = 0.666666666666667 hint = "Indicates the squareness of the astroid shape. Values \ less than one produce diamonds; values larger than one \ push the shape closer and closer towards a square." visible = @trapcount >= 2 && @trap3shape == "astroid" endparam param trap3wavemirrors caption = " Mirroring" default = 0 enum = "none" "half" "full" hint = "Chooses the mirroring on the waves. 'Half' will reflect \ one half of the wave, replacing the other half; 'Full' \ reflects both halves of the wave and superimposes them." visible = @trapcount >= 2 && (@trap3shape == "linear wave") endparam param trap3gridmode caption = " Grid Mode" default = 0 enum = "diagonal" "straight" hint = "Chooses the orientation of the grid by selecting between \ addition ('diagonal') and multiplication ('straight') when \ adding wave components for vertical and horizontal values." visible = @trapcount >= 2 && (@trap3shape == "grid ripples") endparam param trap3frequency1 caption = " Frequency 1" default = 1.0 hint = "Specifies the primary frequency of the wave. Higher \ numbers give a more rapidly-oscillating wave." visible = @trapcount >= 2 && (@trap3shape == "linear wave" || \ @trap3shape == "radial wave" || @trap3shape == "ring ripples" || \ @trap3shape == "grid ripples" || @trap3shape == "radial ripples") endparam param trap3amplitude1 caption = " Amplitude 1" default = 1.0 hint = "Specifies the primary amplitude of the wave. Higher \ numbers increase the distance between extremes in the wave." visible = @trapcount >= 2 && (@trap3shape == "linear wave" || \ @trap3shape == "radial wave" || @trap3shape == "ring ripples" || \ @trap3shape == "grid ripples" || @trap3shape == "radial ripples") endparam param trap3phase1 caption = " Phase 1" default = 0.0 hint = "Provides a phase shift for the wave, which can be used to shift the \ wave peaks side-to-side. Phases are specified in degrees, so a phase \ shift of 360 or -360 is equivalent to a phase shift of zero." visible = @trapcount >= 2 && (@trap3shape == "linear wave" || \ @trap3shape == "radial wave" || @trap3shape == "ring ripples" || \ @trap3shape == "grid ripples" || @trap3shape == "radial ripples") endparam param trap3frequency2 caption = " Frequency 2" default = 1.0 hint = "Specifies the secondary frequency of the wave. Higher \ numbers give a more rapidly-oscillating wave." visible = @trapcount >= 2 && (@trap3shape == "linear wave" || \ @trap3shape == "radial wave" || @trap3shape == "ring ripples" || \ @trap3shape == "grid ripples" || @trap3shape == "radial ripples") endparam param trap3amplitude2 caption = " Amplitude 2" default = 1.0 hint = "Specifies the secondary amplitude of the wave. Higher \ numbers increase the distance between extremes in the wave." visible = @trapcount >= 2 && (@trap3shape == "linear wave" || \ @trap3shape == "radial wave" || @trap3shape == "ring ripples" || \ @trap3shape == "grid ripples" || @trap3shape == "radial ripples") endparam param trap3phase2 caption = " Phase 2" default = 0.0 hint = "Provides a phase shift for the wave, which can be used to shift the \ wave peaks side-to-side. Phases are specified in degrees, so a phase \ shift of 360 or -360 is equivalent to a phase shift of zero." visible = @trapcount >= 2 && (@trap3shape == "linear wave" || \ @trap3shape == "radial wave" || @trap3shape == "ring ripples" || \ @trap3shape == "grid ripples" || @trap3shape == "radial ripples") endparam param trap3petals caption = " Petals" default = 4.0 hint = "Specifies the number of petals in the pinch shape." visible = @trapcount >= 2 && @trap3shape == "pinch" endparam param trap3tightness caption = " Tightness" default = 4.0 hint = "Specifies the tightness of the spiral." visible = @trapcount >= 2 && @trap3shape == "spiral" endparam param trap3heartrot caption = " Pointiness" default = 45.0 hint = "Specifies the pointiness of the heart shape." visible = @trapcount >= 2 && @trap3shape == "heart" endparam param trap3heartsize caption = " Size" default = 1.0 hint = "Specifies the size of the heart shape." visible = @trapcount >= 2 && @trap3shape == "heart" endparam param trap3heartskew caption = " Skew" default = 30.0 hint = "Specifies the skew angle, in degrees, of the halves of the heart." visible = @trapcount >= 2 && @trap3shape == "heart 2" endparam param trap3aspect caption = "Aspect Ratio" default = 1.0 min = 0.0 hint = "This is how square the trap is. You can distort the \ trap by using a value other than 1.0." visible = @trapcount >= 2 endparam param trap3diameter1 caption = "Diameter" default = 0.0 hint = "This is the diameter of the trap. Diameters greater than \ zero produce rings, boxes, pairs of traps, etc." visible = @trapcount >= 2 endparam param trap3diameter2 caption = " Second Diameter" default = 0.0 hint = "Just as changing the Diameter 'splits' the trap, you can \ split it again by setting this value greater than zero." visible = @trapcount >= 2 && @trap3diameter1 != 0.0 endparam param trap3invertexponent caption = "Inversion Exponent" default = 1.0 hint = "Sets the inversion exponent. 1.0 gives no inversion, -1.0 \ gives standard inversion." visible = @trapcount >= 2 endparam param trap3invertoffset caption = "Inversion Offset" default = (0,0) hint = "Sets the offset of the inversion center from the trap center." visible = @trapcount >= 2 && @trap3invertexponent != 1.0 endparam param trap3fade caption = "Fade Radius" default = 0.0 hint = "Sets the radius beyond which the trap will 'fade out'. \ A value of zero disables this feature." visible = @trapcount >= 2 endparam param trap3fadeoffset caption = " Fade Offset" default = (0,0) hint = "Sets the offset from the trap center to fade from. You can use \ this to fade the trap unevenly." visible = @trapcount >= 2 && @trap3fade != 0.0 endparam param trap3fademode caption = " Fade Mode" default = 0 enum = "add" "multiply" hint = "Choose the way in which the fade will be applied. 'Add' works \ best for most trap types, but for any ripples type, you may want \ to use 'Multiply'." visible = @trapcount >= 2 && @trap3fade != 0.0 endparam ; Location/orientation Parameters ; param trap3reuseposition caption = "Re-use Trap 2 position" default = false hint = "If checked, this trap's position is relative to the \ position of the previous trap." visible = @trapcount >= 2 endparam param trap3center caption = "Trap Center" default = (0,0) hint = "This is the location of the trap in the complex plane." visible = @trapcount >= 2 endparam param trap3centermoves caption = "Follows pixel location" default = false hint = "If this is enabled, the trap center will follow the pixel \ location, offset by the Trap Center amount. NOTE: If you \ enable this, you will probably want to skip the first iteration." visible = @trapcount >= 2 endparam param trap3drift caption = "Trap Drift" default = (0,0) hint = "This is the amount the trap center will move with each \ iteration." visible = @trapcount >= 2 endparam param trap3rot caption = "Rotation" default = 0.0 hint = "This is the angle, in degrees, that the trap should \ be rotated." visible = @trapcount >= 2 endparam param trap3rotstep caption = "Rotation Step" default = 0.0 hint = "This is the angle, in degrees, that the trap will \ be rotated with each iteration." visible = @trapcount >= 2 endparam param trap3skew caption = "Skew" default = 0.0 hint = "This is the angle, in degrees, to skew the vertical \ axis of the trap shape." visible = @trapcount >= 2 endparam param trap3skewstep caption = "Skew Step" default = 0.0 hint = "This is the angle, in degrees, that the skew angle \ should be increased by with each iteration." visible = @trapcount >= 2 endparam ; Repeat Parameters ; param trap3repeatspacing caption = "Repeat Spacing" default = 0.0 min = 0.0 hint = "This is the spacing at which the trap will repeat, \ all across the complex plane. If zero, trap does \ not repeat." visible = @trapcount >= 2 endparam param trap3repeatcenter caption = " Repeat Center" default = (0,0) hint = "This is the center point of grid trap repetition." visible = @trapcount >= 2 && (@trap3repeatspacing > 0.0) endparam param trap3repeatangle caption = " Repeat Rotation" default = 0.0 hint = "This is the angle of the repeat grid." visible = @trapcount >= 2 && (@trap3repeatspacing > 0.0) endparam param trap3radialspacing caption = "Radial Spacing" default = 0.0 min = 0 hint = "This is the number of times the trap will repeat, \ radially around the radial center point. If zero, \ trap does not repeat radially." visible = @trapcount >= 2 endparam param trap3concentricspacing caption = "Concentric Spacing" default = 0.0 min = 0 hint = "This is the distance at which the trap will repeat, \ radially out from the radial center point. If zero, \ trap does not repeat radially out." visible = @trapcount >= 2 endparam param trap3radialcenter caption = " Radial Center" default = (0,0) hint = "This is the center point of radial trap repetition." visible = @trapcount >= 2 && (@trap3radialspacing > 0.0 || @trap3concentricspacing > 0.0) endparam param trap3radialmode caption = " Radial Mode" default = 0 enum = "kaleidoscope" "polar coordinates" hint = "Indicates the type of radial repetition to use. The \ two styles produce very different results." visible = @trapcount >= 2 && (@trap3radialspacing > 0.0) endparam ; Transfer Parameters ; param trap3distancetransfer caption = "Distance Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" \ "sin" "cos" "tan" "sinc" hint = "This function is applied to trap distances at every \ iteration. It can be used to apply some special effects \ to trap shapes." visible = @trapcount >= 2 endparam param trap3distanceprescale caption = "Distance Pre-scale" default = 1.0 hint = "This is a multiplier applied to the trap distance, \ before the Distance Transfer function is applied to it." visible = @trapcount >= 2 endparam param trap3distancepostscale caption = "Distance Post-scale" default = 1.0 hint = "This is a multiplier applied to the trap distance, \ after the Distance Transfer function is applied to it." visible = @trapcount >= 2 endparam param trap3nonegdistance caption = "No Negative Distance" default = false hint = "If enabled, eliminates 'negative' distances by taking \ the absolute value of the distance." visible = @trapcount >= 2 endparam ; fBm Parameters ; param trap3fBmenable caption = "Use fBm" default = false hint = "Check this if you want to use fBm to modify this trap shape." enabled = @trapcount >= 2 && (@trap3shape != "fBm" && (@trapcolor != "fBm" || @trapcolorfBmset != 2)) visible = @trapcount >= 2 endparam heading caption = "Trap C fBm Parameters" visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endheading param trap3fBmuseasdistort caption = "Use to Distort" default = false hint = "Check this if you want fBm to distort the trap shape." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmdistortionstyle caption = "Style" default = 0 enum = "radial" "linear" "chained fBm" hint = "Chooses the kind of distortion. Radial distorts radially around a \ point, linear distorts back-and-forth across a line, and chained \ fBm uses trap 2 fBm to control the distortion angle." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) && @trap3fBmuseasdistort endparam param trap3fBmdistortionvariance caption = "Rotation variance" default = 90.0 hint = "Specifies the variance in distortion angles possible, in degrees." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) && @trap3fBmuseasdistort && @trap3fBmdistortionstyle == "chained fBm" endparam param trap3fBmdistortionstrength caption = "Strength" default = 1.0 hint = "Sets the strength of the distortion. Larger strengths will push the \ trap shape more." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) && @trap3fBmuseasdistort endparam param trap3fBmdistortionangle caption = "Angle" default = 0.0 hint = "Sets the angle, in degrees, of the distortion, relative to the center of \ distortion (for radial) or the horizontal axis (for linear)." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) && @trap3fBmuseasdistort endparam param trap3fBmdistortioncenter caption = "Offset" default = (0,0) hint = "Sets the offset from the trap center for the distortion." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) && @trap3fBmuseasdistort && @trap3fBmdistortionstyle == "radial" endparam param trap3fBmuseasadder caption = "Use to Texturize" default = false hint = "Check this if you want fBm to texturize the trap shape." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmadderscale caption = "Intensity" default = 1.0 hint = "Sets how much the intensity of the fBm pattern will affect the trap." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) && @trap3fBmuseasadder endparam param trap3fBmadderstage caption = "Apply" default = 0 enum = "immediately" "after fade" "after transfer" hint = "Sets when when fBm is added to the trap distance." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) && @trap3fBmuseasadder endparam param trap3fBmtransform caption = "fBm Transform" default = 0 enum = "rectangular" "polar" hint = "Selects the transform mode for orbit values used in fBm calculations." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmoffset caption = "fBm Offset" default = (0,0) hint = "Sets the offset of the fBm pattern." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmscale caption = "fBm Scale" default = 1.0 hint = "Sets the scale of the fBm pattern. Larger values give a finer grain." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmbias caption = "fBm Bias" default = 0.0 hint = "This constant is added to the result of the fBm noise. fBm noise typically produces \ values from -0.5 to 0.5; in some cases negative values will be a problem, so you can use \ this setting (try 1) to bias the results and always get a positive value." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmaspect caption = "fBm Aspect" default = 1.0 hint = "Sets the aspect ratio of the fBm pattern. You can use this to stretch \ or squeeze the fBm pattern." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmangle caption = "fBm Rotation" default = 0.0 hint = "Sets the angle, in degrees, of the fBm pattern." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmangleiterstep caption = "fBm Rot. Step" default = 0.0 hint = "This is the angle, in degrees, that the fBm pattern will rotate with \ each fractal iteration." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmscalestep caption = "fBm Scale Iter." default = 0.5 hint = "This is the amount the fBm pattern is scaled by with each fBm iteration." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmanglestep caption = "fBm Rot. Iter." default = 37.0 hint = "This is the angle, in degrees, the fBm pattern is scaled by with each \ fBm iteration." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmoctaves caption = "fBm Octaves" default = 3 min = 1 max = 16 hint = "This sets the number of fBm iterations to perform with each fractal \ iteration. Increasing this number can drastically affect rendering \ speed, but gives a more detailed fBm texture." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmpower caption = "fBm Exponent" default = 2.0 hint = "This is an exponent used in the random number generator. Different \ values will give different noise patterns. Try using values near 2.0." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmslope caption = "Calculate Slope" default = FALSE hint = "If checked, calculate the slope of the fBm and use that instead \ of using the fBm value directly." visible = (@trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2))) && @expertmode == "expert" endparam param trap3fBmslopeseparation caption = "Separation" default = 0.0001 hint = "Sets the separation of points used to calculate the slope." visible = (@trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2))) && @expertmode == "expert" && @trap3fBmslope endparam param trap3fBmslopeangle caption = "Light Angle" default = 30 hint = "Sets the lighting angle." visible = (@trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2))) && @expertmode == "expert" && @trap3fBmslope endparam param trap3fBmslopeelevation caption = "Light Elevation" default = 30 hint = "Sets the elevation of the light." visible = (@trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2))) && @expertmode == "expert" && @trap3fBmslope endparam param trap3fBmslopescale caption = "Height Scale" default = 1.0 hint = "Scales the height of the fBm before calculating the slope." visible = (@trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2))) && @expertmode == "expert" && @trap3fBmslope endparam } dmj3-OrbitTrapsDirect { ; ; This variant of Orbit Traps computes and combines colors ; at every iteration, allowing a gradual buildup. The ; effect can be very subtle, but because only one gradient ; is used for all traps, you may find controlling the ; resulting colors difficult, especially with some merge ; modes. ; ; For more details on orbit traps in general, please see ; the Orbit Traps formula. ; init: ; ---- Compare this code with that of Orbit Traps. Many of ; ---- the variables are commented out because they're not ; ---- used (they're for tracking trap merge mode data ; ---- between iterations). The structure is nearly almost ; ---- identical, intentionally, to make keeping the two ; ---- formulas synchronised. ; working values arrays ; float distances[3]; distance variables for each trap ; complex points[4]; tracks closest points to traps ; int iterations[2]; tracks iteration values at closest approach ; iterations[0] = 0 ; iterations[1] = 0 ; float closest[2]; tracks closest distances to traps ; closest[0] = 1e38 ; closest[1] = 1e38 float d = 0.0; distance to current trap float d2 = 0.0; secondary distance to current trap ; float previousd = 0.0; previous distance complex z2 = (0,0); holds transformed z complex z3 = (0,0); alterable z for trap shapes int iter = 0; counts current iteration float fiter = @trapstart; counts iterations left before applying traps ; BOOL done = false; flag indicating whether trap calculation can stop early BOOL trapping = false; flag indicating whether traps are being applied ; trap shape arrays ; int trapshapes[3]; holds trap center shapes trapshapes[0] = @trap1shape trapshapes[1] = @trap2shape trapshapes[2] = @trap3shape float trapeggseps[3]; holds trap egg separation values trapeggseps[0] = @trap1eggseparation trapeggseps[1] = @trap2eggseparation trapeggseps[2] = @trap3eggseparation float trapegginesses[3]; holds trap egginess values trapegginesses[0] = @trap1egginess trapegginesses[1] = @trap2egginess trapegginesses[2] = @trap3egginess float trappowers[3]; holds trap astroid powers trappowers[0] = @trap1astroidpower trappowers[1] = @trap2astroidpower trappowers[2] = @trap3astroidpower int trapmirrors[3]; holds trap wave mirrors trapmirrors[0] = @trap1wavemirrors trapmirrors[1] = @trap2wavemirrors trapmirrors[2] = @trap3wavemirrors int trapgridmodes[3]; holds trap grid modes trapgridmodes[0] = @trap1gridmode trapgridmodes[1] = @trap2gridmode trapgridmodes[2] = @trap3gridmode float trapfreqs1[3]; holds primary trap frequencies trapfreqs1[0] = @trap1frequency1 trapfreqs1[1] = @trap2frequency1 trapfreqs1[2] = @trap3frequency1 float trapamps1[3]; holds primary trap amplitudes trapamps1[0] = @trap1amplitude1 trapamps1[1] = @trap2amplitude1 trapamps1[2] = @trap3amplitude1 float trapphases1[3]; holds primary trap phases trapphases1[0] = @trap1phase1 * #pi/180 trapphases1[1] = @trap2phase1 * #pi/180 trapphases1[2] = @trap3phase1 * #pi/180 float trapfreqs2[3]; holds secondary trap frequencies trapfreqs2[0] = @trap1frequency2 trapfreqs2[1] = @trap2frequency2 trapfreqs2[2] = @trap3frequency2 float trapamps2[3]; holds secondary trap amplitudes trapamps2[0] = @trap1amplitude2 trapamps2[1] = @trap2amplitude2 trapamps2[2] = @trap3amplitude2 float trapphases2[3]; holds secondary trap phases trapphases2[0] = @trap1phase2 * #pi/180 trapphases2[1] = @trap2phase2 * #pi/180 trapphases2[2] = @trap3phase2 * #pi/180 float trappetals[3]; holds trap petal counts trappetals[0] = @trap1petals trappetals[1] = @trap2petals trappetals[2] = @trap3petals float traptightnesses[3]; holds trap spiral tightnesses traptightnesses[0] = @trap1tightness traptightnesses[1] = @trap2tightness traptightnesses[2] = @trap3tightness complex trapheartrots[3]; holds trap heart rotation vectors trapheartrots[0] = (0,1) ^ (@trap1heartrot / 90.0) trapheartrots[1] = (0,1) ^ (@trap2heartrot / 90.0) trapheartrots[2] = (0,1) ^ (@trap3heartrot / 90.0) float trapheartsizes[3]; holds trap sizes trapheartsizes[0] = @trap1heartsize trapheartsizes[1] = @trap2heartsize trapheartsizes[2] = @trap3heartsize float trapaspects[3]; holds trap aspect ratios trapaspects[0] = @trap1aspect trapaspects[1] = @trap2aspect trapaspects[2] = @trap3aspect float trapdiameters1[3]; holds primary trap diameters trapdiameters1[0] = @trap1diameter1 trapdiameters1[1] = @trap2diameter1 trapdiameters1[2] = @trap3diameter1 float trapdiameters2[3]; holds secondary trap diameters trapdiameters2[0] = @trap1diameter2 trapdiameters2[1] = @trap2diameter2 trapdiameters2[2] = @trap3diameter2 float trapinvertexponents[3]; holds trap inversion exponents trapinvertexponents[0] = @trap1invertexponent trapinvertexponents[1] = @trap2invertexponent trapinvertexponents[2] = @trap3invertexponent complex trapinvertoffsets[3]; holds trap inversion center offsets trapinvertoffsets[0] = @trap1invertoffset trapinvertoffsets[1] = @trap2invertoffset trapinvertoffsets[2] = @trap3invertoffset float trapfades[3]; holds trap fade amounts trapfades[0] = @trap1fade trapfades[1] = @trap2fade trapfades[2] = @trap3fade complex trapfadeoffsets[3]; holds trap fade offsets trapfadeoffsets[0] = @trap1fadeoffset trapfadeoffsets[1] = @trap2fadeoffset trapfadeoffsets[2] = @trap3fadeoffset int trapfademodes[3]; holds trap fade modes trapfademodes[0] = @trap1fademode trapfademodes[1] = @trap2fademode trapfademodes[2] = @trap3fademode ; trap location/orientation arrays ; BOOL trapreusepositions[3]; holds trap relative position flags trapreusepositions[0] = false; this one is ALWAYS false trapreusepositions[1] = @trap2reuseposition trapreusepositions[2] = @trap3reuseposition complex trapcenters[3]; holds trap center locations trapcenters[0] = @trap1center trapcenters[1] = @trap2center trapcenters[2] = @trap3center IF (@trap1centermoves); apply trap center moves trapcenters[0] = trapcenters[0] + #pixel ENDIF IF (@trap2centermoves) trapcenters[1] = trapcenters[1] + #pixel ENDIF IF (@trap3centermoves) trapcenters[2] = trapcenters[2] + #pixel ENDIF complex trapdrifts[3]; holds trap drift amounts trapdrifts[0] = @trap1drift trapdrifts[1] = @trap2drift trapdrifts[2] = @trap3drift float traprots[3]; holds trap rotations traprots[0] = @trap1rot / 90.0 traprots[1] = @trap2rot / 90.0 traprots[2] = @trap3rot / 90.0 float traprotsteps[3]; holds trap rotation steps traprotsteps[0] = @trap1rotstep / 90.0 traprotsteps[1] = @trap2rotstep / 90.0 traprotsteps[2] = @trap3rotstep / 90.0 float trapskews[3]; holds trap skews trapskews[0] = @trap1skew / 90.0 trapskews[1] = @trap2skew / 90.0 trapskews[2] = @trap3skew / 90.0 float trapskewsteps[3]; holds trap skew steps trapskewsteps[0] = @trap1skewstep / 90.0 trapskewsteps[1] = @trap2skewstep / 90.0 trapskewsteps[2] = @trap3skewstep / 90.0 ; trap repeat arrays ; float traprepeatspacings[3]; holds trap repeat spacings traprepeatspacings[0] = @trap1repeatspacing traprepeatspacings[1] = @trap2repeatspacing traprepeatspacings[2] = @trap3repeatspacing complex traprepeatcenters[3]; holds trap repeat centers traprepeatcenters[0] = @trap1repeatcenter traprepeatcenters[1] = @trap2repeatcenter traprepeatcenters[2] = @trap3repeatcenter complex traprepeatangles[3]; holds trap repeat angles traprepeatangles[0] = (0,1) ^ (@trap1repeatangle / 90.0) traprepeatangles[1] = (0,1) ^ (@trap2repeatangle / 90.0) traprepeatangles[2] = (0,1) ^ (@trap3repeatangle / 90.0) float trapradialspacings[3]; holds trap radial spacings trapradialspacings[0] = @trap1radialspacing trapradialspacings[1] = @trap2radialspacing trapradialspacings[2] = @trap3radialspacing float trapconcentricspacings[3]; holds trap concentric spacings trapconcentricspacings[0] = @trap1concentricspacing trapconcentricspacings[1] = @trap2concentricspacing trapconcentricspacings[2] = @trap3concentricspacing complex trapradialcenters[3]; holds trap radial centers trapradialcenters[0] = @trap1radialcenter trapradialcenters[1] = @trap2radialcenter trapradialcenters[2] = @trap3radialcenter int trapradialmodes[3]; holds trap radial modes trapradialmodes[0] = @trap1radialmode trapradialmodes[1] = @trap2radialmode trapradialmodes[2] = @trap3radialmode ; trap transfer arrays ; int trapdistancetransfers[3]; holds trap distance transfer functions trapdistancetransfers[0] = @trap1distancetransfer trapdistancetransfers[1] = @trap2distancetransfer trapdistancetransfers[2] = @trap3distancetransfer float trapdistanceprescales[3]; holds trap distance pre-transfer multipliers trapdistanceprescales[0] = @trap1distanceprescale trapdistanceprescales[1] = @trap2distanceprescale trapdistanceprescales[2] = @trap3distanceprescale float trapdistancepostscales[3]; holds trap distance post-transfer multipliers trapdistancepostscales[0] = @trap1distancepostscale trapdistancepostscales[1] = @trap2distancepostscale trapdistancepostscales[2] = @trap3distancepostscale BOOL trapnonegdistances[3]; flags indicating whether negative distances are allowed trapnonegdistances[0] = @trap1nonegdistance trapnonegdistances[1] = @trap2nonegdistance trapnonegdistances[2] = @trap3nonegdistance ; trap fBm arrays ; BOOL trapfBmenables[3]; flags indicating whether fBm is enabled for a trap trapfBmenables[0] = @trap1shape == "fBm" || ((@trap1fBmuseasdistort || @trap1fBmuseasadder || @trap2fBmdistortionstyle == "chained fBm") && @trap1fBmenable) || (@trapcolor == "fBm" && @trapcolorfBmset == 0 && @trapcolorfBmmode != "trap") trapfBmenables[1] = @trap2shape == "fBm" || ((@trap2fBmuseasdistort || @trap2fBmuseasadder || @trap3fBmdistortionstyle == "chained fBm") && @trap2fBmenable) || (@trapcolor == "fBm" && @trapcolorfBmset == 1 && @trapcolorfBmmode != "trap") trapfBmenables[2] = @trap3shape == "fBm" || ((@trap3fBmuseasdistort || @trap3fBmuseasadder ) && @trap3fBmenable) || (@trapcolor == "fBm" && @trapcolorfBmset == 2 && @trapcolorfBmmode != "trap") BOOL trapfBmenables1[3]; flags indicating actual fBm enabled setting in user interface trapfBmenables1[0] = @trap1fBmenable trapfBmenables1[1] = @trap2fBmenable trapfBmenables1[2] = @trap3fBmenable BOOL trapfBmenables2[3]; flags indicating whether fBm is enabled for a trap, in pseudo-coordinate mode trapfBmenables2[0] = @trapcolor == "fBm" && @trapcolorfBmset == 0 && @trapcolorfBmmode == "trap" trapfBmenables2[1] = @trapcolor == "fBm" && @trapcolorfBmset == 1 && @trapcolorfBmmode == "trap" trapfBmenables2[2] = @trapcolor == "fBm" && @trapcolorfBmset == 2 && @trapcolorfBmmode == "trap" BOOL trapfBmuseasdistorts[3]; flags indicating whether fBm is used for distortion trapfBmuseasdistorts[0] = @trap1fBmuseasdistort trapfBmuseasdistorts[1] = @trap2fBmuseasdistort trapfBmuseasdistorts[2] = @trap3fBmuseasdistort int trapfBmdistortionstyles[3]; holds fBm distortion styles trapfBmdistortionstyles[0] = @trap1fBmdistortionstyle trapfBmdistortionstyles[1] = @trap2fBmdistortionstyle trapfBmdistortionstyles[2] = @trap3fBmdistortionstyle float trapfBmdistortionstrengths[3]; holds fBm distortion strengths trapfBmdistortionstrengths[0] = @trap1fBmdistortionstrength trapfBmdistortionstrengths[1] = @trap2fBmdistortionstrength trapfBmdistortionstrengths[2] = @trap3fBmdistortionstrength float trapfBmdistortionangles[3]; holds fBm distortion angles trapfBmdistortionangles[0] = @trap1fBmdistortionangle / 90.0 trapfBmdistortionangles[1] = @trap2fBmdistortionangle / 90.0 trapfBmdistortionangles[2] = @trap3fBmdistortionangle / 90.0 float trapfBmdistortionvariances[3]; holds fBm rotation variances trapfBmdistortionvariances[0] = 0 trapfBmdistortionvariances[1] = @trap2fBmdistortionvariance / 90.0 trapfBmdistortionvariances[2] = @trap3fBmdistortionvariance / 90.0 complex trapfBmdistortioncenters[3]; holds fBm distortion center offsets trapfBmdistortioncenters[0] = @trap1fBmdistortioncenter trapfBmdistortioncenters[1] = @trap2fBmdistortioncenter trapfBmdistortioncenters[2] = @trap3fBmdistortioncenter BOOL trapfBmuseasadders[3]; flags indicating whether fBm is used for coloring trapfBmuseasadders[0] = @trap1fBmuseasadder trapfBmuseasadders[1] = @trap2fBmuseasadder trapfBmuseasadders[2] = @trap3fBmuseasadder float trapfBmadderscales[3]; holds fBm adder scales trapfBmadderscales[0] = @trap1fBmadderscale trapfBmadderscales[1] = @trap2fBmadderscale trapfBmadderscales[2] = @trap3fBmadderscale int trapfBmadderstages[3]; holds fBm adder usage stage trapfBmadderstages[0] = @trap1fBmadderstage trapfBmadderstages[1] = @trap2fBmadderstage trapfBmadderstages[2] = @trap3fBmadderstage complex trapfBmtransforms[3]; holds fBm transformation modes trapfBmtransforms[0] = @trap1fBmtransform trapfBmtransforms[1] = @trap2fBmtransform trapfBmtransforms[2] = @trap3fBmtransform complex trapfBmoffsets[3]; holds fBm offsets trapfBmoffsets[0] = @trap1fBmoffset trapfBmoffsets[1] = @trap2fBmoffset trapfBmoffsets[2] = @trap3fBmoffset float trapfBmscales[3]; holds fBm scales trapfBmscales[0] = @trap1fBmscale trapfBmscales[1] = @trap2fBmscale trapfBmscales[2] = @trap3fBmscale float trapfBmbiases[3]; holds fBm biases trapfBmbiases[0] = @trap1fBmbias trapfBmbiases[1] = @trap2fBmbias trapfBmbiases[2] = @trap3fBmbias float trapfBmaspects[3]; holds fBm aspects trapfBmaspects[0] = @trap1fBmaspect trapfBmaspects[1] = @trap2fBmaspect trapfBmaspects[2] = @trap3fBmaspect float trapfBmrots[3]; holds fBm rotations trapfBmrots[0] = @trap1fBmangle / 90.0 trapfBmrots[1] = @trap2fBmangle / 90.0 trapfBmrots[2] = @trap3fBmangle / 90.0 float trapfBmrotitersteps[3]; holds fBm rotation steps for each fractal iteration trapfBmrotitersteps[0] = @trap1fBmangleiterstep / 90.0 trapfBmrotitersteps[1] = @trap2fBmangleiterstep / 90.0 trapfBmrotitersteps[2] = @trap3fBmangleiterstep / 90.0 float trapfBmscalesteps[3]; holds fBm scale steps trapfBmscalesteps[0] = @trap1fBmscalestep trapfBmscalesteps[1] = @trap2fBmscalestep trapfBmscalesteps[2] = @trap3fBmscalestep float trapfBmrotsteps[3]; holds fBm rotation steps for each fBm iteration trapfBmrotsteps[0] = @trap1fBmanglestep / 90.0 trapfBmrotsteps[1] = @trap2fBmanglestep / 90.0 trapfBmrotsteps[2] = @trap3fBmanglestep / 90.0 int trapfBmoctaves[3]; holds fBm octaves trapfBmoctaves[0] = @trap1fBmoctaves trapfBmoctaves[1] = @trap2fBmoctaves trapfBmoctaves[2] = @trap3fBmoctaves float trapfBmpowers[3]; holds fBm noise exponents trapfBmpowers[0] = @trap1fBmpower trapfBmpowers[1] = @trap2fBmpower trapfBmpowers[2] = @trap3fBmpower ; miscellaneous other variables ; complex rots[3]; holds complex multipliers to perform rotations rots[0] = (0,1) ^ traprots[0] rots[1] = (0,1) ^ traprots[1] rots[2] = (0,1) ^ traprots[2] complex skews[3]; holds complex multipliers to perform skews skews[0] = (0,1) ^ trapskews[0] skews[1] = (0,1) ^ trapskews[1] skews[2] = (0,1) ^ trapskews[2] complex fBmrots[3]; holds complex multipliers to perform rotations for fBm fBmrots[0] = (0,1) ^ trapfBmrots[0] fBmrots[1] = (0,1) ^ trapfBmrots[1] fBmrots[2] = (0,1) ^ trapfBmrots[2] complex fBmoctaverots[3]; holds complex multipliers to perform rotations for fBm fBmoctaverots[0] = (0,1) ^ trapfBmrotsteps[0] fBmoctaverots[1] = (0,1) ^ trapfBmrotsteps[1] fBmoctaverots[2] = (0,1) ^ trapfBmrotsteps[2] complex fBmdistortrots[3]; holds complex multipliers to perform rotations for fBm fBmdistortrots[0] = (0,1) ^ trapfBmdistortionangles[0] fBmdistortrots[1] = (0,1) ^ trapfBmdistortionangles[1] fBmdistortrots[2] = (0,1) ^ trapfBmdistortionangles[2] float fBmcolor = 0.0 float fBmresults[3]; fBm results for each trap shape complex r0 = (0,0); work rotation vector in spiral shape calculation ; IF (@traptype == "farthest" || @traptype == "sum" || \ ; @traptype == "average" || @traptype == "sign average" || \ ; @traptype == "alternating average" || @traptype == "alternating average 2" || \ ; @traptype == "inverted sum" || @traptype == "exponential average" || \ ; @traptype == "average change" || @traptype == "inverted sum squared" || \ ; @traptype == "trap only"); last, sum, average, sign average ; closest[0] = 0.0 ; ELSEIF (@traptype == "product"); product ; closest[0] = 1.0 ; ELSEIF (@traptype == "second farthest" || @traptype == "two farthest"); second/two farthest ; closest[0] = 0.0 ; closest[1] = 0.0 ; ENDIF BOOL usesolid = true; assume a solid color int j = 0; loop variable ; WHILE (j < 4); clear arrays ; points[j] = (0,0) ; j = j + 1 ; ENDWHILE ; ---- DC-traps additions. color accumulator = @startcolor; initialize color accumulator color current = rgb(0,0,0); holds current iteration's color ; ---- End DC-traps additions. loop: iter = iter + 1; iteration counter IF (@trapalliterations == "some iterations"); we are skipping some iterations fiter = fiter - 1; one less to go before we trap WHILE (fiter < 0.0); iterations all used up IF (trapping); we are currently trapping trapping = false; so stop fiter = fiter + @trapskip; skip this many iterations ELSE; we aren't currently trapping trapping = true; so start fiter = fiter + @trapiter; do this many iterations ENDIF ENDWHILE ENDIF IF (@trapalliterations == "all iterations" || trapping) ; if we're checking for traps... j = 0; start with first trap WHILE (j <= @trapcount); still need to evaluate a trap ; ; MAIN LOOP START: Evaluate one trap. ; ; adjust rotation/skew/trapcenter IF (traprotsteps[j] != 0); changing rotation angle. rots[j] = (0,1) ^ (traprots[j]+traprotsteps[j]*(iter-1)); recompute rotation vector ENDIF IF (trapskewsteps[j] != 0); changing skew angle. skews[j] = (0,1) ^ (trapskews[j]+trapskewsteps[j]*(iter-1)); recompute skewing vector ENDIF IF (trapdrifts[j] != (0,0)); changing trap center trapcenters[j] = trapcenters[j] + trapdrifts[j] ENDIF ; get current pixel coordinate for transformation ; IF (@traptype == "trap only"); trap only, work on unadulterated pixel ; z2 = #pixel ; ELSEIF (!trapreusepositions[j]); other trap mode, and not re-using previous position IF (!trapreusepositions[j]); other trap mode, and not re-using previous position z2 = #z ENDIF ; see if we need to calculate fBm for this trap IF (trapfBmenables[j]); yes, fBm is enabled IF (trapfBmtransforms[j] == 0); rectangular coordinates complex fBmpoint = z2 * trapfBmscales[j] * fBmrots[j] + trapfBmoffsets[j] ELSEIF (trapfBmtransforms[j] == 1) ; polar coordinates complex fBmpoint = (cabs(z2) + flip(atan2(z2))) * trapfBmscales[j] * fBmrots[j] + trapfBmoffsets[j] ENDIF IF (trapfBmdistortionstyles[j] == 2); chained fBm complex v = (0,1) ^ (trapfBmdistortionangles[j] + fBmresults[j-1]*trapfBmdistortionvariances[j]) IF (trapfBmaspects[j] != 1.0); aspect adjustment required fBmpoint = fBmpoint * v fBmpoint = real(fBmpoint) + flip(imag(fBmpoint) * trapfBmaspects[j]); apply aspect fBmpoint = fBmpoint * conj(v) ENDIF ELSEIF (trapfBmaspects[j] != 1.0); aspect adjustment required fBmpoint = real(fBmpoint) + flip(imag(fBmpoint) * trapfBmaspects[j]); apply aspect ENDIF float fBmsum = 0.0 float fBmweight = 1.0 int k = trapfBmoctaves[j] WHILE (k > 0) ; determine integer coordinate for corners of square ; surrounding p float bx0 = floor(real(fBmpoint)) % 256 float by0 = floor(imag(fBmpoint)) % 256 IF (bx0 < 0) bx0 = bx0 + 256 ENDIF IF (by0 < 0) by0 = by0 + 256 ENDIF float bx1 = (bx0 + 1) % 256 float by1 = (by0 + 1) % 256 float rx0 = real(fBmpoint) - floor(real(fBmpoint)) float ry0 = imag(fBmpoint) - floor(imag(fBmpoint)) float rx1 = rx0 - 1 float ry1 = ry0 - 1 ; create a "random" index for each corner ; (this is where Intel's version differs from Perlin's; ; I used Intel's version because it doesn't require a ; pre-computed random table, which is difficult to manage ; in UF.) float b00 = (bx0^trapfBmpowers[j] % 65536 + by0)^trapfBmpowers[j] % 65536 float b10 = (bx1^trapfBmpowers[j] % 65536 + by0)^trapfBmpowers[j] % 65536 float b01 = (bx0^trapfBmpowers[j] % 65536 + by1)^trapfBmpowers[j] % 65536 float b11 = (bx1^trapfBmpowers[j] % 65536 + by1)^trapfBmpowers[j] % 65536 ; produce a "random" vector for each corner float g_b00_0 = (b00)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b10_0 = (b10)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b01_0 = (b01)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b11_0 = (b11)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b00_1 = (b00+1)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b10_1 = (b10+1)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b01_1 = (b01+1)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b11_1 = (b11+1)^trapfBmpowers[j]*0.25 % 512 - 256 ; normalize each vector float d = 0.0; d = 1 / sqrt(sqr(g_b00_0) + sqr(g_b00_1)) g_b00_0 = g_b00_0 * d g_b00_1 = g_b00_1 * d d = 1 / sqrt(sqr(g_b10_0) + sqr(g_b10_1)) g_b10_0 = g_b10_0 * d g_b10_1 = g_b10_1 * d d = 1 / sqrt(sqr(g_b01_0) + sqr(g_b01_1)) g_b01_0 = g_b01_0 * d g_b01_1 = g_b01_1 * d d = 1 / sqrt(sqr(g_b11_0) + sqr(g_b11_1)) g_b11_0 = g_b11_0 * d g_b11_1 = g_b11_1 * d ; produce colors for each corner float u1 = rx0 * g_b00_0 + ry0 * g_b00_1 float v1 = rx1 * g_b10_0 + ry0 * g_b10_1 float u2 = rx0 * g_b01_0 + ry1 * g_b01_1 float v2 = rx1 * g_b11_0 + ry1 * g_b11_1 ; interpolate between corners using ; bilinear filtering float sx = sqr(rx0) * (3 - rx0*2) float sy = sqr(ry0) * (3 - ry0*2) float a = u1 + sx*(v1-u1) float b = u2 + sx*(v2-u2) fBmsum = fBmsum + (a + sy*(b-a))*fBmweight fBmweight = fBmweight * trapfBmscalesteps[j] fBmpoint = fBmpoint * fBmoctaverots[j] / trapfBmscalesteps[j] k = k - 1 ENDWHILE fBmsum = fBmsum + trapfBmbiases[j]; add bias ELSE float fBmsum = 0.0 ENDIF ; apply fBm distortion IF (trapfBmuseasdistorts[j] && trapfBmenables1[j]) ; using this trap's fBm to distort IF (trapfBmdistortionstyles[j] == 0); radial distortion complex v = (z2-trapfBmdistortioncenters[j]-trapcenters[j])/cabs(z2-trapfBmdistortioncenters[j]-trapcenters[j]) * fBmdistortrots[j] ; use vector based on angle to distortion center ELSEIF (trapfBmdistortionstyles[j] == 1); linear distortion complex v = fBmdistortrots[j]; just use rotation vector ;ELSEIF (trapfBmdistortionstyles[j] == 2); chained fBm distortion ; complex v = (0,1) ^ (trapfBmdistortionangles[j] + fBmresults[j-1]*trapfBmdistortionvariances[j]) ENDIF z2 = z2 + v * fBmsum * 0.5 * trapfBmdistortionstrengths[j] ENDIF ; rotate/squash/skew/repeat z ; 1. radially repeat IF (trapconcentricspacings[j] > 0 && trapradialspacings[j] == 0); concentrically repeating trap, but not radial z2 = z2 - trapradialcenters[j]; offset to trap radial center d = cabs(z2); extract just the distance from it d = ((d / trapconcentricspacings[j]) - round(d / trapconcentricspacings[j])) * trapconcentricspacings[j] ; get ratio of old distance to new distance z2 = z2 * d / cabs(z2) + trapradialcenters[j]; force distance to new distance ENDIF IF (trapradialspacings[j] > 0.0); radially repeating trap z2 = z2 - trapradialcenters[j]; offset to trap radial center d = cabs(z2); extract the distance d2 = atan2(z2); and the angle d2 = d2 / (#pi*2); convert this range to +/-0.5 (instead of +/-pi) d2 = ((d2 * trapradialspacings[j]) - round(d2 * trapradialspacings[j])) / trapradialspacings[j] * #pi*2; apply radial spacing IF (trapconcentricspacings[j] > 0); concentrically repeating trap d = ((d / trapconcentricspacings[j]) - round(d / trapconcentricspacings[j])) * trapconcentricspacings[j]; apply concentric spacing ENDIF IF (trapradialmodes[j] == 0); standard radial repeat mode z2 = cos(d2)*d + flip(sin(d2)*d) + trapradialcenters[j]; convert polar coordinates back to rectangular ELSEIF (trapradialmodes[j] == 1); unwrap mode z2 = d + flip(d2); interpret polar coordinates as rectangular (no conversion) ENDIF ENDIF ; 2. grid repeat IF (traprepeatspacings[j] > 0); repeating trap z2 = (z2 - traprepeatcenters[j]) * traprepeatangles[j]; offset to trap repeat center and rotate z2 = ((z2 / traprepeatspacings[j]) - round(z2 / traprepeatspacings[j])) * traprepeatspacings[j]; apply repeat spacing z2 = (z2 + traprepeatcenters[j]) * conj(traprepeatangles[j]); restore angle and offset to repeat center ENDIF ; 3. rotate z2 = (z2 - trapcenters[j]) * rots[j]; rotate ; 4. apply aspect IF (trapaspects[j] != 1.0); aspect adjustment required z2 = real(z2) + flip(imag(z2) * trapaspects[j]); apply aspect ENDIF ; 5. skew z2 = real(z2 * skews[j]) + flip(imag(z2)); apply skew ; determine distance from trap--different for each shape IF (trapshapes[j] == 0); point d = cabs(z2) ELSEIF (trapshapes[j] == 1); egg d = (cabs(z2-flip(trapeggseps[j])) + cabs(z2)*trapegginesses[j]) ELSEIF (trapshapes[j] == 2); hyperbola d = imag(z2) * real(z2) ELSEIF (trapshapes[j] == 3); hypercross d = abs(imag(z2) * real(z2)) ELSEIF (trapshapes[j] == 4); cross d = abs(real(z2)) d2 = abs(imag(z2)) IF (d2 < d) d = d2 ENDIF ELSEIF (trapshapes[j] == 5); astroid d = abs(real(z2))^trappowers[j] + abs(imag(z2))^trappowers[j] IF (trappowers[j] < 0) d = 1/d ENDIF ELSEIF (trapshapes[j] == 6); rectangle d = abs(real(z2)) d2 = abs(imag(z2)) IF (d2 > d) d = d2 ENDIF ELSEIF (trapshapes[j] == 7); lines d = abs(imag(z2)) ELSEIF (trapshapes[j] == 8); linear wave IF (trapmirrors[j] == 0); no mirroring d = abs(imag(z2) + sin((real(z2)+trapphases1[j])*trapfreqs1[j])*trapamps1[j] + sin((real(z2)+trapphases2[j])*trapfreqs2[j])*trapamps2[j]) ELSEIF (trapmirrors[j] == 1); half mirroring d = abs(imag(z2)) + sin((real(z2)+trapphases1[j])*trapfreqs1[j])*trapamps1[j] + sin((real(z2)+trapphases2[j])*trapfreqs2[j])*trapamps2[j] IF (trapdiameters1[j] == 0.0); we have no diameter, thus no abs() applied later d = abs(d); force abs(). note that this is technically redundant as the ; nonegdistances parameter can force this; this is a usability ; issue, in that it's more consistent with no mirroring this way. ENDIF ELSEIF (trapmirrors[j] == 2); full mirroring d2 = sin((real(z2)+trapphases1[j])*trapfreqs1[j])*trapamps1[j] + sin((real(z2)+trapphases2[j])*trapfreqs2[j])*trapamps2[j] d = abs(abs(imag(z2)) - d2); distance to each wave d2 = abs(abs(imag(z2)) + d2) IF (d2 < d) d = d2 ENDIF ENDIF ELSEIF (trapshapes[j] == 9); radial waves d2 = atan2(z2) d = cabs(z2) * (1 - sin((d2+trapphases1[j])*trapfreqs1[j])*trapamps1[j]*0.5 - sin((d2+trapphases2[j])*trapfreqs2[j])*trapamps2[j]*0.5) ELSEIF (trapshapes[j] == 10); ring ripples d = cabs(z2) d = cos((d+trapphases1[j])*trapfreqs1[j])*trapamps1[j] + cos((d+trapphases2[j])*trapfreqs2[j])*trapamps2[j] ELSEIF (trapshapes[j] == 11); grid ripples IF (trapgridmodes[j] == 0); diagonal mode d = (cos((real(z2)+trapphases1[j])*trapfreqs1[j])*trapamps1[j] + cos((real(z2)+trapphases2[j])*trapfreqs2[j])*trapamps2[j]) + \ (cos((imag(z2)+trapphases1[j])*trapfreqs1[j])*trapamps1[j] + cos((imag(z2)+trapphases2[j])*trapfreqs2[j])*trapamps2[j]) ELSEIF (trapgridmodes[j] == 1); straight mode d = (cos((real(z2)+trapphases1[j])*trapfreqs1[j])*trapamps1[j] + cos((real(z2)+trapphases2[j])*trapfreqs2[j])*trapamps2[j]) * \ (cos((imag(z2)+trapphases1[j])*trapfreqs1[j])*trapamps1[j] + cos((imag(z2)+trapphases2[j])*trapfreqs2[j])*trapamps2[j]) ENDIF ELSEIF (trapshapes[j] == 12); radial ripples d = atan2(z2) d = cos((d+trapphases1[j])*trapfreqs1[j])*trapamps1[j] + cos((d+trapphases2[j])*trapfreqs2[j])*trapamps2[j] ELSEIF (trapshapes[j] == 13); pinch d2 = atan2(z2) IF (d2 < 0) d2 = d2 + 2*#pi ENDIF d = sqrt(cabs(z2)) / abs(sin(d2*trappetals[j]*0.5)) ELSEIF (trapshapes[j] == 14); spiral d = 1/(cabs(z2)) * traptightnesses[j] r0 = (0,1) ^ d z3 = z2 * r0 d = atan(abs(imag(z3)/real(z3))) ELSEIF (trapshapes[j] == 15); heart r0 = real(z2) + flip(abs(imag(z2))) r0 = r0*trapheartrots[j] * 3 / trapheartsizes[j] d = abs(real(r0) - sqr(imag(r0)) + 3) ELSEIF (trapshapes[j] == 16); fBm d = fBmsum ENDIF ; apply diameter(s) IF (trapdiameters1[j] != 0.0); a diameter was provided d = abs(trapdiameters1[j] - d); apply it IF (trapdiameters2[j] != 0.0); a second diameter was provided d = abs(trapdiameters2[j] - d); apply it ENDIF ENDIF ; apply fBm texture IF (trapfBmuseasadders[j] && trapfBmadderstages[j] == 0 && trapfBmenables1[j]) d = d + fBmsum * trapfBmadderscales[j] ENDIF ; apply fade IF (trapfades[j] != 0); we have a fade radius d2 = cabs(#z - trapcenters[j] - trapfadeoffsets[j]) IF (trapfademodes[j] == 0); additive d = d + sqr(d2/trapfades[j]); add a fade value to the trap distance ELSEIF (trapfademodes[j] == 1); multiplicative IF (d2 > trapfades[j]); outside fade radius d = 0; so the fade multiplier is zero; this makes the distance zero ELSE; inside the fade radius d = d * sqr(1-d2/trapfades[j]); apply quadratic fade multiplier ENDIF ENDIF ENDIF ; apply fBm texture IF (trapfBmuseasadders[j] && trapfBmadderstages[j] == 1 && trapfBmenables1[j]) d = d + fBmsum * trapfBmadderscales[j] ENDIF ; apply trap transfer function ; a function is not used because these are floats ; and not all functions apply to floats d = d * trapdistanceprescales[j] IF (trapdistancetransfers[j] == 1); log d = log(d) ELSEIF (trapdistancetransfers[j] == 2); sqrt d = sqrt(d) ELSEIF (trapdistancetransfers[j] == 3); cuberoot d = (d)^(1/3) ELSEIF (trapdistancetransfers[j] == 4); exp d = exp(d) ELSEIF (trapdistancetransfers[j] == 5); sqr d = sqr(d) ELSEIF (trapdistancetransfers[j] == 6); cube d = (d)^3 ELSEIF (trapdistancetransfers[j] == 7); sin d = sin(d) ELSEIF (trapdistancetransfers[j] == 8); cos d = cos(d) ELSEIF (trapdistancetransfers[j] == 9); tan d = tan(d) ELSEIF (trapdistancetransfers[j] == 10); sinc (modified form) IF (d == 0) d = 1 ELSE d = sin(#pi*d)/d ENDIF ENDIF d = d * trapdistancepostscales[j] ; apply fBm texture IF (trapfBmuseasadders[j] && trapfBmadderstages[j] == 2 && trapfBmenables1[j]) d = d + fBmsum * trapfBmadderscales[j] ENDIF ; eliminate negative distances IF (trapnonegdistances[j]); absolute value only d = abs(d) ENDIF distances[j] = d; save computed distance to trap ; see if we need to calculate fBm for this trap, as a color, using trap pseudo-coordinate IF (trapfBmenables2[j]); yes, fBm is enabled complex fBmpoint = (d + flip(atan2(z2))) * trapfBmscales[j] * fBmrots[j] + trapfBmoffsets[j] IF (trapfBmaspects[j] != 1.0); aspect adjustment required fBmpoint = real(fBmpoint) + flip(imag(fBmpoint) * trapfBmaspects[j]); apply aspect ENDIF float fBmsum = 0.0 float fBmweight = 1.0 int k = trapfBmoctaves[j] WHILE (k > 0) ; determine integer coordinate for corners of square ; surrounding p float bx0 = floor(real(fBmpoint)) % 256 float by0 = floor(imag(fBmpoint)) % 256 IF (bx0 < 0) bx0 = bx0 + 256 ENDIF IF (by0 < 0) by0 = by0 + 256 ENDIF float bx1 = (bx0 + 1) % 256 float by1 = (by0 + 1) % 256 float rx0 = real(fBmpoint) - floor(real(fBmpoint)) float ry0 = imag(fBmpoint) - floor(imag(fBmpoint)) float rx1 = rx0 - 1 float ry1 = ry0 - 1 ; create a "random" index for each corner ; (this is where Intel's version differs from Perlin's; ; I used Intel's version because it doesn't require a ; pre-computed random table, which is difficult to manage ; in UF.) float b00 = (bx0^trapfBmpowers[j] % 65536 + by0)^trapfBmpowers[j] % 65536 float b10 = (bx1^trapfBmpowers[j] % 65536 + by0)^trapfBmpowers[j] % 65536 float b01 = (bx0^trapfBmpowers[j] % 65536 + by1)^trapfBmpowers[j] % 65536 float b11 = (bx1^trapfBmpowers[j] % 65536 + by1)^trapfBmpowers[j] % 65536 ; produce a "random" vector for each corner float g_b00_0 = (b00)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b10_0 = (b10)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b01_0 = (b01)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b11_0 = (b11)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b00_1 = (b00+1)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b10_1 = (b10+1)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b01_1 = (b01+1)^trapfBmpowers[j]*0.25 % 512 - 256 float g_b11_1 = (b11+1)^trapfBmpowers[j]*0.25 % 512 - 256 ; normalize each vector float d = 0.0; d = 1 / sqrt(sqr(g_b00_0) + sqr(g_b00_1)) g_b00_0 = g_b00_0 * d g_b00_1 = g_b00_1 * d d = 1 / sqrt(sqr(g_b10_0) + sqr(g_b10_1)) g_b10_0 = g_b10_0 * d g_b10_1 = g_b10_1 * d d = 1 / sqrt(sqr(g_b01_0) + sqr(g_b01_1)) g_b01_0 = g_b01_0 * d g_b01_1 = g_b01_1 * d d = 1 / sqrt(sqr(g_b11_0) + sqr(g_b11_1)) g_b11_0 = g_b11_0 * d g_b11_1 = g_b11_1 * d ; produce colors for each corner float u1 = rx0 * g_b00_0 + ry0 * g_b00_1 float v1 = rx1 * g_b10_0 + ry0 * g_b10_1 float u2 = rx0 * g_b01_0 + ry1 * g_b01_1 float v2 = rx1 * g_b11_0 + ry1 * g_b11_1 ; interpolate between corners using ; bilinear filtering float sx = sqr(rx0) * (3 - rx0*2) float sy = sqr(ry0) * (3 - ry0*2) float a = u1 + sx*(v1-u1) float b = u2 + sx*(v2-u2) fBmsum = fBmsum + (a + sy*(b-a))*fBmweight fBmweight = fBmweight * trapfBmscalesteps[j] fBmpoint = fBmpoint * fBmoctaverots[j] / trapfBmscalesteps[j] k = k - 1 ENDWHILE fBmsum = fBmsum + trapfBmbiases[j]; add bias ENDIF fBmresults[j] = fBmsum; save fBm result IF (j == @trapcolorfBmset); this is the fBm color calculation fBmcolor = fBmsum; save it ENDIF j = j + 1; ready to move to next trap ; ; END MAIN LOOP ; ENDWHILE ; Now merge trap distances to get a single distance. ; IF (@trapcount >= 1) IF (@trap1weightfunc == "A") ; ELSEIF (@trap1weightfunc == "-A") distances[0] = -distances[0] ELSEIF (@trap1weightfunc == "|A|") distances[0] = abs(distances[0]) ELSEIF (@trap1weightfunc == "A*A") distances[0] = sqr(distances[0]) ELSEIF (@trap1weightfunc == "-A*A") distances[0] = -sqr(distances[0]) ELSEIF (@trap1weightfunc == "A*A*A") distances[0] = sqr(distances[0])*distances[0] ELSEIF (@trap1weightfunc == "-A*A*A") distances[0] = -sqr(distances[0])*distances[0] ELSEIF (@trap1weightfunc == "|A*A*A|") distances[0] = abs(sqr(distances[0])*distances[0]) ELSEIF (@trap1weightfunc == "log(A)") distances[0] = log(distances[0]) ELSEIF (@trap1weightfunc == "exp(A)") distances[0] = exp(distances[0]) ENDIF IF (@trap2weightfunc == "B") ; ELSEIF (@trap2weightfunc == "-B") distances[1] = -distances[1] ELSEIF (@trap2weightfunc == "|B|") distances[1] = abs(distances[1]) ELSEIF (@trap2weightfunc == "B*B") distances[1] = sqr(distances[1]) ELSEIF (@trap2weightfunc == "-B*B") distances[1] = -sqr(distances[1]) ELSEIF (@trap2weightfunc == "B*B*B") distances[1] = sqr(distances[1])*distances[1] ELSEIF (@trap2weightfunc == "-B*B*B") distances[1] = -sqr(distances[1])*distances[1] ELSEIF (@trap2weightfunc == "|B*B*B|") distances[1] = abs(sqr(distances[1])*distances[1]) ELSEIF (@trap2weightfunc == "log(B)") distances[1] = log(distances[1]) ELSEIF (@trap2weightfunc == "exp(B)") distances[1] = exp(distances[1]) ENDIF ENDIF IF (@trapcount >= 2) IF (@trap3weightfunc == "C") ; ELSEIF (@trap3weightfunc == "-C") distances[2] = -distances[2] ELSEIF (@trap3weightfunc == "|C|") distances[2] = abs(distances[2]) ELSEIF (@trap3weightfunc == "C*C") distances[2] = sqr(distances[2]) ELSEIF (@trap3weightfunc == "-C*C") distances[2] = -sqr(distances[2]) ELSEIF (@trap3weightfunc == "C*C*C") distances[2] = sqr(distances[2])*distances[2] ELSEIF (@trap3weightfunc == "-C*C*C") distances[2] = -sqr(distances[2])*distances[2] ELSEIF (@trap3weightfunc == "|C*C*C|") distances[2] = abs(sqr(distances[2])*distances[2]) ELSEIF (@trap3weightfunc == "log(C)") distances[2] = log(distances[2]) ELSEIF (@trap3weightfunc == "exp(C)") distances[2] = exp(distances[2]) ENDIF ENDIF IF (@trapcount == 0); just one trap d = distances[0]; therefore only one distance ELSEIF (@trapcount == 1); two traps IF (@trapmerging2 == "min(A,B)") IF (distances[0] < distances[1]) d = distances[0] ELSE d = distances[1] ENDIF ELSEIF (@trapmerging2 == "max(A,B)") IF (distances[0] > distances[1]) d = distances[0] ELSE d = distances[1] ENDIF ELSEIF (@trapmerging2 == "A+B") d = distances[0] + distances[1] ELSEIF (@trapmerging2 == "A*B") d = distances[0] * distances[1] ELSEIF (@trapmerging2 == "A/B") d = distances[0] / distances[1] ELSEIF (@trapmerging2 == "B/A") d = distances[1] / distances[0] ELSEIF (@trapmerging2 == "1/(A*B)") d = 1 / (distances[0] * distances[1]) ELSEIF (@trapmerging2 == "A^B") d = distances[0] ^ distances[1] ELSEIF (@trapmerging2 == "B^A") d = distances[1] ^ distances[0] ENDIF ELSEIF (@trapcount == 2); three traps IF (@trapmerging31 == "A") d = distances[0] ELSEIF (@trapmerging31 == "1/A") d = 1/distances[0] ELSEIF (@trapmerging31 == "B") d = distances[1] ELSEIF (@trapmerging31 == "1/B") d = 1/distances[1] ELSEIF (@trapmerging31 == "C") d = distances[2] ELSEIF (@trapmerging31 == "1/C") d = 1/distances[2] ENDIF IF (@trapmerging33 == "A") d2 = distances[0] ELSEIF (@trapmerging33 == "1/A") d2 = 1/distances[0] ELSEIF (@trapmerging33 == "B") d2 = distances[1] ELSEIF (@trapmerging33 == "1/B") d2 = 1/distances[1] ELSEIF (@trapmerging33 == "C") d2 = distances[2] ELSEIF (@trapmerging33 == "1/C") d2 = 1/distances[2] ENDIF IF (@trapmerging32 == "+") d = d + d2 ELSEIF (@trapmerging32 == "*") d = d * d2 ELSEIF (@trapmerging32 == "^") d = d ^ d2 ELSEIF (@trapmerging32 == "min") IF (d2 < d) d = d2 ENDIF ELSEIF (@trapmerging32 == "max") IF (d2 > d) d = d2 ENDIF ENDIF IF (@trapmerging35 == "A") d2 = distances[0] ELSEIF (@trapmerging35 == "1/A") d2 = 1/distances[0] ELSEIF (@trapmerging35 == "B") d2 = distances[1] ELSEIF (@trapmerging35 == "1/B") d2 = 1/distances[1] ELSEIF (@trapmerging35 == "C") d2 = distances[2] ELSEIF (@trapmerging35 == "1/C") d2 = 1/distances[2] ENDIF IF (@trapmerging34 == "+") d = d + d2 ELSEIF (@trapmerging34 == "*") d = d * d2 ELSEIF (@trapmerging34 == "^") d = d ^ d2 ELSEIF (@trapmerging34 == "min") IF (d2 < d) d = d2 ENDIF ELSEIF (@trapmerging34 == "max") IF (d2 > d) d = d2 ENDIF ENDIF ENDIF ; ---- DC traps additions. ; Compute direct color. This code is very similar ; to the Orbit Traps final: processing. IF (d < @threshold); orbit is close enough to shape IF (@trapcolor == "distance"); distance current = gradient(d/@threshold) ELSEIF (@trapcolor == "magnitude"); magnitude current = gradient(cabs(z2)) ELSEIF (@trapcolor == "real"); real current = gradient(abs(real(z2))) ELSEIF (@trapcolor == "imaginary"); imaginary current = gradient(abs(imag(z2))) ELSEIF (@trapcolor == "angle to trap"); angle to trap d2 = atan2(z2) IF (d2 < 0) d2 = d2 + #pi * 2 ENDIF current = gradient(d2 / (#pi * 2)) ELSEIF (@trapcolor == "angle to origin"); angle to origin d2 = atan2(#z) IF (d2 < 0) d2 = d2 + #pi * 2 ENDIF current = gradient(d2 / (#pi * 2)) ELSEIF (@trapcolor == "angle to origin 2") ; angle to origin 2 (old ReallyCool) current = gradient(0.02 * abs(atan(imag(#z) / real(#z)) * 180/#pi)) ELSEIF (@trapcolor == "iteration"); iteration current = gradient(iter / #maxiter) ELSEIF (@trapcolor == "fBm"); fBm current = gradient(fBmcolor) ENDIF IF (@trapmergemodifier == "distance") current = rgba(red(current), green(current), blue(current), alpha(current) * (1 - d / @threshold)) ENDIF IF (@trapmergeorder == "bottom-up") accumulator = compose(accumulator, blend(current, @trapmergemode(accumulator, current), alpha(accumulator)), @trapmergeopacity) ELSEIF (@trapmergeorder == "top-down") accumulator = compose(current, blend(accumulator, @trapmergemode(current, accumulator), alpha(current)), @trapmergeopacity) ELSEIF (@trapmergeorder == "mangled") accumulator = compose(accumulator, blend(current, @trapmergemode(accumulator, current), alpha(current)), @trapmergeopacity) ENDIF ENDIF ; ---- End DC traps additions. ENDIF final: ; choose coloring based on method IF (!@solidcolor); solid color not allowed #solid = false ELSE #solid = usesolid ENDIF #color = accumulator default: title = "Orbit Traps Direct (UF3)" helpfile = "dmj3\dmj3-pub-uf-ot.htm" param expertmode caption = "Show Options" default = 0 enum = "basic" "expert" hint = "This chooses how many options to display. Choose 'basic' for the \ most common options; choose 'expert' to see all options." endparam param trapsversion caption = "Traps Formula Version" default = 300 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam ; Overall parameters ; heading caption = "Overall Parameters" endheading ; ---- These are DC-specific parameters that replace traptype. color param startcolor caption = "Base Color" default = rgb(0,0,0) hint = "Specifies the 'base', or starting color with which all iterations' \ colors will be merged." endparam color func trapmergemode caption = "Trap Color Merge" default = mergenormal() hint = "This chooses the merge mode used to blend colors at each iteration." endfunc param trapmergemodifier caption = "Additional Alpha" default = 0 enum = "none" "distance" hint = "Specifies an additional alpha value to incorporate during merging." endparam param trapmergeopacity caption = "Trap Merge Opacity" default = 0.2 hint = "Sets the opacity of each trap shape. Even if you set this value to 1 \ (forcing all traps to be fully opaque) you can still control opacity \ using the alpha channel in the gradient." endparam param trapmergeorder caption = "Trap Merge Order" default = 0 enum = "bottom-up" "top-down" "mangled" hint = "Sets the order in which traps will be merged. Bottom-up merges new \ traps on top of previous ones; top-down merges new traps underneath \ previous ones; and mangled replicates a broken behavior used during \ testing." endparam ; ---- End DC-specific parameters. param trapcolor caption = "Trap Coloring" default = 0 enum = "distance" "magnitude" "real" "imaginary" "angle to trap" \ "angle to origin" "angle to origin 2" "iteration" \ "fBm" hint = "This is the information used to produce a color." endparam param trapcolorfBmset caption = " Use fBm from" default = 0 enum = "trap A" "trap B" "trap C" hint = "This selects which trap's fBm value will be used for coloring." visible = @trapcolor == "fBm" endparam param trapcolorfBmmode caption = " fBm Mapping" default = 0 enum = "normal" "trap" hint = "This selects whether fBm is calculated normally or by using a pseudo-coordinate \ derived from the trap distance and angle. Note, this overrides the fBm Transform \ for the trap shape used for coloring." visible = @trapcolor == "fBm" && @expertmode == "expert" endparam param threshold caption = "Threshold" default = 0.25 min = 0 hint = "This is the width of the trap area trap modes." endparam param solidcolor caption = "Use Solid Color" default = false hint = "If enabled, areas 'outside' the trap area will be colored \ with the 'solid color' on the coloring tab." endparam param trapalliterations caption = "Traps Apply To" default = 0 enum = "all iterations" "some iterations" hint = "This option, if set to 'some iterations', allows you to apply the \ orbit traps to only some iterations (with extra options shown below)." visible = @expertmode == "expert" endparam param trapstart caption = " Start Iteration" default = 0.0 hint = "This is the iteration at which to start watching for \ orbit traps." visible = @trapalliterations == 1 endparam param trapiter caption = " Trap Iterations" default = 10.0 hint = "This is the number of iterations to watch for traps \ in a single block." visible = @trapalliterations == 1 endparam param trapskip caption = " Skip Iterations" default = 10.0 hint = "This is the number of iterations to skip watching for \ traps, after a block of watched iterations." visible = @trapalliterations == 1 endparam param trapcount caption = "Number of Traps" default = 0 enum = "1" "2" "3" hint = "This indicates the number of trap shapes to use. Each \ trap shape includes a full set of parameters." visible = @expertmode == "expert" endparam ; ; Trap Merging Parameters ; heading caption = "Trap Merging" visible = @trapcount >= 1 endheading param trap1weightfunc caption = "Trap A Mode" default = 0 enum = "A" "-A" "|A|" "A*A" "-A*A" "A*A*A" "-A*A*A" "|A*A*A|" "log(A)" "exp(A)" hint = "Sets the mode for this trap, applied before combining it with other traps." visible = @trapcount >= 1 endparam param trap2weightfunc caption = "Trap B Mode" default = 0 enum = "B" "-B" "|B|" "B*B" "-B*B" "B*B*B" "-B*B*B" "|B*B*B|" "log(B)" "exp(B)" hint = "Sets the mode for this trap, applied before combining it with other traps." visible = @trapcount >= 1 endparam param trap3weightfunc caption = "Trap C Mode" default = 0 enum = "C" "-C" "|C|" "C*C" "-C*C" "C*C*C" "-C*C*C" "|C*C*C|" "log(C)" "exp(C)" hint = "Sets the mode for this trap, applied before combining it with other traps." visible = @trapcount >= 2 endparam param trapmerging2 caption = "Merge Mode" default = 0 enum = "min(A,B)" "max(A,B)" "A+B" "A*B" "A/B" "B/A" "1/(A*B)" "A^B" "B^A" "A" "B" hint = "Sets the overall merge method for traps, after the individual trap mode is applied." visible = @trapcount == 1 endparam param trapmerging31 caption = "Merge Term 1" default = 0 enum = "A" "1/A" "B" "1/B" "C" "1/C" hint = "Sets the first term in the expression for combining traps." visible = @trapcount == 2 endparam param trapmerging32 caption = " Merge Operator 1" default = 0 enum = "+" "*" "^" "min" "max" hint = "Sets the operator for combining the first two terms in the trap combining expression." visible = @trapcount == 2 endparam param trapmerging33 caption = "Merge Term 2" default = 2 enum = "A" "1/A" "B" "1/B" "C" "1/C" hint = "Sets the second term in the expression for combining traps." visible = @trapcount == 2 endparam param trapmerging34 caption = " Merge Operator 2" default = 0 enum = "+" "*" "^" "min" "max" hint = "Sets the operator for combining the last two terms in the trap combining expression." visible = @trapcount == 2 endparam param trapmerging35 caption = "Merge Term 3" default = 4 enum = "A" "1/A" "B" "1/B" "C" "1/C" hint = "Sets the third term in the expression for combining traps." visible = @trapcount == 2 endparam ; ; Trap 1 Parameters ; heading caption = "Trap Parameters" visible = @trapcount == 0 endheading heading caption = "Trap A Parameters" visible = @trapcount >= 1 endheading ; Shape parameters ; param trap1shape caption = "Trap Shape" default = 3 enum = "point" "egg" "hyperbola" "hypercross" \ "cross" "astroid" "rectangle" "line" \ "linear wave" "radial wave" "ring ripples" \ "grid ripples" "radial ripples" "pinch" "spiral" "heart" \ "fBm" hint = "This is the shape of the orbit trap." visible = @trapcount >= 0 endparam param trap1eggseparation caption = " Stretching" default = 1.0 hint = "Specifies how stretched the egg shape should be." visible = @trapcount >= 0 && @trap1shape == "egg" endparam param trap1egginess caption = " Egginess" default = 0.5 hint = "Specifies how pointy the egg shape should be." visible = @trapcount >= 0 && @trap1shape == "egg" endparam param trap1astroidpower caption = " Squareness" default = 0.666666666666667 hint = "Indicates the squareness of the astroid shape. Values \ less than one produce diamonds; values larger than one \ push the shape closer and closer towards a square." visible = @trapcount >= 0 && @trap1shape == "astroid" endparam param trap1wavemirrors caption = " Mirroring" default = 0 enum = "none" "half" "full" hint = "Chooses the mirroring on the waves. 'Half' will reflect \ one half of the wave, replacing the other half; 'Full' \ reflects both halves of the wave and superimposes them." visible = @trapcount >= 0 && (@trap1shape == "linear wave") endparam param trap1gridmode caption = " Grid Mode" default = 0 enum = "diagonal" "straight" hint = "Chooses the orientation of the grid by selecting between \ addition ('diagonal') and multiplication ('straight') when \ adding wave components for vertical and horizontal values." visible = @trapcount >= 0 && (@trap1shape == "grid ripples") endparam param trap1frequency1 caption = " Frequency 1" default = 1.0 hint = "Specifies the primary frequency of the wave. Higher \ numbers give a more rapidly-oscillating wave." visible = @trapcount >= 0 && (@trap1shape == "linear wave" || \ @trap1shape == "radial wave" || @trap1shape == "ring ripples" || \ @trap1shape == "grid ripples" || @trap1shape == "radial ripples") endparam param trap1amplitude1 caption = " Amplitude 1" default = 1.0 hint = "Specifies the primary amplitude of the wave. Higher \ numbers increase the distance between extremes in the wave." visible = @trapcount >= 0 && (@trap1shape == "linear wave" || \ @trap1shape == "radial wave" || @trap1shape == "ring ripples" || \ @trap1shape == "grid ripples" || @trap1shape == "radial ripples") endparam param trap1phase1 caption = " Phase 1" default = 0.0 hint = "Provides a phase shift for the wave, which can be used to shift the \ wave peaks side-to-side. Phases are specified in degrees, so a phase \ shift of 360 or -360 is equivalent to a phase shift of zero." visible = @trapcount >= 0 && (@trap1shape == "linear wave" || \ @trap1shape == "radial wave" || @trap1shape == "ring ripples" || \ @trap1shape == "grid ripples" || @trap1shape == "radial ripples") endparam param trap1frequency2 caption = " Frequency 2" default = 1.0 hint = "Specifies the secondary frequency of the wave. Higher \ numbers give a more rapidly-oscillating wave." visible = (@trapcount >= 0 && (@trap1shape == "linear wave" || \ @trap1shape == "radial wave" || @trap1shape == "ring ripples" || \ @trap1shape == "grid ripples" || @trap1shape == "radial ripples")) && @expertmode == "expert" endparam param trap1amplitude2 caption = " Amplitude 2" default = 0.0 hint = "Specifies the secondary amplitude of the wave. Higher \ numbers increase the distance between extremes in the wave." visible = (@trapcount >= 0 && (@trap1shape == "linear wave" || \ @trap1shape == "radial wave" || @trap1shape == "ring ripples" || \ @trap1shape == "grid ripples" || @trap1shape == "radial ripples")) && @expertmode == "expert" endparam param trap1phase2 caption = " Phase 2" default = 0.0 hint = "Provides a phase shift for the wave, which can be used to shift the \ wave peaks side-to-side. Phases are specified in degrees, so a phase \ shift of 360 or -360 is equivalent to a phase shift of zero." visible = (@trapcount >= 0 && (@trap1shape == "linear wave" || \ @trap1shape == "radial wave" || @trap1shape == "ring ripples" || \ @trap1shape == "grid ripples" || @trap1shape == "radial ripples")) && @expertmode == "expert" endparam param trap1petals caption = " Petals" default = 4.0 hint = "Specifies the number of petals in the pinch shape." visible = @trapcount >= 0 && @trap1shape == "pinch" endparam param trap1tightness caption = " Tightness" default = 4.0 hint = "Specifies the tightness of the spiral." visible = @trapcount >= 0 && @trap1shape == "spiral" endparam param trap1heartrot caption = " Pointiness" default = 45.0 hint = "Specifies the pointiness of the heart shape." visible = @trapcount >= 0 && @trap1shape == "heart" endparam param trap1heartsize caption = " Size" default = 1.0 hint = "Specifies the size of the heart shape." visible = @trapcount >= 0 && @trap1shape == "heart" endparam param trap1aspect caption = "Aspect Ratio" default = 1.0 min = 0.0 hint = "This is how square the trap is. You can distort the \ trap by using a value other than 1.0." visible = @trapcount >= 0 endparam param trap1diameter1 caption = "Diameter" default = 0.0 hint = "This is the diameter of the trap. Diameters greater than \ zero produce rings, boxes, pairs of traps, etc." visible = @trapcount >= 0 endparam param trap1diameter2 caption = " Second Diameter" default = 0.0 hint = "Just as changing the Diameter 'splits' the trap, you can \ split it again by setting this value greater than zero." visible = (@trapcount >= 0 && @trap1diameter1 != 0.0) && @expertmode == "expert" endparam param trap1invertexponent caption = "Inversion Exponent" default = 1.0 hint = "Sets the inversion exponent. 1.0 gives no inversion, -1.0 \ gives standard inversion." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1invertoffset caption = "Inversion Offset" default = (0,0) hint = "Sets the offset of the inversion center from the trap center." visible = @trapcount >= 0 && @trap1invertexponent != 1.0 endparam param trap1fade caption = "Fade Radius" default = 0.0 hint = "Sets the radius beyond which the trap will 'fade out'. \ A value of zero disables this feature." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1fadeoffset caption = " Fade Offset" default = (0,0) hint = "Sets the offset from the trap center to fade from. You can use \ this to fade the trap unevenly." visible = @trapcount >= 0 && @trap1fade != 0.0 endparam param trap1fademode caption = " Fade Mode" default = 0 enum = "add" "multiply" hint = "Choose the way in which the fade will be applied. 'Add' works \ best for most trap types, but for any ripples type, you may want \ to use 'Multiply'." visible = @trapcount >= 0 && @trap1fade != 0.0 endparam ; Location/orientation Parameters ; param trap1center caption = "Trap Center" default = (0,0) hint = "This is the location of the trap in the complex plane." visible = @trapcount >= 0 endparam param trap1centermoves caption = "Follows pixel location" default = false hint = "If this is enabled, the trap center will follow the pixel \ location, offset by the Trap Center amount. NOTE: If you \ enable this, you will probably want to skip the first iteration." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1drift caption = "Trap Drift" default = (0,0) hint = "This is the amount the trap center will move with each \ iteration." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1rot caption = "Rotation" default = 0.0 hint = "This is the angle, in degrees, that the trap should \ be rotated." visible = @trapcount >= 0 endparam param trap1rotstep caption = "Rotation Step" default = 0.0 hint = "This is the angle, in degrees, that the trap will \ be rotated with each iteration." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1skew caption = "Skew" default = 0.0 hint = "This is the angle, in degrees, to skew the vertical \ axis of the trap shape." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1skewstep caption = "Skew Step" default = 0.0 hint = "This is the angle, in degrees, that the skew angle \ should be increased by with each iteration." visible = @trapcount >= 0 && @expertmode == "expert" endparam ; Repeat Parameters ; param trap1repeatspacing caption = "Repeat Spacing" default = 0.0 min = 0.0 hint = "This is the spacing at which the trap will repeat, \ all across the complex plane. If zero, trap does \ not repeat." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1repeatcenter caption = " Repeat Center" default = (0,0) hint = "This is the center point of grid trap repetition." visible = @trapcount >= 0 && (@trap1repeatspacing > 0.0) endparam param trap1repeatangle caption = " Repeat Rotation" default = 0.0 hint = "This is the angle of the repeat grid." visible = @trapcount >= 0 && (@trap1repeatspacing > 0.0) endparam param trap1radialspacing caption = "Radial Spacing" default = 0.0 min = 0 hint = "This is the number of times the trap will repeat, \ radially around the radial center point. If zero, \ trap does not repeat radially." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1concentricspacing caption = "Concentric Spacing" default = 0.0 min = 0 hint = "This is the distance at which the trap will repeat, \ radially out from the radial center point. If zero, \ trap does not repeat radially out." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1radialcenter caption = " Radial Center" default = (0,0) hint = "This is the center point of radial trap repetition." visible = @trapcount >= 0 && (@trap1radialspacing > 0.0 || @trap1concentricspacing > 0.0) endparam param trap1radialmode caption = " Radial Mode" default = 0 enum = "kaleidoscope" "polar coordinates" hint = "Indicates the type of radial repetition to use. The \ two styles produce very different results." visible = @trapcount >= 0 && (@trap1radialspacing > 0.0) endparam ; Transfer Parameters ; param trap1distancetransfer caption = "Distance Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" \ "sin" "cos" "tan" "sinc" hint = "This function is applied to trap distances at every \ iteration. It can be used to apply some special effects \ to trap shapes." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1distanceprescale caption = "Distance Pre-scale" default = 1.0 hint = "This is a multiplier applied to the trap distance, \ before the Distance Transfer function is applied to it." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1distancepostscale caption = "Distance Post-scale" default = 1.0 hint = "This is a multiplier applied to the trap distance, \ after the Distance Transfer function is applied to it." visible = @trapcount >= 0 && @expertmode == "expert" endparam param trap1nonegdistance caption = "No Negative Distance" default = false hint = "If enabled, eliminates 'negative' distances by taking \ the absolute value of the distance." visible = @trapcount >= 0 && @expertmode == "expert" endparam ; fBm Parameters ; param trap1fBmenable caption = "Use fBm" default = false hint = "Check this if you want to use fBm to modify this trap shape." enabled = @trapcount >= 0 && (@trap1shape != "fBm" && (@trapcolor != "fBm" || @trapcolorfBmset != 0)) endparam heading caption = "Trap fBm Parameters" visible = @trapcount == 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) endheading heading caption = "Trap A fBm Parameters" visible = @trapcount >= 1 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) endheading param trap1fBmuseasdistort caption = "Use to Distort" default = false hint = "Check this if you want fBm to distort the trap shape." visible = @trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) endparam param trap1fBmdistortionstyle caption = "Style" default = 0 enum = "radial" "linear" hint = "Chooses the kind of distortion. Radial distorts radially around a \ point, linear distorts back-and-forth across a line." visible = @trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) && @trap1fBmuseasdistort endparam param trap1fBmdistortionstrength caption = "Strength" default = 1.0 hint = "Sets the strength of the distortion. Larger strengths will push the \ trap shape more." visible = @trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) && @trap1fBmuseasdistort endparam param trap1fBmdistortionangle caption = "Angle" default = 0.0 hint = "Sets the angle, in degrees, of the distortion, relative to the center of \ distortion (for radial) or the horizontal axis (for linear)." visible = @trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) && @trap1fBmuseasdistort endparam param trap1fBmdistortioncenter caption = "Offset" default = (0,0) hint = "Sets the offset from the trap center for the distortion." visible = @trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) && @trap1fBmuseasdistort && @trap1fBmdistortionstyle == "radial" endparam param trap1fBmuseasadder caption = "Use to Texturize" default = false hint = "Check this if you want fBm to texturize the trap shape." visible = @trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) endparam param trap1fBmadderscale caption = "Intensity" default = 1.0 hint = "Sets how much the intensity of the fBm pattern will affect the trap." visible = @trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) && @trap1fBmuseasadder endparam param trap1fBmadderstage caption = "Apply" default = 0 enum = "immediately" "after fade" "after transfer" hint = "Sets when when fBm is added to the trap distance." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) && @trap1fBmuseasadder) && @expertmode == "expert" endparam param trap1fBmtransform caption = "fBm Transform" default = 0 enum = "rectangular" "polar" hint = "Selects the transform mode for orbit values used in fBm calculations." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0))) && @expertmode == "expert" endparam param trap1fBmoffset caption = "fBm Offset" default = (0,0) hint = "Sets the offset of the fBm pattern." visible = @trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) endparam param trap1fBmscale caption = "fBm Scale" default = 1.0 hint = "Sets the scale of the fBm pattern. Larger values give a finer grain." visible = @trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) endparam param trap1fBmbias caption = "fBm Bias" default = 0.0 hint = "This constant is added to the result of the fBm noise. fBm noise typically produces \ values from -0.5 to 0.5; in some cases negative values will be a problem, so you can use \ this setting (try 1) to bias the results and always get a positive value." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0))) && @expertmode == "expert" endparam param trap1fBmaspect caption = "fBm Aspect" default = 1.0 hint = "Sets the aspect ratio of the fBm pattern. You can use this to stretch \ or squeeze the fBm pattern." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0))) && @expertmode == "expert" endparam param trap1fBmangle caption = "fBm Rotation" default = 0.0 hint = "Sets the angle, in degrees, of the fBm pattern." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0))) && @expertmode == "expert" endparam param trap1fBmangleiterstep caption = "fBm Rot. Step" default = 0.0 hint = "This is the angle, in degrees, that the fBm pattern will rotate with \ each fractal iteration." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0))) && @expertmode == "expert" endparam param trap1fBmscalestep caption = "fBm Scale Iter." default = 0.5 hint = "This is the amount the fBm pattern is scaled by with each fBm iteration." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0))) && @expertmode == "expert" endparam param trap1fBmanglestep caption = "fBm Rot. Iter." default = 37.0 hint = "This is the angle, in degrees, the fBm pattern is scaled by with each \ fBm iteration." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0))) && @expertmode == "expert" endparam param trap1fBmoctaves caption = "fBm Octaves" default = 3 min = 1 max = 16 hint = "This sets the number of fBm iterations to perform with each fractal \ iteration. Increasing this number can drastically affect rendering \ speed, but gives a more detailed fBm texture." visible = @trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0)) endparam param trap1fBmpower caption = "fBm Exponent" default = 2.0 hint = "This is an exponent used in the random number generator. Different \ values will give different noise patterns. Try using values near 2.0." visible = (@trapcount >= 0 && (@trap1fBmenable || @trap1shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 0))) && @expertmode == "expert" endparam ; ; Trap 2 Parameters ; heading caption = "Trap B Parameters" visible = @trapcount >= 1 endheading ; Shape parameters ; param trap2shape caption = "Trap Shape" default = 0 enum = "point" "egg" "hyperbola" "hypercross" \ "cross" "astroid" "rectangle" "line" \ "linear wave" "radial wave" "ring ripples" \ "grid ripples" "radial ripples" "pinch" "spiral" "heart" \ "fBm" hint = "This is the shape of the orbit trap." visible = @trapcount >= 1 endparam param trap2eggseparation caption = " Stretching" default = 1.0 hint = "Specifies how stretched the egg shape should be." visible = @trapcount >= 1 && @trap2shape == "egg" endparam param trap2egginess caption = " Egginess" default = 4.0 hint = "Specifies how pointy the egg shape should be." visible = @trapcount >= 1 && @trap2shape == "egg" endparam param trap2astroidpower caption = " Squareness" default = 0.666666666666667 hint = "Indicates the squareness of the astroid shape. Values \ less than one produce diamonds; values larger than one \ push the shape closer and closer towards a square." visible = @trapcount >= 1 && @trap2shape == "astroid" endparam param trap2wavemirrors caption = " Mirroring" default = 0 enum = "none" "half" "full" hint = "Chooses the mirroring on the waves. 'Half' will reflect \ one half of the wave, replacing the other half; 'Full' \ reflects both halves of the wave and superimposes them." visible = @trapcount >= 1 && (@trap2shape == "linear wave") endparam param trap2gridmode caption = " Grid Mode" default = 0 enum = "diagonal" "straight" hint = "Chooses the orientation of the grid by selecting between \ addition ('diagonal') and multiplication ('straight') when \ adding wave components for vertical and horizontal values." visible = @trapcount >= 1 && (@trap2shape == "grid ripples") endparam param trap2frequency1 caption = " Frequency 1" default = 1.0 hint = "Specifies the primary frequency of the wave. Higher \ numbers give a more rapidly-oscillating wave." visible = @trapcount >= 1 && (@trap2shape == "linear wave" || \ @trap2shape == "radial wave" || @trap2shape == "ring ripples" || \ @trap2shape == "grid ripples" || @trap2shape == "radial ripples") endparam param trap2amplitude1 caption = " Amplitude 1" default = 1.0 hint = "Specifies the primary amplitude of the wave. Higher \ numbers increase the distance between extremes in the wave." visible = @trapcount >= 1 && (@trap2shape == "linear wave" || \ @trap2shape == "radial wave" || @trap2shape == "ring ripples" || \ @trap2shape == "grid ripples" || @trap2shape == "radial ripples") endparam param trap2phase1 caption = " Phase 1" default = 0.0 hint = "Provides a phase shift for the wave, which can be used to shift the \ wave peaks side-to-side. Phases are specified in degrees, so a phase \ shift of 360 or -360 is equivalent to a phase shift of zero." visible = @trapcount >= 1 && (@trap2shape == "linear wave" || \ @trap2shape == "radial wave" || @trap2shape == "ring ripples" || \ @trap2shape == "grid ripples" || @trap2shape == "radial ripples") endparam param trap2frequency2 caption = " Frequency 2" default = 1.0 hint = "Specifies the secondary frequency of the wave. Higher \ numbers give a more rapidly-oscillating wave." visible = @trapcount >= 1 && (@trap2shape == "linear wave" || \ @trap2shape == "radial wave" || @trap2shape == "ring ripples" || \ @trap2shape == "grid ripples" || @trap2shape == "radial ripples") endparam param trap2amplitude2 caption = " Amplitude 2" default = 1.0 hint = "Specifies the secondary amplitude of the wave. Higher \ numbers increase the distance between extremes in the wave." visible = @trapcount >= 1 && (@trap2shape == "linear wave" || \ @trap2shape == "radial wave" || @trap2shape == "ring ripples" || \ @trap2shape == "grid ripples" || @trap2shape == "radial ripples") endparam param trap2phase2 caption = " Phase 2" default = 0.0 hint = "Provides a phase shift for the wave, which can be used to shift the \ wave peaks side-to-side. Phases are specified in degrees, so a phase \ shift of 360 or -360 is equivalent to a phase shift of zero." visible = @trapcount >= 1 && (@trap2shape == "linear wave" || \ @trap2shape == "radial wave" || @trap2shape == "ring ripples" || \ @trap2shape == "grid ripples" || @trap2shape == "radial ripples") endparam param trap2petals caption = " Petals" default = 4.0 hint = "Specifies the number of petals in the pinch shape." visible = @trapcount >= 1 && @trap2shape == "pinch" endparam param trap2tightness caption = " Tightness" default = 4.0 hint = "Specifies the tightness of the spiral." visible = @trapcount >= 1 && @trap2shape == "spiral" endparam param trap2heartrot caption = " Pointiness" default = 45.0 hint = "Specifies the pointiness of the heart shape." visible = @trapcount >= 1 && @trap2shape == "heart" endparam param trap2heartsize caption = " Size" default = 1.0 hint = "Specifies the size of the heart shape." visible = @trapcount >= 1 && @trap2shape == "heart" endparam param trap2aspect caption = "Aspect Ratio" default = 1.0 min = 0.0 hint = "This is how square the trap is. You can distort the \ trap by using a value other than 1.0." visible = @trapcount >= 1 endparam param trap2diameter1 caption = "Diameter" default = 0.0 hint = "This is the diameter of the trap. Diameters greater than \ zero produce rings, boxes, pairs of traps, etc." visible = @trapcount >= 1 endparam param trap2diameter2 caption = " Second Diameter" default = 0.0 hint = "Just as changing the Diameter 'splits' the trap, you can \ split it again by setting this value greater than zero." visible = @trapcount >= 1 && @trap2diameter1 != 0.0 endparam param trap2invertexponent caption = "Inversion Exponent" default = 1.0 hint = "Sets the inversion exponent. 1.0 gives no inversion, -1.0 \ gives standard inversion." visible = @trapcount >= 1 endparam param trap2invertoffset caption = "Inversion Offset" default = (0,0) hint = "Sets the offset of the inversion center from the trap center." visible = @trapcount >= 1 && @trap2invertexponent != 1.0 endparam param trap2fade caption = "Fade Radius" default = 0.0 hint = "Sets the radius beyond which the trap will 'fade out'. \ A value of zero disables this feature." visible = @trapcount >= 1 endparam param trap2fadeoffset caption = " Fade Offset" default = (0,0) hint = "Sets the offset from the trap center to fade from. You can use \ this to fade the trap unevenly." visible = @trapcount >= 1 && @trap2fade != 0.0 endparam param trap2fademode caption = " Fade Mode" default = 0 enum = "add" "multiply" hint = "Choose the way in which the fade will be applied. 'Add' works \ best for most trap types, but for any ripples type, you may want \ to use 'Multiply'." visible = @trapcount >= 1 && @trap2fade != 0.0 endparam ; Location/orientation Parameters ; param trap2reuseposition caption = "Re-use Trap 1 position" default = false hint = "If checked, this trap's position is relative to the \ position of the previous trap." visible = @trapcount >= 1 endparam param trap2center caption = "Trap Center" default = (0,0) hint = "This is the location of the trap in the complex plane." visible = @trapcount >= 1 endparam param trap2centermoves caption = "Follows pixel location" default = false hint = "If this is enabled, the trap center will follow the pixel \ location, offset by the Trap Center amount. NOTE: If you \ enable this, you will probably want to skip the first iteration." visible = @trapcount >= 1 endparam param trap2drift caption = "Trap Drift" default = (0,0) hint = "This is the amount the trap center will move with each \ iteration." visible = @trapcount >= 1 endparam param trap2rot caption = "Rotation" default = 0.0 hint = "This is the angle, in degrees, that the trap should \ be rotated." visible = @trapcount >= 1 endparam param trap2rotstep caption = "Rotation Step" default = 0.0 hint = "This is the angle, in degrees, that the trap will \ be rotated with each iteration." visible = @trapcount >= 1 endparam param trap2skew caption = "Skew" default = 0.0 hint = "This is the angle, in degrees, to skew the vertical \ axis of the trap shape." visible = @trapcount >= 1 endparam param trap2skewstep caption = "Skew Step" default = 0.0 hint = "This is the angle, in degrees, that the skew angle \ should be increased by with each iteration." visible = @trapcount >= 1 endparam ; Repeat Parameters ; param trap2repeatspacing caption = "Repeat Spacing" default = 0.0 min = 0.0 hint = "This is the spacing at which the trap will repeat, \ all across the complex plane. If zero, trap does \ not repeat." visible = @trapcount >= 1 endparam param trap2repeatcenter caption = " Repeat Center" default = (0,0) hint = "This is the center point of grid trap repetition." visible = @trapcount >= 1 && (@trap2repeatspacing > 0.0) endparam param trap2repeatangle caption = " Repeat Rotation" default = 0.0 hint = "This is the angle of the repeat grid." visible = @trapcount >= 1 && (@trap2repeatspacing > 0.0) endparam param trap2radialspacing caption = "Radial Spacing" default = 0.0 min = 0 hint = "This is the number of times the trap will repeat, \ radially around the radial center point. If zero, \ trap does not repeat radially." visible = @trapcount >= 1 endparam param trap2concentricspacing caption = "Concentric Spacing" default = 0.0 min = 0 hint = "This is the distance at which the trap will repeat, \ radially out from the radial center point. If zero, \ trap does not repeat radially out." visible = @trapcount >= 1 endparam param trap2radialcenter caption = " Radial Center" default = (0,0) hint = "This is the center point of radial trap repetition." visible = @trapcount >= 1 && (@trap2radialspacing > 0.0 || @trap2concentricspacing > 0.0) endparam param trap2radialmode caption = " Radial Mode" default = 0 enum = "kaleidoscope" "polar coordinates" hint = "Indicates the type of radial repetition to use. The \ two styles produce very different results." visible = @trapcount >= 1 && (@trap2radialspacing > 0.0) endparam ; Transfer Parameters ; param trap2distancetransfer caption = "Distance Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" \ "sin" "cos" "tan" "sinc" hint = "This function is applied to trap distances at every \ iteration. It can be used to apply some special effects \ to trap shapes." visible = @trapcount >= 1 endparam param trap2distanceprescale caption = "Distance Pre-scale" default = 1.0 hint = "This is a multiplier applied to the trap distance, \ before the Distance Transfer function is applied to it." visible = @trapcount >= 1 endparam param trap2distancepostscale caption = "Distance Post-scale" default = 1.0 hint = "This is a multiplier applied to the trap distance, \ after the Distance Transfer function is applied to it." visible = @trapcount >= 1 endparam param trap2nonegdistance caption = "No Negative Distance" default = false hint = "If enabled, eliminates 'negative' distances by taking \ the absolute value of the distance." visible = @trapcount >= 1 endparam ; fBm Parameters ; param trap2fBmenable caption = "Use fBm" default = false hint = "Check this if you want to use fBm to modify this trap shape." enabled = @trapcount >= 1 && (@trap2shape != "fBm" && (@trapcolor != "fBm" || @trapcolorfBmset != 1)) visible = @trapcount >= 1 endparam heading caption = "Trap B fBm Parameters" visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endheading param trap2fBmuseasdistort caption = "Use to Distort" default = false hint = "Check this if you want fBm to distort the trap shape." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmdistortionstyle caption = "Style" default = 0 enum = "radial" "linear" "chained fBm" hint = "Chooses the kind of distortion. Radial distorts radially around a \ point, linear distorts back-and-forth across a line, and chained \ fBm uses trap 1 fBm to control the distortion angle." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) && @trap2fBmuseasdistort endparam param trap2fBmdistortionvariance caption = "Rotation variance" default = 90.0 hint = "Specifies the variance in distortion angles possible, in degrees." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) && @trap2fBmuseasdistort && @trap2fBmdistortionstyle == "chained fBm" endparam param trap2fBmdistortionstrength caption = "Strength" default = 1.0 hint = "Sets the strength of the distortion. Larger strengths will push the \ trap shape more." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) && @trap2fBmuseasdistort endparam param trap2fBmdistortionangle caption = "Angle" default = 0.0 hint = "Sets the angle, in degrees, of the distortion, relative to the center of \ distortion (for radial) or the horizontal axis (for linear)." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) && @trap2fBmuseasdistort endparam param trap2fBmdistortioncenter caption = "Offset" default = (0,0) hint = "Sets the offset from the trap center for the distortion." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) && @trap2fBmuseasdistort && @trap2fBmdistortionstyle == "radial" endparam param trap2fBmuseasadder caption = "Use to Texturize" default = false hint = "Check this if you want fBm to texturize the trap shape." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmadderscale caption = "Intensity" default = 1.0 hint = "Sets how much the intensity of the fBm pattern will affect the trap." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) && @trap2fBmuseasadder endparam param trap2fBmadderstage caption = "Apply" default = 0 enum = "immediately" "after fade" "after transfer" hint = "Sets when when fBm is added to the trap distance." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) && @trap2fBmuseasadder endparam param trap2fBmtransform caption = "fBm Transform" default = 0 enum = "rectangular" "polar" hint = "Selects the transform mode for orbit values used in fBm calculations." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmoffset caption = "fBm Offset" default = (0,0) hint = "Sets the offset of the fBm pattern." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmscale caption = "fBm Scale" default = 1.0 hint = "Sets the scale of the fBm pattern. Larger values give a finer grain." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmbias caption = "fBm Bias" default = 0.0 hint = "This constant is added to the result of the fBm noise. fBm noise typically produces \ values from -0.5 to 0.5; in some cases negative values will be a problem, so you can use \ this setting (try 1) to bias the results and always get a positive value." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmaspect caption = "fBm Aspect" default = 1.0 hint = "Sets the aspect ratio of the fBm pattern. You can use this to stretch \ or squeeze the fBm pattern." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmangle caption = "fBm Rotation" default = 0.0 hint = "Sets the angle, in degrees, of the fBm pattern." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmangleiterstep caption = "fBm Rot. Step" default = 0.0 hint = "This is the angle, in degrees, that the fBm pattern will rotate with \ each fractal iteration." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmscalestep caption = "fBm Scale Iter." default = 0.5 hint = "This is the amount the fBm pattern is scaled by with each fBm iteration." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmanglestep caption = "fBm Rot. Iter." default = 37.0 hint = "This is the angle, in degrees, the fBm pattern is scaled by with each \ fBm iteration." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmoctaves caption = "fBm Octaves" default = 3 min = 1 max = 16 hint = "This sets the number of fBm iterations to perform with each fractal \ iteration. Increasing this number can drastically affect rendering \ speed, but gives a more detailed fBm texture." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam param trap2fBmpower caption = "fBm Exponent" default = 2.0 hint = "This is an exponent used in the random number generator. Different \ values will give different noise patterns. Try using values near 2.0." visible = @trapcount >= 1 && (@trap2fBmenable || @trap2shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 1)) endparam ; ; Trap 3 Parameters ; heading caption = "Trap C Parameters" visible = @trapcount >= 2 endheading ; Shape parameters ; param trap3shape caption = "Trap Shape" default = 0 enum = "point" "egg" "hyperbola" "hypercross" \ "cross" "astroid" "rectangle" "line" \ "linear wave" "radial wave" "ring ripples" \ "grid ripples" "radial ripples" "pinch" "spiral" "heart" \ "fBm" hint = "This is the shape of the orbit trap." visible = @trapcount >= 2 endparam param trap3eggseparation caption = " Stretching" default = 1.0 hint = "Specifies how stretched the egg shape should be." visible = @trapcount >= 2 && @trap3shape == "egg" endparam param trap3egginess caption = " Egginess" default = 4.0 hint = "Specifies how pointy the egg shape should be." visible = @trapcount >= 2 && @trap3shape == "egg" endparam param trap3astroidpower caption = " Squareness" default = 0.666666666666667 hint = "Indicates the squareness of the astroid shape. Values \ less than one produce diamonds; values larger than one \ push the shape closer and closer towards a square." visible = @trapcount >= 2 && @trap3shape == "astroid" endparam param trap3wavemirrors caption = " Mirroring" default = 0 enum = "none" "half" "full" hint = "Chooses the mirroring on the waves. 'Half' will reflect \ one half of the wave, replacing the other half; 'Full' \ reflects both halves of the wave and superimposes them." visible = @trapcount >= 2 && (@trap3shape == "linear wave") endparam param trap3gridmode caption = " Grid Mode" default = 0 enum = "diagonal" "straight" hint = "Chooses the orientation of the grid by selecting between \ addition ('diagonal') and multiplication ('straight') when \ adding wave components for vertical and horizontal values." visible = @trapcount >= 2 && (@trap3shape == "grid ripples") endparam param trap3frequency1 caption = " Frequency 1" default = 1.0 hint = "Specifies the primary frequency of the wave. Higher \ numbers give a more rapidly-oscillating wave." visible = @trapcount >= 2 && (@trap3shape == "linear wave" || \ @trap3shape == "radial wave" || @trap3shape == "ring ripples" || \ @trap3shape == "grid ripples" || @trap3shape == "radial ripples") endparam param trap3amplitude1 caption = " Amplitude 1" default = 1.0 hint = "Specifies the primary amplitude of the wave. Higher \ numbers increase the distance between extremes in the wave." visible = @trapcount >= 2 && (@trap3shape == "linear wave" || \ @trap3shape == "radial wave" || @trap3shape == "ring ripples" || \ @trap3shape == "grid ripples" || @trap3shape == "radial ripples") endparam param trap3phase1 caption = " Phase 1" default = 0.0 hint = "Provides a phase shift for the wave, which can be used to shift the \ wave peaks side-to-side. Phases are specified in degrees, so a phase \ shift of 360 or -360 is equivalent to a phase shift of zero." visible = @trapcount >= 2 && (@trap3shape == "linear wave" || \ @trap3shape == "radial wave" || @trap3shape == "ring ripples" || \ @trap3shape == "grid ripples" || @trap3shape == "radial ripples") endparam param trap3frequency2 caption = " Frequency 2" default = 1.0 hint = "Specifies the secondary frequency of the wave. Higher \ numbers give a more rapidly-oscillating wave." visible = @trapcount >= 2 && (@trap3shape == "linear wave" || \ @trap3shape == "radial wave" || @trap3shape == "ring ripples" || \ @trap3shape == "grid ripples" || @trap3shape == "radial ripples") endparam param trap3amplitude2 caption = " Amplitude 2" default = 1.0 hint = "Specifies the secondary amplitude of the wave. Higher \ numbers increase the distance between extremes in the wave." visible = @trapcount >= 2 && (@trap3shape == "linear wave" || \ @trap3shape == "radial wave" || @trap3shape == "ring ripples" || \ @trap3shape == "grid ripples" || @trap3shape == "radial ripples") endparam param trap3phase2 caption = " Phase 2" default = 0.0 hint = "Provides a phase shift for the wave, which can be used to shift the \ wave peaks side-to-side. Phases are specified in degrees, so a phase \ shift of 360 or -360 is equivalent to a phase shift of zero." visible = @trapcount >= 2 && (@trap3shape == "linear wave" || \ @trap3shape == "radial wave" || @trap3shape == "ring ripples" || \ @trap3shape == "grid ripples" || @trap3shape == "radial ripples") endparam param trap3petals caption = " Petals" default = 4.0 hint = "Specifies the number of petals in the pinch shape." visible = @trapcount >= 2 && @trap3shape == "pinch" endparam param trap3tightness caption = " Tightness" default = 4.0 hint = "Specifies the tightness of the spiral." visible = @trapcount >= 2 && @trap3shape == "spiral" endparam param trap3heartrot caption = " Pointiness" default = 45.0 hint = "Specifies the pointiness of the heart shape." visible = @trapcount >= 2 && @trap3shape == "heart" endparam param trap3heartsize caption = " Size" default = 1.0 hint = "Specifies the size of the heart shape." visible = @trapcount >= 2 && @trap3shape == "heart" endparam param trap3aspect caption = "Aspect Ratio" default = 1.0 min = 0.0 hint = "This is how square the trap is. You can distort the \ trap by using a value other than 1.0." visible = @trapcount >= 2 endparam param trap3diameter1 caption = "Diameter" default = 0.0 hint = "This is the diameter of the trap. Diameters greater than \ zero produce rings, boxes, pairs of traps, etc." visible = @trapcount >= 2 endparam param trap3diameter2 caption = " Second Diameter" default = 0.0 hint = "Just as changing the Diameter 'splits' the trap, you can \ split it again by setting this value greater than zero." visible = @trapcount >= 2 && @trap3diameter1 != 0.0 endparam param trap3invertexponent caption = "Inversion Exponent" default = 1.0 hint = "Sets the inversion exponent. 1.0 gives no inversion, -1.0 \ gives standard inversion." visible = @trapcount >= 2 endparam param trap3invertoffset caption = "Inversion Offset" default = (0,0) hint = "Sets the offset of the inversion center from the trap center." visible = @trapcount >= 2 && @trap3invertexponent != 1.0 endparam param trap3fade caption = "Fade Radius" default = 0.0 hint = "Sets the radius beyond which the trap will 'fade out'. \ A value of zero disables this feature." visible = @trapcount >= 2 endparam param trap3fadeoffset caption = " Fade Offset" default = (0,0) hint = "Sets the offset from the trap center to fade from. You can use \ this to fade the trap unevenly." visible = @trapcount >= 2 && @trap3fade != 0.0 endparam param trap3fademode caption = " Fade Mode" default = 0 enum = "add" "multiply" hint = "Choose the way in which the fade will be applied. 'Add' works \ best for most trap types, but for any ripples type, you may want \ to use 'Multiply'." visible = @trapcount >= 2 && @trap3fade != 0.0 endparam ; Location/orientation Parameters ; param trap3reuseposition caption = "Re-use Trap 2 position" default = false hint = "If checked, this trap's position is relative to the \ position of the previous trap." visible = @trapcount >= 2 endparam param trap3center caption = "Trap Center" default = (0,0) hint = "This is the location of the trap in the complex plane." visible = @trapcount >= 2 endparam param trap3centermoves caption = "Follows pixel location" default = false hint = "If this is enabled, the trap center will follow the pixel \ location, offset by the Trap Center amount. NOTE: If you \ enable this, you will probably want to skip the first iteration." visible = @trapcount >= 2 endparam param trap3drift caption = "Trap Drift" default = (0,0) hint = "This is the amount the trap center will move with each \ iteration." visible = @trapcount >= 2 endparam param trap3rot caption = "Rotation" default = 0.0 hint = "This is the angle, in degrees, that the trap should \ be rotated." visible = @trapcount >= 2 endparam param trap3rotstep caption = "Rotation Step" default = 0.0 hint = "This is the angle, in degrees, that the trap will \ be rotated with each iteration." visible = @trapcount >= 2 endparam param trap3skew caption = "Skew" default = 0.0 hint = "This is the angle, in degrees, to skew the vertical \ axis of the trap shape." visible = @trapcount >= 2 endparam param trap3skewstep caption = "Skew Step" default = 0.0 hint = "This is the angle, in degrees, that the skew angle \ should be increased by with each iteration." visible = @trapcount >= 2 endparam ; Repeat Parameters ; param trap3repeatspacing caption = "Repeat Spacing" default = 0.0 min = 0.0 hint = "This is the spacing at which the trap will repeat, \ all across the complex plane. If zero, trap does \ not repeat." visible = @trapcount >= 2 endparam param trap3repeatcenter caption = " Repeat Center" default = (0,0) hint = "This is the center point of grid trap repetition." visible = @trapcount >= 2 && (@trap3repeatspacing > 0.0) endparam param trap3repeatangle caption = " Repeat Rotation" default = 0.0 hint = "This is the angle of the repeat grid." visible = @trapcount >= 2 && (@trap3repeatspacing > 0.0) endparam param trap3radialspacing caption = "Radial Spacing" default = 0.0 min = 0 hint = "This is the number of times the trap will repeat, \ radially around the radial center point. If zero, \ trap does not repeat radially." visible = @trapcount >= 2 endparam param trap3concentricspacing caption = "Concentric Spacing" default = 0.0 min = 0 hint = "This is the distance at which the trap will repeat, \ radially out from the radial center point. If zero, \ trap does not repeat radially out." visible = @trapcount >= 2 endparam param trap3radialcenter caption = " Radial Center" default = (0,0) hint = "This is the center point of radial trap repetition." visible = @trapcount >= 2 && (@trap3radialspacing > 0.0 || @trap3concentricspacing > 0.0) endparam param trap3radialmode caption = " Radial Mode" default = 0 enum = "kaleidoscope" "polar coordinates" hint = "Indicates the type of radial repetition to use. The \ two styles produce very different results." visible = @trapcount >= 2 && (@trap3radialspacing > 0.0) endparam ; Transfer Parameters ; param trap3distancetransfer caption = "Distance Transfer" default = 0 enum = "linear" "log" "sqrt" "cuberoot" "exp" "sqr" "cube" \ "sin" "cos" "tan" "sinc" hint = "This function is applied to trap distances at every \ iteration. It can be used to apply some special effects \ to trap shapes." visible = @trapcount >= 2 endparam param trap3distanceprescale caption = "Distance Pre-scale" default = 1.0 hint = "This is a multiplier applied to the trap distance, \ before the Distance Transfer function is applied to it." visible = @trapcount >= 2 endparam param trap3distancepostscale caption = "Distance Post-scale" default = 1.0 hint = "This is a multiplier applied to the trap distance, \ after the Distance Transfer function is applied to it." visible = @trapcount >= 2 endparam param trap3nonegdistance caption = "No Negative Distance" default = false hint = "If enabled, eliminates 'negative' distances by taking \ the absolute value of the distance." visible = @trapcount >= 2 endparam ; fBm Parameters ; param trap3fBmenable caption = "Use fBm" default = false hint = "Check this if you want to use fBm to modify this trap shape." enabled = @trapcount >= 2 && (@trap3shape != "fBm" && (@trapcolor != "fBm" || @trapcolorfBmset != 2)) visible = @trapcount >= 2 endparam heading caption = "Trap C fBm Parameters" visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endheading param trap3fBmuseasdistort caption = "Use to Distort" default = false hint = "Check this if you want fBm to distort the trap shape." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmdistortionstyle caption = "Style" default = 0 enum = "radial" "linear" "chained fBm" hint = "Chooses the kind of distortion. Radial distorts radially around a \ point, linear distorts back-and-forth across a line, and chained \ fBm uses trap 2 fBm to control the distortion angle." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) && @trap3fBmuseasdistort endparam param trap3fBmdistortionvariance caption = "Rotation variance" default = 90.0 hint = "Specifies the variance in distortion angles possible, in degrees." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) && @trap3fBmuseasdistort && @trap3fBmdistortionstyle == "chained fBm" endparam param trap3fBmdistortionstrength caption = "Strength" default = 1.0 hint = "Sets the strength of the distortion. Larger strengths will push the \ trap shape more." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) && @trap3fBmuseasdistort endparam param trap3fBmdistortionangle caption = "Angle" default = 0.0 hint = "Sets the angle, in degrees, of the distortion, relative to the center of \ distortion (for radial) or the horizontal axis (for linear)." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) && @trap3fBmuseasdistort endparam param trap3fBmdistortioncenter caption = "Offset" default = (0,0) hint = "Sets the offset from the trap center for the distortion." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) && @trap3fBmuseasdistort && @trap3fBmdistortionstyle == "radial" endparam param trap3fBmuseasadder caption = "Use to Texturize" default = false hint = "Check this if you want fBm to texturize the trap shape." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmadderscale caption = "Intensity" default = 1.0 hint = "Sets how much the intensity of the fBm pattern will affect the trap." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) && @trap3fBmuseasadder endparam param trap3fBmadderstage caption = "Apply" default = 0 enum = "immediately" "after fade" "after transfer" hint = "Sets when when fBm is added to the trap distance." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) && @trap3fBmuseasadder endparam param trap3fBmtransform caption = "fBm Transform" default = 0 enum = "rectangular" "polar" hint = "Selects the transform mode for orbit values used in fBm calculations." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmoffset caption = "fBm Offset" default = (0,0) hint = "Sets the offset of the fBm pattern." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmscale caption = "fBm Scale" default = 1.0 hint = "Sets the scale of the fBm pattern. Larger values give a finer grain." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmbias caption = "fBm Bias" default = 0.0 hint = "This constant is added to the result of the fBm noise. fBm noise typically produces \ values from -0.5 to 0.5; in some cases negative values will be a problem, so you can use \ this setting (try 1) to bias the results and always get a positive value." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmaspect caption = "fBm Aspect" default = 1.0 hint = "Sets the aspect ratio of the fBm pattern. You can use this to stretch \ or squeeze the fBm pattern." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmangle caption = "fBm Rotation" default = 0.0 hint = "Sets the angle, in degrees, of the fBm pattern." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmangleiterstep caption = "fBm Rot. Step" default = 0.0 hint = "This is the angle, in degrees, that the fBm pattern will rotate with \ each fractal iteration." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmscalestep caption = "fBm Scale Iter." default = 0.5 hint = "This is the amount the fBm pattern is scaled by with each fBm iteration." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmanglestep caption = "fBm Rot. Iter." default = 37.0 hint = "This is the angle, in degrees, the fBm pattern is scaled by with each \ fBm iteration." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmoctaves caption = "fBm Octaves" default = 3 min = 1 max = 16 hint = "This sets the number of fBm iterations to perform with each fractal \ iteration. Increasing this number can drastically affect rendering \ speed, but gives a more detailed fBm texture." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam param trap3fBmpower caption = "fBm Exponent" default = 2.0 hint = "This is an exponent used in the random number generator. Different \ values will give different noise patterns. Try using values near 2.0." visible = @trapcount >= 2 && (@trap3fBmenable || @trap3shape == "fBm" || (@trapcolor == "fBm" && @trapcolorfBmset == 2)) endparam } dmj3-alephone { ; ; This coloring algorithm is based on one technique for showing ; that the complex plane is only an aleph-one (uncountable) infinity ; and not aleph-two. An interesting discussion of infinities and ; their cardinality can be found here: ; ; http://www.mathacademy.com/pr/minitext/infinity/index.asp ; ; This particular proof of aleph-oneness involves taking the real ; and imaginary components of the complex number and splicing the ; digits of their binary expansion together, yielding a single ; real number. This shows that the complex plane is aleph-one, much ; the same as we show that both the set of natural numbers (1, 2, 3...) ; and the set of squares (1, 4, 9...) are aleph-null because we can ; establish a one-to-one correspondence between them. ; final: complex r = (0,1) ^ (@angle / 90.0) complex z2 = #z * r * @scale float zr = real(z2 ) - floor(real(z2 )) float zi = imag(z2*@aspect) - floor(imag(z2*@aspect)) BOOL f = false float a1 = 0 float p = 1.0 int c = 0 WHILE (c < @precision) IF (zr >= 0.5) a1 = a1 + p IF (@style != "normal") f = !f ENDIF ENDIF IF ((zi >= 0.5 && !f) || (zi < 0.5 && f)) a1 = a1 + p*0.5 ENDIF IF (@style == "half-flipped") f = false ENDIF zr = zr * 2 zi = zi * 2 zr = zr - floor(zr) zi = zi - floor(zi) p = p * 0.25 c = c + 1 ENDWHILE #index = a1 default: title = "Aleph-One (UF3)" helpfile = "dmj3\dmj3-pub-uf-a1.htm" param scale caption = "Pattern Scale" default = 1.0 hint = "Specifies the overall size of the pattern." endparam param aspect caption = "Aspect Ratio" default = 1.0 hint = "Specifies how square the pattern is. You can distort the pattern \ by using a value other than 1.0." endparam param angle caption = "Rotation" default = 0.0 hint = "This is the angle, in degrees, that the pattern should \ be rotated." endparam param precision caption = "Precision" default = 5 hint = "Specifies the number of bits each from the real and imaginary \ components to use in building the pattern." endparam param style caption = "Pattern Style" default = 0 enum = "normal" "half-flipped" "chain-flipped" hint = "Chooses a pattern style; each has a different feel." endparam }