Skip to content

Commit

Permalink
transf_difs_box_v2.ui color
Browse files Browse the repository at this point in the history
  • Loading branch information
mclarekin committed Sep 9, 2024
1 parent 5417f70 commit 5d0b2c7
Show file tree
Hide file tree
Showing 12 changed files with 178 additions and 65 deletions.
19 changes: 15 additions & 4 deletions mandelbulber2/formula/definition/fractal_transf_difs_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,26 @@ void cFractalTransfDIFSBox::FormulaCode(CVector4 &z, const sFractal *fractal, sE
if (fractal->foldColor.auxColorEnabledFalse && aux.i >= fractal->foldColor.startIterationsA
&& aux.i < fractal->foldColor.stopIterationsA)
{
if (colDist != aux.dist) aux.color += fractal->foldColor.difs0000.x;
if (fractal->foldColor.auxColorEnabledAFalse)
if (!fractal->foldColor.auxColorEnabledAFalse)
{
if (fractal->foldColor.difs0000.y != 0.0f && zc.x == fabs(q.x))
if (colDist != aux.dist) aux.color += fractal->foldColor.difs0000.x;
}
else
{
if (zc.x > max(zc.y, zc.z))
aux.color += fractal->foldColor.difs0000.y;
if (zc.y > max(zc.x, zc.z))
aux.color += fractal->foldColor.difs0000.z;
if (zc.z > max(zc.y, zc.x))
aux.color += fractal->foldColor.difs0000.w;
/*if (fractal->foldColor.difs0000.y != 0.0f && zc.x == fabs(q.x))
aux.color += fractal->foldColor.difs0000.y;
if (fractal->foldColor.difs0000.z != 0.0f && zc.y == fabs(q.y))
aux.color += fractal->foldColor.difs0000.z;
if (fractal->foldColor.difs0000.w != 0.0f && zc.z == fabs(q.z))
aux.color += fractal->foldColor.difs0000.w;
aux.color += fractal->foldColor.difs0000.w;*/

if (fractal->foldColor.difs0 != 0.0)
{
double t = z.x * z.y;
if ((t > 0.0 && z.z > 0.0) || (t < 0.0 && z.z < 0.0)) aux.color += fractal->foldColor.difs0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ void cFractalTransfDIFSBoxV2::FormulaCode(CVector4 &z, const sFractal *fractal,
if (fractal->foldColor.auxColorEnabledFalse && aux.i >= fractal->foldColor.startIterationsA
&& aux.i < fractal->foldColor.stopIterationsA)
{
if (colDist != aux.dist) aux.color += fractal->foldColor.difs0000.x;
if (fractal->foldColor.auxColorEnabledAFalse)
if (!fractal->foldColor.auxColorEnabledAFalse)
{
if (colDist != aux.dist) aux.color += fractal->foldColor.difs0000.x;
}
else
{
if (fractal->foldColor.difs0000.y != 0.0f && zc.x == fabs(q.x))
aux.color += fractal->foldColor.difs0000.y;
Expand Down
19 changes: 8 additions & 11 deletions mandelbulber2/formula/definition/fractal_transf_difs_box_v3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,18 @@ void cFractalTransfDIFSBoxV3::FormulaCode(CVector4 &z, const sFractal *fractal,
if (fractal->foldColor.auxColorEnabledFalse && aux.i >= fractal->foldColor.startIterationsA
&& aux.i < fractal->foldColor.stopIterationsA)
{
if (colDist != aux.dist) aux.color += fractal->foldColor.difs0000.x;
if (fractal->foldColor.auxColorEnabledAFalse)
if (!fractal->foldColor.auxColorEnabledAFalse)
{
if (fractal->foldColor.difs0000.y != 0.0f && zc.x == fabs(q.x))
if (colDist != aux.dist) aux.color += fractal->foldColor.difs0000.x;
}
else
{
if (zc.x > max(zc.y, zc.z))
aux.color += fractal->foldColor.difs0000.y;
if (fractal->foldColor.difs0000.z != 0.0f && zc.y == fabs(q.y))
if (zc.y > max(zc.x, zc.z))
aux.color += fractal->foldColor.difs0000.z;
if (fractal->foldColor.difs0000.w != 0.0f && zc.z == fabs(q.z))
if (zc.z > max(zc.y, zc.x))
aux.color += fractal->foldColor.difs0000.w;
/* if (zc.y < max(zc.x, zc.z))
aux.color += fractal->foldColor.difs0000.y;
if (zc.x < max(zc.y, zc.z))
aux.color += fractal->foldColor.difs0000.z;
if (zc.z < max(zc.y, zc.x))
aux.color += fractal->foldColor.difs0000.w;*/

if (fractal->foldColor.difs0 != 0.0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,15 @@ void cFractalTransfDIFSCylinder::FormulaCode(
// swap axis
if (fractal->transformCommon.functionEnabledSwFalse) swap(zc.x, zc.z);

double xyR = sqrt(zc.x * zc.x + zc.y * zc.y);
double cylR = xyR - fractal->transformCommon.radius1;
double xyR = sqrt(zc.x * zc.x + zc.y * zc.y)- fractal->transformCommon.radius1;
double cylR = xyR;
if (fractal->transformCommon.functionEnabledFalse)
{
cylR = fabs(cylR) - fractal->transformCommon.offset0;
if (fractal->transformCommon.functionEnabledAFalse)
cylR = max(cylR, xyR);
}

double cylH = fabs(zc.z) - fractal->transformCommon.offsetA1;

cylR = max(cylR, 0.0);
Expand All @@ -64,8 +69,7 @@ void cFractalTransfDIFSCylinder::FormulaCode(
{
if (fractal->transformCommon.offsetA1 < fabs(zc.z))
aux.color += fractal->foldColor.difs0000.y;
if (fractal->transformCommon.radius1 - fractal->transformCommon.offset0
>= xyR)
if (xyR < -fractal->transformCommon.offset0)
aux.color += fractal->foldColor.difs0000.z;
if (fractal->transformCommon.offsetA1 - fractal->foldColor.difs0 < fabs(zc.z)) aux.color += fractal->foldColor.difs0000.w;
}
Expand Down
17 changes: 13 additions & 4 deletions mandelbulber2/formula/opencl/transf_difs_box.cl
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,24 @@ REAL4 TransfDIFSBoxIteration(REAL4 z, __constant sFractalCl *fractal, sExtendedA
if (fractal->foldColor.auxColorEnabledFalse && aux->i >= fractal->foldColor.startIterationsA
&& aux->i < fractal->foldColor.stopIterationsA)
{
if (colDist != aux->dist) aux->color += fractal->foldColor.difs0000.x;
if (fractal->foldColor.auxColorEnabledAFalse)
if (!fractal->foldColor.auxColorEnabledAFalse)
{
if (fractal->foldColor.difs0000.y != 0.0f && zc.x == fabs(q.x))
if (colDist != aux->dist) aux->color += fractal->foldColor.difs0000.x;
}
else
{
if (zc.x > max(zc.y, zc.z))
aux->color += fractal->foldColor.difs0000.y;
if (zc.y > max(zc.x, zc.z))
aux->color += fractal->foldColor.difs0000.z;
if (zc.z > max(zc.y, zc.x))
aux->color += fractal->foldColor.difs0000.w;
/*if (fractal->foldColor.difs0000.y != 0.0f && zc.x == fabs(q.x)) // will color "round"
aux->color += fractal->foldColor.difs0000.y;
if (fractal->foldColor.difs0000.z != 0.0f && zc.y == fabs(q.y))
aux->color += fractal->foldColor.difs0000.z;
if (fractal->foldColor.difs0000.w != 0.0f && zc.z == fabs(q.z))
aux->color += fractal->foldColor.difs0000.w;
aux->color += fractal->foldColor.difs0000.w;*/

if (fractal->foldColor.difs0 != 0.0)
{
Expand Down
7 changes: 5 additions & 2 deletions mandelbulber2/formula/opencl/transf_difs_box_v2.cl
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ REAL4 TransfDIFSBoxV2Iteration(REAL4 z, __constant sFractalCl *fractal, sExtende
if (fractal->foldColor.auxColorEnabledFalse && aux->i >= fractal->foldColor.startIterationsA
&& aux->i < fractal->foldColor.stopIterationsA)
{
if (colDist != aux->dist) aux->color += fractal->foldColor.difs0000.x;
if (fractal->foldColor.auxColorEnabledAFalse)
if (!fractal->foldColor.auxColorEnabledAFalse)
{
if (colDist != aux->dist) aux->color += fractal->foldColor.difs0000.x;
}
else
{
if (fractal->foldColor.difs0000.y != 0.0f && zc.x == fabs(q.x))
aux->color += fractal->foldColor.difs0000.y;
Expand Down
15 changes: 12 additions & 3 deletions mandelbulber2/formula/opencl/transf_difs_box_v3.cl
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,23 @@ REAL4 TransfDIFSBoxV3Iteration(REAL4 z, __constant sFractalCl *fractal, sExtende
if (fractal->foldColor.auxColorEnabledFalse && aux->i >= fractal->foldColor.startIterationsA
&& aux->i < fractal->foldColor.stopIterationsA)
{
if (colDist != aux->dist) aux->color += fractal->foldColor.difs0000.x;
if (fractal->foldColor.auxColorEnabledAFalse)
if (!fractal->foldColor.auxColorEnabledAFalse)
{
if (fractal->foldColor.difs0000.y != 0.0f && zc.x == fabs(q.x))
if (colDist != aux->dist) aux->color += fractal->foldColor.difs0000.x;
}
else
{
/* if (fractal->foldColor.difs0000.y != 0.0f && zc.x == fabs(q.x) && (zc.x > max(zc.y, zc.z)))
aux->color += fractal->foldColor.difs0000.y;
if (fractal->foldColor.difs0000.z != 0.0f && zc.y == fabs(q.y))
aux->color += fractal->foldColor.difs0000.z;
if (fractal->foldColor.difs0000.w != 0.0f && zc.z == fabs(q.z))
aux->color += fractal->foldColor.difs0000.w;*/
if (zc.x > max(zc.y, zc.z))
aux->color += fractal->foldColor.difs0000.y;
if (zc.y > max(zc.x, zc.z))
aux->color += fractal->foldColor.difs0000.z;
if (zc.z > max(zc.y, zc.x))
aux->color += fractal->foldColor.difs0000.w;

if (fractal->foldColor.difs0 != 0.0)
Expand Down
11 changes: 7 additions & 4 deletions mandelbulber2/formula/opencl/transf_difs_cylinder.cl
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ REAL4 TransfDIFSCylinderIteration(REAL4 z, __constant sFractalCl *fractal, sExte
zc.x = zc.z;
zc.z = temp;
}
REAL xyR = native_sqrt(zc.x * zc.x + zc.y * zc.y);
REAL cylR = xyR - fractal->transformCommon.radius1;
REAL xyR = sqrt(zc.x * zc.x + zc.y * zc.y)- fractal->transformCommon.radius1;
REAL cylR = xyR;
if (fractal->transformCommon.functionEnabledFalse)
{
cylR = fabs(cylR) - fractal->transformCommon.offset0;
if (fractal->transformCommon.functionEnabledAFalse)
cylR = max(cylR, xyR);
}
REAL cylH = fabs(zc.z) - fractal->transformCommon.offsetA1;

cylR = max(cylR, 0.0f);
Expand All @@ -55,8 +59,7 @@ REAL4 TransfDIFSCylinderIteration(REAL4 z, __constant sFractalCl *fractal, sExte
{
if (fractal->transformCommon.offsetA1 < fabs(zc.z))
aux->color += fractal->foldColor.difs0000.y;
if (fractal->transformCommon.radius1 - fractal->transformCommon.offset0
>= xyR)
if (xyR < -fractal->transformCommon.offset0)
aux->color += fractal->foldColor.difs0000.z;
if (fractal->transformCommon.offsetA1 - fractal->foldColor.difs0 < fabs(zc.z)) aux->color += fractal->foldColor.difs0000.w;
}
Expand Down
19 changes: 18 additions & 1 deletion mandelbulber2/formula/ui/transf_difs_box.ui
Original file line number Diff line number Diff line change
Expand Up @@ -593,5 +593,22 @@
<tabstop>groupCheck_info</tabstop>
</tabstops>
<resources/>
<connections/>
<connections>
<connection>
<sender>groupCheck_fold_color_aux_color_enabledA_false</sender>
<signal>toggled(bool)</signal>
<receiver>spinbox4_fold_color_difs_0000_x</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>15</x>
<y>219</y>
</hint>
<hint type="destinationlabel">
<x>205</x>
<y>189</y>
</hint>
</hints>
</connection>
</connections>
</ui>
19 changes: 18 additions & 1 deletion mandelbulber2/formula/ui/transf_difs_box_v2.ui
Original file line number Diff line number Diff line change
Expand Up @@ -945,5 +945,22 @@
<tabstop>groupCheck_info</tabstop>
</tabstops>
<resources/>
<connections/>
<connections>
<connection>
<sender>groupCheck_fold_color_aux_color_enabledA_false</sender>
<signal>toggled(bool)</signal>
<receiver>spinbox4_fold_color_difs_0000_x</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>11</x>
<y>473</y>
</hint>
<hint type="destinationlabel">
<x>234</x>
<y>450</y>
</hint>
</hints>
</connection>
</connections>
</ui>
19 changes: 18 additions & 1 deletion mandelbulber2/formula/ui/transf_difs_box_v3.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1409,5 +1409,22 @@
<tabstop>groupCheck_info</tabstop>
</tabstops>
<resources/>
<connections/>
<connections>
<connection>
<sender>groupCheck_fold_color_aux_color_enabledA_false</sender>
<signal>toggled(bool)</signal>
<receiver>spinbox4_fold_color_difs_0000_x</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>26</x>
<y>834</y>
</hint>
<hint type="destinationlabel">
<x>257</x>
<y>798</y>
</hint>
</hints>
</connection>
</connections>
</ui>
Loading

0 comments on commit 5d0b2c7

Please sign in to comment.