mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-01-21 21:20:07 -05:00
Merged mfeemster/fractorium into master
This commit is contained in:
commit
6f0f81d7bf
@ -3084,12 +3084,11 @@ public:
|
||||
|
||||
virtual void Precalc() override
|
||||
{
|
||||
T pa = T(M_2PI) / Zeps(m_P);
|
||||
T pa = M_2PI / Zeps(m_P);
|
||||
T cs = std::cos(pa);
|
||||
T r2 = (T(1) - cs) / (cs + cos(M_2PI / Zeps(m_Q))) + 1;
|
||||
T r = (r2 > 0) ? T(1) / sqrt(r2) : T(1);
|
||||
T a = m_N * pa;
|
||||
|
||||
m_Real = r * std::cos(a);
|
||||
m_Imag = r * std::sin(a);
|
||||
}
|
||||
@ -3178,7 +3177,7 @@ public:
|
||||
|
||||
virtual void Precalc() override
|
||||
{
|
||||
m_Pa = T(M_2PI) / Zeps(m_P);
|
||||
m_Pa = M_2PI / Zeps(m_P);
|
||||
T cs = cos(m_Pa);
|
||||
T r2 = T(1) - (cs - 1) / (cs + cos(M_2PI / Zeps(m_Q)));
|
||||
m_R = (r2 > 0) ? T(1) / sqrt(r2) : T(1);
|
||||
|
@ -2294,7 +2294,7 @@ public:
|
||||
T x = rad * fx + m_Shift;
|
||||
T y = rad * fy;
|
||||
rad = m_Weight * m_Scale / Zeps(x * x + y * y);
|
||||
T angle = ((rand.Rand() % int(m_P)) * 2 + 1) * T(M_PI) / m_P;
|
||||
T angle = ((rand.Frand01<T>() * m_IP) + 1) * T(M_PI) / m_P;
|
||||
T X = rad * x + m_Shift;
|
||||
T Y = rad * y;
|
||||
T cosa = std::cos(angle);
|
||||
@ -2320,14 +2320,15 @@ public:
|
||||
string shift = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string scale2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string ip = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t fx = vIn.x * " << scale2 << ";\n"
|
||||
<< "\t\treal_t fy = vIn.y * " << scale2 << ";\n"
|
||||
<< "\t\treal_t rad = 1 / Zeps(fma(fx, fx, SQR(fy)));\n"
|
||||
<< "\t\treal_t x = rad * fx + " << shift << ";\n"
|
||||
<< "\t\treal_t x = fma(rad, fx, " << shift << ");\n"
|
||||
<< "\t\treal_t y = rad * fy;\n"
|
||||
<< "\t\trad = " << weight << " * " << scale << " / Zeps(fma(x, x, SQR(y)));\n"
|
||||
<< "\t\treal_t angle = (MwcNextRange(mwc, (int)" << p << ") * 2 + 1) * MPI / " << p << ";\n"
|
||||
<< "\t\treal_t angle = fma(MwcNext01(mwc), " << ip << ", (real_t)(1.0)) * MPI / " << p << ";\n"
|
||||
<< "\t\treal_t X = fma(rad, x, " << shift << ");\n"
|
||||
<< "\t\treal_t Y = rad * y;\n"
|
||||
<< "\t\treal_t cosa = cos(angle);\n"
|
||||
@ -2354,6 +2355,7 @@ public:
|
||||
m_Scale2 = 1 / std::sqrt(Sqr(sin(T(M_PI) / 2 + pp)) / Sqr(spq) - 1);
|
||||
m_Scale2 = m_Scale2 * (std::sin(T(M_PI) / 2 + pp) / spq - 1);
|
||||
m_Scale = 1 - SQR(m_Shift);
|
||||
m_IP = T((int)m_P * 2);
|
||||
}
|
||||
|
||||
virtual vector<string> OpenCLGlobalFuncNames() const override
|
||||
@ -2371,6 +2373,7 @@ protected:
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_Shift, prefix + "hypershift2_shift"));//Precalc.
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_Scale, prefix + "hypershift2_scale"));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_Scale2, prefix + "hypershift2_scale2"));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_IP, prefix + "hypershift2_ip"));
|
||||
}
|
||||
|
||||
private:
|
||||
@ -2379,6 +2382,7 @@ private:
|
||||
T m_Shift;//Precalc.
|
||||
T m_Scale;
|
||||
T m_Scale2;
|
||||
T m_IP;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
@ -443,7 +443,8 @@ bool FractoriumEmberController<T>::Render()
|
||||
{
|
||||
auto btn = QApplication::mouseButtons();
|
||||
|
||||
if (!btn.testFlag(Qt::LeftButton) && !btn.testFlag(Qt::RightButton) && !btn.testFlag(Qt::MiddleButton))
|
||||
if ((action == eProcessAction::ACCUM_ONLY || action == eProcessAction::FILTER_AND_ACCUM) ||
|
||||
(!btn.testFlag(Qt::LeftButton) && !btn.testFlag(Qt::RightButton) && !btn.testFlag(Qt::MiddleButton)))
|
||||
{
|
||||
m_UndoList.push_back(m_Ember);
|
||||
m_UndoIndex = m_UndoList.size() - 1;
|
||||
|
Loading…
Reference in New Issue
Block a user