mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-06-30 21:36:33 -04:00
--User changes
-Allow for pausing the renderer in the main window. This makes is more efficient when entering many parameters, such as when following a tutorial. -Add support for new variations: erf, gamma, jac_cn, jac_dn, jac_sn, logDB, pressure_wave, pRose3D, splits3D, w, waves2b, x, xerf, y, z. -Inform user of the start and stop of file parsing in EmberAnimate because the files could potentially be very large. -Move the follwing fields to a new table called Animation: Interpolation, Affine Interpolation, Temporal Samples, Temporal Filter Width, Temporal Filter Type. -These currently have no effect on the interactive renderer and instead are used when running flames through EmberGenome to generate sequences, and then animating them in Fractorium or EmberAnimate. -Add new parameter overrides for EmberRender and EmberAnimate which directly assign values to all flames being rendered, rather than scale: --quality --demin --demax --Bug fixes -Left pad instead of right pad names of sequence outputs from EmberGenome. -Unique file naming was broken for files which already had an underscore in them. -Properly report that png is the default format of EmberRender and EmberAnimate output instead of erroneously claiming it was jpg. -Make command line programs search these folders in this order for the palette file: ./ ~/.fractorium ~/.config/fractorium /usr/share/fractorium /usr/local/share/fractorium -Fix possible bad values in hexes. -Better assignment of Z variables. -Fix boarders due to use of poorly implemented rint() function from flam3. Use std::rint() now. -wedge_sph was completely wrong due to having accidentally swapped the mapping of two parameters. -Make juliascope juliascope_power parameter be of type REAL_NONZERO since it's used as a denominator. -Make Z assignment compatible with the originals in: -arch, bcircle, bCollide, bent, bent2, bisplit, blob, blur_linear, blur_square, bMod, boarders, boarders2, bSwirl, bTransform, butterfly, cardioid, cell, circleblur, circlize, circlize2, circus, collideoscope, cos, cosine, cosh, coth, cpow, cpow2, crescents, cropn, csc, csch, curl, curve, dc_gridout, deltaa, diamond, disc2, eclipse, eCollide, edisc, eJulia, elliptic, eMod, eMotion, ennepers, epispiral, ePush, eRotate, eScale, eSwirl, ex, exp, expo, exponential, fan, fdisc, fibonacci, fibonacci2, fisheye, flipcircle, flipy, flower, flux, funnel, glynnia, GlynnSim1, GlynnSim2, GlynnSim3, gridout, handkerchief, heart, hole, idisc, julia, julian2, juliaNab, kaleidoscope, lazyTravis, Lissajous, mask, MobiusN, mobius_strip, modulus, murl, murl2, npolar, ortho, oscilloscope, parabola, perspective, petal, phoenix_julia, pie (was also inconsistent between cpu and gpu), poincare, popcorn, popcorn2, power, pow_block, rational3, rays, rblur, rings, rippled, roundspher, sec, secant2, sigmoid, sin, sineblur, sinh, sinusgrid, sphericaln, spiralwing, spirograph, split, squarize, squirrel, squish, sschecks, starblur, stripes, stwin, super_shape, tan, tancos, tangent, tanh, TwinTrian, twoface, unpolar, waves, wavesn, wedge_julia, whorl, xheart, zblur, zscale. --Code changes -Generalize Variation::PrecalcHelper() and rename to PrePostPrecalcHelper(). --Do the same for the OpenCL version and rename it PrePostPrecalcOpenCLString(). -Rename Variation::m_AssignType to m_PrePostAssignType since it's only relevant to pre/post variations.
This commit is contained in:
@ -73,7 +73,6 @@ static string ConstantDefinesString(bool doublePrecision)
|
||||
"#define COLORMAP_LENGTH_MINUS_1 255u\n"
|
||||
"#define DE_THRESH 100u\n"
|
||||
"#define BadVal(x) (((x) != (x)) || ((x) > 1e10) || ((x) < -1e10))\n"
|
||||
"#define Rint(A) floor((A) + (((A) < 0) ? -0.5 : 0.5))\n"
|
||||
"#define SQR(x) ((x) * (x))\n"
|
||||
"#define CUBE(x) ((x) * (x) * (x))\n"
|
||||
"#define M_2PI (M_PI * 2)\n"
|
||||
|
@ -43,6 +43,14 @@ FunctionMapper::FunctionMapper()
|
||||
"\n"
|
||||
" return sqrt(x);\n"
|
||||
"}\n";
|
||||
m_GlobalMap["SafeDivInv"] =
|
||||
"inline real_t SafeDivInv(real_t q, real_t r)\n"
|
||||
"{\n"
|
||||
" if (r < EPS)\n"
|
||||
" return 1 / r;\n"
|
||||
"\n"
|
||||
" return q / r;\n"
|
||||
"}\n";
|
||||
m_GlobalMap["Cube"] =
|
||||
"inline real_t Cube(real_t v)\n"
|
||||
"{\n"
|
||||
@ -125,7 +133,7 @@ FunctionMapper::FunctionMapper()
|
||||
" if (pmq.x == 0 && pmq.y == 0)\n"
|
||||
" return 1.0;\n"
|
||||
"\n"
|
||||
" return 2 * (((*u).x - (*q).x) * pmq.x + ((*u).y - (*q).y) * pmq.y) / (SQR(pmq.x) + SQR(pmq.y));\n"
|
||||
" return 2 * (((*u).x - (*q).x) * pmq.x + ((*u).y - (*q).y) * pmq.y) / Zeps(SQR(pmq.x) + SQR(pmq.y));\n"
|
||||
"}\n";
|
||||
m_GlobalMap["Closest"] =
|
||||
"inline int Closest(real2* p, int n, real2* u)\n"
|
||||
@ -273,6 +281,93 @@ FunctionMapper::FunctionMapper()
|
||||
"\n"
|
||||
" return n;\n"
|
||||
"}\n";
|
||||
m_GlobalMap["JacobiElliptic"] =
|
||||
"inline void JacobiElliptic(real_t uu, real_t emmc, real_t* sn, real_t* cn, real_t* dn)\n"
|
||||
"{\n"
|
||||
" real_t CA = 0.0003;\n"
|
||||
" real_t a, b, c, d, em[13], en[13];\n"
|
||||
" int bo;\n"
|
||||
" int l;\n"
|
||||
" int ii;\n"
|
||||
" int i;\n"
|
||||
" real_t emc = emmc;\n"
|
||||
" real_t u = uu;\n"
|
||||
"\n"
|
||||
" if (emc != 0)\n"
|
||||
" {\n"
|
||||
" bo = 0;\n"
|
||||
"\n"
|
||||
" if (emc < 0)\n"
|
||||
" bo = 1;\n"
|
||||
"\n"
|
||||
" if (bo != 0)\n"
|
||||
" {\n"
|
||||
" d = 1 - emc;\n"
|
||||
" emc = -emc / d;\n"
|
||||
" d = sqrt(d);\n"
|
||||
" u = d * u;\n"
|
||||
" }\n"
|
||||
"\n"
|
||||
" a = 1;\n"
|
||||
" *dn = 1;\n"
|
||||
"\n"
|
||||
" for (i = 0; i < 8; i++)\n"
|
||||
" {\n"
|
||||
" l = i;\n"
|
||||
" em[i] = a;\n"
|
||||
" emc = sqrt(emc);\n"
|
||||
" en[i] = emc;\n"
|
||||
" c = 0.5 * (a + emc);\n"
|
||||
"\n"
|
||||
" if (fabs(a - emc) <= CA * a)\n"
|
||||
" break;\n"
|
||||
"\n"
|
||||
" emc = a * emc;\n"
|
||||
" a = c;\n"
|
||||
" }\n"
|
||||
"\n"
|
||||
" u = c * u;\n"
|
||||
" *sn = sincos(u, cn);\n"
|
||||
"\n"
|
||||
" if (*sn != 0)\n"
|
||||
" {\n"
|
||||
" a = *cn / *sn;\n"
|
||||
" c = a * c;\n"
|
||||
"\n"
|
||||
" for (ii = l; ii >= 0; --ii)\n"
|
||||
" {\n"
|
||||
" b = em[ii];\n"
|
||||
" a = c * a;\n"
|
||||
" c = *dn * c;\n"
|
||||
" *dn = (en[ii] + a) / (b + a);\n"
|
||||
" a = c / b;\n"
|
||||
" }\n"
|
||||
"\n"
|
||||
" a = 1 / sqrt(c * c + 1);\n"
|
||||
"\n"
|
||||
" if (*sn < 0)\n"
|
||||
" *sn = -a;\n"
|
||||
" else\n"
|
||||
" *sn = a;\n"
|
||||
"\n"
|
||||
" *cn = c * *sn;\n"
|
||||
" }\n"
|
||||
"\n"
|
||||
" if (bo != 0)\n"
|
||||
" {\n"
|
||||
" a = *dn;\n"
|
||||
" *dn = *cn;\n"
|
||||
" *cn = a;\n"
|
||||
" *sn = *sn / d;\n"
|
||||
" }\n"
|
||||
" }\n"
|
||||
" else\n"
|
||||
" {\n"
|
||||
" *cn = 1 / cosh(u);\n"
|
||||
" *dn = *cn;\n"
|
||||
" *sn = tanh(u);\n"
|
||||
" }\n"
|
||||
"}\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -122,8 +122,8 @@ string IterOpenCLKernelCreator<T>::CreateIterKernelString(const Ember<T>& ember,
|
||||
if (Variation<T>* var = xform->GetVariation(varIndex))
|
||||
{
|
||||
xformFuncs << "\n\t//" << var->Name() << ".\n";
|
||||
xformFuncs << var->PrecalcOpenCLString();
|
||||
xformFuncs << xform->ReadOpenCLString(eVariationType::VARTYPE_PRE) << "\n";
|
||||
xformFuncs << var->PrePostPrecalcOpenCLString();
|
||||
xformFuncs << var->OpenCLString() << "\n";
|
||||
xformFuncs << xform->WriteOpenCLString(eVariationType::VARTYPE_PRE, var->AssignType()) << "\n";
|
||||
}
|
||||
@ -188,8 +188,8 @@ string IterOpenCLKernelCreator<T>::CreateIterKernelString(const Ember<T>& ember,
|
||||
if (Variation<T>* var = xform->GetVariation(varIndex))
|
||||
{
|
||||
xformFuncs << "\n\t//" << var->Name() << ".\n";
|
||||
xformFuncs << var->PrecalcOpenCLString();
|
||||
xformFuncs << xform->ReadOpenCLString(eVariationType::VARTYPE_POST) << "\n";
|
||||
xformFuncs << var->PrePostPrecalcOpenCLString();
|
||||
xformFuncs << var->OpenCLString() << "\n";
|
||||
xformFuncs << xform->WriteOpenCLString(eVariationType::VARTYPE_POST, var->AssignType()) << (varIndex == varCount - 1 ? "\n" : "\n\n");
|
||||
}
|
||||
|
Reference in New Issue
Block a user