--Bug fixes

-Attempt to fix several OpenCL build errors that were occurring on Mac.

--Code changes
 -Improve the coloring code during final accum by getting rid of the last remnants of unnecessary scaling to 255 from flam3.
 -Begin work of supporting 16bpc on the GPU.
This commit is contained in:
Person
2017-07-04 23:08:06 -07:00
parent 562ab9b01a
commit 2adf9f3ff9
16 changed files with 292 additions and 232 deletions

View File

@ -372,7 +372,7 @@ public:
<< "\t\t}\n"
<< "\n"
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * side;\n"
<< "\t\treal_t val = M_PI_4 * perimeter / side - M_PI_4;\n"
<< "\t\treal_t val = MPI4 * perimeter / side - MPI4;\n"
<< "\t\treal_t sina = sin(val);\n"
<< "\t\treal_t cosa = cos(val);\n"
<< "\n"
@ -1108,7 +1108,7 @@ public:
ss << "\t{\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) - (real_t)(2.0));\n"
<< "\t\treal_t angle2 = MwcNext01(mwc) * M_PI;\n"
<< "\t\treal_t angle2 = MwcNext01(mwc) * MPI;\n"
<< "\t\treal_t sina = sin(angle);\n"
<< "\t\treal_t cosa = cos(angle);\n"
<< "\t\treal_t sinb = sin(angle2);\n"
@ -1710,7 +1710,7 @@ public:
<< "\t\t}\n"
<< "\n"
<< "\t\treal_t r = " << vvar4pi << " * side + " << hole << ";\n"
<< "\t\treal_t val = M_PI_4 * perimeter / side - M_PI_4;\n"
<< "\t\treal_t val = MPI4 * perimeter / side - MPI4;\n"
<< "\n"
<< "\t\tvOut.x = r * cos(val);\n"
<< "\t\tvOut.y = r * sin(val);\n"
@ -1818,7 +1818,7 @@ public:
<< "\t\t}\n"
<< "\n"
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * (side + " << hole << ");\n"
<< "\t\treal_t val = M_PI_4 * perimeter / side - M_PI_4;\n"
<< "\t\treal_t val = MPI4 * perimeter / side - MPI4;\n"
<< "\n"
<< "\t\tvOut.x = r * cos(val);\n"
<< "\t\tvOut.y = r * sin(val);\n"
@ -2171,7 +2171,7 @@ public:
intmax_t varIndex = IndexInXform();
ss << "\t{\n"
<< "\t\treal_t a = M_2PI / (precalcSqrtSumSquares + 1);\n"
<< "\t\treal_t r = (precalcAtanyx * M_1_PI + 1) * (real_t)(0.5);\n"
<< "\t\treal_t r = (precalcAtanyx * M1PI + 1) * (real_t)(0.5);\n"
<< "\t\treal_t s = sin(a);\n"
<< "\t\treal_t c = cos(a);\n"
<< "\n"
@ -2223,11 +2223,11 @@ public:
<< "\t\treal_t temp = vIn.y * " << natLog << ";\n"
<< "\t\treal_t snum1 = sin(temp);\n"
<< "\t\treal_t cnum1 = cos(temp);\n"
<< "\t\ttemp = (vIn.x * M_PI + vIn.y * " << natLog << ") * -(real_t)(1.0);\n"
<< "\t\ttemp = (vIn.x * MPI + vIn.y * " << natLog << ") * -(real_t)(1.0);\n"
<< "\t\treal_t snum2 = sin(temp);\n"
<< "\t\treal_t cnum2 = cos(temp);\n"
<< "\t\treal_t eradius1 = exp(vIn.x * " << natLog << ");\n"
<< "\t\treal_t eradius2 = exp((vIn.x * " << natLog << " - vIn.y * M_PI) * -(real_t)(1.0));\n"
<< "\t\treal_t eradius2 = exp((vIn.x * " << natLog << " - vIn.y * MPI) * -(real_t)(1.0));\n"
<< "\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"
@ -2298,11 +2298,11 @@ public:
<< "\t\treal_t temp = vIn.y * " << natLog << ";\n"
<< "\t\treal_t snum1 = sin(temp);\n"
<< "\t\treal_t cnum1 = cos(temp);\n"
<< "\t\ttemp = (vIn.x * M_PI + vIn.y * " << natLog << ") * -1;\n"
<< "\t\ttemp = (vIn.x * MPI + vIn.y * " << natLog << ") * -1;\n"
<< "\t\treal_t snum2 = sin(temp);\n"
<< "\t\treal_t cnum2 = cos(temp);\n"
<< "\t\treal_t eradius1 = " << sc << " * exp(" << sc2 << " * (vIn.x * " << natLog << "));\n"
<< "\t\treal_t eradius2 = " << sc << " * exp(" << sc2 << " * ((vIn.x * " << natLog << " - vIn.y * M_PI) * -1));\n"
<< "\t\treal_t eradius2 = " << sc << " * exp(" << sc2 << " * ((vIn.x * " << natLog << " - vIn.y * MPI) * -1));\n"
<< "\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"
@ -2647,7 +2647,7 @@ public:
string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
string inside = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
ss << "\t{\n"
<< "\t\treal_t r, delta = pow(precalcAtanyx / (real_t)M_PI + 1, " << a << ");\n"
<< "\t\treal_t r, delta = pow(precalcAtanyx / MPI + 1, " << a << ");\n"
<< "\n"
<< "\t\tif (" << inside << " != 0)\n"
<< "\t\t r = xform->m_VariationWeights[" << varIndex << "] * delta / (precalcSqrtSumSquares + delta);\n"
@ -3310,7 +3310,7 @@ public:
string index = ss2.str();
string v = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params.
ss << "\t{\n"
<< "\t\treal_t a = M_PI / (precalcSqrtSumSquares + 1);\n"
<< "\t\treal_t a = MPI / (precalcSqrtSumSquares + 1);\n"
<< "\t\treal_t s = sin(a);\n"
<< "\t\treal_t c = cos(a);\n"
<< "\t\treal_t r = precalcAtanyx * " << v << ";\n"