Welcome to Fractal Forums

Fractal Software => Tutorials => Topic started by: mclarekin on December 06, 2014, 12:01:47 AM




Title: Decreasing Render Time with OpenCL Mandelbulber 1.21 Custom Formulas
Post by: mclarekin on December 06, 2014, 12:01:47 AM
Decreasing Render Time with  OpenCL Mandelbulber 1.21 Custom Formulas

Well some may say that just rendering with Mandelbulber 1.21 OpenCL is fast enough, but Open CL will not run on my GPU so I have to use  my old CPU,  therefore the majority of my images are produced from Mandelbox and/or Menger formulas as they render quite quickly .  The iteration loop is full of + - / *,   avoiding such functions as exponentials  and powers and trig functions.

A programmer could tell us the computation time of these various functions (help?).

The Mandelbulb formula has this line of code:

float rp = native_powr(r, power - 1.0f);

No if we are rendering a power 2  Mandelbulb  or Burning Ship Mandelbulb this line is really
   float rp = r;

So I create a new custom formula, replace the line of code in my iteration loop file, save, recompile and render in 80% of the previous render time simply by replacing the native_ powr  part of the code. I did this trial with Fast AO, when I repeat the trial with proper AO settings the render time reduction was less, 87%. And if  I include an additional big overhead like volumetric light the difference would become very little as the saving is only in the iteration loop section of the complete program.

 In fact anywhere in the new MBulbPwr2  code
 power can be replaced by 2.0f;

  rp can be replaced by r  (as for pwr2 custom formula  rp = r  therefore the line  float rp = r; could be deleted and all references to rp could be replaced by just r.


For pwr3    float rp = r *r
For pwr4    float rp = r *r * r etc

Could a programmer confirm the above.