Skip to content

Commit

Permalink
Added missing code for DeltaDE josKleinian. It fixed bug #627
Browse files Browse the repository at this point in the history
  • Loading branch information
buddhi1980 committed Apr 27, 2019
1 parent ffe0f3d commit 02be968
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mandelbulber2/opencl/engines/calculate_distance.cl
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ formulaOut CalculateDistance(__constant sClInConstants *consts, float3 point,
#elif DELTA_PSEUDO_KLEINIAN_DE
float rxy = native_sqrt(out.z.x * out.z.x + out.z.y * out.z.y);
out.distance = max(rxy - 0.92784f, fabs(rxy * out.z.z) / r) / d;
#elif DELTA_JOS_KLEINIAN_DE
float4 z = out.z;
float rxy = native_sqrt(z.x * z.x + z.z * z.z);
out.distance = (fabs(rxy * z.y) / r) / d;
out.maxiter = false;
#endif
}

Expand Down
6 changes: 6 additions & 0 deletions mandelbulber2/opencl/engines/compute_fractal.cl
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,12 @@ formulaOut Fractal(__constant sClInConstants *consts, float3 point, sClCalcParam
}
#endif

#ifdef DELTA_JOS_KLEINIAN_DE
// needed for JosKleinian fractal to calculate spheres in deltaDE mode
if (consts->fractal[sequence].transformCommon.spheresEnabled)
z.y = min(z.y, consts->fractal[sequence].transformCommon.foldingValue - z.y);
#endif

// end
if (dist < 0.0f) dist = 0.0f;
out.distance = dist;
Expand Down
4 changes: 4 additions & 0 deletions mandelbulber2/src/opencl_engine_render_fractal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ void cOpenClEngineRenderFractal::SetParameters(const cParameterContainer *paramC
bool useLinearDEFunction = false;
bool useLogarithmicDEFunction = false;
bool usePseudoKleinianDEFunction = false;
bool useJosKleinianDEFunction = true;

if (fractals->IsHybrid())
{
Expand Down Expand Up @@ -393,6 +394,7 @@ void cOpenClEngineRenderFractal::SetParameters(const cParameterContainer *paramC
case fractal::linearDEFunction: useLinearDEFunction = true; break;
case fractal::logarithmicDEFunction: useLogarithmicDEFunction = true; break;
case fractal::pseudoKleinianDEFunction: usePseudoKleinianDEFunction = true; break;
case fractal::josKleinianDEFunction: useJosKleinianDEFunction = true; break;
default: break;
}
}
Expand All @@ -415,6 +417,7 @@ void cOpenClEngineRenderFractal::SetParameters(const cParameterContainer *paramC
case fractal::linearDEFunction: useLinearDEFunction = true; break;
case fractal::logarithmicDEFunction: useLogarithmicDEFunction = true; break;
case fractal::pseudoKleinianDEFunction: usePseudoKleinianDEFunction = true; break;
case fractal::josKleinianDEFunction: useJosKleinianDEFunction = true; break;
default: break;
}
}
Expand All @@ -426,6 +429,7 @@ void cOpenClEngineRenderFractal::SetParameters(const cParameterContainer *paramC
if (useLinearDEFunction) definesCollector += " -DDELTA_LINEAR_DE";
if (useLogarithmicDEFunction) definesCollector += " -DDELTA_LOG_DE";
if (usePseudoKleinianDEFunction) definesCollector += " -DDELTA_PSEUDO_KLEINIAN_DE";
if (useJosKleinianDEFunction) definesCollector += " -DDELTA_JOS_KLEINIAN_DE";

if (paramRender->limitsEnabled) definesCollector += " -DLIMITS_ENABLED";

Expand Down

0 comments on commit 02be968

Please sign in to comment.