News: Visit the official fractalforums.com Youtube Channel  Welcome, Guest. Please login or register. September 26, 2022, 11:25:55 AM 1 Hour 1 Day 1 Week 1 Month Forever Login with username, password and session length

## The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!

 Pages:    Go Down       Author Topic: OpenCL & hybrid formula  (Read 834 times) Description: 0 Members and 1 Guest are viewing this topic.
Buddhi
Fractal Iambus   Posts: 895   « on: November 19, 2013, 06:23:59 PM »

OpenCL & hybrid formula http://www.fractalforums.com/index.php?action=gallery;sa=view;id=15179

Image rendered using Mandelbulber 1.19
This is a trial with hybrid fractal defined as a custom formula. Used "Delta DE" distance estimation and "linear DE mode"

init:
Code:
float power = consts->fractal.power;
float tgladDE = 1.0f;
float3 ones = 1.0f;
float3 foldingLimit = consts->fractal.mandelbox.foldingLimit;
float3 foldingValue = consts->fractal.mandelbox.foldingValue;
float scale = consts->fractal.mandelbox.scale;
colourMin = 0.0f;

iterations:
Code:

z = fabs(z + ones) - fabs(z - ones) - z;
float rr = dot(z,z);
float m = 2.0f;
if (rr < mr2) m = native_divide(2.0f, mr2);
else if (rr < fr2) m = native_divide(2.0f,rr);

z = z * m;

if(i>4)
{
float x2 = z.x * z.x;
float y2 = z.y * z.y;
float z2 = z.z * z.z;
float temp = 1.0 - z2 / (x2 + y2);
float newx = (x2 - y2) * temp;
float newy = 2.0 * z.x * z.y * temp;
float newz = -2.0 * z.z * sqrt(x2 + y2);
z.x = newx + c.x;
z.y = newy + c.y;
z.z = newz + c.z;
z.z *= consts->fractal.custom;
}
else
{
z += c;
}

r = distance(z, orbitTrap);

#if _orbitTrapsEnabled
if (i >= consts->fractal.fakeLightsMinIter && i <= consts->fractal.fakeLightsMaxIter) distFromOrbitTrap += (1.0f/(r*r));
#endif

//iteration terminate condition
if(r>1024.0f)
{
dist = r / fabs(tgladDE);
out.colourIndex = colourMin / i * 300.0f;
break;
} Logged

quaz0r
Fractal Molossus  Posts: 652  « Reply #1 on: November 19, 2013, 11:24:41 PM »

nice! Logged
 Pages:    Go Down
 Related Topics Subject Started by Replies Views Last post  Mandelbulber 0.90 - with Hybrid Formula Mandelbulber Buddhi 9 5543 August 26, 2010, 09:30:53 PM by XICO2KX  New hybrid types? (basic formula editor) Mandelbulb 3d bib 1 1589 February 02, 2011, 04:03:53 PM by Jesse  differences between hybrid and non-hybrid Mandelbulber jwm-art 1 2067 March 05, 2011, 09:45:40 PM by Buddhi  Hybrid fractals in OpenCL mode? Mandelbulber erstwhile 1 1927 December 01, 2013, 09:23:45 PM by Buddhi  Feature requests - v1.2 OpenCL, Z-Buffer, IFS folding, Hybrid Feature Requests Patryk Kizny 4 1088 May 24, 2015, 02:00:03 PM by Patryk Kizny