Mandelbrot with 3DickUlus averaging coloring method Previous Image | Next Image
Description: having a lot of fun with the color averaging technique.
wish you could see it animated.
visit: https://fractalforums.org/fractal-mathematics-and-new-theories/28/triangle-inequality-average-algorithm/1368

here's my rendition:

control.maxIter = 894;
control.skip = 1;
control.stripeDensity = 3.02572274;
control.multiplier = 0.512945116;
control.R = 0.826509476;
control.G = 0.684140741;
control.B = 0.954962491;
control.contrast = 1.21072662;

// ---------------------------
...
int iter,maxIter = int(control.maxIter);
int skip = int(control.skip);
float avg = 0;
float count = 0;
float2 z = float2();
float co = mix * pow(10.0,control.multiplier) * 6.2831;
float3 color = float3();

for(iter = 0;iter < maxIter;++iter) {
z = complexPower(z,2) + cc;

if(iter >= skip)) {
count += 1;
lastAdded = 0.5 + 0.5 * sin(control.stripeDensity * atan2(z.y, z.x));
}

z2 = dot(z,z);
if (z2 > control.escapeRadius && iter > skip) break;
}

if(count > 1) {
float fracDen = log(z2);
float prevAvg = (avg - lastAdded) / (count - 1.0);
avg = avg / count;

float frac = 1.0 + (log2(log(control.escapeRadius) / fracDen));
float mix = frac * avg + (1.0 - frac) * prevAvg;

if(iter < maxIter) {
color.x = 0.5 + 0.5 * cos(co + control.R);
color.y = 0.5 + 0.5 * cos(co + control.G);
color.z = 0.5 + 0.5 * cos(co + control.B);
}
}

color.x = 0.5 + (color.x - 0.5) * control.contrast;
color.y = 0.5 + (color.y - 0.5) * control.contrast;
color.z = 0.5 + (color.z - 0.5) * control.contrast;

outTexture.write(float4(color,1),pt);
}

float2 complexPower(float2 value, float power) {
float rr = value.x * value.x + value.y * value.y; // radius squared
if(rr == 0) return 0.0001;

float p1 = pow(rr, power / 2);
float arg = atan2(value.y, value.x);
float2 p2 = float2( cos(power * arg), sin(power * arg));
return p1 * p2;
}

Stats:
Views: 68
Total Favorities: 0 View Who Favorited
Filesize: 4.09MB
Height: 2626 Width: 3134
Keywords: Mandelbrot
Posted by: kosalos March 24, 2020, 08:22:20 AM

Rating:    by 2 members.
Total Likes: 3

 BB Thumbnail Image Code BB Medium Image Code Direct Link ### Comments (1) 3DickUlus 3f       Offline Posts: 1790   March 28, 2020, 05:40:26 AMA mis-attribution there I think I am not the one responsible for writing that fragment or the coloring method, it's included as part of the default Fragmentarium distribution. There is no copyright notice or info about the author in the file so I imagine it was intended as a free public domain piece of code 