mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-02-23 13:31:31 -05:00
Merge branch 'osx-opencl' of https://github.com/gh2k/fractorium
This commit is contained in:
commit
fa6ec63447
@ -202,7 +202,7 @@ public:
|
|||||||
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / Zeps(precalcSqrtSumSquares);\n"
|
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / Zeps(precalcSqrtSumSquares);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = (vIn.x - vIn.y) * (vIn.x + vIn.y) * r;\n"
|
<< "\t\tvOut.x = (vIn.x - vIn.y) * (vIn.x + vIn.y) * r;\n"
|
||||||
<< "\t\tvOut.y = 2.0 * vIn.x * vIn.y * r;\n"
|
<< "\t\tvOut.y = (real_t)(2.0) * vIn.x * vIn.y * r;\n"
|
||||||
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
@ -239,7 +239,7 @@ public:
|
|||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (precalcAtanxy * M_1_PI);\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (precalcAtanxy * M_1_PI);\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (precalcSqrtSumSquares - 1.0);\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (precalcSqrtSumSquares - (real_t)(1.0));\n"
|
||||||
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
@ -610,7 +610,7 @@ public:
|
|||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * sqrt(precalcSqrtSumSquares);\n"
|
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * sqrt(precalcSqrtSumSquares);\n"
|
||||||
<< "\t\treal_t a = 0.5 * precalcAtanxy;\n"
|
<< "\t\treal_t a = (real_t)(0.5) * precalcAtanxy;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (MwcNext(mwc) & 1)\n"
|
<< "\t\tif (MwcNext(mwc) & 1)\n"
|
||||||
<< "\t\t a += M_PI;\n"
|
<< "\t\t a += M_PI;\n"
|
||||||
@ -657,8 +657,8 @@ public:
|
|||||||
intmax_t varIndex = IndexInXform();
|
intmax_t varIndex = IndexInXform();
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t nx = vIn.x < 0.0 ? (vIn.x * 2.0) : vIn.x;\n"
|
<< "\t\treal_t nx = vIn.x < (real_t)(0.0) ? (vIn.x * (real_t)(2.0)) : vIn.x;\n"
|
||||||
<< "\t\treal_t ny = vIn.y < 0.0 ? (vIn.y / 2.0) : vIn.y;\n"
|
<< "\t\treal_t ny = vIn.y < (real_t)(0.0) ? (vIn.y / (real_t)(2.0)) : vIn.y;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * nx;\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * nx;\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * ny;\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * ny;\n"
|
||||||
@ -878,7 +878,7 @@ public:
|
|||||||
intmax_t varIndex = IndexInXform();
|
intmax_t varIndex = IndexInXform();
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t dx = xform->m_VariationWeights[" << varIndex << "] * exp(vIn.x - 1.0);\n"
|
<< "\t\treal_t dx = xform->m_VariationWeights[" << varIndex << "] * exp(vIn.x - (real_t)(1.0));\n"
|
||||||
<< "\t\treal_t dy = M_PI * vIn.y;\n"
|
<< "\t\treal_t dy = M_PI * vIn.y;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = dx * cos(dy);\n"
|
<< "\t\tvOut.x = dx * cos(dy);\n"
|
||||||
@ -1074,7 +1074,7 @@ public:
|
|||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t dx = M_PI * Zeps(xform->m_C * xform->m_C);\n"
|
<< "\t\treal_t dx = M_PI * Zeps(xform->m_C * xform->m_C);\n"
|
||||||
<< "\t\treal_t dy = xform->m_F;\n"
|
<< "\t\treal_t dy = xform->m_F;\n"
|
||||||
<< "\t\treal_t dx2 = 0.5 * dx;\n"
|
<< "\t\treal_t dx2 = (real_t)(0.5) * dx;\n"
|
||||||
<< "\t\treal_t a = precalcAtanxy + ((fmod(precalcAtanxy + dy, dx) > dx2) ? -dx2 : dx2);\n"
|
<< "\t\treal_t a = precalcAtanxy + ((fmod(precalcAtanxy + dy, dx) > dx2) ? -dx2 : dx2);\n"
|
||||||
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares;\n"
|
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
@ -1130,7 +1130,7 @@ public:
|
|||||||
string blobDiff = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string blobDiff = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t r = precalcSqrtSumSquares * (" << blobLow << " + " << blobDiff << " * (0.5 + 0.5 * sin(" << blobWaves << " * precalcAtanxy)));\n"
|
<< "\t\treal_t r = precalcSqrtSumSquares * (" << blobLow << " + " << blobDiff << " * ((real_t)(0.5) + (real_t)(0.5) * sin(" << blobWaves << " * precalcAtanxy)));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = (xform->m_VariationWeights[" << varIndex << "] * precalcSina * r);\n"
|
<< "\t\tvOut.x = (xform->m_VariationWeights[" << varIndex << "] * precalcSina * r);\n"
|
||||||
<< "\t\tvOut.y = (xform->m_VariationWeights[" << varIndex << "] * precalcCosa * r);\n"
|
<< "\t\tvOut.y = (xform->m_VariationWeights[" << varIndex << "] * precalcCosa * r);\n"
|
||||||
@ -1408,7 +1408,7 @@ public:
|
|||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t r = precalcSqrtSumSquares;\n"
|
<< "\t\treal_t r = precalcSqrtSumSquares;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tr += -2.0 * " << rings2Val2 << " * (int)((r + " << rings2Val2 << ") / (2.0 * " << rings2Val2 << ")) + r * (1.0 - " << rings2Val2 << ");\n"
|
<< "\t\tr += -(real_t)(2.0) * " << rings2Val2 << " * (int)((r + " << rings2Val2 << ") / ((real_t)(2.0) * " << rings2Val2 << ")) + r * ((real_t)(1.0) - " << rings2Val2 << ");\n"
|
||||||
<< "\t\tvOut.x = (xform->m_VariationWeights[" << varIndex << "] * precalcSina * r);\n"
|
<< "\t\tvOut.x = (xform->m_VariationWeights[" << varIndex << "] * precalcSina * r);\n"
|
||||||
<< "\t\tvOut.y = (xform->m_VariationWeights[" << varIndex << "] * precalcCosa * r);\n"
|
<< "\t\tvOut.y = (xform->m_VariationWeights[" << varIndex << "] * precalcCosa * r);\n"
|
||||||
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
||||||
@ -1471,7 +1471,7 @@ public:
|
|||||||
intmax_t varIndex = IndexInXform();
|
intmax_t varIndex = IndexInXform();
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t r = (xform->m_VariationWeights[" << varIndex << "] * 2.0) / (precalcSqrtSumSquares + 1.0);\n"
|
<< "\t\treal_t r = (xform->m_VariationWeights[" << varIndex << "] * (real_t)(2.0)) / (precalcSqrtSumSquares + (real_t)(1.0));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = r * vIn.x;\n"
|
<< "\t\tvOut.x = r * vIn.x;\n"
|
||||||
<< "\t\tvOut.y = r * vIn.y;\n"
|
<< "\t\tvOut.y = r * vIn.y;\n"
|
||||||
@ -1509,7 +1509,7 @@ public:
|
|||||||
intmax_t varIndex = IndexInXform();
|
intmax_t varIndex = IndexInXform();
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t denom = 0.25 * precalcSumSquares + 1;\n"
|
<< "\t\treal_t denom = (real_t)(0.25) * precalcSumSquares + 1;\n"
|
||||||
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / denom;\n"
|
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / denom;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = r * vIn.x;\n"
|
<< "\t\tvOut.x = r * vIn.x;\n"
|
||||||
@ -1591,7 +1591,7 @@ public:
|
|||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t d = Zeps(" << dist << " - vIn.y * " << vSin << ");\n"
|
<< "\t\treal_t d = Zeps(" << dist << " - vIn.y * " << vSin << ");\n"
|
||||||
<< "\t\treal_t t = 1.0 / d;\n"
|
<< "\t\treal_t t = (real_t)(1.0) / d;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = (xform->m_VariationWeights[" << varIndex << "] * " << dist << " * vIn.x * t);\n"
|
<< "\t\tvOut.x = (xform->m_VariationWeights[" << varIndex << "] * " << dist << " * vIn.x * t);\n"
|
||||||
<< "\t\tvOut.y = (xform->m_VariationWeights[" << varIndex << "] * " << vfCos << " * vIn.y * t);\n"
|
<< "\t\tvOut.y = (xform->m_VariationWeights[" << varIndex << "] * " << vfCos << " * vIn.y * t);\n"
|
||||||
@ -1943,7 +1943,7 @@ public:
|
|||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t angle = MwcNext01(mwc) * M_2PI;\n"
|
<< "\t\treal_t angle = MwcNext01(mwc) * M_2PI;\n"
|
||||||
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - 2.0);\n"
|
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - (real_t)(2.0));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = r * cos(angle);\n"
|
<< "\t\tvOut.x = r * cos(angle);\n"
|
||||||
<< "\t\tvOut.y = r * sin(angle);\n"
|
<< "\t\tvOut.y = r * sin(angle);\n"
|
||||||
@ -1995,7 +1995,7 @@ public:
|
|||||||
string zoom = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string zoom = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t rndG = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - 2.0);\n"
|
<< "\t\treal_t rndG = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - (real_t)(2.0));\n"
|
||||||
<< "\t\treal_t ra = precalcSqrtSumSquares;\n"
|
<< "\t\treal_t ra = precalcSqrtSumSquares;\n"
|
||||||
<< "\t\treal_t tempa = precalcAtanyx + "<< spin << " * rndG;\n"
|
<< "\t\treal_t tempa = precalcAtanyx + "<< spin << " * rndG;\n"
|
||||||
<< "\t\treal_t rz = " << zoom << " * rndG - 1;\n"
|
<< "\t\treal_t rz = " << zoom << " * rndG - 1;\n"
|
||||||
@ -2070,7 +2070,7 @@ public:
|
|||||||
string thickness = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string thickness = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\tint sl = (int)(MwcNext01(mwc) * " << slices << " + 0.5);\n"
|
<< "\t\tint sl = (int)(MwcNext01(mwc) * " << slices << " + (real_t)(0.5));\n"
|
||||||
<< "\t\treal_t a = " << rotation << " + M_2PI * (sl + MwcNext01(mwc) * " << thickness << ") / " << slices << ";\n"
|
<< "\t\treal_t a = " << rotation << " + M_2PI * (sl + MwcNext01(mwc) * " << thickness << ") / " << slices << ";\n"
|
||||||
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * MwcNext01(mwc);\n"
|
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * MwcNext01(mwc);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
@ -2096,8 +2096,8 @@ protected:
|
|||||||
|
|
||||||
m_Params.clear();
|
m_Params.clear();
|
||||||
m_Params.push_back(ParamWithName<T>(&m_Slices, prefix + "pie_slices", 6, INTEGER_NONZERO, 1));
|
m_Params.push_back(ParamWithName<T>(&m_Slices, prefix + "pie_slices", 6, INTEGER_NONZERO, 1));
|
||||||
m_Params.push_back(ParamWithName<T>(&m_Rotation, prefix + "pie_rotation", T(0.5), REAL_CYCLIC, 0, M_2PI));
|
m_Params.push_back(ParamWithName<T>(&m_Rotation, prefix + "pie_rotation", T(0.5), REAL_CYCLIC, 0, M_2PI));
|
||||||
m_Params.push_back(ParamWithName<T>(&m_Thickness, prefix + "pie_thickness", T(0.5), REAL, 0, 1));
|
m_Params.push_back(ParamWithName<T>(&m_Thickness, prefix + "pie_thickness", T(0.5), REAL, 0, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -2158,14 +2158,14 @@ public:
|
|||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t rFactor;\n"
|
<< "\t\treal_t rFactor;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif ((vIn.x == 0.0) && (vIn.y == 0.0))\n"
|
<< "\t\tif ((vIn.x == (real_t)(0.0)) && (vIn.y == (real_t)(0.0)))\n"
|
||||||
<< "\t\t rFactor = 0.0;\n"
|
<< "\t\t rFactor = (real_t)(0.0);\n"
|
||||||
<< "\t\telse\n"
|
<< "\t\telse\n"
|
||||||
<< "\t\t rFactor = pow(precalcSumSquares, " << cpower << ");\n"
|
<< "\t\t rFactor = pow(precalcSumSquares, " << cpower << ");\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\treal_t phi = precalcAtanyx - " << csides << " * floor(precalcAtanyx * " << csidesinv << ");\n"
|
<< "\t\treal_t phi = precalcAtanyx - " << csides << " * floor(precalcAtanyx * " << csidesinv << ");\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (phi > 0.5 * " << csides << ")\n"
|
<< "\t\tif (phi > (real_t)(0.5) * " << csides << ")\n"
|
||||||
<< "\t\t phi -= " << csides << ";\n"
|
<< "\t\t phi -= " << csides << ";\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\treal_t amp = (" << corners << " * (1 / cos(phi) - 1) + " << circle << ") * xform->m_VariationWeights[" << varIndex << "] * rFactor;\n"
|
<< "\t\treal_t amp = (" << corners << " * (1 / cos(phi) - 1) + " << circle << ") * xform->m_VariationWeights[" << varIndex << "] * rFactor;\n"
|
||||||
@ -2257,7 +2257,7 @@ public:
|
|||||||
string c22 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string c22 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t re = 1.0 + " << c1 << " * vIn.x + " << c2 << " * (SQR(vIn.x) - SQR(vIn.y));\n"
|
<< "\t\treal_t re = (real_t)(1.0) + " << c1 << " * vIn.x + " << c2 << " * (SQR(vIn.x) - SQR(vIn.y));\n"
|
||||||
<< "\t\treal_t im = " << c1 << " * vIn.y + " << c22 << " * vIn.x * vIn.y;\n"
|
<< "\t\treal_t im = " << c1 << " * vIn.y + " << c22 << " * vIn.x * vIn.y;\n"
|
||||||
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / Zeps(SQR(re) + SQR(im));\n"
|
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / Zeps(SQR(re) + SQR(im));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
@ -2471,8 +2471,8 @@ public:
|
|||||||
intmax_t varIndex = IndexInXform();
|
intmax_t varIndex = IndexInXform();
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) - 0.5);\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) - (real_t)(0.5));\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) - 0.5);\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) - (real_t)(0.5));\n"
|
||||||
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
@ -2597,14 +2597,14 @@ public:
|
|||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares;\n"
|
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares;\n"
|
||||||
<< "\t\treal_t cr = cos(r);\n"
|
<< "\t\treal_t cr = cos(r);\n"
|
||||||
<< "\t\treal_t icr = 1.0 / cr;\n"
|
<< "\t\treal_t icr = (real_t)(1.0) / cr;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (cr < 0.0)\n"
|
<< "\t\tif (cr < (real_t)(0.0))\n"
|
||||||
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (icr + 1.0);\n"
|
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (icr + (real_t)(1.0));\n"
|
||||||
<< "\t\telse\n"
|
<< "\t\telse\n"
|
||||||
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (icr - 1.0);\n"
|
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (icr - (real_t)(1.0));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
@ -2652,7 +2652,7 @@ public:
|
|||||||
<< "\t\treal_t diff = log10(sinr * sinr) + cosr;\n"
|
<< "\t\treal_t diff = log10(sinr * sinr) + cosr;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (BadVal(diff))\n"
|
<< "\t\tif (BadVal(diff))\n"
|
||||||
<< "\t\t diff = -30.0;\n"
|
<< "\t\t diff = -(real_t)(30.0);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x * diff;\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x * diff;\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.x * (diff - sinr * M_PI);\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.x * (diff - sinr * M_PI);\n"
|
||||||
@ -2855,7 +2855,7 @@ public:
|
|||||||
<< "\t\tt1 = pow(t1, " << n2 << ");\n"
|
<< "\t\tt1 = pow(t1, " << n2 << ");\n"
|
||||||
<< "\t\treal_t t2 = fabs(sin(theta));\n"
|
<< "\t\treal_t t2 = fabs(sin(theta));\n"
|
||||||
<< "\t\tt2 = pow(t2, " << n3 << ");\n"
|
<< "\t\tt2 = pow(t2, " << n3 << ");\n"
|
||||||
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * ((" << rnd << " * MwcNext01(mwc) + (1.0 - " << rnd << ") * precalcSqrtSumSquares) - " << holes << ") * pow(t1 + t2, " << pNeg1N1 << ") / precalcSqrtSumSquares;\n"
|
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * ((" << rnd << " * MwcNext01(mwc) + ((real_t)(1.0) - " << rnd << ") * precalcSqrtSumSquares) - " << holes << ") * pow(t1 + t2, " << pNeg1N1 << ") / precalcSqrtSumSquares;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = r * vIn.x;\n"
|
<< "\t\tvOut.x = r * vIn.x;\n"
|
||||||
<< "\t\tvOut.y = r * vIn.y;\n"
|
<< "\t\tvOut.y = r * vIn.y;\n"
|
||||||
@ -3263,7 +3263,7 @@ public:
|
|||||||
<< "\t\treal_t t = x2y2 + 1;\n"
|
<< "\t\treal_t t = x2y2 + 1;\n"
|
||||||
<< "\t\treal_t x2 = 2 * vIn.x;\n"
|
<< "\t\treal_t x2 = 2 * vIn.x;\n"
|
||||||
<< "\t\treal_t ps = " << s << ";\n"
|
<< "\t\treal_t ps = " << s << ";\n"
|
||||||
<< "\t\treal_t y = 0.5 * atan2(2.0 * vIn.y, x2y2 - 1.0) + ps;\n"
|
<< "\t\treal_t y = (real_t)(0.5) * atan2((real_t)(2.0) * vIn.y, x2y2 - (real_t)(1.0)) + ps;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (y > M_PI_2)\n"
|
<< "\t\tif (y > M_PI_2)\n"
|
||||||
<< "\t\t y = -M_PI_2 + fmod(y + M_PI_2, M_PI);\n"
|
<< "\t\t y = -M_PI_2 + fmod(y + M_PI_2, M_PI);\n"
|
||||||
@ -3416,37 +3416,37 @@ public:
|
|||||||
<< "\t\treal_t offsetX = vIn.x - roundX;\n"
|
<< "\t\treal_t offsetX = vIn.x - roundX;\n"
|
||||||
<< "\t\treal_t offsetY = vIn.y - roundY;\n"
|
<< "\t\treal_t offsetY = vIn.y - roundY;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (MwcNext01(mwc) >= 0.75)\n"
|
<< "\t\tif (MwcNext01(mwc) >= (real_t)(0.75))\n"
|
||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetX * 0.5 + roundX);\n"
|
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX);\n"
|
||||||
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (offsetY * 0.5 + roundY);\n"
|
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY);\n"
|
||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
<< "\t\telse\n"
|
<< "\t\telse\n"
|
||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
<< "\t\t if (fabs(offsetX) >= fabs(offsetY))\n"
|
<< "\t\t if (fabs(offsetX) >= fabs(offsetY))\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t if (offsetX >= 0.0)\n"
|
<< "\t\t if (offsetX >= (real_t)(0.0))\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetX * 0.5 + roundX + 0.25);\n"
|
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX + (real_t)(0.25));\n"
|
||||||
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (offsetY * 0.5 + roundY + 0.25 * offsetY / offsetX);\n"
|
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY + (real_t)(0.25) * offsetY / offsetX);\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t else\n"
|
<< "\t\t else\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetX * 0.5 + roundX - 0.25);\n"
|
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX - (real_t)(0.25));\n"
|
||||||
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (offsetY * 0.5 + roundY - 0.25 * offsetY / offsetX);\n"
|
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY - (real_t)(0.25) * offsetY / offsetX);\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t else\n"
|
<< "\t\t else\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t if (offsetY >= 0.0)\n"
|
<< "\t\t if (offsetY >= (real_t)(0.0))\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (offsetY * 0.5 + roundY + 0.25);\n"
|
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY + (real_t)(0.25));\n"
|
||||||
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetX * 0.5 + roundX + offsetX / offsetY * 0.25);\n"
|
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX + offsetX / offsetY * (real_t)(0.25));\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t else\n"
|
<< "\t\t else\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (offsetY * 0.5 + roundY - 0.25);\n"
|
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY - (real_t)(0.25));\n"
|
||||||
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetX * 0.5 + roundX - offsetX / offsetY * 0.25);\n"
|
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX - offsetX / offsetY * (real_t)(0.25));\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
@ -3486,8 +3486,8 @@ public:
|
|||||||
intmax_t varIndex = IndexInXform();
|
intmax_t varIndex = IndexInXform();
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t wx = xform->m_VariationWeights[" << varIndex << "] * 1.3029400317411197908970256609023;\n"
|
<< "\t\treal_t wx = xform->m_VariationWeights[" << varIndex << "] * (real_t)(1.3029400317411197908970256609023);\n"
|
||||||
<< "\t\treal_t y2 = vIn.y * 2.0;\n"
|
<< "\t\treal_t y2 = vIn.y * (real_t)(2.0);\n"
|
||||||
<< "\t\treal_t r = wx * sqrt(fabs(vIn.y * vIn.x) / Zeps(SQR(vIn.x) + SQR(y2)));\n"
|
<< "\t\treal_t r = wx * sqrt(fabs(vIn.y * vIn.x) / Zeps(SQR(vIn.x) + SQR(y2)));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = r * vIn.x;\n"
|
<< "\t\tvOut.x = r * vIn.x;\n"
|
||||||
@ -3569,7 +3569,7 @@ public:
|
|||||||
string size = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string size = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t invCellSize = 1.0 / " << size << ";\n"
|
<< "\t\treal_t invCellSize = (real_t)(1.0) / " << size << ";\n"
|
||||||
//Float to int, orig.
|
//Float to int, orig.
|
||||||
//<< "\t\tint x = (int)floor(vIn.x * invCellSize);\n"
|
//<< "\t\tint x = (int)floor(vIn.x * invCellSize);\n"
|
||||||
//<< "\t\tint y = (int)floor(vIn.y * invCellSize);\n"
|
//<< "\t\tint y = (int)floor(vIn.y * invCellSize);\n"
|
||||||
@ -3675,7 +3675,7 @@ public:
|
|||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t a = precalcAtanyx;\n"
|
<< "\t\treal_t a = precalcAtanyx;\n"
|
||||||
<< "\t\treal_t lnr = 0.5 * log(precalcSumSquares);\n"
|
<< "\t\treal_t lnr = (real_t)(0.5) * log(precalcSumSquares);\n"
|
||||||
<< "\t\treal_t angle = " << c << " * a + " << d << " * lnr + " << ang << " * floor(" << power << " * MwcNext01(mwc));\n"
|
<< "\t\treal_t angle = " << c << " * a + " << d << " * lnr + " << ang << " * floor(" << power << " * MwcNext01(mwc));\n"
|
||||||
<< "\t\treal_t m = xform->m_VariationWeights[" << varIndex << "] * exp(" << c << " * lnr - " << d << " * a);\n"
|
<< "\t\treal_t m = xform->m_VariationWeights[" << varIndex << "] * exp(" << c << " * lnr - " << d << " * a);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
@ -3854,14 +3854,14 @@ public:
|
|||||||
intmax_t varIndex = IndexInXform();
|
intmax_t varIndex = IndexInXform();
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t tmp = precalcSumSquares + 1.0;\n"
|
<< "\t\treal_t tmp = precalcSumSquares + (real_t)(1.0);\n"
|
||||||
<< "\t\treal_t tmp2 = 2.0 * vIn.x;\n"
|
<< "\t\treal_t tmp2 = (real_t)(2.0) * vIn.x;\n"
|
||||||
<< "\t\treal_t r1 = sqrt(tmp + tmp2);\n"
|
<< "\t\treal_t r1 = sqrt(tmp + tmp2);\n"
|
||||||
<< "\t\treal_t r2 = sqrt(tmp - tmp2);\n"
|
<< "\t\treal_t r2 = sqrt(tmp - tmp2);\n"
|
||||||
<< "\t\treal_t xmax = (r1 + r2) * 0.5;\n"
|
<< "\t\treal_t xmax = (r1 + r2) * (real_t)(0.5);\n"
|
||||||
<< "\t\treal_t a1 = log(xmax + sqrt(xmax - 1.0));\n"
|
<< "\t\treal_t a1 = log(xmax + sqrt(xmax - (real_t)(1.0)));\n"
|
||||||
<< "\t\treal_t a2 = -acos(Clamp(vIn.x / xmax, -1.0, 1.0));\n"
|
<< "\t\treal_t a2 = -acos(Clamp(vIn.x / xmax, -(real_t)(1.0), (real_t)(1.0)));\n"
|
||||||
<< "\t\treal_t w = xform->m_VariationWeights[" << varIndex << "] / 11.57034632;\n"
|
<< "\t\treal_t w = xform->m_VariationWeights[" << varIndex << "] / (real_t)(11.57034632);\n"
|
||||||
<< "\t\treal_t snv = sin(a1);\n"
|
<< "\t\treal_t snv = sin(a1);\n"
|
||||||
<< "\t\treal_t csv = cos(a1);\n"
|
<< "\t\treal_t csv = cos(a1);\n"
|
||||||
<< "\t\treal_t snhu = sinh(a2);\n"
|
<< "\t\treal_t snhu = sinh(a2);\n"
|
||||||
@ -3932,12 +3932,12 @@ public:
|
|||||||
string weightDivPiDiv2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string weightDivPiDiv2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t tmp = precalcSumSquares + 1.0;\n"
|
<< "\t\treal_t tmp = precalcSumSquares + (real_t)(1.0);\n"
|
||||||
<< "\t\treal_t x2 = 2.0 * vIn.x;\n"
|
<< "\t\treal_t x2 = (real_t)(2.0) * vIn.x;\n"
|
||||||
<< "\t\treal_t xmax = 0.5 * (sqrt(tmp + x2) + sqrt(tmp - x2));\n"
|
<< "\t\treal_t xmax = (real_t)(0.5) * (sqrt(tmp + x2) + sqrt(tmp - x2));\n"
|
||||||
<< "\t\treal_t a = vIn.x / xmax;\n"
|
<< "\t\treal_t a = vIn.x / xmax;\n"
|
||||||
<< "\t\treal_t b = 1.0 - a * a;\n"
|
<< "\t\treal_t b = (real_t)(1.0) - a * a;\n"
|
||||||
<< "\t\treal_t ssx = xmax - 1.0;\n"
|
<< "\t\treal_t ssx = xmax - (real_t)(1.0);\n"
|
||||||
<< "\t\tconst real_t w = " << weightDivPiDiv2 << ";\n"
|
<< "\t\tconst real_t w = " << weightDivPiDiv2 << ";\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (b < 0)\n"
|
<< "\t\tif (b < 0)\n"
|
||||||
@ -4019,7 +4019,7 @@ public:
|
|||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t a = precalcAtanyx;\n"
|
<< "\t\treal_t a = precalcAtanyx;\n"
|
||||||
<< "\t\treal_t lnr = 0.5 * log(precalcSumSquares);\n"
|
<< "\t\treal_t lnr = (real_t)(0.5) * log(precalcSumSquares);\n"
|
||||||
<< "\t\treal_t m = xform->m_VariationWeights[" << varIndex << "] * exp(" << c << " * lnr - " << d << " * a);\n"
|
<< "\t\treal_t m = xform->m_VariationWeights[" << varIndex << "] * exp(" << c << " * lnr - " << d << " * a);\n"
|
||||||
<< "\t\treal_t n = " << c << " * a + " << d << " * lnr;\n"
|
<< "\t\treal_t n = " << c << " * a + " << d << " * lnr;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
@ -4104,8 +4104,8 @@ public:
|
|||||||
intmax_t varIndex = IndexInXform();
|
intmax_t varIndex = IndexInXform();
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t expx = exp(vIn.x) * 0.5;\n"
|
<< "\t\treal_t expx = exp(vIn.x) * (real_t)(0.5);\n"
|
||||||
<< "\t\treal_t expnx = 0.25 / expx;\n"
|
<< "\t\treal_t expnx = (real_t)(0.25) / expx;\n"
|
||||||
<< "\t\treal_t sn = sin(vIn.y);\n"
|
<< "\t\treal_t sn = sin(vIn.y);\n"
|
||||||
<< "\t\treal_t cn = cos(vIn.y);\n"
|
<< "\t\treal_t cn = cos(vIn.y);\n"
|
||||||
<< "\t\treal_t tmp = Zeps(expx + expnx - cn);\n"
|
<< "\t\treal_t tmp = Zeps(expx + expnx - cn);\n"
|
||||||
@ -4185,7 +4185,7 @@ public:
|
|||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
<< "\t\telse\n"
|
<< "\t\telse\n"
|
||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
<< "\t\t r = 1.0 + " << space << " / Zeps(r);\n"
|
<< "\t\t r = (real_t)(1.0) + " << space << " / Zeps(r);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (r * x + " << x << ");\n"
|
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (r * x + " << x << ");\n"
|
||||||
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (r * y - " << y << ");\n"
|
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (r * y - " << y << ");\n"
|
||||||
@ -4282,7 +4282,7 @@ public:
|
|||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\tif (precalcSumSquares < " << w2 << " && precalcSumSquares != 0)\n"
|
<< "\t\tif (precalcSumSquares < " << w2 << " && precalcSumSquares != 0)\n"
|
||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
<< "\t\t real_t r = xform->m_VariationWeights[" << varIndex << "] * sqrt((" << w2 << " / precalcSumSquares) - 1.0);\n"
|
<< "\t\t real_t r = xform->m_VariationWeights[" << varIndex << "] * sqrt((" << w2 << " / precalcSumSquares) - (real_t)(1.0));\n"
|
||||||
<< "\t\t vOut.x = r * vIn.x;\n"
|
<< "\t\t vOut.x = r * vIn.x;\n"
|
||||||
<< "\t\t vOut.y = r * vIn.y;\n"
|
<< "\t\t vOut.y = r * vIn.y;\n"
|
||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
@ -4464,7 +4464,7 @@ public:
|
|||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t t;\n"
|
<< "\t\treal_t t;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (" << damping << " == 0.0)\n"
|
<< "\t\tif (" << damping << " == (real_t)(0.0))\n"
|
||||||
<< "\t\t t = " << amplitude << " * cos(" << tpf << " * vIn.x) + " << separation << ";\n"
|
<< "\t\t t = " << amplitude << " * cos(" << tpf << " * vIn.x) + " << separation << ";\n"
|
||||||
<< "\t\telse\n"
|
<< "\t\telse\n"
|
||||||
<< "\t\t t = " << amplitude << " * exp(-fabs(vIn.x) * " << damping << ") * cos(" << tpf << " * vIn.x) + " << separation << ";\n"
|
<< "\t\t t = " << amplitude << " * exp(-fabs(vIn.x) * " << damping << ") * cos(" << tpf << " * vIn.x) + " << separation << ";\n"
|
||||||
@ -4681,7 +4681,7 @@ public:
|
|||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t t = precalcSumSquares;\n"
|
<< "\t\treal_t t = precalcSumSquares;\n"
|
||||||
<< "\t\treal_t r = 1.0 / Zeps(precalcSqrtSumSquares * (t + " << invWeight << "));\n"
|
<< "\t\treal_t r = (real_t)(1.0) / Zeps(precalcSqrtSumSquares * (t + " << invWeight << "));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = vIn.x * r;\n"
|
<< "\t\tvOut.x = vIn.x * r;\n"
|
||||||
<< "\t\tvOut.y = vIn.y * r;\n"
|
<< "\t\tvOut.y = vIn.y * r;\n"
|
||||||
@ -4752,12 +4752,12 @@ public:
|
|||||||
string yy = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string yy = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\tif (vIn.x > 0.0)\n"
|
<< "\t\tif (vIn.x > (real_t)(0.0))\n"
|
||||||
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (sqrt(vIn.x * vIn.x + " << xx << ") - vIn.x * " << xInside << ");\n"
|
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (sqrt(vIn.x * vIn.x + " << xx << ") - vIn.x * " << xInside << ");\n"
|
||||||
<< "\t\telse\n"
|
<< "\t\telse\n"
|
||||||
<< "\t\t vOut.x = -(xform->m_VariationWeights[" << varIndex << "] * (sqrt(vIn.x * vIn.x + " << xx << ") + vIn.x * " << xInside << "));\n"
|
<< "\t\t vOut.x = -(xform->m_VariationWeights[" << varIndex << "] * (sqrt(vIn.x * vIn.x + " << xx << ") + vIn.x * " << xInside << "));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (vIn.y > 0.0)\n"
|
<< "\t\tif (vIn.y > (real_t)(0.0))\n"
|
||||||
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (sqrt(vIn.y * vIn.y + " << yy << ") - vIn.y * " << yInside << ");\n"
|
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (sqrt(vIn.y * vIn.y + " << yy << ") - vIn.y * " << yInside << ");\n"
|
||||||
<< "\t\telse\n"
|
<< "\t\telse\n"
|
||||||
<< "\t\t vOut.y = -(xform->m_VariationWeights[" << varIndex << "] * (sqrt(vIn.y * vIn.y + " << yy << ") + vIn.y * " << yInside << "));\n"
|
<< "\t\t vOut.y = -(xform->m_VariationWeights[" << varIndex << "] * (sqrt(vIn.y * vIn.y + " << yy << ") + vIn.y * " << yInside << "));\n"
|
||||||
@ -5003,10 +5003,10 @@ public:
|
|||||||
string warp = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string warp = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t roundx = (real_t)(int)(vIn.x >= 0 ? (vIn.x + 0.5) : (vIn.x - 0.5));\n"
|
<< "\t\treal_t roundx = (real_t)(int)(vIn.x >= 0 ? (vIn.x + (real_t)(0.5)) : (vIn.x - (real_t)(0.5)));\n"
|
||||||
<< "\t\treal_t offsetx = vIn.x - roundx;\n"
|
<< "\t\treal_t offsetx = vIn.x - roundx;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetx * (1.0 - " << space << ") + roundx);\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetx * ((real_t)(1.0) - " << space << ") + roundx);\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + offsetx * offsetx * " << warp << ");\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + offsetx * offsetx * " << warp << ");\n"
|
||||||
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
@ -5077,7 +5077,7 @@ public:
|
|||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t r = precalcSqrtSumSquares;\n"
|
<< "\t\treal_t r = precalcSqrtSumSquares;\n"
|
||||||
<< "\t\treal_t a = precalcAtanyx + " << swirl << " * r;\n"
|
<< "\t\treal_t a = precalcAtanyx + " << swirl << " * r;\n"
|
||||||
<< "\t\treal_t c = floor((" << count << " * a + M_PI) * M_1_PI * 0.5);\n"
|
<< "\t\treal_t c = floor((" << count << " * a + M_PI) * M_1_PI * (real_t)(0.5));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\ta = a * " << compFac << " + c * " << angle << ";\n"
|
<< "\t\ta = a * " << compFac << " + c * " << angle << ";\n"
|
||||||
<< "\t\tr = xform->m_VariationWeights[" << varIndex << "] * (r + " << hole << ");\n"
|
<< "\t\tr = xform->m_VariationWeights[" << varIndex << "] * (r + " << hole << ");\n"
|
||||||
@ -5168,7 +5168,7 @@ public:
|
|||||||
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * pow(precalcSumSquares, " << cn << ");\n"
|
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * pow(precalcSumSquares, " << cn << ");\n"
|
||||||
<< "\t\tint tRand = (int)(" << rn << " * MwcNext01(mwc));\n"
|
<< "\t\tint tRand = (int)(" << rn << " * MwcNext01(mwc));\n"
|
||||||
<< "\t\treal_t a = (precalcAtanyx + M_2PI * tRand) / " << power << ";\n"
|
<< "\t\treal_t a = (precalcAtanyx + M_2PI * tRand) / " << power << ";\n"
|
||||||
<< "\t\treal_t c = floor((" << count << " * a + M_PI) * M_1_PI * 0.5);\n"
|
<< "\t\treal_t c = floor((" << count << " * a + M_PI) * M_1_PI * (real_t)(0.5));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\ta = a * " << cf << " + c * " << angle << ";\n"
|
<< "\t\ta = a * " << cf << " + c * " << angle << ";\n"
|
||||||
<< "\t\tvOut.x = r * cos(a);\n"
|
<< "\t\tvOut.x = r * cos(a);\n"
|
||||||
@ -5259,10 +5259,10 @@ public:
|
|||||||
string swirl = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string swirl = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t r = 1.0 / Zeps(precalcSqrtSumSquares);\n"
|
<< "\t\treal_t r = (real_t)(1.0) / Zeps(precalcSqrtSumSquares);\n"
|
||||||
<< "\t\treal_t a = precalcAtanyx + " << swirl << " * r;\n"
|
<< "\t\treal_t a = precalcAtanyx + " << swirl << " * r;\n"
|
||||||
<< "\t\treal_t c = floor((" << count << " * a + M_PI) * M_1_PI * 0.5);\n"
|
<< "\t\treal_t c = floor((" << count << " * a + M_PI) * M_1_PI * (real_t)(0.5));\n"
|
||||||
<< "\t\treal_t compFac = 1 - " << angle << " * " << count << " * M_1_PI * 0.5;\n"
|
<< "\t\treal_t compFac = 1 - " << angle << " * " << count << " * M_1_PI * (real_t)(0.5);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\ta = a * compFac + c * " << angle << ";\n"
|
<< "\t\ta = a * compFac + c * " << angle << ";\n"
|
||||||
<< "\t\tr = xform->m_VariationWeights[" << varIndex << "] * (r + " << hole << ");\n"
|
<< "\t\tr = xform->m_VariationWeights[" << varIndex << "] * (r + " << hole << ");\n"
|
||||||
@ -5645,11 +5645,11 @@ public:
|
|||||||
intmax_t varIndex = IndexInXform();
|
intmax_t varIndex = IndexInXform();
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t tansin = sin(2.0 * vIn.x);\n"
|
<< "\t\treal_t tansin = sin((real_t)(2.0) * vIn.x);\n"
|
||||||
<< "\t\treal_t tancos = cos(2.0 * vIn.x);\n"
|
<< "\t\treal_t tancos = cos((real_t)(2.0) * vIn.x);\n"
|
||||||
<< "\t\treal_t tansinh = sinh(2.0 * vIn.y);\n"
|
<< "\t\treal_t tansinh = sinh((real_t)(2.0) * vIn.y);\n"
|
||||||
<< "\t\treal_t tancosh = cosh(2.0 * vIn.y);\n"
|
<< "\t\treal_t tancosh = cosh((real_t)(2.0) * vIn.y);\n"
|
||||||
<< "\t\treal_t tanden = 1.0 / (tancos + tancosh);\n"
|
<< "\t\treal_t tanden = (real_t)(1.0) / (tancos + tancosh);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * tanden * tansin;\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * tanden * tansin;\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * tanden * tansinh;\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * tanden * tansinh;\n"
|
||||||
@ -5694,7 +5694,7 @@ public:
|
|||||||
<< "\t\treal_t seccos = cos(vIn.x);\n"
|
<< "\t\treal_t seccos = cos(vIn.x);\n"
|
||||||
<< "\t\treal_t secsinh = sinh(vIn.y);\n"
|
<< "\t\treal_t secsinh = sinh(vIn.y);\n"
|
||||||
<< "\t\treal_t seccosh = cosh(vIn.y);\n"
|
<< "\t\treal_t seccosh = cosh(vIn.y);\n"
|
||||||
<< "\t\treal_t secden = 2.0 / (cos(2.0 * vIn.x) + cosh(2.0 * vIn.y));\n"
|
<< "\t\treal_t secden = (real_t)(2.0) / (cos((real_t)(2.0) * vIn.x) + cosh((real_t)(2.0) * vIn.y));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * secden * seccos * seccosh;\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * secden * seccos * seccosh;\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * secden * secsin * secsinh;\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * secden * secsin * secsinh;\n"
|
||||||
@ -5739,7 +5739,7 @@ public:
|
|||||||
<< "\t\treal_t csccos = cos(vIn.x);\n"
|
<< "\t\treal_t csccos = cos(vIn.x);\n"
|
||||||
<< "\t\treal_t cscsinh = sinh(vIn.y);\n"
|
<< "\t\treal_t cscsinh = sinh(vIn.y);\n"
|
||||||
<< "\t\treal_t csccosh = cosh(vIn.y);\n"
|
<< "\t\treal_t csccosh = cosh(vIn.y);\n"
|
||||||
<< "\t\treal_t cscden = 2.0 / (cosh(2.0 * vIn.y) - cos(2.0 * vIn.x));\n"
|
<< "\t\treal_t cscden = (real_t)(2.0) / (cosh((real_t)(2.0) * vIn.y) - cos((real_t)(2.0) * vIn.x));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cscden * cscsin * csccosh;\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cscden * cscsin * csccosh;\n"
|
||||||
<< "\t\tvOut.y = -(xform->m_VariationWeights[" << varIndex << "] * cscden * csccos * cscsinh);\n"
|
<< "\t\tvOut.y = -(xform->m_VariationWeights[" << varIndex << "] * cscden * csccos * cscsinh);\n"
|
||||||
@ -5780,11 +5780,11 @@ public:
|
|||||||
intmax_t varIndex = IndexInXform();
|
intmax_t varIndex = IndexInXform();
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t cotsin = sin(2.0 * vIn.x);\n"
|
<< "\t\treal_t cotsin = sin((real_t)(2.0) * vIn.x);\n"
|
||||||
<< "\t\treal_t cotcos = cos(2.0 * vIn.x);\n"
|
<< "\t\treal_t cotcos = cos((real_t)(2.0) * vIn.x);\n"
|
||||||
<< "\t\treal_t cotsinh = sinh(2.0 * vIn.y);\n"
|
<< "\t\treal_t cotsinh = sinh((real_t)(2.0) * vIn.y);\n"
|
||||||
<< "\t\treal_t cotcosh = cosh(2.0 * vIn.y);\n"
|
<< "\t\treal_t cotcosh = cosh((real_t)(2.0) * vIn.y);\n"
|
||||||
<< "\t\treal_t cotden = 1.0 / (cotcosh - cotcos);\n"
|
<< "\t\treal_t cotden = (real_t)(1.0) / (cotcosh - cotcos);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cotden * cotsin;\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cotden * cotsin;\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * cotden * -1 * cotsinh;\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * cotden * -1 * cotsinh;\n"
|
||||||
@ -5911,11 +5911,11 @@ public:
|
|||||||
intmax_t varIndex = IndexInXform();
|
intmax_t varIndex = IndexInXform();
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t tanhsin = sin(2.0 * vIn.y);\n"
|
<< "\t\treal_t tanhsin = sin((real_t)(2.0) * vIn.y);\n"
|
||||||
<< "\t\treal_t tanhcos = cos(2.0 * vIn.y);\n"
|
<< "\t\treal_t tanhcos = cos((real_t)(2.0) * vIn.y);\n"
|
||||||
<< "\t\treal_t tanhsinh = sinh(2.0 * vIn.x);\n"
|
<< "\t\treal_t tanhsinh = sinh((real_t)(2.0) * vIn.x);\n"
|
||||||
<< "\t\treal_t tanhcosh = cosh(2.0 * vIn.x);\n"
|
<< "\t\treal_t tanhcosh = cosh((real_t)(2.0) * vIn.x);\n"
|
||||||
<< "\t\treal_t tanhden = 1.0 / (tanhcos + tanhcosh);\n"
|
<< "\t\treal_t tanhden = (real_t)(1.0) / (tanhcos + tanhcosh);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * tanhden * tanhsinh;\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * tanhden * tanhsinh;\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * tanhden * tanhsin;\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * tanhden * tanhsin;\n"
|
||||||
@ -5960,7 +5960,7 @@ public:
|
|||||||
<< "\t\treal_t sechcos = cos(vIn.y);\n"
|
<< "\t\treal_t sechcos = cos(vIn.y);\n"
|
||||||
<< "\t\treal_t sechsinh = sinh(vIn.x);\n"
|
<< "\t\treal_t sechsinh = sinh(vIn.x);\n"
|
||||||
<< "\t\treal_t sechcosh = cosh(vIn.x);\n"
|
<< "\t\treal_t sechcosh = cosh(vIn.x);\n"
|
||||||
<< "\t\treal_t sechden = 2.0 / (cos(2.0 * vIn.y) + cosh(2.0 * vIn.x));\n"
|
<< "\t\treal_t sechden = (real_t)(2.0) / (cos((real_t)(2.0) * vIn.y) + cosh((real_t)(2.0) * vIn.x));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sechden * sechcos * sechcosh;\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sechden * sechcos * sechcosh;\n"
|
||||||
<< "\t\tvOut.y = -(xform->m_VariationWeights[" << varIndex << "] * sechden * sechsin * sechsinh);\n"
|
<< "\t\tvOut.y = -(xform->m_VariationWeights[" << varIndex << "] * sechden * sechsin * sechsinh);\n"
|
||||||
@ -6005,7 +6005,7 @@ public:
|
|||||||
<< "\t\treal_t cschcos = cos(vIn.y);\n"
|
<< "\t\treal_t cschcos = cos(vIn.y);\n"
|
||||||
<< "\t\treal_t cschsinh = sinh(vIn.x);\n"
|
<< "\t\treal_t cschsinh = sinh(vIn.x);\n"
|
||||||
<< "\t\treal_t cschcosh = cosh(vIn.x);\n"
|
<< "\t\treal_t cschcosh = cosh(vIn.x);\n"
|
||||||
<< "\t\treal_t cschden = 2.0 / (cosh(2.0 * vIn.x) - cos(2.0 * vIn.y));\n"
|
<< "\t\treal_t cschden = (real_t)(2.0) / (cosh((real_t)(2.0) * vIn.x) - cos((real_t)(2.0) * vIn.y));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cschden * cschsinh * cschcos;\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cschden * cschsinh * cschcos;\n"
|
||||||
<< "\t\tvOut.y = -(xform->m_VariationWeights[" << varIndex << "] * cschden * cschcosh * cschsin);\n"
|
<< "\t\tvOut.y = -(xform->m_VariationWeights[" << varIndex << "] * cschden * cschcosh * cschsin);\n"
|
||||||
@ -6046,11 +6046,11 @@ public:
|
|||||||
intmax_t varIndex = IndexInXform();
|
intmax_t varIndex = IndexInXform();
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t cothsin = sin(2.0 * vIn.y);\n"
|
<< "\t\treal_t cothsin = sin((real_t)(2.0) * vIn.y);\n"
|
||||||
<< "\t\treal_t cothcos = cos(2.0 * vIn.y);\n"
|
<< "\t\treal_t cothcos = cos((real_t)(2.0) * vIn.y);\n"
|
||||||
<< "\t\treal_t cothsinh = sinh(2.0 * vIn.x);\n"
|
<< "\t\treal_t cothsinh = sinh((real_t)(2.0) * vIn.x);\n"
|
||||||
<< "\t\treal_t cothcosh = cosh(2.0 * vIn.x);\n"
|
<< "\t\treal_t cothcosh = cosh((real_t)(2.0) * vIn.x);\n"
|
||||||
<< "\t\treal_t cothden = 1.0 / (cothcosh - cothcos);\n"
|
<< "\t\treal_t cothden = (real_t)(1.0) / (cothcosh - cothcos);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cothden * cothsinh;\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cothden * cothsinh;\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * cothden * cothsin;\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * cothden * cothsin;\n"
|
||||||
@ -6101,8 +6101,8 @@ public:
|
|||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t s = sin(" << freq << " * vIn.x);\n"
|
<< "\t\treal_t s = sin(" << freq << " * vIn.x);\n"
|
||||||
<< "\t\treal_t t = sin(" << freq << " * vIn.y);\n"
|
<< "\t\treal_t t = sin(" << freq << " * vIn.y);\n"
|
||||||
<< "\t\treal_t dy = vIn.y + " << augerWeight << " * (" << scale << " * s / 2.0 + fabs(vIn.y) * s);\n"
|
<< "\t\treal_t dy = vIn.y + " << augerWeight << " * (" << scale << " * s / (real_t)(2.0) + fabs(vIn.y) * s);\n"
|
||||||
<< "\t\treal_t dx = vIn.x + " << augerWeight << " * (" << scale << " * t / 2.0 + fabs(vIn.x) * t);\n"
|
<< "\t\treal_t dx = vIn.x + " << augerWeight << " * (" << scale << " * t / (real_t)(2.0) + fabs(vIn.x) * t);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + " << symmetry << " * (dx - vIn.x));\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + " << symmetry << " * (dx - vIn.x));\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * dy;\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * dy;\n"
|
||||||
@ -6187,11 +6187,11 @@ public:
|
|||||||
<< "\t\treal_t yy = SQR(vIn.y);\n"
|
<< "\t\treal_t yy = SQR(vIn.y);\n"
|
||||||
<< "\t\treal_t frac = sqrt(yy + SQR(xmw));\n"
|
<< "\t\treal_t frac = sqrt(yy + SQR(xmw));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (frac == 0.0)\n"
|
<< "\t\tif (frac == (real_t)(0.0))\n"
|
||||||
<< "\t\t frac = 1.0;\n"
|
<< "\t\t frac = (real_t)(1.0);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\treal_t avgr = xform->m_VariationWeights[" << varIndex << "] * (" << spr << " * sqrt(sqrt(yy + SQR(xpw)) / frac));\n"
|
<< "\t\treal_t avgr = xform->m_VariationWeights[" << varIndex << "] * (" << spr << " * sqrt(sqrt(yy + SQR(xpw)) / frac));\n"
|
||||||
<< "\t\treal_t avga = (atan2(vIn.y, xmw) - atan2(vIn.y, xpw)) * 0.5;\n"
|
<< "\t\treal_t avga = (atan2(vIn.y, xmw) - atan2(vIn.y, xpw)) * (real_t)(0.5);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = avgr * cos(avga);\n"
|
<< "\t\tvOut.x = avgr * cos(avga);\n"
|
||||||
<< "\t\tvOut.y = avgr * sin(avga);\n"
|
<< "\t\tvOut.y = avgr * sin(avga);\n"
|
||||||
|
@ -30,7 +30,7 @@ public:
|
|||||||
intmax_t varIndex = IndexInXform();
|
intmax_t varIndex = IndexInXform();
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t t = xform->m_VariationWeights[" << varIndex << "] / sqrt(precalcSumSquares + 1.0);\n"
|
<< "\t\treal_t t = xform->m_VariationWeights[" << varIndex << "] / sqrt(precalcSumSquares + (real_t)(1.0));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = vIn.x * t;\n"
|
<< "\t\tvOut.x = vIn.x * t;\n"
|
||||||
<< "\t\tvOut.y = vIn.y * t;\n"
|
<< "\t\tvOut.y = vIn.y * t;\n"
|
||||||
@ -209,8 +209,8 @@ public:
|
|||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
<< "\t\t real_t vx = vIn.x;\n"
|
<< "\t\t real_t vx = vIn.x;\n"
|
||||||
<< "\t\t real_t vy = vIn.y;\n"
|
<< "\t\t real_t vy = vIn.y;\n"
|
||||||
<< "\t\t real_t cx = (floor(vx / " << bwrapsCellsize << ") + 0.5) * " << bwrapsCellsize << ";\n"
|
<< "\t\t real_t cx = (floor(vx / " << bwrapsCellsize << ") + (real_t)(0.5)) * " << bwrapsCellsize << ";\n"
|
||||||
<< "\t\t real_t cy = (floor(vy / " << bwrapsCellsize << ") + 0.5) * " << bwrapsCellsize << ";\n"
|
<< "\t\t real_t cy = (floor(vy / " << bwrapsCellsize << ") + (real_t)(0.5)) * " << bwrapsCellsize << ";\n"
|
||||||
<< "\t\t real_t lx = vx - cx;\n"
|
<< "\t\t real_t lx = vx - cx;\n"
|
||||||
<< "\t\t real_t ly = vy - cy;\n"
|
<< "\t\t real_t ly = vy - cy;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
@ -497,8 +497,8 @@ public:
|
|||||||
<< "\t\treal_t x = floor(vIn.x * " << invSize << ");\n"
|
<< "\t\treal_t x = floor(vIn.x * " << invSize << ");\n"
|
||||||
<< "\t\treal_t y = floor(vIn.y * " << invSize << ");\n"
|
<< "\t\treal_t y = floor(vIn.y * " << invSize << ");\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = " << v << " * (x + " << blurPixelizeScale << " * (MwcNext01(mwc) - 0.5) + 0.5);\n"
|
<< "\t\tvOut.x = " << v << " * (x + " << blurPixelizeScale << " * (MwcNext01(mwc) - (real_t)(0.5)) + (real_t)(0.5));\n"
|
||||||
<< "\t\tvOut.y = " << v << " * (y + " << blurPixelizeScale << " * (MwcNext01(mwc) - 0.5) + 0.5);\n"
|
<< "\t\tvOut.y = " << v << " * (y + " << blurPixelizeScale << " * (MwcNext01(mwc) - (real_t)(0.5)) + (real_t)(0.5));\n"
|
||||||
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
@ -756,7 +756,7 @@ public:
|
|||||||
<< "\t\t if (" << bcbw << " != 0)\n"
|
<< "\t\t if (" << bcbw << " != 0)\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t real_t ang = atan2(y, x);\n"
|
<< "\t\t real_t ang = atan2(y, x);\n"
|
||||||
<< "\t\t real_t omega = (0.2 * " << bcbw << " * MwcNext01(mwc)) + 1;\n"
|
<< "\t\t real_t omega = ((real_t)(0.2) * " << bcbw << " * MwcNext01(mwc)) + 1;\n"
|
||||||
<< "\t\t real_t px = omega * cos(ang);\n"
|
<< "\t\t real_t px = omega * cos(ang);\n"
|
||||||
<< "\t\t real_t py = omega * sin(ang);\n"
|
<< "\t\t real_t py = omega * sin(ang);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
@ -892,8 +892,8 @@ public:
|
|||||||
string v = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params.
|
string v = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params.
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\tvOut.x = " << v << " * (MwcNext01(mwc) - 0.5);\n"
|
<< "\t\tvOut.x = " << v << " * (MwcNext01(mwc) - (real_t)(0.5));\n"
|
||||||
<< "\t\tvOut.y = " << v << " * (MwcNext01(mwc) - 0.5);\n"
|
<< "\t\tvOut.y = " << v << " * (MwcNext01(mwc) - (real_t)(0.5));\n"
|
||||||
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
@ -996,7 +996,7 @@ public:
|
|||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\tvOut.x = vOut.y = 0;\n"
|
<< "\t\tvOut.x = vOut.y = 0;\n"
|
||||||
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - 2.0);\n"
|
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - (real_t)(2.0));\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
return ss.str();
|
return ss.str();
|
||||||
@ -1151,7 +1151,7 @@ public:
|
|||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t angle = MwcNext01(mwc) * M_2PI;\n"
|
<< "\t\treal_t angle = MwcNext01(mwc) * M_2PI;\n"
|
||||||
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - 2.0);\n"
|
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - (real_t)(2.0));\n"
|
||||||
<< "\t\treal_t angle2 = MwcNext01(mwc) * M_PI;\n"
|
<< "\t\treal_t angle2 = MwcNext01(mwc) * M_PI;\n"
|
||||||
<< "\t\treal_t sina = sin(angle);\n"
|
<< "\t\treal_t sina = sin(angle);\n"
|
||||||
<< "\t\treal_t cosa = cos(angle);\n"
|
<< "\t\treal_t cosa = cos(angle);\n"
|
||||||
@ -1244,7 +1244,7 @@ public:
|
|||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t r2 = precalcSumSquares + SQR(vIn.z);\n"
|
<< "\t\treal_t r2 = precalcSumSquares + SQR(vIn.z);\n"
|
||||||
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / Zeps(r2 * " << c2 << " + " << c2x << " * vIn.x - " << c2y << " * vIn.y + " << c2z << " * vIn.z + 1.0);\n"
|
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / Zeps(r2 * " << c2 << " + " << c2x << " * vIn.x - " << c2y << " * vIn.y + " << c2z << " * vIn.z + (real_t)(1.0));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = r * (vIn.x + " << cx << " * r2);\n"
|
<< "\t\tvOut.x = r * (vIn.x + " << cx << " * r2);\n"
|
||||||
<< "\t\tvOut.y = r * (vIn.y - " << cy << " * r2);\n"
|
<< "\t\tvOut.y = r * (vIn.y - " << cy << " * r2);\n"
|
||||||
@ -1423,8 +1423,8 @@ public:
|
|||||||
string cr = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string cr = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t roundX = (real_t)(int)(vIn.x >= 0 ? (int)(vIn.x + 0.5) : (int)(vIn.x - 0.5));\n"
|
<< "\t\treal_t roundX = (real_t)(int)(vIn.x >= 0 ? (int)(vIn.x + (real_t)(0.5)) : (int)(vIn.x - (real_t)(0.5)));\n"
|
||||||
<< "\t\treal_t roundY = (real_t)(int)(vIn.y >= 0 ? (int)(vIn.y + 0.5) : (int)(vIn.y - 0.5));\n"
|
<< "\t\treal_t roundY = (real_t)(int)(vIn.y >= 0 ? (int)(vIn.y + (real_t)(0.5)) : (int)(vIn.y - (real_t)(0.5)));\n"
|
||||||
<< "\t\treal_t offsetX = vIn.x - roundX;\n"
|
<< "\t\treal_t offsetX = vIn.x - roundX;\n"
|
||||||
<< "\t\treal_t offsetY = vIn.y - roundY;\n"
|
<< "\t\treal_t offsetY = vIn.y - roundY;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
@ -1941,8 +1941,8 @@ public:
|
|||||||
string vv2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string vv2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t x = 0.5 * vIn.x + 0.5;\n"
|
<< "\t\treal_t x = (real_t)(0.5) * vIn.x + (real_t)(0.5);\n"
|
||||||
<< "\t\treal_t y = 0.5 * vIn.y + 0.5;\n"
|
<< "\t\treal_t y = (real_t)(0.5) * vIn.y + (real_t)(0.5);\n"
|
||||||
<< "\t\treal_t bx = Fabsmod(" << fr << " * x);\n"
|
<< "\t\treal_t bx = Fabsmod(" << fr << " * x);\n"
|
||||||
<< "\t\treal_t by = Fabsmod(" << fr << " * y);\n"
|
<< "\t\treal_t by = Fabsmod(" << fr << " * y);\n"
|
||||||
<< "\t\treal_t oscnapx = Foscn(" << amountX << ", " << px << ");\n"
|
<< "\t\treal_t oscnapx = Foscn(" << amountX << ", " << px << ");\n"
|
||||||
@ -2172,7 +2172,7 @@ public:
|
|||||||
<< "\t\tvOut.x = vOut.y = vOut.z = 0;\n"
|
<< "\t\tvOut.x = vOut.y = vOut.z = 0;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (MwcNext01(mwc) < " << rootFace << ")\n"
|
<< "\t\tif (MwcNext01(mwc) < " << rootFace << ")\n"
|
||||||
<< "\t\t outPoint->m_Z = max(xform->m_VariationWeights[" << varIndex << "], 0.0);\n"
|
<< "\t\t outPoint->m_Z = max(xform->m_VariationWeights[" << varIndex << "], (real_t)(0.0));\n"
|
||||||
<< "\t\telse\n"
|
<< "\t\telse\n"
|
||||||
<< "\t\t outPoint->m_Z = xform->m_VariationWeights[" << varIndex << "] * MwcNext01(mwc);\n"
|
<< "\t\t outPoint->m_Z = xform->m_VariationWeights[" << varIndex << "] * MwcNext01(mwc);\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
@ -2184,7 +2184,7 @@ public:
|
|||||||
<< "\t\tvOut.y = vIn.y;\n"
|
<< "\t\tvOut.y = vIn.y;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (MwcNext01(mwc) < " << rootFace << ")\n"
|
<< "\t\tif (MwcNext01(mwc) < " << rootFace << ")\n"
|
||||||
<< "\t\t vOut.z = max(xform->m_VariationWeights[" << varIndex << "], 0.0);\n"
|
<< "\t\t vOut.z = max(xform->m_VariationWeights[" << varIndex << "], (real_t)(0.0));\n"
|
||||||
<< "\t\telse\n"
|
<< "\t\telse\n"
|
||||||
<< "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * MwcNext01(mwc);\n"
|
<< "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * MwcNext01(mwc);\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
@ -2236,7 +2236,7 @@ public:
|
|||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t a = M_2PI / (precalcSqrtSumSquares + 1);\n"
|
<< "\t\treal_t a = M_2PI / (precalcSqrtSumSquares + 1);\n"
|
||||||
<< "\t\treal_t r = (precalcAtanyx * M_1_PI + 1) * 0.5;\n"
|
<< "\t\treal_t r = (precalcAtanyx * M_1_PI + 1) * (real_t)(0.5);\n"
|
||||||
<< "\t\treal_t s = sin(a);\n"
|
<< "\t\treal_t s = sin(a);\n"
|
||||||
<< "\t\treal_t c = cos(a);\n"
|
<< "\t\treal_t c = cos(a);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
@ -2293,11 +2293,11 @@ public:
|
|||||||
<< "\t\treal_t temp = vIn.y * " << natLog << ";\n"
|
<< "\t\treal_t temp = vIn.y * " << natLog << ";\n"
|
||||||
<< "\t\treal_t snum1 = sin(temp);\n"
|
<< "\t\treal_t snum1 = sin(temp);\n"
|
||||||
<< "\t\treal_t cnum1 = cos(temp);\n"
|
<< "\t\treal_t cnum1 = cos(temp);\n"
|
||||||
<< "\t\ttemp = (vIn.x * M_PI + vIn.y * " << natLog << ") * -1.0;\n"
|
<< "\t\ttemp = (vIn.x * M_PI + vIn.y * " << natLog << ") * -(real_t)(1.0);\n"
|
||||||
<< "\t\treal_t snum2 = sin(temp);\n"
|
<< "\t\treal_t snum2 = sin(temp);\n"
|
||||||
<< "\t\treal_t cnum2 = cos(temp);\n"
|
<< "\t\treal_t cnum2 = cos(temp);\n"
|
||||||
<< "\t\treal_t eradius1 = exp(vIn.x * " << natLog << ");\n"
|
<< "\t\treal_t eradius1 = exp(vIn.x * " << natLog << ");\n"
|
||||||
<< "\t\treal_t eradius2 = exp((vIn.x * " << natLog << " - vIn.y * M_PI) * -1.0);\n"
|
<< "\t\treal_t eradius2 = exp((vIn.x * " << natLog << " - vIn.y * M_PI) * -(real_t)(1.0));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (eradius1 * cnum1 - eradius2 * cnum2) * " << five << ";\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (eradius1 * cnum1 - eradius2 * cnum2) * " << five << ";\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (eradius1 * snum1 - eradius2 * snum2) * " << five << ";\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (eradius1 * snum1 - eradius2 * snum2) * " << five << ";\n"
|
||||||
@ -2480,7 +2480,7 @@ public:
|
|||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (r > 1)\n"
|
<< "\t\tif (r > 1)\n"
|
||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
<< "\t\t if (MwcNext01(mwc) > 0.5)\n"
|
<< "\t\t if (MwcNext01(mwc) > (real_t)(0.5))\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t d = sqrt(r + vIn.x);\n"
|
<< "\t\t d = sqrt(r + vIn.x);\n"
|
||||||
<< "\t\t vOut.x = " << v2 << " * d;\n"
|
<< "\t\t vOut.x = " << v2 << " * d;\n"
|
||||||
@ -2496,7 +2496,7 @@ public:
|
|||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
<< "\t\telse\n"
|
<< "\t\telse\n"
|
||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
<< "\t\t if (MwcNext01(mwc) > 0.5)\n"
|
<< "\t\t if (MwcNext01(mwc) > (real_t)(0.5))\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t d = sqrt(r + vIn.x);\n"
|
<< "\t\t d = sqrt(r + vIn.x);\n"
|
||||||
<< "\t\t vOut.x = -(" << v2 << " * d);\n"
|
<< "\t\t vOut.x = -(" << v2 << " * d);\n"
|
||||||
@ -4279,12 +4279,12 @@ public:
|
|||||||
<< "\t\treal_t x2cx = " << c2x << " * vIn.x;\n"
|
<< "\t\treal_t x2cx = " << c2x << " * vIn.x;\n"
|
||||||
<< "\t\treal_t y2cy = " << c2y << " * vIn.y;\n"
|
<< "\t\treal_t y2cy = " << c2y << " * vIn.y;\n"
|
||||||
<< "\t\treal_t z2cz = " << c2z << " * vIn.z;\n"
|
<< "\t\treal_t z2cz = " << c2z << " * vIn.z;\n"
|
||||||
<< "\t\treal_t val = Zeps(" << c2 << " * r2 - x2cx - y2cy - z2cz + 1.0);\n"
|
<< "\t\treal_t val = Zeps(" << c2 << " * r2 - x2cx - y2cy - z2cz + (real_t)(1.0));\n"
|
||||||
<< "\t\treal_t d = xform->m_VariationWeights[" << varIndex << "] / val;\n"
|
<< "\t\treal_t d = xform->m_VariationWeights[" << varIndex << "] / val;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = d * (vIn.x * " << s2x << " + " << cx << " * (y2cy + z2cz - r2 - 1.0));\n"
|
<< "\t\tvOut.x = d * (vIn.x * " << s2x << " + " << cx << " * (y2cy + z2cz - r2 - (real_t)(1.0)));\n"
|
||||||
<< "\t\tvOut.y = d * (vIn.y * " << s2y << " + " << cy << " * (x2cx + z2cz - r2 - 1.0));\n"
|
<< "\t\tvOut.y = d * (vIn.y * " << s2y << " + " << cy << " * (x2cx + z2cz - r2 - (real_t)(1.0)));\n"
|
||||||
<< "\t\tvOut.z = d * (vIn.z * " << s2z << " + " << cz << " * (y2cy + x2cx - r2 - 1.0));\n"
|
<< "\t\tvOut.z = d * (vIn.z * " << s2z << " + " << cz << " * (y2cy + x2cx - r2 - (real_t)(1.0)));\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
return ss.str();
|
return ss.str();
|
||||||
@ -4784,8 +4784,8 @@ public:
|
|||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t c0 = " << ax << " / (1 + exp(" << sx << " * vIn.x));\n"
|
<< "\t\treal_t c0 = " << ax << " / (1 + exp(" << sx << " * vIn.x));\n"
|
||||||
<< "\t\treal_t c1 = " << ay << " / (1 + exp(" << sy << " * vIn.y));\n"
|
<< "\t\treal_t c1 = " << ay << " / (1 + exp(" << sy << " * vIn.y));\n"
|
||||||
<< "\t\treal_t x = (2 * (c0 - 0.5));\n"
|
<< "\t\treal_t x = (2 * (c0 - (real_t)(0.5)));\n"
|
||||||
<< "\t\treal_t y = (2 * (c1 - 0.5));\n"
|
<< "\t\treal_t y = (2 * (c1 - (real_t)(0.5)));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = " << vv << " * x;\n"
|
<< "\t\tvOut.x = " << vv << " * x;\n"
|
||||||
<< "\t\tvOut.y = " << vv << " * y;\n"
|
<< "\t\tvOut.y = " << vv << " * y;\n"
|
||||||
@ -5002,8 +5002,8 @@ public:
|
|||||||
string distort = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string distort = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t x = vIn.x * xform->m_VariationWeights[" << varIndex << "] * 0.05;\n"
|
<< "\t\treal_t x = vIn.x * xform->m_VariationWeights[" << varIndex << "] * (real_t)(0.05);\n"
|
||||||
<< "\t\treal_t y = vIn.y * xform->m_VariationWeights[" << varIndex << "] * 0.05;\n"
|
<< "\t\treal_t y = vIn.y * xform->m_VariationWeights[" << varIndex << "] * (real_t)(0.05);\n"
|
||||||
<< "\t\treal_t x2 = SQR(x);\n"
|
<< "\t\treal_t x2 = SQR(x);\n"
|
||||||
<< "\t\treal_t y2 = SQR(y);\n"
|
<< "\t\treal_t y2 = SQR(y);\n"
|
||||||
<< "\t\treal_t xPlusy = x + y;\n"
|
<< "\t\treal_t xPlusy = x + y;\n"
|
||||||
@ -5202,8 +5202,8 @@ public:
|
|||||||
<< "\t\treal_t yn = r * sina;\n"
|
<< "\t\treal_t yn = r * sina;\n"
|
||||||
<< "\t\treal_t siny = sin(" << freqX << " * yn);\n"
|
<< "\t\treal_t siny = sin(" << freqX << " * yn);\n"
|
||||||
<< "\t\treal_t sinx = sin(" << freqY << " * xn);\n"
|
<< "\t\treal_t sinx = sin(" << freqY << " * xn);\n"
|
||||||
<< "\t\treal_t dx = xn + 0.5 * (" << scaleX << " * siny + fabs(xn) * " << incX << " * siny);\n"
|
<< "\t\treal_t dx = xn + (real_t)(0.5) * (" << scaleX << " * siny + fabs(xn) * " << incX << " * siny);\n"
|
||||||
<< "\t\treal_t dy = yn + 0.5 * (" << scaleY << " * sinx + fabs(yn) * " << incY << " * sinx);\n"
|
<< "\t\treal_t dy = yn + (real_t)(0.5) * (" << scaleY << " * sinx + fabs(yn) * " << incY << " * sinx);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * dx;\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * dx;\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * dy;\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * dy;\n"
|
||||||
@ -5418,7 +5418,7 @@ public:
|
|||||||
<< "\t\treal_t dot02 = " << a << " * vIn.x + " << b << " * vIn.y;\n"
|
<< "\t\treal_t dot02 = " << a << " * vIn.x + " << b << " * vIn.y;\n"
|
||||||
<< "\t\treal_t dot11 = SQR(" << c << ") + SQR(" << d << ");\n"
|
<< "\t\treal_t dot11 = SQR(" << c << ") + SQR(" << d << ");\n"
|
||||||
<< "\t\treal_t dot12 = " << c << " * vIn.x + " << d << " * vIn.y;\n"
|
<< "\t\treal_t dot12 = " << c << " * vIn.x + " << d << " * vIn.y;\n"
|
||||||
<< "\t\treal_t invDenom = 1.0 / (dot00 * dot11 - dot01 * dot01);\n"
|
<< "\t\treal_t invDenom = (real_t)(1.0) / (dot00 * dot11 - dot01 * dot01);\n"
|
||||||
<< "\t\treal_t u = (dot11 * dot02 - dot01 * dot12) * invDenom;\n"
|
<< "\t\treal_t u = (dot11 * dot02 - dot01 * dot12) * invDenom;\n"
|
||||||
<< "\t\treal_t v = (dot00 * dot12 - dot01 * dot02) * invDenom;\n"
|
<< "\t\treal_t v = (dot00 * dot12 - dot01 * dot02) * invDenom;\n"
|
||||||
<< "\t\treal_t um = sqrt(SQR(u) + SQR(vIn.x)) * Sign(u);\n"
|
<< "\t\treal_t um = sqrt(SQR(u) + SQR(vIn.x)) * Sign(u);\n"
|
||||||
@ -5531,8 +5531,8 @@ public:
|
|||||||
intmax_t varIndex = IndexInXform();
|
intmax_t varIndex = IndexInXform();
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sin(vIn.x) * (cosh(vIn.y) + 1.0) * Sqr(sin(vIn.x));\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sin(vIn.x) * (cosh(vIn.y) + (real_t)(1.0)) * Sqr(sin(vIn.x));\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * cos(vIn.x) * (cosh(vIn.y) + 1.0) * Sqr(sin(vIn.x));\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * cos(vIn.x) * (cosh(vIn.y) + (real_t)(1.0)) * Sqr(sin(vIn.x));\n"
|
||||||
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
@ -5568,8 +5568,8 @@ public:
|
|||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t d = xform->m_VariationWeights[" << varIndex << "] / precalcSumSquares;\n"
|
<< "\t\treal_t d = xform->m_VariationWeights[" << varIndex << "] / precalcSumSquares;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = d * sin(vIn.x) * (cosh(vIn.y) + 1.0) * Sqr(sin(vIn.x));\n"
|
<< "\t\tvOut.x = d * sin(vIn.x) * (cosh(vIn.y) + (real_t)(1.0)) * Sqr(sin(vIn.x));\n"
|
||||||
<< "\t\tvOut.y = d * cos(vIn.x) * (cosh(vIn.y) + 1.0) * Sqr(sin(vIn.x));\n"
|
<< "\t\tvOut.y = d * cos(vIn.x) * (cosh(vIn.y) + (real_t)(1.0)) * Sqr(sin(vIn.x));\n"
|
||||||
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ public:
|
|||||||
string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t r2 = pow(precalcSumSquares, " << power << " * 0.5) * xform->m_VariationWeights[" << varIndex << "];\n"
|
<< "\t\treal_t r2 = pow(precalcSumSquares, " << power << " * (real_t)(0.5)) * xform->m_VariationWeights[" << varIndex << "];\n"
|
||||||
<< "\t\treal_t ran = (precalcAtanyx / Zeps(" << denominator << ") + (" << root << " * M_2PI * floor(MwcNext01(mwc) * " << denominator << ") / Zeps(" << denominator << "))) * " << numerator << ";\n"
|
<< "\t\treal_t ran = (precalcAtanyx / Zeps(" << denominator << ") + (" << root << " * M_2PI * floor(MwcNext01(mwc) * " << denominator << ") / Zeps(" << denominator << "))) * " << numerator << ";\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = r2 * cos(ran);\n"
|
<< "\t\tvOut.x = r2 * cos(ran);\n"
|
||||||
@ -202,7 +202,7 @@ public:
|
|||||||
string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t u = sqrt(ClampGte(Zeps(" << a << ") * SQR(vIn.x) + Zeps(" << b << ") * SQR(vIn.y), 0.0));\n"
|
<< "\t\treal_t u = sqrt(ClampGte(Zeps(" << a << ") * SQR(vIn.x) + Zeps(" << b << ") * SQR(vIn.y), (real_t)(0.0)));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = cos(u) * tan(vIn.x) * xform->m_VariationWeights[" << varIndex << "];\n"
|
<< "\t\tvOut.x = cos(u) * tan(vIn.x) * xform->m_VariationWeights[" << varIndex << "];\n"
|
||||||
<< "\t\tvOut.y = sin(u) * tan(vIn.y) * xform->m_VariationWeights[" << varIndex << "];\n"
|
<< "\t\tvOut.y = sin(u) * tan(vIn.y) * xform->m_VariationWeights[" << varIndex << "];\n"
|
||||||
@ -528,7 +528,7 @@ public:
|
|||||||
return
|
return
|
||||||
"void GlynnSim1Circle(__constant real_t* radius1, __constant real_t* thickness, __constant real_t* x1, __constant real_t* y1, uint2* mwc, real_t* x, real_t* y)\n"
|
"void GlynnSim1Circle(__constant real_t* radius1, __constant real_t* thickness, __constant real_t* x1, __constant real_t* y1, uint2* mwc, real_t* x, real_t* y)\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" real_t r = *radius1 * (*thickness + (1.0 - *thickness) * MwcNext01(mwc));\n"
|
" real_t r = *radius1 * (*thickness + (T(1.0) - *thickness) * MwcNext01(mwc));\n"
|
||||||
" real_t phi = M_2PI * MwcNext01(mwc);\n"
|
" real_t phi = M_2PI * MwcNext01(mwc);\n"
|
||||||
" real_t sinPhi = sin(phi);\n"
|
" real_t sinPhi = sin(phi);\n"
|
||||||
" real_t cosPhi = cos(phi);\n"
|
" real_t cosPhi = cos(phi);\n"
|
||||||
@ -1243,7 +1243,7 @@ public:
|
|||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t else\n"
|
<< "\t\t else\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t real_t rdc = xr + (MwcNext01(mwc) * 0.5 * " << scatterDist << ");\n"
|
<< "\t\t real_t rdc = xr + (MwcNext01(mwc) * (real_t)(0.5) * " << scatterDist << ");\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * rdc * cos(precalcAtanyx);\n"
|
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * rdc * cos(precalcAtanyx);\n"
|
||||||
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * rdc * sin(precalcAtanyx);\n"
|
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * rdc * sin(precalcAtanyx);\n"
|
||||||
@ -2185,8 +2185,8 @@ public:
|
|||||||
<< "\t\treal_t c1 = Zeps(SQR(vIn.x));\n"
|
<< "\t\treal_t c1 = Zeps(SQR(vIn.x));\n"
|
||||||
<< "\t\treal_t c2 = Zeps(SQR(vIn.y));\n"
|
<< "\t\treal_t c2 = Zeps(SQR(vIn.y));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * ((1.0 / d) * cos(c1) * sin(c2));\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (((real_t)(1.0) / d) * cos(c1) * sin(c2));\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * ((1.0 / d) * sin(c1) * sin(c2));\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (((real_t)(1.0) / d) * sin(c1) * sin(c2));\n"
|
||||||
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
@ -2454,7 +2454,7 @@ protected:
|
|||||||
m_Params.clear();
|
m_Params.clear();
|
||||||
m_Params.push_back(ParamWithName<T>(&m_Power, prefix + "phoenix_julia_power", 2));
|
m_Params.push_back(ParamWithName<T>(&m_Power, prefix + "phoenix_julia_power", 2));
|
||||||
m_Params.push_back(ParamWithName<T>(&m_Dist, prefix + "phoenix_julia_dist", 1));
|
m_Params.push_back(ParamWithName<T>(&m_Dist, prefix + "phoenix_julia_dist", 1));
|
||||||
m_Params.push_back(ParamWithName<T>(&m_XDistort, prefix + "phoenix_julia_x_distort", T(-0.5)));//Original omitted phoenix_ prefix.
|
m_Params.push_back(ParamWithName<T>(&m_XDistort, prefix + "phoenix_julia_x_distort", T(-T(0.5))));//Original omitted phoenix_ prefix.
|
||||||
m_Params.push_back(ParamWithName<T>(&m_YDistort, prefix + "phoenix_julia_y_distort"));
|
m_Params.push_back(ParamWithName<T>(&m_YDistort, prefix + "phoenix_julia_y_distort"));
|
||||||
m_Params.push_back(ParamWithName<T>(true, &m_Cn, prefix + "phoenix_julia_cn"));//Precalc.
|
m_Params.push_back(ParamWithName<T>(true, &m_Cn, prefix + "phoenix_julia_cn"));//Precalc.
|
||||||
m_Params.push_back(ParamWithName<T>(true, &m_InvN, prefix + "phoenix_julia_invn"));
|
m_Params.push_back(ParamWithName<T>(true, &m_InvN, prefix + "phoenix_julia_invn"));
|
||||||
@ -2617,7 +2617,7 @@ public:
|
|||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\tint n;\n"
|
<< "\t\tint n;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\treal_t z = 4.0 * " << dist << " / " << power << ";\n"
|
<< "\t\treal_t z = (real_t)(4.0) * " << dist << " / " << power << ";\n"
|
||||||
<< "\t\treal_t r = pow(precalcSqrtSumSquares, z);\n"
|
<< "\t\treal_t r = pow(precalcSqrtSumSquares, z);\n"
|
||||||
<< "\t\treal_t alpha = precalcAtanyx * " << power << ";\n"
|
<< "\t\treal_t alpha = precalcAtanyx * " << power << ";\n"
|
||||||
<< "\t\treal_t x = r * cos(alpha);\n"
|
<< "\t\treal_t x = r * cos(alpha);\n"
|
||||||
@ -2631,7 +2631,7 @@ public:
|
|||||||
<< "\t\tx = (reU * reV + imU * imV) / radV;\n"
|
<< "\t\tx = (reU * reV + imU * imV) / radV;\n"
|
||||||
<< "\t\ty = (imU * reV - reU * imV) / radV;\n"
|
<< "\t\ty = (imU * reV - reU * imV) / radV;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tz = 1.0 / z;\n"
|
<< "\t\tz = (real_t)(1.0) / z;\n"
|
||||||
<< "\t\tr = pow(sqrt(SQR(x) + SQR(y)), z);\n"
|
<< "\t\tr = pow(sqrt(SQR(x) + SQR(y)), z);\n"
|
||||||
<< "\t\tn = (int)floor(" << power << " * MwcNext01(mwc));\n"
|
<< "\t\tn = (int)floor(" << power << " * MwcNext01(mwc));\n"
|
||||||
<< "\t\talpha = (atan2(y, x) + n * M_2PI) / floor(" << power << ");\n"
|
<< "\t\talpha = (atan2(y, x) + n * M_2PI) / floor(" << power << ");\n"
|
||||||
@ -2899,7 +2899,7 @@ public:
|
|||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t t = (" << max << " - " << min << ") * MwcNext01(mwc) + " << min << ";\n"
|
<< "\t\treal_t t = (" << max << " - " << min << ") * MwcNext01(mwc) + " << min << ";\n"
|
||||||
<< "\t\treal_t y = MwcNext01(mwc) - 0.5;\n"
|
<< "\t\treal_t y = MwcNext01(mwc) - (real_t)(0.5);\n"
|
||||||
<< "\t\treal_t x1 = sin(" << a << " * t + " << d << ");\n"
|
<< "\t\treal_t x1 = sin(" << a << " * t + " << d << ");\n"
|
||||||
<< "\t\treal_t y1 = sin(" << b << " * t);\n"
|
<< "\t\treal_t y1 = sin(" << b << " * t);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
@ -3048,7 +3048,7 @@ public:
|
|||||||
<< "\t\treal_t a = precalcAtanyx;\n"
|
<< "\t\treal_t a = precalcAtanyx;\n"
|
||||||
<< "\t\treal_t t = log(precalcSqrtSumSquares);\n"
|
<< "\t\treal_t t = log(precalcSqrtSumSquares);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (t < 0.0)\n"
|
<< "\t\tif (t < (real_t)(0.0))\n"
|
||||||
<< "\t\t t -= " << sizeDiv2 << ";\n"
|
<< "\t\t t -= " << sizeDiv2 << ";\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tt = fmod(fabs(t), " << size << ");\n"
|
<< "\t\tt = fmod(fabs(t), " << size << ");\n"
|
||||||
@ -3338,11 +3338,11 @@ public:
|
|||||||
string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t tau = 0.5 * (log(Sqr(vIn.x + 1.0) + SQR(vIn.y)) - log(Sqr(vIn.x - 1.0) + SQR(vIn.y)));\n"
|
<< "\t\treal_t tau = (real_t)(0.5) * (log(Sqr(vIn.x + (real_t)(1.0)) + SQR(vIn.y)) - log(Sqr(vIn.x - (real_t)(1.0)) + SQR(vIn.y)));\n"
|
||||||
<< "\t\treal_t sigma = M_PI - atan2(vIn.y, vIn.x + 1.0) - atan2(vIn.y, 1.0 - vIn.x);\n"
|
<< "\t\treal_t sigma = M_PI - atan2(vIn.y, vIn.x + (real_t)(1.0)) - atan2(vIn.y, (real_t)(1.0) - vIn.x);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (tau < " << radius << " && -tau < " << radius << ")\n"
|
<< "\t\tif (tau < " << radius << " && -tau < " << radius << ")\n"
|
||||||
<< "\t\t tau = fmod(tau + " << radius << " + " << dist << " * " << radius << ", 2.0 * " << radius << ") - " << radius << ";\n"
|
<< "\t\t tau = fmod(tau + " << radius << " + " << dist << " * " << radius << ", (real_t)(2.0) * " << radius << ") - " << radius << ";\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\treal_t temp = cosh(tau) - cos(sigma);\n"
|
<< "\t\treal_t temp = cosh(tau) - cos(sigma);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
@ -3407,8 +3407,8 @@ public:
|
|||||||
string out = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string out = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t tau = 0.5 * (log(Sqr(vIn.x + 1.0) + SQR(vIn.y)) - log(Sqr(vIn.x - 1.0) + SQR(vIn.y)));\n"
|
<< "\t\treal_t tau = (real_t)(0.5) * (log(Sqr(vIn.x + (real_t)(1.0)) + SQR(vIn.y)) - log(Sqr(vIn.x - (real_t)(1.0)) + SQR(vIn.y)));\n"
|
||||||
<< "\t\treal_t sigma = M_PI - atan2(vIn.y, vIn.x + 1.0) - atan2(vIn.y, 1.0 - vIn.x);\n"
|
<< "\t\treal_t sigma = M_PI - atan2(vIn.y, vIn.x + (real_t)(1.0)) - atan2(vIn.y, (real_t)(1.0) - vIn.x);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tsigma = sigma + tau * " << out << " + " << in << " / tau;\n"
|
<< "\t\tsigma = sigma + tau * " << out << " + " << in << " / tau;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
@ -3482,8 +3482,8 @@ public:
|
|||||||
string split = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string split = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t tau = 0.5 * (log(Sqr(vIn.x + 1.0) + SQR(vIn.y)) - log(Sqr(vIn.x - 1.0) + SQR(vIn.y))) / " << power << " + " << move << ";\n"
|
<< "\t\treal_t tau = (real_t)(0.5) * (log(Sqr(vIn.x + (real_t)(1.0)) + SQR(vIn.y)) - log(Sqr(vIn.x - (real_t)(1.0)) + SQR(vIn.y))) / " << power << " + " << move << ";\n"
|
||||||
<< "\t\treal_t sigma = M_PI - atan2(vIn.y, vIn.x + 1.0) - atan2(vIn.y, 1.0 - vIn.x) + " << rotate << ";\n"
|
<< "\t\treal_t sigma = M_PI - atan2(vIn.y, vIn.x + (real_t)(1.0)) - atan2(vIn.y, (real_t)(1.0) - vIn.x) + " << rotate << ";\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tsigma = sigma / " << power << " + M_2PI / " << power << " * floor(MwcNext01(mwc) * " << power << ");\n"
|
<< "\t\tsigma = sigma / " << power << " + M_2PI / " << power << " * floor(MwcNext01(mwc) * " << power << ");\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
@ -3567,8 +3567,8 @@ public:
|
|||||||
string piCn = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string piCn = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t tau = 0.5 * (log(Sqr(vIn.x + 1.0) + SQR(vIn.y)) - log(Sqr(vIn.x - 1.0) + SQR(vIn.y)));\n"
|
<< "\t\treal_t tau = (real_t)(0.5) * (log(Sqr(vIn.x + (real_t)(1.0)) + SQR(vIn.y)) - log(Sqr(vIn.x - (real_t)(1.0)) + SQR(vIn.y)));\n"
|
||||||
<< "\t\treal_t sigma = M_PI - atan2(vIn.y, vIn.x + 1.0) - atan2(vIn.y, 1.0 - vIn.x);\n"
|
<< "\t\treal_t sigma = M_PI - atan2(vIn.y, vIn.x + (real_t)(1.0)) - atan2(vIn.y, (real_t)(1.0) - vIn.x);\n"
|
||||||
<< "\t\tint alt = (int)(sigma * " << cnPi << ");\n"
|
<< "\t\tint alt = (int)(sigma * " << cnPi << ");\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (alt % 2 == 0)\n"
|
<< "\t\tif (alt % 2 == 0)\n"
|
||||||
@ -3897,13 +3897,13 @@ public:
|
|||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t tmp = precalcSumSquares + 1;\n"
|
<< "\t\treal_t tmp = precalcSumSquares + 1;\n"
|
||||||
<< "\t\treal_t tmp2 = 2 * vIn.x;\n"
|
<< "\t\treal_t tmp2 = 2 * vIn.x;\n"
|
||||||
<< "\t\treal_t xmax = (SafeSqrt(tmp + tmp2) + SafeSqrt(tmp - tmp2)) * 0.5;\n"
|
<< "\t\treal_t xmax = (SafeSqrt(tmp + tmp2) + SafeSqrt(tmp - tmp2)) * (real_t)(0.5);\n"
|
||||||
<< "\t\tint alt;\n"
|
<< "\t\tint alt;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (xmax < 1)\n"
|
<< "\t\tif (xmax < 1)\n"
|
||||||
<< "\t\t xmax = 1;\n"
|
<< "\t\t xmax = 1;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\treal_t nu = acos(Clamp(vIn.x / xmax, -1.0, 1.0));\n"
|
<< "\t\treal_t nu = acos(Clamp(vIn.x / xmax, -(real_t)(1.0), (real_t)(1.0)));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (vIn.y > 0)\n"
|
<< "\t\tif (vIn.y > 0)\n"
|
||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
@ -4037,13 +4037,13 @@ public:
|
|||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\treal_t tmp = r2 + 1;\n"
|
<< "\t\treal_t tmp = r2 + 1;\n"
|
||||||
<< "\t\treal_t tmp2 = 2 * x;\n"
|
<< "\t\treal_t tmp2 = 2 * x;\n"
|
||||||
<< "\t\treal_t xmax = (SafeSqrt(tmp + tmp2) + SafeSqrt(tmp - tmp2)) * 0.5;\n"
|
<< "\t\treal_t xmax = (SafeSqrt(tmp + tmp2) + SafeSqrt(tmp - tmp2)) * (real_t)(0.5);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (xmax < 1)\n"
|
<< "\t\tif (xmax < 1)\n"
|
||||||
<< "\t\t xmax = 1;\n"
|
<< "\t\t xmax = 1;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\treal_t mu = acosh(xmax);\n"
|
<< "\t\treal_t mu = acosh(xmax);\n"
|
||||||
<< "\t\treal_t nu = acos(Clamp(x / xmax, -1.0, 1.0));\n"
|
<< "\t\treal_t nu = acos(Clamp(x / xmax, -(real_t)(1.0), (real_t)(1.0)));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (vIn.y < 0)\n"
|
<< "\t\tif (vIn.y < 0)\n"
|
||||||
<< "\t\t nu *= -1;\n"
|
<< "\t\t nu *= -1;\n"
|
||||||
@ -4135,13 +4135,13 @@ public:
|
|||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t tmp = precalcSumSquares + 1;\n"
|
<< "\t\treal_t tmp = precalcSumSquares + 1;\n"
|
||||||
<< "\t\treal_t tmp2 = 2 * vIn.x;\n"
|
<< "\t\treal_t tmp2 = 2 * vIn.x;\n"
|
||||||
<< "\t\treal_t xmax = (SafeSqrt(tmp + tmp2) + SafeSqrt(tmp - tmp2)) * 0.5;\n"
|
<< "\t\treal_t xmax = (SafeSqrt(tmp + tmp2) + SafeSqrt(tmp - tmp2)) * (real_t)(0.5);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (xmax < 1)\n"
|
<< "\t\tif (xmax < 1)\n"
|
||||||
<< "\t\t xmax = 1;\n"
|
<< "\t\t xmax = 1;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\treal_t mu = acosh(xmax);\n"
|
<< "\t\treal_t mu = acosh(xmax);\n"
|
||||||
<< "\t\treal_t nu = acos(Clamp(vIn.x / xmax, -1.0, 1.0));\n"
|
<< "\t\treal_t nu = acos(Clamp(vIn.x / xmax, -(real_t)(1.0), (real_t)(1.0)));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (vIn.y < 0)\n"
|
<< "\t\tif (vIn.y < 0)\n"
|
||||||
<< "\t\t nu *= -1;\n"
|
<< "\t\t nu *= -1;\n"
|
||||||
@ -4235,13 +4235,13 @@ public:
|
|||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t tmp = precalcSumSquares + 1;\n"
|
<< "\t\treal_t tmp = precalcSumSquares + 1;\n"
|
||||||
<< "\t\treal_t tmp2 = 2 * vIn.x;\n"
|
<< "\t\treal_t tmp2 = 2 * vIn.x;\n"
|
||||||
<< "\t\treal_t xmax = (SafeSqrt(tmp + tmp2) + SafeSqrt(tmp - tmp2)) * 0.5;\n"
|
<< "\t\treal_t xmax = (SafeSqrt(tmp + tmp2) + SafeSqrt(tmp - tmp2)) * (real_t)(0.5);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (xmax < 1)\n"
|
<< "\t\tif (xmax < 1)\n"
|
||||||
<< "\t\t xmax = 1;\n"
|
<< "\t\t xmax = 1;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\treal_t mu = acosh(xmax);\n"
|
<< "\t\treal_t mu = acosh(xmax);\n"
|
||||||
<< "\t\treal_t nu = acos(Clamp(vIn.x / xmax, -1.0, 1.0));\n"
|
<< "\t\treal_t nu = acos(Clamp(vIn.x / xmax, -(real_t)(1.0), (real_t)(1.0)));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (vIn.y < 0)\n"
|
<< "\t\tif (vIn.y < 0)\n"
|
||||||
<< "\t\t nu *= -1;\n"
|
<< "\t\t nu *= -1;\n"
|
||||||
@ -4332,13 +4332,13 @@ public:
|
|||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t tmp = precalcSumSquares + 1;\n"
|
<< "\t\treal_t tmp = precalcSumSquares + 1;\n"
|
||||||
<< "\t\treal_t tmp2 = 2 * vIn.x;\n"
|
<< "\t\treal_t tmp2 = 2 * vIn.x;\n"
|
||||||
<< "\t\treal_t xmax = (SafeSqrt(tmp + tmp2) + SafeSqrt(tmp - tmp2)) * 0.5;\n"
|
<< "\t\treal_t xmax = (SafeSqrt(tmp + tmp2) + SafeSqrt(tmp - tmp2)) * (real_t)(0.5);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (xmax < 1)\n"
|
<< "\t\tif (xmax < 1)\n"
|
||||||
<< "\t\t xmax = 1;\n"
|
<< "\t\t xmax = 1;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\treal_t mu = acosh(xmax);\n"
|
<< "\t\treal_t mu = acosh(xmax);\n"
|
||||||
<< "\t\treal_t nu = acos(Clamp(vIn.x / xmax, -1.0, 1.0));\n"
|
<< "\t\treal_t nu = acos(Clamp(vIn.x / xmax, -(real_t)(1.0), (real_t)(1.0)));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (vIn.y < 0)\n"
|
<< "\t\tif (vIn.y < 0)\n"
|
||||||
<< "\t\t nu *= -1;\n"
|
<< "\t\t nu *= -1;\n"
|
||||||
@ -4418,12 +4418,12 @@ public:
|
|||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t tmp = precalcSumSquares + 1;\n"
|
<< "\t\treal_t tmp = precalcSumSquares + 1;\n"
|
||||||
<< "\t\treal_t tmp2 = 2 * vIn.x;\n"
|
<< "\t\treal_t tmp2 = 2 * vIn.x;\n"
|
||||||
<< "\t\treal_t xmax = (SafeSqrt(tmp + tmp2) + SafeSqrt(tmp - tmp2)) * 0.5;\n"
|
<< "\t\treal_t xmax = (SafeSqrt(tmp + tmp2) + SafeSqrt(tmp - tmp2)) * (real_t)(0.5);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (xmax < 1)\n"
|
<< "\t\tif (xmax < 1)\n"
|
||||||
<< "\t\t xmax = 1;\n"
|
<< "\t\t xmax = 1;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\treal_t nu = acos(Clamp(vIn.x / xmax, -1.0, 1.0));\n"
|
<< "\t\treal_t nu = acos(Clamp(vIn.x / xmax, -(real_t)(1.0), (real_t)(1.0)));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (vIn.y < 0)\n"
|
<< "\t\tif (vIn.y < 0)\n"
|
||||||
<< "\t\t nu *= -1;\n"
|
<< "\t\t nu *= -1;\n"
|
||||||
@ -4505,13 +4505,13 @@ public:
|
|||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t tmp = precalcSumSquares + 1;\n"
|
<< "\t\treal_t tmp = precalcSumSquares + 1;\n"
|
||||||
<< "\t\treal_t tmp2 = 2 * vIn.x;\n"
|
<< "\t\treal_t tmp2 = 2 * vIn.x;\n"
|
||||||
<< "\t\treal_t xmax = (SafeSqrt(tmp + tmp2) + SafeSqrt(tmp - tmp2)) * 0.5;\n"
|
<< "\t\treal_t xmax = (SafeSqrt(tmp + tmp2) + SafeSqrt(tmp - tmp2)) * (real_t)(0.5);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (xmax < 1)\n"
|
<< "\t\tif (xmax < 1)\n"
|
||||||
<< "\t\t xmax = 1;\n"
|
<< "\t\t xmax = 1;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\treal_t mu = acosh(xmax);\n"
|
<< "\t\treal_t mu = acosh(xmax);\n"
|
||||||
<< "\t\treal_t nu = acos(Clamp(vIn.x / xmax, -1.0, 1.0));\n"
|
<< "\t\treal_t nu = acos(Clamp(vIn.x / xmax, -(real_t)(1.0), (real_t)(1.0)));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (vIn.y < 0)\n"
|
<< "\t\tif (vIn.y < 0)\n"
|
||||||
<< "\t\t nu *= -1;\n"
|
<< "\t\t nu *= -1;\n"
|
||||||
|
@ -51,13 +51,13 @@ public:
|
|||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t tmp = precalcSumSquares + 1;\n"
|
<< "\t\treal_t tmp = precalcSumSquares + 1;\n"
|
||||||
<< "\t\treal_t tmp2 = 2 * vIn.x;\n"
|
<< "\t\treal_t tmp2 = 2 * vIn.x;\n"
|
||||||
<< "\t\treal_t xmax = (SafeSqrt(tmp + tmp2) + SafeSqrt(tmp - tmp2)) * 0.5;\n"
|
<< "\t\treal_t xmax = (SafeSqrt(tmp + tmp2) + SafeSqrt(tmp - tmp2)) * (real_t)(0.5);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (xmax < 1)\n"
|
<< "\t\tif (xmax < 1)\n"
|
||||||
<< "\t\t xmax = 1;\n"
|
<< "\t\t xmax = 1;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\treal_t mu = acosh(xmax);\n"
|
<< "\t\treal_t mu = acosh(xmax);\n"
|
||||||
<< "\t\treal_t nu = acos(Clamp(vIn.x / xmax, -1.0, 1.0));\n"
|
<< "\t\treal_t nu = acos(Clamp(vIn.x / xmax, -(real_t)(1.0), (real_t)(1.0)));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (vIn.y < 0)\n"
|
<< "\t\tif (vIn.y < 0)\n"
|
||||||
<< "\t\t nu *= -1;\n"
|
<< "\t\t nu *= -1;\n"
|
||||||
@ -616,8 +616,8 @@ public:
|
|||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t d = Zeps(precalcSumSquares);\n"
|
<< "\t\treal_t d = Zeps(precalcSumSquares);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = (xform->m_VariationWeights[" << varIndex << "] / d) * (tanh(d) * (2.0 * vIn.x));\n"
|
<< "\t\tvOut.x = (xform->m_VariationWeights[" << varIndex << "] / d) * (tanh(d) * ((real_t)(2.0) * vIn.x));\n"
|
||||||
<< "\t\tvOut.y = (xform->m_VariationWeights[" << varIndex << "] / d) * (cos(d) * (2.0 * vIn.y));\n"
|
<< "\t\tvOut.y = (xform->m_VariationWeights[" << varIndex << "] / d) * (cos(d) * ((real_t)(2.0) * vIn.y));\n"
|
||||||
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
@ -653,8 +653,8 @@ public:
|
|||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t d = Zeps(precalcSumSquares);\n"
|
<< "\t\treal_t d = Zeps(precalcSumSquares);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = (xform->m_VariationWeights[" << varIndex << "] / 2.0) * (tanh(d) * (2.0 * vIn.x));\n"
|
<< "\t\tvOut.x = (xform->m_VariationWeights[" << varIndex << "] / (real_t)(2.0)) * (tanh(d) * ((real_t)(2.0) * vIn.x));\n"
|
||||||
<< "\t\tvOut.y = (xform->m_VariationWeights[" << varIndex << "] / 2.0) * (cos(d) * (2.0 * vIn.y));\n"
|
<< "\t\tvOut.y = (xform->m_VariationWeights[" << varIndex << "] / (real_t)(2.0)) * (cos(d) * ((real_t)(2.0) * vIn.y));\n"
|
||||||
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
@ -1179,8 +1179,8 @@ public:
|
|||||||
<< "\t\tr = r < 0 ? 0 : r;\n"
|
<< "\t\tr = r < 0 ? 0 : r;\n"
|
||||||
<< "\t\tr *= " << s2 << ";\n"
|
<< "\t\tr *= " << s2 << ";\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + (MwcNext01(mwc) - 0.5) * r);\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + (MwcNext01(mwc) - (real_t)(0.5)) * r);\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + (MwcNext01(mwc) - 0.5) * r);\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + (MwcNext01(mwc) - (real_t)(0.5)) * r);\n"
|
||||||
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
@ -1425,7 +1425,7 @@ public:
|
|||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\tint i, j, l, k, m, m1, n, n1;\n"
|
<< "\t\tint i, j, l, k, m, m1, n, n1;\n"
|
||||||
<< "\t\treal_t r, rMin, offsetX, offsetY, x0 = 0.0, y0 = 0.0, x, y;\n"
|
<< "\t\treal_t r, rMin, offsetX, offsetY, x0 = (real_t)(0.0), y0 = (real_t)(0.0), x, y;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\trMin = 20;\n"
|
<< "\t\trMin = 20;\n"
|
||||||
<< "\t\tm = (int)floor(vIn.x / " << step << ");\n"
|
<< "\t\tm = (int)floor(vIn.x / " << step << ");\n"
|
||||||
@ -1661,9 +1661,9 @@ public:
|
|||||||
intmax_t varIndex = IndexInXform();
|
intmax_t varIndex = IndexInXform();
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) - 0.5);\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) - (real_t)(0.5));\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) - 0.5);\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) - (real_t)(0.5));\n"
|
||||||
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) - 0.5);\n"
|
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) - (real_t)(0.5));\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
return ss.str();
|
return ss.str();
|
||||||
@ -2043,7 +2043,7 @@ public:
|
|||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tconst real_t rad = sqrt(SQR(xi) + SQR(yi));\n"
|
<< "\t\tconst real_t rad = sqrt(SQR(xi) + SQR(yi));\n"
|
||||||
<< "\t\tconst real_t ang = atan2(yi, xi);\n"
|
<< "\t\tconst real_t ang = atan2(yi, xi);\n"
|
||||||
<< "\t\tconst real_t rdc = " << radius << " + (MwcNext01(mwc) * 0.5 * " << ca << "); \n"
|
<< "\t\tconst real_t rdc = " << radius << " + (MwcNext01(mwc) * (real_t)(0.5) * " << ca << "); \n"
|
||||||
<< "\t\tconst real_t s = sin(ang);\n"
|
<< "\t\tconst real_t s = sin(ang);\n"
|
||||||
<< "\t\tconst real_t c = cos(ang);\n"
|
<< "\t\tconst real_t c = cos(ang);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
@ -2574,7 +2574,7 @@ public:
|
|||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\tconst real_t zr = Hypot(vIn.z, precalcSqrtSumSquares);\n"
|
<< "\t\tconst real_t zr = Hypot(vIn.z, precalcSqrtSumSquares);\n"
|
||||||
<< "\t\tconst real_t phi = acos(Clamp(vIn.z / zr, -1.0, 1.0));\n"
|
<< "\t\tconst real_t phi = acos(Clamp(vIn.z / zr, -(real_t)(1.0), (real_t)(1.0)));\n"
|
||||||
<< "\t\tconst real_t ps = sin(phi);\n"
|
<< "\t\tconst real_t ps = sin(phi);\n"
|
||||||
<< "\t\tconst real_t pc = cos(phi);\n"
|
<< "\t\tconst real_t pc = cos(phi);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
@ -2739,7 +2739,7 @@ public:
|
|||||||
<< "\t\tconst real_t y = Powq4c(vIn.y, " << power << ");\n"
|
<< "\t\tconst real_t y = Powq4c(vIn.y, " << power << ");\n"
|
||||||
<< "\t\tconst real_t z = Powq4c(vIn.z, " << power << ");\n"
|
<< "\t\tconst real_t z = Powq4c(vIn.z, " << power << ");\n"
|
||||||
<< "\t\tconst real_t d = SQR(x) - SQR(y);\n"
|
<< "\t\tconst real_t d = SQR(x) - SQR(y);\n"
|
||||||
<< "\t\tconst real_t re = Spread(" << c1 << " * x + " << c2 << " * d, " << sx << ") + 1.0;\n"
|
<< "\t\tconst real_t re = Spread(" << c1 << " * x + " << c2 << " * d, " << sx << ") + (real_t)(1.0);\n"
|
||||||
<< "\t\tconst real_t im = Spread(" << c1 << " * y + " << c2x2 << " * x * y, " << sy << ");\n"
|
<< "\t\tconst real_t im = Spread(" << c1 << " * y + " << c2x2 << " * x * y, " << sy << ");\n"
|
||||||
<< "\t\treal_t c = Zeps(Powq4c(SQR(re) + SQR(im), " << powerInv << "));\n"
|
<< "\t\treal_t c = Zeps(Powq4c(SQR(re) + SQR(im), " << powerInv << "));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
@ -2748,7 +2748,7 @@ public:
|
|||||||
<< "\t\tvOut.x = (x * re + y * im) * r;\n"
|
<< "\t\tvOut.x = (x * re + y * im) * r;\n"
|
||||||
<< "\t\tvOut.y = (y * re - x * im) * r;\n"
|
<< "\t\tvOut.y = (y * re - x * im) * r;\n"
|
||||||
<< "\t\tvOut.z = (z * xform->m_VariationWeights[" << varIndex << "]) / c;\n"
|
<< "\t\tvOut.z = (z * xform->m_VariationWeights[" << varIndex << "]) / c;\n"
|
||||||
<< "\t\toutPoint->m_ColorX = Clamp(outPoint->m_ColorX + " << dcAdjust << " * c, 0.0, 1.0);\n"
|
<< "\t\toutPoint->m_ColorX = Clamp(outPoint->m_ColorX + " << dcAdjust << " * c, (real_t)(0.0), (real_t)(1.0));\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
return ss.str();
|
return ss.str();
|
||||||
@ -2865,7 +2865,7 @@ public:
|
|||||||
<< "\t\treal_t st = sin(temp);\n"
|
<< "\t\treal_t st = sin(temp);\n"
|
||||||
<< "\t\treal_t ct = cos(temp);\n"
|
<< "\t\treal_t ct = cos(temp);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\ttemp = fma(" << ap << ", sin(fma(" << bp << ", r, " << cp << ")), acos(Clamp(vIn.z / r, -1.0, 1.0)));\n"
|
<< "\t\ttemp = fma(" << ap << ", sin(fma(" << bp << ", r, " << cp << ")), acos(Clamp(vIn.z / r, -(real_t)(1.0), (real_t)(1.0))));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\treal_t sp = sin(temp);\n"
|
<< "\t\treal_t sp = sin(temp);\n"
|
||||||
<< "\t\treal_t cp = cos(temp);\n"
|
<< "\t\treal_t cp = cos(temp);\n"
|
||||||
@ -4056,8 +4056,8 @@ public:
|
|||||||
string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t xx = (MwcNext01(mwc) - 0.5) * 2;\n"
|
<< "\t\treal_t xx = (MwcNext01(mwc) - (real_t)(0.5)) * 2;\n"
|
||||||
<< "\t\treal_t yy = (MwcNext01(mwc) - 0.5) * 2;\n"
|
<< "\t\treal_t yy = (MwcNext01(mwc) - (real_t)(0.5)) * 2;\n"
|
||||||
<< "\t\treal_t k = SignNz(yy);\n"
|
<< "\t\treal_t k = SignNz(yy);\n"
|
||||||
<< "\t\treal_t yymax = ((" << a << " * pow(fabs(xx), " << p << ") + k * " << b << " * sqrt(fabs(1 - SQR(xx)))) - " << a << ");\n"
|
<< "\t\treal_t yymax = ((" << a << " * pow(fabs(xx), " << p << ") + k * " << b << " * sqrt(fabs(1 - SQR(xx)))) - " << a << ");\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
@ -4089,7 +4089,7 @@ protected:
|
|||||||
|
|
||||||
m_Params.clear();
|
m_Params.clear();
|
||||||
m_Params.push_back(ParamWithName<T>(&m_P, prefix + "blur_heart_p", T(0.5)));
|
m_Params.push_back(ParamWithName<T>(&m_P, prefix + "blur_heart_p", T(0.5)));
|
||||||
m_Params.push_back(ParamWithName<T>(&m_A, prefix + "blur_heart_a", T(-0.6)));
|
m_Params.push_back(ParamWithName<T>(&m_A, prefix + "blur_heart_a", T(-T(0.6))));
|
||||||
m_Params.push_back(ParamWithName<T>(&m_B, prefix + "blur_heart_b", T(0.7)));
|
m_Params.push_back(ParamWithName<T>(&m_B, prefix + "blur_heart_b", T(0.7)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4350,7 +4350,7 @@ public:
|
|||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tr = fabs(r0 - 0.5) * " << oneOverRmax << ";\n"
|
<< "\t\tr = fabs(r0 - (real_t)(0.5)) * " << oneOverRmax << ";\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (r < 1)\n"
|
<< "\t\tif (r < 1)\n"
|
||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
@ -4359,11 +4359,11 @@ public:
|
|||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
<< "\t\telse\n"
|
<< "\t\telse\n"
|
||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
<< "\t\t vOut.x = 0.0;\n"
|
<< "\t\t vOut.x = (real_t)(0.0);\n"
|
||||||
<< "\t\t vOut.y = 0.0;\n"
|
<< "\t\t vOut.y = (real_t)(0.0);\n"
|
||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tr = fabs(r1 - 0.5) * " << oneOverRmax << ";\n"
|
<< "\t\tr = fabs(r1 - (real_t)(0.5)) * " << oneOverRmax << ";\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (r < 1)\n"
|
<< "\t\tif (r < 1)\n"
|
||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
@ -4909,7 +4909,7 @@ public:
|
|||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t arg = precalcAtanyx + fmod((real_t)MwcNext(mwc), (real_t)(1 / " << reInv << ")) * M_2PI;\n"
|
<< "\t\treal_t arg = precalcAtanyx + fmod((real_t)MwcNext(mwc), (real_t)(1 / " << reInv << ")) * M_2PI;\n"
|
||||||
<< "\t\treal_t lnmod = " << dist << " * 0.5 * log(precalcSumSquares);\n"
|
<< "\t\treal_t lnmod = " << dist << " * (real_t)(0.5) * log(precalcSumSquares);\n"
|
||||||
<< "\t\treal_t temp = arg * " << reInv << " + lnmod * " << im100 << ";\n"
|
<< "\t\treal_t temp = arg * " << reInv << " + lnmod * " << im100 << ";\n"
|
||||||
<< "\t\treal_t mod2 = exp(lnmod * " << reInv << " - arg * " << im100 << ");\n"
|
<< "\t\treal_t mod2 = exp(lnmod * " << reInv << " - arg * " << im100 << ");\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
@ -5024,7 +5024,7 @@ public:
|
|||||||
string blobDiff = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string blobDiff = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t r = precalcSqrtSumSquares * (" << blobLow << " + " << blobDiff << " * (0.5 + 0.5 * sin(" << blobWaves << " * precalcAtanxy)));\n"
|
<< "\t\treal_t r = precalcSqrtSumSquares * (" << blobLow << " + " << blobDiff << " * ((real_t)(0.5) + (real_t)(0.5) * sin(" << blobWaves << " * precalcAtanxy)));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (precalcSina * r);\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (precalcSina * r);\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (precalcCosa * r);\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (precalcCosa * r);\n"
|
||||||
@ -5119,8 +5119,8 @@ public:
|
|||||||
<< "\t\treal_t tmp = precalcSumSquares + 1;\n"
|
<< "\t\treal_t tmp = precalcSumSquares + 1;\n"
|
||||||
<< "\t\treal_t x2 = 2 * vIn.x;\n"
|
<< "\t\treal_t x2 = 2 * vIn.x;\n"
|
||||||
<< "\t\treal_t y2 = 2 * vIn.y;\n"
|
<< "\t\treal_t y2 = 2 * vIn.y;\n"
|
||||||
<< "\t\treal_t xmax = 0.5 * (sqrt(tmp + x2) + sqrt(tmp - x2));\n"
|
<< "\t\treal_t xmax = (real_t)(0.5) * (sqrt(tmp + x2) + sqrt(tmp - x2));\n"
|
||||||
<< "\t\treal_t ymax = 0.5 * (sqrt(tmp + y2) + sqrt(tmp - y2));\n"
|
<< "\t\treal_t ymax = (real_t)(0.5) * (sqrt(tmp + y2) + sqrt(tmp - y2));\n"
|
||||||
<< "\t\treal_t a = vIn.x / Zeps(xmax);\n"
|
<< "\t\treal_t a = vIn.x / Zeps(xmax);\n"
|
||||||
<< "\t\treal_t b = SafeSqrt(1 - SQR(a));\n"
|
<< "\t\treal_t b = SafeSqrt(1 - SQR(a));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
|
@ -45,7 +45,7 @@ public:
|
|||||||
string z = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string z = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t t = 0.25 * (precalcSumSquares + SQR(vIn.z)) + 1;\n"
|
<< "\t\treal_t t = (real_t)(0.25) * (precalcSumSquares + SQR(vIn.z)) + 1;\n"
|
||||||
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / t;\n"
|
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / t;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = vIn.x * r * " << x << ";\n"
|
<< "\t\tvOut.x = vIn.x * r * " << x << ";\n"
|
||||||
@ -158,12 +158,12 @@ public:
|
|||||||
string seed = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string seed = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\tint m = (int)floor(0.5 * vIn.x / " << sc << ");\n"
|
<< "\t\tint m = (int)floor((real_t)(0.5) * vIn.x / " << sc << ");\n"
|
||||||
<< "\t\tint n = (int)floor(0.5 * vIn.y / " << sc << ");\n"
|
<< "\t\tint n = (int)floor((real_t)(0.5) * vIn.y / " << sc << ");\n"
|
||||||
<< "\t\treal_t x = vIn.x - (m * 2 + 1) * " << sc << ";\n"
|
<< "\t\treal_t x = vIn.x - (m * 2 + 1) * " << sc << ";\n"
|
||||||
<< "\t\treal_t y = vIn.y - (n * 2 + 1) * " << sc << ";\n"
|
<< "\t\treal_t y = vIn.y - (n * 2 + 1) * " << sc << ";\n"
|
||||||
<< "\t\treal_t u = Zeps(Hypot(x, y));\n"
|
<< "\t\treal_t u = Zeps(Hypot(x, y));\n"
|
||||||
<< "\t\treal_t v = (0.3 + 0.7 * CircleLinearDiscreteNoise2(m + 10, n + 3)) * " << sc << ";\n"
|
<< "\t\treal_t v = ((real_t)(0.3) + (real_t)(0.7) * CircleLinearDiscreteNoise2(m + 10, n + 3)) * " << sc << ";\n"
|
||||||
<< "\t\treal_t z1 = CircleLinearDiscreteNoise2((int)(m + " << seed << "), n);\n"
|
<< "\t\treal_t z1 = CircleLinearDiscreteNoise2((int)(m + " << seed << "), n);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif ((z1 < " << dens1 << ") && (u < v))\n"
|
<< "\t\tif ((z1 < " << dens1 << ") && (u < v))\n"
|
||||||
@ -320,8 +320,8 @@ public:
|
|||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
<< "\t\t x = " << x << " * (1 - 2 * MwcNext01(mwc));\n"
|
<< "\t\t x = " << x << " * (1 - 2 * MwcNext01(mwc));\n"
|
||||||
<< "\t\t y = " << y << " * (1 - 2 * MwcNext01(mwc));\n"
|
<< "\t\t y = " << y << " * (1 - 2 * MwcNext01(mwc));\n"
|
||||||
<< "\t\t m = (int)floor(0.5 * x / " << sc << ");\n"
|
<< "\t\t m = (int)floor((real_t)(0.5) * x / " << sc << ");\n"
|
||||||
<< "\t\t n = (int)floor(0.5 * y / " << sc << ");\n"
|
<< "\t\t n = (int)floor((real_t)(0.5) * y / " << sc << ");\n"
|
||||||
<< "\t\t x = x - (m * 2 + 1) * " << sc << ";\n"
|
<< "\t\t x = x - (m * 2 + 1) * " << sc << ";\n"
|
||||||
<< "\t\t y = y - (n * 2 + 1) * " << sc << ";\n"
|
<< "\t\t y = y - (n * 2 + 1) * " << sc << ";\n"
|
||||||
<< "\t\t u = Hypot(x, y);\n"
|
<< "\t\t u = Hypot(x, y);\n"
|
||||||
@ -329,7 +329,7 @@ public:
|
|||||||
<< "\t\t if (++iters > 10)\n"
|
<< "\t\t if (++iters > 10)\n"
|
||||||
<< "\t\t break;\n"
|
<< "\t\t break;\n"
|
||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
<< "\t\twhile ((CircleRandDiscreteNoise2((int)(m + " << seed << "), n) > " << dens << ") || (u > (0.3 + 0.7 * CircleRandDiscreteNoise2(m + 10, n + 3)) * " << sc << "));\n"
|
<< "\t\twhile ((CircleRandDiscreteNoise2((int)(m + " << seed << "), n) > " << dens << ") || (u > ((real_t)(0.3) + (real_t)(0.7) * CircleRandDiscreteNoise2(m + 10, n + 3)) * " << sc << "));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (x + (m * 2 + 1) * " << sc << ");\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (x + (m * 2 + 1) * " << sc << ");\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (y + (n * 2 + 1) * " << sc << ");\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (y + (n * 2 + 1) * " << sc << ");\n"
|
||||||
@ -445,14 +445,14 @@ public:
|
|||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tCircleTrans1Trans(" << x << ", " << y << ", vIn.x, vIn.y, &ux, &uy);\n"
|
<< "\t\tCircleTrans1Trans(" << x << ", " << y << ", vIn.x, vIn.y, &ux, &uy);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tint m = (int)floor(0.5 * ux / " << sc << ");\n"
|
<< "\t\tint m = (int)floor((real_t)(0.5) * ux / " << sc << ");\n"
|
||||||
<< "\t\tint n = (int)floor(0.5 * uy / " << sc << ");\n"
|
<< "\t\tint n = (int)floor((real_t)(0.5) * uy / " << sc << ");\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tx = ux - (m * 2 + 1) * " << sc << ";\n"
|
<< "\t\tx = ux - (m * 2 + 1) * " << sc << ";\n"
|
||||||
<< "\t\ty = uy - (n * 2 + 1) * " << sc << ";\n"
|
<< "\t\ty = uy - (n * 2 + 1) * " << sc << ";\n"
|
||||||
<< "\t\tu = Hypot(x, y);\n"
|
<< "\t\tu = Hypot(x, y);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif ((CircleTrans1DiscreteNoise2((int)(m + " << seed << "), n) > " << dens << ") || (u > (0.3 + 0.7 * CircleTrans1DiscreteNoise2(m + 10, n + 3)) * " << sc << "))\n"
|
<< "\t\tif ((CircleTrans1DiscreteNoise2((int)(m + " << seed << "), n) > " << dens << ") || (u > ((real_t)(0.3) + (real_t)(0.7) * CircleTrans1DiscreteNoise2(m + 10, n + 3)) * " << sc << "))\n"
|
||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
<< "\t\t ux = ux;\n"
|
<< "\t\t ux = ux;\n"
|
||||||
<< "\t\t uy = uy;\n"
|
<< "\t\t uy = uy;\n"
|
||||||
@ -485,8 +485,8 @@ public:
|
|||||||
"\n"
|
"\n"
|
||||||
"void CircleTrans1Trans(real_t a, real_t b, real_t x, real_t y, real_t* x1, real_t* y1)\n"
|
"void CircleTrans1Trans(real_t a, real_t b, real_t x, real_t y, real_t* x1, real_t* y1)\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" *x1 = (x - a) * 0.5 + a;\n"
|
" *x1 = (x - a) * T(0.5) + a;\n"
|
||||||
" *y1 = (y - b) * 0.5 + b;\n"
|
" *y1 = (y - b) * T(0.5) + b;\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n"
|
"\n"
|
||||||
"void CircleTrans1CircleR(real_t mx, real_t my, real_t sc, real_t seed, real_t dens, real_t* ux, real_t* vy, uint2* mwc)\n"
|
"void CircleTrans1CircleR(real_t mx, real_t my, real_t sc, real_t seed, real_t dens, real_t* ux, real_t* vy, uint2* mwc)\n"
|
||||||
@ -498,10 +498,10 @@ public:
|
|||||||
" {\n"
|
" {\n"
|
||||||
" x = fabs(mx) * (1 - 2 * MwcNext01(mwc));\n"
|
" x = fabs(mx) * (1 - 2 * MwcNext01(mwc));\n"
|
||||||
" y = fabs(my) * (1 - 2 * MwcNext01(mwc));\n"
|
" y = fabs(my) * (1 - 2 * MwcNext01(mwc));\n"
|
||||||
" m = (int)floor(0.5 * x / sc);\n"
|
" m = (int)floor(T(0.5) * x / sc);\n"
|
||||||
" n = (int)floor(0.5 * y / sc);\n"
|
" n = (int)floor(T(0.5) * y / sc);\n"
|
||||||
" alpha = M_2PI * MwcNext01(mwc);\n"
|
" alpha = M_2PI * MwcNext01(mwc);\n"
|
||||||
" u = 0.3 + 0.7 * CircleTrans1DiscreteNoise2(m + 10, n + 3);\n"
|
" u = T(0.3) + T(0.7) * CircleTrans1DiscreteNoise2(m + 10, n + 3);\n"
|
||||||
" x = u * cos(alpha);\n"
|
" x = u * cos(alpha);\n"
|
||||||
" y = u * sin(alpha);\n"
|
" y = u * sin(alpha);\n"
|
||||||
"\n"
|
"\n"
|
||||||
@ -681,7 +681,7 @@ public:
|
|||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\tint useNode = MwcNext(mwc) & 7;\n"
|
<< "\t\tint useNode = MwcNext(mwc) & 7;\n"
|
||||||
<< "\t\treal_t exnze, wynze, znxy;\n"
|
<< "\t\treal_t exnze, wynze, znxy;\n"
|
||||||
<< "\t\treal_t lattd = xform->m_VariationWeights[" << varIndex << "] * 0.5;\n"
|
<< "\t\treal_t lattd = xform->m_VariationWeights[" << varIndex << "] * (real_t)(0.5);\n"
|
||||||
<< "\t\treal_t px, py, pz;\n"
|
<< "\t\treal_t px, py, pz;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\texnze = 1 - (" << smoothStyle << " * (1 - (cos(atan2(vIn.x, vIn.z)))));\n"
|
<< "\t\texnze = 1 - (" << smoothStyle << " * (1 - (cos(atan2(vIn.x, vIn.z)))));\n"
|
||||||
@ -690,7 +690,7 @@ public:
|
|||||||
<< "\t\tif (" << smoothStyle << " > 1)\n"
|
<< "\t\tif (" << smoothStyle << " > 1)\n"
|
||||||
<< "\t\t znxy = 1 - (" << smoothStyle << " * (1 - ((exnze + wynze) / 2 * " << smoothStyle << ")));\n"
|
<< "\t\t znxy = 1 - (" << smoothStyle << " * (1 - ((exnze + wynze) / 2 * " << smoothStyle << ")));\n"
|
||||||
<< "\t\telse\n"
|
<< "\t\telse\n"
|
||||||
<< "\t\t znxy = 1 - (" << smoothStyle << " * (1 - ((exnze + wynze) * 0.5)));\n";
|
<< "\t\t znxy = 1 - (" << smoothStyle << " * (1 - ((exnze + wynze) * (real_t)(0.5))));\n";
|
||||||
|
|
||||||
if (m_VarType == VARTYPE_PRE)
|
if (m_VarType == VARTYPE_PRE)
|
||||||
{
|
{
|
||||||
@ -915,7 +915,7 @@ public:
|
|||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
<< "\t\t exnze = cos(atan2(vIn.x, vIn.z));\n"
|
<< "\t\t exnze = cos(atan2(vIn.x, vIn.z));\n"
|
||||||
<< "\t\t wynze = sin(atan2(vIn.y, vIn.z));\n"
|
<< "\t\t wynze = sin(atan2(vIn.y, vIn.z));\n"
|
||||||
<< "\t\t znxy = (exnze + wynze) * 0.5;\n"
|
<< "\t\t znxy = (exnze + wynze) * (real_t)(0.5);\n"
|
||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
<< "\t\telse\n"
|
<< "\t\telse\n"
|
||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
@ -1045,8 +1045,8 @@ public:
|
|||||||
intmax_t varIndex = IndexInXform();
|
intmax_t varIndex = IndexInXform();
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t expx = exp(vIn.x) * 0.5;\n"
|
<< "\t\treal_t expx = exp(vIn.x) * (real_t)(0.5);\n"
|
||||||
<< "\t\treal_t expnx = 0.25 / expx;\n"
|
<< "\t\treal_t expnx = (real_t)(0.25) / expx;\n"
|
||||||
<< "\t\treal_t boot = vIn.z == 0 ? precalcAtanyx : vIn.z;\n"
|
<< "\t\treal_t boot = vIn.z == 0 ? precalcAtanyx : vIn.z;\n"
|
||||||
<< "\t\treal_t tmp = xform->m_VariationWeights[" << varIndex << "] / (expx + expnx - (cos(vIn.y) * cos(boot)));\n"
|
<< "\t\treal_t tmp = xform->m_VariationWeights[" << varIndex << "] / (expx + expnx - (cos(vIn.y) * cos(boot)));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
@ -1117,8 +1117,8 @@ public:
|
|||||||
<< "\t\treal_t cv = cos(vIn.y);\n"
|
<< "\t\treal_t cv = cos(vIn.y);\n"
|
||||||
<< "\t\treal_t cucv = cu * cv;\n"
|
<< "\t\treal_t cucv = cu * cv;\n"
|
||||||
<< "\t\treal_t sucv = su * cv;\n"
|
<< "\t\treal_t sucv = su * cv;\n"
|
||||||
<< "\t\treal_t x = pow(fabs(cucv), " << xpow << ") + (cucv * " << xpow << ") + (0.25 * atOmegaX);\n"
|
<< "\t\treal_t x = pow(fabs(cucv), " << xpow << ") + (cucv * " << xpow << ") + ((real_t)(0.25) * atOmegaX);\n"
|
||||||
<< "\t\treal_t y = pow(fabs(sucv), " << ypow << ") + (sucv * " << ypow << ") + (0.25 * atOmegaY);\n"
|
<< "\t\treal_t y = pow(fabs(sucv), " << ypow << ") + (sucv * " << ypow << ") + ((real_t)(0.25) * atOmegaY);\n"
|
||||||
<< "\t\treal_t z = pow(fabs(sv), " << zpow << ") + sv * " << zpow << ";\n"
|
<< "\t\treal_t z = pow(fabs(sv), " << zpow << ") + sv * " << zpow << ";\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * x;\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * x;\n"
|
||||||
@ -1373,13 +1373,13 @@ public:
|
|||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\t vOut.x = r * vIn.x;\n"
|
<< "\t\t vOut.x = r * vIn.x;\n"
|
||||||
<< "\t\t vOut.y = r * vIn.y;\n"
|
<< "\t\t vOut.y = r * vIn.y;\n"
|
||||||
<< "\t\t vOut.z = r * efTez * 0.5;\n"
|
<< "\t\t vOut.z = r * efTez * (real_t)(0.5);\n"
|
||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
<< "\t\telse\n"
|
<< "\t\telse\n"
|
||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n"
|
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n"
|
||||||
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n"
|
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n"
|
||||||
<< "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * efTez * 0.5;\n"
|
<< "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * efTez * (real_t)(0.5);\n"
|
||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
@ -1442,7 +1442,7 @@ public:
|
|||||||
string tilt = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string tilt = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t t = precalcSumSquares * 0.25 + 1;\n"
|
<< "\t\treal_t t = precalcSumSquares * (real_t)(0.25) + 1;\n"
|
||||||
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / t;\n"
|
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / t;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = vIn.x * r * " << x << ";\n"
|
<< "\t\tvOut.x = vIn.x * r * " << x << ";\n"
|
||||||
@ -1510,7 +1510,7 @@ public:
|
|||||||
string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t avgxy = (vIn.x + vIn.y) * 0.5;\n"
|
<< "\t\treal_t avgxy = (vIn.x + vIn.y) * (real_t)(0.5);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + " << scale << " * sin(vIn.y * " << freq << "));\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + " << scale << " * sin(vIn.y * " << freq << "));\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + " << scale << " * sin(vIn.x * " << freq << "));\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + " << scale << " * sin(vIn.x * " << freq << "));\n"
|
||||||
@ -1571,7 +1571,7 @@ public:
|
|||||||
string thickness = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string thickness = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\tint sl = (int)(MwcNext01(mwc) * " << slices << " + 0.5);\n"
|
<< "\t\tint sl = (int)(MwcNext01(mwc) * " << slices << " + (real_t)(0.5));\n"
|
||||||
<< "\t\treal_t a = " << rotation << " + M_2PI * (sl + MwcNext01(mwc) * " << thickness << ") / " << slices << ";\n"
|
<< "\t\treal_t a = " << rotation << " + M_2PI * (sl + MwcNext01(mwc) * " << thickness << ") / " << slices << ";\n"
|
||||||
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * MwcNext01(mwc);\n"
|
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * MwcNext01(mwc);\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
@ -1863,8 +1863,8 @@ public:
|
|||||||
<< "\t\tconst real_t xrng = vIn.x / " << xdist << ";\n"
|
<< "\t\tconst real_t xrng = vIn.x / " << xdist << ";\n"
|
||||||
<< "\t\tconst real_t yrng = vIn.y / " << ydist << ";\n"
|
<< "\t\tconst real_t yrng = vIn.y / " << ydist << ";\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.x = " << xw << " * ((xrng - (int)xrng) * " << xwidth << " + (int)xrng + (0.5 - xpos) * " << onemx << ");\n"
|
<< "\t\tvOut.x = " << xw << " * ((xrng - (int)xrng) * " << xwidth << " + (int)xrng + ((real_t)(0.5) - xpos) * " << onemx << ");\n"
|
||||||
<< "\t\tvOut.y = " << yw << " * ((yrng - (int)yrng) * " << ywidth << " + (int)yrng + (0.5 - ypos) * " << onemy << ");\n"
|
<< "\t\tvOut.y = " << yw << " * ((yrng - (int)yrng) * " << ywidth << " + (int)yrng + ((real_t)(0.5) - ypos) * " << onemy << ");\n"
|
||||||
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
@ -1983,7 +1983,7 @@ public:
|
|||||||
string py = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string py = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t b = xform->m_VariationWeights[" << varIndex << "] / (precalcSumSquares * 0.25 + 1);\n"
|
<< "\t\treal_t b = xform->m_VariationWeights[" << varIndex << "] / (precalcSumSquares * (real_t)(0.25) + 1);\n"
|
||||||
<< "\t\treal_t roundX = rint(vIn.x);\n"
|
<< "\t\treal_t roundX = rint(vIn.x);\n"
|
||||||
<< "\t\treal_t roundY = rint(vIn.y);\n"
|
<< "\t\treal_t roundY = rint(vIn.y);\n"
|
||||||
<< "\t\treal_t offsetX = vIn.x - roundX;\n"
|
<< "\t\treal_t offsetX = vIn.x - roundX;\n"
|
||||||
@ -1992,10 +1992,10 @@ public:
|
|||||||
<< "\t\tvOut.x = vIn.x * b;\n"
|
<< "\t\tvOut.x = vIn.x * b;\n"
|
||||||
<< "\t\tvOut.y = vIn.y * b;\n"
|
<< "\t\tvOut.y = vIn.y * b;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (MwcNext01(mwc) >= 0.75)\n"
|
<< "\t\tif (MwcNext01(mwc) >= (real_t)(0.75))\n"
|
||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
<< "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * 0.5 + roundX);\n"
|
<< "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX);\n"
|
||||||
<< "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * 0.5 + roundY);\n"
|
<< "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY);\n"
|
||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
<< "\t\telse\n"
|
<< "\t\telse\n"
|
||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
@ -2003,26 +2003,26 @@ public:
|
|||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t if (offsetX >= 0)\n"
|
<< "\t\t if (offsetX >= 0)\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * 0.5 + roundX + " << x << ");\n"
|
<< "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX + " << x << ");\n"
|
||||||
<< "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * 0.5 + roundY + " << y << " * offsetY / offsetX);\n"
|
<< "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY + " << y << " * offsetY / offsetX);\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t else\n"
|
<< "\t\t else\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * 0.5 + roundX - " << y << ");\n"
|
<< "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX - " << y << ");\n"
|
||||||
<< "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * 0.5 + roundY - " << y << " * offsetY / offsetX);\n"
|
<< "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY - " << y << " * offsetY / offsetX);\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t else\n"
|
<< "\t\t else\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t if (offsetY >= 0)\n"
|
<< "\t\t if (offsetY >= 0)\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * 0.5 + roundY + " << y << ");\n"
|
<< "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY + " << y << ");\n"
|
||||||
<< "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * 0.5 + roundX + offsetX / offsetY * " << y << ");\n"
|
<< "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX + offsetX / offsetY * " << y << ");\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t else\n"
|
<< "\t\t else\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * 0.5 + roundY - " << y << ");\n"
|
<< "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY - " << y << ");\n"
|
||||||
<< "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * 0.5 + roundX - offsetX / offsetY * " << x << ");\n"
|
<< "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX - offsetX / offsetY * " << x << ");\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
@ -2181,8 +2181,8 @@ public:
|
|||||||
<< "\t\tconst real_t ay = MwcNext0505(mwc);\n"
|
<< "\t\tconst real_t ay = MwcNext0505(mwc);\n"
|
||||||
<< "\t\tconst real_t az = MwcNext0505(mwc);\n"
|
<< "\t\tconst real_t az = MwcNext0505(mwc);\n"
|
||||||
<< "\t\tconst real_t r = sqrt(Sqr(vIn.x - " << x0 << ") + Sqr(vIn.y - " << y0 << ") + Sqr(vIn.z - " << z0 << "));\n"
|
<< "\t\tconst real_t r = sqrt(Sqr(vIn.x - " << x0 << ") + Sqr(vIn.y - " << y0 << ") + Sqr(vIn.z - " << z0 << "));\n"
|
||||||
<< "\t\tconst real_t rc = ((" << invert << " != 0 ? max(1 - r, 0.0) : max(r, 0.0)) - " << minDist << ") * " << internalScatter << ";\n"
|
<< "\t\tconst real_t rc = ((" << invert << " != 0 ? max(1 - r, (real_t)(0.0)) : max(r, (real_t)(0.0))) - " << minDist << ") * " << internalScatter << ";\n"
|
||||||
<< "\t\tconst real_t rs = max(rc, 0.0);\n"
|
<< "\t\tconst real_t rs = max(rc, (real_t)(0.0));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\treal_t sigma, phi, rad, sigmas, sigmac, phis, phic;\n"
|
<< "\t\treal_t sigma, phi, rad, sigmas, sigmac, phis, phic;\n"
|
||||||
<< "\t\treal_t scale, denom;\n"
|
<< "\t\treal_t scale, denom;\n"
|
||||||
@ -2209,7 +2209,7 @@ public:
|
|||||||
<< "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * (rad * sigmas);\n"
|
<< "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * (rad * sigmas);\n"
|
||||||
<< "\t\t break;\n"
|
<< "\t\t break;\n"
|
||||||
<< "\t\t case 2:\n"
|
<< "\t\t case 2:\n"
|
||||||
<< "\t\t scale = Clamp(rs, 0, 0.9) + 0.1;\n"
|
<< "\t\t scale = Clamp(rs, 0, (real_t)(0.9)) + (real_t)(0.1);\n"
|
||||||
<< "\t\t denom = 1 / scale;\n"
|
<< "\t\t denom = 1 / scale;\n"
|
||||||
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * Lerp(vIn.x, floor(vIn.x * denom) + scale * ax, " << mulX << " * rs) + " << mulX << " * pow(ax, " << boxPow << ") * rs * denom;\n"
|
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * Lerp(vIn.x, floor(vIn.x * denom) + scale * ax, " << mulX << " * rs) + " << mulX << " * pow(ax, " << boxPow << ") * rs * denom;\n"
|
||||||
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * Lerp(vIn.y, floor(vIn.y * denom) + scale * ay, " << mulY << " * rs) + " << mulY << " * pow(ay, " << boxPow << ") * rs * denom;\n"
|
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * Lerp(vIn.y, floor(vIn.y * denom) + scale * ay, " << mulY << " * rs) + " << mulY << " * pow(ay, " << boxPow << ") * rs * denom;\n"
|
||||||
@ -2361,8 +2361,8 @@ public:
|
|||||||
<< "\t\tconst real_t randz = MwcNext0505(mwc);\n"
|
<< "\t\tconst real_t randz = MwcNext0505(mwc);\n"
|
||||||
<< "\t\tconst real_t randc = MwcNext0505(mwc);\n"
|
<< "\t\tconst real_t randc = MwcNext0505(mwc);\n"
|
||||||
<< "\t\tconst real_t distA = sqrt(Sqr(vIn.x - " << x0 << ") + Sqr(vIn.y - " << y0 << ") + Sqr(vIn.z - " << z0 << "));\n"
|
<< "\t\tconst real_t distA = sqrt(Sqr(vIn.x - " << x0 << ") + Sqr(vIn.y - " << y0 << ") + Sqr(vIn.z - " << z0 << "));\n"
|
||||||
<< "\t\tconst real_t distB = " << invert << " != 0 ? max(1 - distA, 0.0) : max(distA, 0.0);\n"
|
<< "\t\tconst real_t distB = " << invert << " != 0 ? max(1 - distA, (real_t)(0.0)) : max(distA, (real_t)(0.0));\n"
|
||||||
<< "\t\tconst real_t dist = max((distB - " << minDist << ") * " << rMax<< ", 0.0);\n"
|
<< "\t\tconst real_t dist = max((distB - " << minDist << ") * " << rMax<< ", (real_t)(0.0));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tswitch ((int)" << type << ")\n"
|
<< "\t\tswitch ((int)" << type << ")\n"
|
||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
@ -2370,7 +2370,7 @@ public:
|
|||||||
<< "\t\t vOut.x = vIn.x + " << mulX << " * randx * dist;\n"
|
<< "\t\t vOut.x = vIn.x + " << mulX << " * randx * dist;\n"
|
||||||
<< "\t\t vOut.y = vIn.y + " << mulY << " * randy * dist;\n"
|
<< "\t\t vOut.y = vIn.y + " << mulY << " * randy * dist;\n"
|
||||||
<< "\t\t vOut.z = vIn.z + " << mulZ << " * randz * dist;\n"
|
<< "\t\t vOut.z = vIn.z + " << mulZ << " * randz * dist;\n"
|
||||||
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + " << mulC << " * randc * dist, 1.0));\n"
|
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + " << mulC << " * randc * dist, (real_t)(1.0)));\n"
|
||||||
<< "\t\t break;\n"
|
<< "\t\t break;\n"
|
||||||
<< "\t\t case 1:\n"
|
<< "\t\t case 1:\n"
|
||||||
<< "\t\t if (vIn.x == 0 && vIn.y == 0 && vIn.z == 0)\n"
|
<< "\t\t if (vIn.x == 0 && vIn.y == 0 && vIn.z == 0)\n"
|
||||||
@ -2393,7 +2393,7 @@ public:
|
|||||||
<< "\t\t vOut.x = r * sigmac * phic;\n"
|
<< "\t\t vOut.x = r * sigmac * phic;\n"
|
||||||
<< "\t\t vOut.y = r * sigmac * phis;\n"
|
<< "\t\t vOut.y = r * sigmac * phis;\n"
|
||||||
<< "\t\t vOut.z = r * sigmas;\n"
|
<< "\t\t vOut.z = r * sigmas;\n"
|
||||||
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + " << mulC << " * randc * dist, 1.0));\n"
|
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + " << mulC << " * randc * dist, (real_t)(1.0)));\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t break;\n"
|
<< "\t\t break;\n"
|
||||||
<< "\t\t case 2:\n"
|
<< "\t\t case 2:\n"
|
||||||
@ -2409,7 +2409,7 @@ public:
|
|||||||
<< "\t\t vOut.x = vIn.x + " << mulX << " * rad * sigmac * phic;\n"
|
<< "\t\t vOut.x = vIn.x + " << mulX << " * rad * sigmac * phic;\n"
|
||||||
<< "\t\t vOut.y = vIn.y + " << mulY << " * rad * sigmac * phis;\n"
|
<< "\t\t vOut.y = vIn.y + " << mulY << " * rad * sigmac * phis;\n"
|
||||||
<< "\t\t vOut.z = vIn.z + " << mulZ << " * rad * sigmas;\n"
|
<< "\t\t vOut.z = vIn.z + " << mulZ << " * rad * sigmas;\n"
|
||||||
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + " << mulC << " * randc * dist, 1.0));\n"
|
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + " << mulC << " * randc * dist, (real_t)(1.0)));\n"
|
||||||
<< "\t\t break;\n"
|
<< "\t\t break;\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
@ -2584,7 +2584,7 @@ public:
|
|||||||
<< "\t\t break;\n"
|
<< "\t\t break;\n"
|
||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tconst real_t dist = max(((" << invertDist << " != 0 ? max(1 - radius, 0.0) : max(radius, 0.0)) - " << minDist << ") * " << rMax << ", 0.0);\n"
|
<< "\t\tconst real_t dist = max(((" << invertDist << " != 0 ? max(1 - radius, (real_t)(0.0)) : max(radius, (real_t)(0.0))) - " << minDist << ") * " << rMax << ", (real_t)(0.0));\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tswitch ((int)" << blurType << ")\n"
|
<< "\t\tswitch ((int)" << blurType << ")\n"
|
||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
@ -2601,7 +2601,7 @@ public:
|
|||||||
<< "\t\t vOut.x = vIn.x + " << mulX << " * rad * sigmac * phic;\n"
|
<< "\t\t vOut.x = vIn.x + " << mulX << " * rad * sigmac * phic;\n"
|
||||||
<< "\t\t vOut.y = vIn.y + " << mulY << " * rad * sigmac * phis;\n"
|
<< "\t\t vOut.y = vIn.y + " << mulY << " * rad * sigmac * phis;\n"
|
||||||
<< "\t\t vOut.z = vIn.z + " << mulZ << " * rad * sigmas;\n"
|
<< "\t\t vOut.z = vIn.z + " << mulZ << " * rad * sigmas;\n"
|
||||||
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + " << mulC << " * randc * dist, 1.0));\n"
|
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + " << mulC << " * randc * dist, (real_t)(1.0)));\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t break;\n"
|
<< "\t\t break;\n"
|
||||||
<< "\t\tcase 1:\n"
|
<< "\t\tcase 1:\n"
|
||||||
@ -2625,7 +2625,7 @@ public:
|
|||||||
<< "\t\t vOut.x = r * sigmac * phic;\n"
|
<< "\t\t vOut.x = r * sigmac * phic;\n"
|
||||||
<< "\t\t vOut.y = r * sigmac * phis;\n"
|
<< "\t\t vOut.y = r * sigmac * phis;\n"
|
||||||
<< "\t\t vOut.z = r * sigmas;\n"
|
<< "\t\t vOut.z = r * sigmas;\n"
|
||||||
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + " << mulC << " * randc * dist, 1.0));\n"
|
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + " << mulC << " * randc * dist, (real_t)(1.0)));\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t break;\n"
|
<< "\t\t break;\n"
|
||||||
<< "\t\tcase 2:\n"
|
<< "\t\tcase 2:\n"
|
||||||
@ -2635,7 +2635,7 @@ public:
|
|||||||
<< "\t\t vOut.x = vIn.x + LogMap(" << mulX << ") * LogScale(randx) * coeff,\n"
|
<< "\t\t vOut.x = vIn.x + LogMap(" << mulX << ") * LogScale(randx) * coeff,\n"
|
||||||
<< "\t\t vOut.y = vIn.y + LogMap(" << mulY << ") * LogScale(randy) * coeff,\n"
|
<< "\t\t vOut.y = vIn.y + LogMap(" << mulY << ") * LogScale(randy) * coeff,\n"
|
||||||
<< "\t\t vOut.z = vIn.z + LogMap(" << mulZ << ") * LogScale(randz) * coeff,\n"
|
<< "\t\t vOut.z = vIn.z + LogMap(" << mulZ << ") * LogScale(randz) * coeff,\n"
|
||||||
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + LogMap(" << mulC << ") * LogScale(randc) * coeff, 1.0));\n"
|
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + LogMap(" << mulC << ") * LogScale(randc) * coeff, (real_t)(1.0)));\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t break;\n"
|
<< "\t\t break;\n"
|
||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
|
@ -59,7 +59,7 @@ public:
|
|||||||
<< "\t\treal_t tempX = vOut.x + outPoint->m_X;\n"
|
<< "\t\treal_t tempX = vOut.x + outPoint->m_X;\n"
|
||||||
<< "\t\treal_t tempY = vOut.y + outPoint->m_Y;\n"
|
<< "\t\treal_t tempY = vOut.y + outPoint->m_Y;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\toutPoint->m_ColorX = fmod(fabs(" << bdcs << " * (Sqr(tempX + " << centerX << ") + Sqr(tempY + " << centerY << "))), 1.0);\n"
|
<< "\t\toutPoint->m_ColorX = fmod(fabs(" << bdcs << " * (Sqr(tempX + " << centerX << ") + Sqr(tempY + " << centerY << "))), (real_t)(1.0));\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
return ss.str();
|
return ss.str();
|
||||||
@ -138,7 +138,7 @@ public:
|
|||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (xform->m_A * x + xform->m_B * y + xform->m_E);\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (xform->m_A * x + xform->m_B * y + xform->m_E);\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (xform->m_C * x + xform->m_D * y + xform->m_F);\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (xform->m_C * x + xform->m_D * y + xform->m_F);\n"
|
||||||
<< "\t\tvOut.z = " << ((m_VarType == VARTYPE_REG) ? "0" : "vIn.z") << ";\n"
|
<< "\t\tvOut.z = " << ((m_VarType == VARTYPE_REG) ? "0" : "vIn.z") << ";\n"
|
||||||
<< "\t\toutPoint->m_ColorX = fmod(fabs(outPoint->m_ColorX * 0.5 * (1 + h) + x0_xor_y0 * (1 - h) * 0.5), 1.0);\n"
|
<< "\t\toutPoint->m_ColorX = fmod(fabs(outPoint->m_ColorX * (real_t)(0.5) * (1 + h) + x0_xor_y0 * (1 - h) * (real_t)(0.5)), (real_t)(1.0));\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
return ss.str();
|
return ss.str();
|
||||||
@ -416,7 +416,7 @@ public:
|
|||||||
<< "\t\treal_t tempX = vOut.x + outPoint->m_X;\n"
|
<< "\t\treal_t tempX = vOut.x + outPoint->m_X;\n"
|
||||||
<< "\t\treal_t tempY = vOut.y + outPoint->m_Y;\n"
|
<< "\t\treal_t tempY = vOut.y + outPoint->m_Y;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\toutPoint->m_ColorX = fmod(fabs(0.5 * (" << ldcs << " * ((" << cosa << " * tempX + " << sina << " * tempY + " << offset << ")) + 1.0)), 1.0);\n"
|
<< "\t\toutPoint->m_ColorX = fmod(fabs((real_t)(0.5) * (" << ldcs << " * ((" << cosa << " * tempX + " << sina << " * tempY + " << offset << ")) + (real_t)(1.0))), (real_t)(1.0));\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
return ss.str();
|
return ss.str();
|
||||||
@ -566,13 +566,13 @@ public:
|
|||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + 1);\n"
|
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + 1);\n"
|
||||||
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n"
|
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n"
|
||||||
<< "\t\t c += 0.25;\n"
|
<< "\t\t c += (real_t)(0.25);\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t else\n"
|
<< "\t\t else\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n"
|
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n"
|
||||||
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + 1);\n"
|
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + 1);\n"
|
||||||
<< "\t\t c += 0.75;\n"
|
<< "\t\t c += (real_t)(0.75);\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t else\n"
|
<< "\t\t else\n"
|
||||||
@ -581,13 +581,13 @@ public:
|
|||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + 1);\n"
|
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + 1);\n"
|
||||||
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n"
|
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n"
|
||||||
<< "\t\t c += 0.25;\n"
|
<< "\t\t c += (real_t)(0.25);\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t else\n"
|
<< "\t\t else\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n"
|
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n"
|
||||||
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y - 1);\n"
|
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y - 1);\n"
|
||||||
<< "\t\t c += 0.75;\n"
|
<< "\t\t c += (real_t)(0.75);\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
@ -599,13 +599,13 @@ public:
|
|||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x - 1);\n"
|
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x - 1);\n"
|
||||||
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n"
|
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n"
|
||||||
<< "\t\t c += 0.25;\n"
|
<< "\t\t c += (real_t)(0.25);\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t else\n"
|
<< "\t\t else\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n"
|
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n"
|
||||||
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + 1);\n"
|
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + 1);\n"
|
||||||
<< "\t\t c += 0.75;\n"
|
<< "\t\t c += (real_t)(0.75);\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t else\n"
|
<< "\t\t else\n"
|
||||||
@ -614,19 +614,19 @@ public:
|
|||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x - 1);\n"
|
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x - 1);\n"
|
||||||
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n"
|
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n"
|
||||||
<< "\t\t c += 0.25;\n"
|
<< "\t\t c += (real_t)(0.25);\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t else\n"
|
<< "\t\t else\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n"
|
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n"
|
||||||
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y - 1);\n"
|
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y - 1);\n"
|
||||||
<< "\t\t c += 0.75;\n"
|
<< "\t\t c += (real_t)(0.75);\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
||||||
<< "\t\toutPoint->m_ColorX = fmod(c, 1.0);\n"
|
<< "\t\toutPoint->m_ColorX = fmod(c, (real_t)(1.0));\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
return ss.str();
|
return ss.str();
|
||||||
@ -683,7 +683,7 @@ public:
|
|||||||
<< "\t\treal_t tempX = vOut.x + outPoint->m_X;\n"
|
<< "\t\treal_t tempX = vOut.x + outPoint->m_X;\n"
|
||||||
<< "\t\treal_t tempY = vOut.y + outPoint->m_Y;\n"
|
<< "\t\treal_t tempY = vOut.y + outPoint->m_Y;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\toutPoint->m_ColorX = fmod(fabs(0.5 * (" << ldcs << " * ((" << cosa << " * tempX + " << sina << " * tempY + " << offset << ")) + 1.0)), 1.0);\n"
|
<< "\t\toutPoint->m_ColorX = fmod(fabs((real_t)(0.5) * (" << ldcs << " * ((" << cosa << " * tempX + " << sina << " * tempY + " << offset << ")) + (real_t)(1.0))), (real_t)(1.0));\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
return ss.str();
|
return ss.str();
|
||||||
@ -907,7 +907,7 @@ public:
|
|||||||
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (ox + u * xx + v * yx);\n"
|
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (ox + u * xx + v * yx);\n"
|
||||||
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (oy + u * xy + v * yy);\n"
|
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (oy + u * xy + v * yy);\n"
|
||||||
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
|
||||||
<< "\t\toutPoint->m_ColorX = fmod(fabs(u + v), 1.0);\n"
|
<< "\t\toutPoint->m_ColorX = fmod(fabs(u + v), (real_t)(1.0));\n"
|
||||||
<< "\t}\n";
|
<< "\t}\n";
|
||||||
|
|
||||||
return ss.str();
|
return ss.str();
|
||||||
|
@ -385,7 +385,7 @@ string FinalAccumOpenCLKernelCreator<T>::CreateGammaCorrectionFunctionString(boo
|
|||||||
|
|
||||||
os <<
|
os <<
|
||||||
"\n"
|
"\n"
|
||||||
" correctedChannels[rgbi] = (" << dataType << ")clamp(a, 0.0, 255.0);\n"
|
" correctedChannels[rgbi] = (" << dataType << ")clamp(a, (real_t)0.0, (real_t)255.0);\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
"\n";
|
"\n";
|
||||||
|
|
||||||
|
@ -1130,6 +1130,7 @@ uint OpenCLWrapper::DeviceIndex() const { return m_DeviceIndex; }
|
|||||||
size_t OpenCLWrapper::GlobalMemSize() const { return GetInfo<cl_ulong>(PlatformIndex(), DeviceIndex(), CL_DEVICE_GLOBAL_MEM_SIZE); }
|
size_t OpenCLWrapper::GlobalMemSize() const { return GetInfo<cl_ulong>(PlatformIndex(), DeviceIndex(), CL_DEVICE_GLOBAL_MEM_SIZE); }
|
||||||
uint OpenCLWrapper::LocalMemSize() const { return m_LocalMemSize; }
|
uint OpenCLWrapper::LocalMemSize() const { return m_LocalMemSize; }
|
||||||
size_t OpenCLWrapper::MaxAllocSize() const { return GetInfo<cl_ulong>(PlatformIndex(), DeviceIndex(), CL_DEVICE_MAX_MEM_ALLOC_SIZE); }
|
size_t OpenCLWrapper::MaxAllocSize() const { return GetInfo<cl_ulong>(PlatformIndex(), DeviceIndex(), CL_DEVICE_MAX_MEM_ALLOC_SIZE); }
|
||||||
|
std::vector<std::string> OpenCLWrapper::ProgramBuildErrors() const { return m_programBuildErrors; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Makes the even grid dims.
|
/// Makes the even grid dims.
|
||||||
@ -1242,6 +1243,9 @@ bool OpenCLWrapper::CreateSPK(const string& name, const string& program, const s
|
|||||||
|
|
||||||
if (CheckCL(err, "cl::Kernel()"))
|
if (CheckCL(err, "cl::Kernel()"))
|
||||||
return true;//Everything is ok.
|
return true;//Everything is ok.
|
||||||
|
} else {
|
||||||
|
for (std::vector<cl::Device>::iterator i = m_DeviceVec.begin(); i != m_DeviceVec.end(); ++ i )
|
||||||
|
m_programBuildErrors.push_back(spk.m_Program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(*i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,6 +192,7 @@ public:
|
|||||||
uint LocalMemSize() const;
|
uint LocalMemSize() const;
|
||||||
size_t GlobalMemSize() const;
|
size_t GlobalMemSize() const;
|
||||||
size_t MaxAllocSize() const;
|
size_t MaxAllocSize() const;
|
||||||
|
std::vector<std::string> ProgramBuildErrors() const;
|
||||||
|
|
||||||
static void MakeEvenGridDims(uint blockW, uint blockH, uint& gridW, uint& gridH);
|
static void MakeEvenGridDims(uint blockW, uint blockH, uint& gridW, uint& gridH);
|
||||||
|
|
||||||
@ -217,5 +218,6 @@ private:
|
|||||||
std::vector<NamedBuffer> m_Buffers;
|
std::vector<NamedBuffer> m_Buffers;
|
||||||
std::vector<NamedImage2D> m_Images;
|
std::vector<NamedImage2D> m_Images;
|
||||||
std::vector<NamedImage2DGL> m_GLImages;
|
std::vector<NamedImage2DGL> m_GLImages;
|
||||||
|
std::vector<std::string> m_programBuildErrors;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -759,7 +759,12 @@ bool RendererCL<T>::BuildIterProgramForEmber(bool doAccum)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + "():\nBuilding the following program failed: \n" + m_IterKernel + "\n");
|
//m_ErrorReport.push_back(string(loc) + "():\nBuilding the following program failed: \n" + m_IterKernel + "\n");
|
||||||
|
|
||||||
|
std::vector<std::string> errors = m_Wrapper.ProgramBuildErrors();
|
||||||
|
m_ErrorReport.insert(m_ErrorReport.end(), errors.begin(), errors.end());
|
||||||
|
m_ErrorReport.push_back(loc);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1297,7 +1302,11 @@ int RendererCL<T>::MakeAndGetFinalAccumProgram(T& alphaBase, T& alphaScale)
|
|||||||
if (b)
|
if (b)
|
||||||
kernelIndex = m_Wrapper.FindKernelIndex(finalAccumEntryPoint);//Try to find it again, it will be present if successfully built.
|
kernelIndex = m_Wrapper.FindKernelIndex(finalAccumEntryPoint);//Try to find it again, it will be present if successfully built.
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
std::vector<std::string> errors = m_Wrapper.ProgramBuildErrors();
|
||||||
|
m_ErrorReport.insert(m_ErrorReport.end(), errors.begin(), errors.end());
|
||||||
m_ErrorReport.push_back(loc);
|
m_ErrorReport.push_back(loc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return kernelIndex;
|
return kernelIndex;
|
||||||
|
Loading…
Reference in New Issue
Block a user