END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Visit the official fractalforums.com Youtube Channel
 
*
Welcome, Guest. Please login or register. September 26, 2022, 11:25:55 AM


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: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: OpenCL & hybrid formula  (Read 834 times)
0 Members and 1 Guest are viewing this topic.
Buddhi
Fractal Iambus
***
Posts: 895



WWW
« 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 mr2 = consts->fractal.mandelbox.minRadius * consts->fractal.mandelbox.minRadius;
float fr2 = consts->fractal.mandelbox.fixedRadius * consts->fractal.mandelbox.fixedRadius;
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[0];
}
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: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Mandelbulber 0.90 - with Hybrid Formula Mandelbulber Buddhi 9 5543 Last post August 26, 2010, 09:30:53 PM
by XICO2KX
New hybrid types? (basic formula editor) Mandelbulb 3d bib 1 1589 Last post February 02, 2011, 04:03:53 PM
by Jesse
differences between hybrid and non-hybrid Mandelbulber jwm-art 1 2067 Last post March 05, 2011, 09:45:40 PM
by Buddhi
Hybrid fractals in OpenCL mode? Mandelbulber erstwhile 1 1927 Last post 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 Last post May 24, 2015, 02:00:03 PM
by Patryk Kizny

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.194 seconds with 25 queries. (Pretty URLs adds 0.007s, 2q)