Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master' into win64qt
Browse files Browse the repository at this point in the history
  • Loading branch information
buddhi1980 committed Sep 9, 2024
2 parents 30403d9 + 5d0b2c7 commit 6ff1833
Show file tree
Hide file tree
Showing 48 changed files with 5,544 additions and 211 deletions.
3 changes: 3 additions & 0 deletions mandelbulber2/formula/definition/all_fractal_definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ FRACTAL_CLASS(cFractalTransfDIFSBox)
FRACTAL_CLASS(cFractalTransfDIFSBoxFrame)
FRACTAL_CLASS(cFractalTransfDIFSBoxV2)
FRACTAL_CLASS(cFractalTransfDIFSBoxV3)

FRACTAL_CLASS(cFractalTransfDIFSCayley2)
FRACTAL_CLASS(cFractalTransfDIFSChessboard)
FRACTAL_CLASS(cFractalTransfDIFSClipCustom)
Expand All @@ -336,6 +337,8 @@ FRACTAL_CLASS(cFractalTransfDIFSHexprism)
FRACTAL_CLASS(cFractalTransfDIFSHexprismV2)
FRACTAL_CLASS(cFractalTransfDIFSHextgrid2)
FRACTAL_CLASS(cFractalTransfDIFSHybridColor)
FRACTAL_CLASS(cFractalTransfDIFSOctahedron)
FRACTAL_CLASS(cFractalTransfDIFSOctahedronV2)
FRACTAL_CLASS(cFractalTransfDIFSPiriform)
FRACTAL_CLASS(cFractalTransfDIFSPolyhedra)
FRACTAL_CLASS(cFractalTransfDIFSPolyhedraV2)
Expand Down
3 changes: 2 additions & 1 deletion mandelbulber2/formula/definition/all_fractal_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,8 @@ void DefineFractalList(QList<cAbstractFractal *> *fractalList)
fractalList->append(new cFractalTesting4d());
fractalList->append(new cFractalTestingTransform());
fractalList->append(new cFractalTestingTransform2());

fractalList->append(new cFractalTransfDIFSOctahedron());
fractalList->append(new cFractalTransfDIFSOctahedronV2());
fractalList->append(new cFractalPseudoKleinianMod7());
fractalList->append(new cFractalTinkerTowers());

Expand Down
6 changes: 5 additions & 1 deletion mandelbulber2/formula/definition/all_fractal_list_enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,14 @@ enum enumFractalFormula
transfDIFSHelixMenger = 1638,
transfDIFSChessboard = 1639,
transfDIFSTorusMenger = 1640,

// 2.32
transfDIFSSupershape = 1641,


// 2.33
transfDIFSOctahedron = 1642,
transfDIFSOctahedronV2 = 1643,

// hybrid color
transfHybridColor = 2000,
transfHybridColor2 = 2001,
Expand Down
6 changes: 5 additions & 1 deletion mandelbulber2/formula/definition/fractal_mandelbulb_quat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ void cFractalMandelbulbQuat::FormulaCode(CVector4 &z, const sFractal *fractal, s
case multi_OrderOfZYX_xzy: v = CVector3(z.x, z.z, z.y); break;
case multi_OrderOfZYX_xyz: v = CVector3(z.x, z.y, z.z); break;
}

if (v.x * v.x + v.y * v.y == 0.0)
{
v.y = v.z * v.z;
v.z = 0.0;
}
if (fractal->sinTan2Trig.asinOrAcos == multi_asinOrAcos_asin)
th0 += asin(v.x / aux.r);
else
Expand Down
34 changes: 29 additions & 5 deletions mandelbulber2/formula/definition/fractal_transf_difs_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,42 @@ cFractalTransfDIFSBox::cFractalTransfDIFSBox() : cAbstractFractal()

void cFractalTransfDIFSBox::FormulaCode(CVector4 &z, const sFractal *fractal, sExtendedAux &aux)
{
CVector4 zc = z;
CVector4 boxSize = fractal->transformCommon.additionConstant111;
zc = fabs(zc) - boxSize;
CVector4 q = fabs(z) - fractal->transformCommon.additionConstant111;
CVector4 zc = q;
zc.x = max(zc.x, 0.0);
zc.y = max(zc.y, 0.0);
zc.z = max(zc.z, 0.0);
double zcd = zc.Length();
double colDist = aux.dist;
aux.dist = min(aux.dist, zcd / (aux.DE + 1.0) - fractal->transformCommon.offsetB0);

if (fractal->foldColor.auxColorEnabledFalse)
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 (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;*/

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;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,16 @@ void cFractalTransfDIFSBoxFrame::FormulaCode(
else
aux.dist = D;

if (fractal->foldColor.auxColorEnabledFalse
&& aux.i >= fractal->foldColor.startIterationsA
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 (q.y < max(q.x, q.z)) aux.color += fractal->foldColor.difs0000.y;
if (q.x < max(q.y, q.z)) aux.color += fractal->foldColor.difs0000.z;
if (q.z < max(q.y, q.x)) aux.color += fractal->foldColor.difs0000.w;
}
}

if (fractal->transformCommon.functionEnabledZcFalse
Expand Down
35 changes: 27 additions & 8 deletions mandelbulber2/formula/definition/fractal_transf_difs_box_v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,36 @@ void cFractalTransfDIFSBoxV2::FormulaCode(CVector4 &z, const sFractal *fractal,
boxSize.y -= subZ;
}

zc = fabs(zc) - boxSize;
zc.x = max(zc.x, 0.0);
zc.y = max(zc.y, 0.0);
zc.z = max(zc.z, 0.0);
CVector4 q = fabs(zc) - boxSize;
zc.x = max(q.x, 0.0);
zc.y = max(q.y, 0.0);
zc.z = max(q.z, 0.0);
double zcd = zc.Length();

double colDist = aux.dist;
aux.dist = min(aux.dist, zcd / (aux.DE + 1.0));

/* if (!fractal->transformCommon.functionEnabledEFalse)
aux.dist = min(aux.dist, zcd / (aux.DE + 1.0));
if (fractal->foldColor.auxColorEnabledFalse && aux.i >= fractal->foldColor.startIterationsA
&& aux.i < fractal->foldColor.stopIterationsA)
{
if (!fractal->foldColor.auxColorEnabledAFalse)
{
if (colDist != aux.dist) aux.color += fractal->foldColor.difs0000.x;
}
else
aux.dist = min(aux.dist, zcd / (aux.DE + 1.0) - fractal->transformCommon.offsetB0);
}*/
{
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;

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;
}
}
}
}
28 changes: 27 additions & 1 deletion mandelbulber2/formula/definition/fractal_transf_difs_box_v3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,40 @@ void cFractalTransfDIFSBoxV3::FormulaCode(CVector4 &z, const sFractal *fractal,
zc.y = s * swap + c * zc.y;
}

zc = fabs(zc) - boxSize;
CVector4 q = fabs(zc) - boxSize;
zc = q;
zc.x = max(zc.x, 0.0);
zc.y = max(zc.y, 0.0);
zc.z = max(zc.z, 0.0);
double zcd = zc.Length();

double colDist = aux.dist;
if (!fractal->transformCommon.functionEnabledEFalse)
aux.dist = min(aux.dist, zcd / (aux.DE + 1.0));
else
aux.dist = min(aux.dist, zcd / (aux.DE + 1.0) - fractal->transformCommon.offsetB0);

if (fractal->foldColor.auxColorEnabledFalse && aux.i >= fractal->foldColor.startIterationsA
&& aux.i < fractal->foldColor.stopIterationsA)
{
if (!fractal->foldColor.auxColorEnabledAFalse)
{
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.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;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,37 @@ void cFractalTransfDIFSCylinder::FormulaCode(
// swap axis
if (fractal->transformCommon.functionEnabledSwFalse) swap(zc.x, zc.z);

double cylR = sqrt(zc.x * zc.x + zc.y * zc.y) - 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);
cylH = max(cylH, 0.0);
double cylD = sqrt(cylR * cylR + cylH * cylH);
cylD = min(max(cylR, cylH), 0.0) + cylD;

double colDist = aux.dist;
aux.dist = min(aux.dist, cylD / (aux.DE + 1.0));

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->transformCommon.offsetA1 < fabs(zc.z))
aux.color += fractal->foldColor.difs0000.y;
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;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ void cFractalTransfDIFSCylinderV2::FormulaCode(
double cylR = zc.x * zc.x;
double absH = fabs(zc.z);
double lengthCyl = zc.z;

cylR = sqrt(cylR + zc.y * zc.y);

double cylH = absH - fractal->transformCommon.offsetA1;

// no absz
Expand Down Expand Up @@ -102,9 +102,25 @@ void cFractalTransfDIFSCylinderV2::FormulaCode(
cylD = sqrt(cylRm * cylRm + cylH * cylH);
}
cylD = min(max(cylRm, cylH) - fractal->transformCommon.offsetR0, 0.0) + cylD;

double colDist = aux.dist;
aux.dist = min(aux.dist, cylD / (aux.DE + 1.0));

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->transformCommon.offsetA1 < fabs(zc.z))
aux.color += fractal->foldColor.difs0000.y;
if (fractal->transformCommon.radius1 - fractal->transformCommon.offset0
>= cylR)
aux.color += fractal->foldColor.difs0000.z;
if (fractal->transformCommon.offsetA1 - fractal->foldColor.difs0 < zc.z) aux.color += fractal->foldColor.difs0000.w;
}
}

if (fractal->transformCommon.functionEnabledZcFalse
&& aux.i >= fractal->transformCommon.startIterationsZc
&& aux.i < fractal->transformCommon.stopIterationsZc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ void cFractalTransfDIFSHexprism::FormulaCode(CVector4 &z, const sFractal *fracta
dx = tp * sign(zc.y - lenX);
dy = zc.z - lenY;

double colIn = 0.0;
if (fractal->transformCommon.functionEnabledDFalse)
{
colIn = dx + fractal->transformCommon.offset0;
dx = fabs(dx) - fractal->transformCommon.offset0;
}

double maxdx = max(dx, 0.0);
double maxdy = max(dy, 0.0);
Expand All @@ -78,8 +82,16 @@ void cFractalTransfDIFSHexprism::FormulaCode(CVector4 &z, const sFractal *fracta
double colDist = aux.dist;
aux.dist = min(aux.dist, aux.DE0 / (aux.DE + 1.0));

if (fractal->foldColor.auxColorEnabledFalse)
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 (lenY < zc.z) aux.color += fractal->foldColor.difs0000.y;
if (colIn < maxdx)aux.color += fractal->foldColor.difs0000.z;
if (lenY - fractal->foldColor.difs0 < zc.z && colIn > maxdx) aux.color += fractal->foldColor.difs0000.w;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,36 @@ void cFractalTransfDIFSHexprismV2::FormulaCode(CVector4 &z, const sFractal *frac
&& aux.i < fractal->transformCommon.stopIterationsO)
k.y = fractal->transformCommon.offsetF0;
}

double colIn = 0.0;
if (fractal->transformCommon.functionEnabledDFalse)
{
colIn = dx + fractal->transformCommon.offset0;
dx = fabs(dx) - fractal->transformCommon.offset0;
}


double maxdx = max(dx, k.x);
double maxdy = max(dy, k.y);

tp = sqrt(maxdx * maxdx + maxdy * maxdy);
aux.DE0 = min(max(dx, dy), 0.0) + tp;
double colDist = aux.dist;
aux.dist = min(aux.dist, aux.DE0 / (aux.DE + 1.0));

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->transformCommon.offsetA1 < zc.z) aux.color += fractal->foldColor.difs0000.y;
if (colIn < maxdx)aux.color += fractal->foldColor.difs0000.z;
if (fractal->transformCommon.offsetA1 - fractal->foldColor.difs0 < zc.z && colIn > maxdx) aux.color += fractal->foldColor.difs0000.w;
}
}


if (fractal->transformCommon.functionEnabledZcFalse
&& aux.i >= fractal->transformCommon.startIterationsZc
&& aux.i < fractal->transformCommon.stopIterationsZc)
Expand Down
Loading

0 comments on commit 6ff1833

Please sign in to comment.