mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-07-01 05:46:06 -04:00
--User changes
-Add new variations waves22, waves23, waves42, waves3 and waves4 from user tatasz. -Add new stylesheet called lightdark.qss which gives a more modern look to the dark theme. Started by Michel Mastriani (triptychaos). --Included in the qmake and Wix installers. --Code changes -Add a new C# project that attempts to convert Apophysis plugins to Fractorium style Variation classes. It's not entirely perfect, but gets most of the job done much more quickly than doing so manually. -Remove unused OpenCL functions from variations: elliptic, poincare, mask, bMod, bSwirl, bTransform, bCollide, farblur, popcorn2_3D, falloff, falloff2, falloff3, crackle2, waves2b, hypercrop, depth_gaussian2, depth_sine, depth_sine2, dust, asteria, vibration, vibration2, arctanh, smartshape, squares, starblur2, Truchet,. -Add code in EmberTester to automatically detect such unused functions.
This commit is contained in:
@ -185,13 +185,13 @@ static const char* RandFunctionString =
|
||||
"inline real_t MwcNextFRange(uint2* s, real_t lower, real_t upper)\n"
|
||||
"{\n"
|
||||
" real_t f = (real_t)MwcNext(s) / (real_t)UINT_MAX;\n"
|
||||
" return lower + (f * (upper - lower));\n"
|
||||
" return fma(f, upper - lower, lower);\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"inline real_t MwcNextNeg1Pos1(uint2* s)\n"
|
||||
"{\n"
|
||||
" real_t f = (real_t)MwcNext(s) / (real_t)UINT_MAX;\n"
|
||||
" return -1.0 + (f * 2.0);\n"
|
||||
" return fma(f, 2.0, -1.0);\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"inline real_t MwcNext0505(uint2* s)\n"
|
||||
@ -213,11 +213,12 @@ static const char* AddToAccumWithCheckFunctionString =
|
||||
|
||||
/// <summary>
|
||||
/// OpenCL equivalent various CarToRas member functions.
|
||||
/// Normaly would subtract m_RasLlX and m_RasLlY, but they were negated in RendererCL before being passed in, so they could be used with fma().
|
||||
/// </summary>
|
||||
static const char* CarToRasFunctionString =
|
||||
"inline void CarToRasConvertPointToSingle(__constant CarToRasCL* carToRas, Point* point, uint* singleBufferIndex)\n"
|
||||
"{\n"
|
||||
" *singleBufferIndex = (uint)(carToRas->m_PixPerImageUnitW * point->m_X - carToRas->m_RasLlX) + (carToRas->m_RasWidth * (uint)(carToRas->m_PixPerImageUnitH * point->m_Y - carToRas->m_RasLlY));\n"
|
||||
" *singleBufferIndex = (uint)fma(carToRas->m_PixPerImageUnitW, point->m_X, carToRas->m_RasLlX) + (carToRas->m_RasWidth * (uint)fma(carToRas->m_PixPerImageUnitH, point->m_Y, carToRas->m_RasLlY));\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"inline bool CarToRasInBounds(__constant CarToRasCL* carToRas, Point* point)\n"
|
||||
|
@ -83,6 +83,7 @@ static string ConstantDefinesString(bool doublePrecision)
|
||||
"#define M_3PI (MPI * 3)\n"
|
||||
"#define SQRT5 2.2360679774997896964091736687313\n"
|
||||
"#define M_PHI 1.61803398874989484820458683436563\n"
|
||||
"#define M_1_2PI 0.15915494309189533576888376337251\n"
|
||||
"#define DEG_2_RAD (MPI / 180)\n"
|
||||
"#define CURVES_LENGTH_M1 ((real_bucket_t)" << CURVES_LENGTH_M1 << ")\n" <<
|
||||
"#define ONE_OVER_CURVES_LENGTH_M1 ((real_bucket_t)" << ONE_OVER_CURVES_LENGTH_M1 << ")\n" <<
|
||||
|
@ -93,7 +93,7 @@ string IterOpenCLKernelCreator<T>::CreateIterKernelString(const Ember<T>& ember,
|
||||
if (needPrecalcAtanYX)
|
||||
xformFuncs << "\treal_t precalcAtanyx;\n";
|
||||
|
||||
xformFuncs << "\treal_t tempColor = outPoint->m_ColorX = xform->m_ColorSpeedCache + (xform->m_OneMinusColorCache * inPoint->m_ColorX);\n\n";
|
||||
xformFuncs << "\treal_t tempColor = outPoint->m_ColorX = fma(xform->m_OneMinusColorCache, inPoint->m_ColorX, xform->m_ColorSpeedCache);\n\n";
|
||||
|
||||
if (xform->PreVariationCount() + xform->VariationCount() == 0)
|
||||
{
|
||||
@ -215,7 +215,7 @@ string IterOpenCLKernelCreator<T>::CreateIterKernelString(const Ember<T>& ember,
|
||||
"\toutPoint->m_Y = fma(xform->m_PostD, tempX, fma(xform->m_PostE, outPoint->m_Y, xform->m_PostF));\n";
|
||||
}
|
||||
|
||||
xformFuncs << "\toutPoint->m_ColorX = tempColor + xform->m_DirectColor * (outPoint->m_ColorX - tempColor);\n";
|
||||
xformFuncs << "\toutPoint->m_ColorX = fma(xform->m_DirectColor, (outPoint->m_ColorX - tempColor), tempColor);\n";
|
||||
xformFuncs << "\n";
|
||||
xformFuncs << "\tif (isnan(outPoint->m_ColorX))\n";
|
||||
xformFuncs << "\t outPoint->m_ColorX = 0.0; \n";
|
||||
|
@ -1822,9 +1822,9 @@ void RendererCL<T, bucketT>::ConvertCarToRas(const CarToRas<T>& carToRas)
|
||||
{
|
||||
m_CarToRasCL.m_RasWidth = uint(carToRas.RasWidth());
|
||||
m_CarToRasCL.m_PixPerImageUnitW = carToRas.PixPerImageUnitW();
|
||||
m_CarToRasCL.m_RasLlX = carToRas.RasLlX();
|
||||
m_CarToRasCL.m_RasLlX = -carToRas.RasLlX();//Flip here because it's only used by CarToRasConvertPointToSingle(), which only needs the negative of it.
|
||||
m_CarToRasCL.m_PixPerImageUnitH = carToRas.PixPerImageUnitH();
|
||||
m_CarToRasCL.m_RasLlY = carToRas.RasLlY();
|
||||
m_CarToRasCL.m_RasLlY = -carToRas.RasLlY();//Ditto here.
|
||||
m_CarToRasCL.m_CarLlX = carToRas.CarLlX();
|
||||
m_CarToRasCL.m_CarLlY = carToRas.CarLlY();
|
||||
m_CarToRasCL.m_CarUrX = carToRas.CarUrX();
|
||||
|
Reference in New Issue
Block a user