From cf9da379b65cfd0247d8a339f8747ab5a4604669 Mon Sep 17 00:00:00 2001 From: mfeemster Date: Fri, 29 Jan 2016 17:02:15 -0800 Subject: [PATCH] --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. --- Builds/MSVC/VS2013/Ember.vcxproj | 1 + Builds/MSVC/VS2013/Ember.vcxproj.filters | 3 + Builds/QtCreator/Ember/Ember.pro | 1 + Builds/QtCreator/defaults.pri | 19 +- Data/Variations.xlsx | Bin 29043 -> 29102 bytes Data/dark.qss | 3 +- Source/Ember/Ember.cpp | 16 + Source/Ember/Ember.h | 2 +- Source/Ember/EmberDefines.h | 1 - Source/Ember/EmberToXml.h | 10 +- Source/Ember/Utils.h | 16 + Source/Ember/VarFuncs.h | 95 +- Source/Ember/Variation.h | 201 +-- Source/Ember/VariationList.h | 16 + Source/Ember/Variations01.h | 314 ++-- Source/Ember/Variations02.h | 167 +- Source/Ember/Variations03.h | 166 +- Source/Ember/Variations04.h | 90 +- Source/Ember/Variations05.h | 46 +- Source/Ember/Variations06.h | 1027 +++++++++++- Source/Ember/Variations07.h | 968 ++++++++++++ Source/Ember/VariationsDC.h | 12 +- Source/Ember/Xform.h | 4 +- Source/Ember/XmlToEmber.h | 1 + Source/EmberAnimate/EmberAnimate.cpp | 16 +- Source/EmberCL/EmberCLStructs.h | 1 - Source/EmberCL/FunctionMapper.cpp | 97 +- Source/EmberCL/IterOpenCLKernelCreator.cpp | 4 +- Source/EmberCommon/EmberCommon.h | 14 + Source/EmberCommon/EmberOptions.h | 24 +- Source/EmberGenome/EmberGenome.cpp | 15 + Source/EmberRender/EmberRender.cpp | 9 + Source/EmberTester/EmberTester.cpp | 2 +- Source/Fractorium/EmberFile.h | 6 +- Source/Fractorium/Fractorium.h | 2 + Source/Fractorium/Fractorium.qrc | 2 + Source/Fractorium/Fractorium.ui | 1382 ++++++++++------- Source/Fractorium/FractoriumMenus.cpp | 2 + Source/Fractorium/FractoriumParams.cpp | 22 +- Source/Fractorium/FractoriumRender.cpp | 14 + Source/Fractorium/FractoriumToolbar.cpp | 33 +- .../Fractorium/Icons/control-stop-square.png | Bin 0 -> 404 bytes Source/Fractorium/Icons/control.png | Bin 0 -> 419 bytes 43 files changed, 3688 insertions(+), 1136 deletions(-) create mode 100644 Source/Ember/Variations07.h create mode 100644 Source/Fractorium/Icons/control-stop-square.png create mode 100644 Source/Fractorium/Icons/control.png diff --git a/Builds/MSVC/VS2013/Ember.vcxproj b/Builds/MSVC/VS2013/Ember.vcxproj index 3160a48..0688dec 100644 --- a/Builds/MSVC/VS2013/Ember.vcxproj +++ b/Builds/MSVC/VS2013/Ember.vcxproj @@ -299,6 +299,7 @@ + diff --git a/Builds/MSVC/VS2013/Ember.vcxproj.filters b/Builds/MSVC/VS2013/Ember.vcxproj.filters index fb9f959..c5bda1e 100644 --- a/Builds/MSVC/VS2013/Ember.vcxproj.filters +++ b/Builds/MSVC/VS2013/Ember.vcxproj.filters @@ -122,6 +122,9 @@ Header Files + + Header Files\Variations + diff --git a/Builds/QtCreator/Ember/Ember.pro b/Builds/QtCreator/Ember/Ember.pro index bf31d8f..9f0ea05 100644 --- a/Builds/QtCreator/Ember/Ember.pro +++ b/Builds/QtCreator/Ember/Ember.pro @@ -59,6 +59,7 @@ HEADERS += \ $$PRJ_DIR/Variations04.h \ $$PRJ_DIR/Variations05.h \ $$PRJ_DIR/Variations06.h \ + $$PRJ_DIR/Variations07.h \ $$PRJ_DIR/VariationsDC.h \ $$PRJ_DIR/VarFuncs.h \ $$PRJ_DIR/Xform.h \ diff --git a/Builds/QtCreator/defaults.pri b/Builds/QtCreator/defaults.pri index 917a1e7..e458994 100644 --- a/Builds/QtCreator/defaults.pri +++ b/Builds/QtCreator/defaults.pri @@ -14,16 +14,21 @@ unix|macx { #This cannot be this... #EMBER_ROOT = $$(PWD)/../../.. #It must be this... -EMBER_ROOT = ./../../../ +win32:{ +EMBER_ROOT = ./../../ +} +unix|macx{ +EMBER_ROOT = ./../../.. +} # When compiling from project root autobuild { - EMBER_ROOT = $$(PWD)/../.. +# EMBER_ROOT = $$(PWD)/../.. } win32:{ - EMBER_ROOT = $$(PWD)../../.. - EXTERNAL_DIR = $$(PWD)../../../../External - EXTERNAL_LIB = $$(PWD)../../../External/libs + #EMBER_ROOT = $$(PWD)../../.. + EXTERNAL_DIR = $$(EMBER_ROOT)/../ + EXTERNAL_LIB = $$(EMBER_ROOT)/../ # EXTERNAL_DIR which contains Third Party Codes is in the parent folder of "fractorium" # EXTERNAL_LIB is in EXTERNAL_DIR actually, but it is strange that EXTERNAL_DIR must go # one more step upper than EXTERNAL_LIB to get it work @@ -32,8 +37,8 @@ win32:{ SHARE_INSTALL_DIR = $$(PWD)../../../Install/share/fractorium # INSTALL_DIRs Don't work? message(EMBER_ROOT: $$absolute_path($$EMBER_ROOT)) - message(EXTERNAL: $$absolute_path($$EXTERNAL_DIR)) - message(EXTERNAL_LIB:$$absolute_path($$EXTERNAL_LIB) ) + message(EXTERNAL_DIR: $$absolute_path($$EXTERNAL_DIR)) + message(EXTERNAL_LIB: $$absolute_path($$EXTERNAL_LIB) ) } message(EMBER_ROOT: $$EMBER_ROOT) diff --git a/Data/Variations.xlsx b/Data/Variations.xlsx index 040dd5c280f173fcea73f28602ac246adb289110..4563f8e35bc54f0a82b2f549dec4a79f90c702bb 100644 GIT binary patch delta 20721 zc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data/dark.qss +++ b/Data/dark.qss @@ -537,6 +537,7 @@ QTableWidget#ColorTableHeader QHeaderView::section::horizontal, QTableWidget#GeometryTableHeader QHeaderView::section::horizontal, QTableWidget#FilterTableHeader QHeaderView::section::horizontal, QTableWidget#IterationTableHeader QHeaderView::section::horizontal, +QTableWidget#AnimationTableHeader QHeaderView::section::horizontal, QTreeWidget#LibraryTree QHeaderView::section::horizontal { border-right: none; @@ -546,6 +547,7 @@ QTableWidget#ColorTable, QTableWidget#GeometryTable, QTableWidget#FilterTable, QTableWidget#IterationTable, +QTableWidget#AnimationTable, QTableWidget#XformWeightNameTable { border-left: 1px solid gray; @@ -617,4 +619,3 @@ QTableView#FinalRenderParamsTable QPushButton margin-bottom: 2px; padding: 0px; } - \ No newline at end of file diff --git a/Source/Ember/Ember.cpp b/Source/Ember/Ember.cpp index 5b7ab1f..7161b8e 100644 --- a/Source/Ember/Ember.cpp +++ b/Source/Ember/Ember.cpp @@ -23,6 +23,7 @@ template<> CriticalSection QTIsaac::m_CS = CriticalSectio #include "Variations04.h" #include "Variations05.h" #include "Variations06.h" +#include "Variations07.h" #include "VariationsDC.h" #include "VariationList.h" #include "Affine2D.h" @@ -379,6 +380,21 @@ uint Timing::m_ProcessorCount; EXPORTPREPOSTREGVAR(BubbleT3D, T) \ EXPORTPREPOSTREGVAR(Synth, T) \ EXPORTPREPOSTREGVAR(Crackle, T) \ + EXPORTPREPOSTREGVAR(Erf, T) \ + EXPORTPREPOSTREGVAR(Xerf, T) \ + EXPORTPREPOSTREGVAR(W, T) \ + EXPORTPREPOSTREGVAR(X, T) \ + EXPORTPREPOSTREGVAR(Y, T) \ + EXPORTPREPOSTREGVAR(Z, T) \ + EXPORTPREPOSTREGVAR(Splits3D, T) \ + EXPORTPREPOSTREGVAR(Waves2B, T) \ + EXPORTPREPOSTREGVAR(JacCn, T) \ + EXPORTPREPOSTREGVAR(JacDn, T) \ + EXPORTPREPOSTREGVAR(JacSn, T) \ + EXPORTPREPOSTREGVAR(PressureWave, T) \ + EXPORTPREPOSTREGVAR(Gamma, T) \ + EXPORTPREPOSTREGVAR(PRose3D, T) \ + EXPORTPREPOSTREGVAR(LogDB, T) \ template EMBER_API class PostSmartcropVariation; /*Only implemented as post.*/ \ EXPORTPREPOSTREGVAR(DCBubble, T) \ EXPORTPREPOSTREGVAR(DCCarpet, T) \ diff --git a/Source/Ember/Ember.h b/Source/Ember/Ember.h index 732c63a..0608c34 100644 --- a/Source/Ember/Ember.h +++ b/Source/Ember/Ember.h @@ -1794,7 +1794,7 @@ private: for (size_t k = 0; k < size; k++) t += coefs[k] * embers[k].*m; - this->*m = size_t(Rint(t)); + this->*m = size_t(std::rint(t)); } /// diff --git a/Source/Ember/EmberDefines.h b/Source/Ember/EmberDefines.h index 77558f9..1b4d3f9 100644 --- a/Source/Ember/EmberDefines.h +++ b/Source/Ember/EmberDefines.h @@ -64,7 +64,6 @@ namespace EmberNs #define CX(c) (reinterpret_cast(c)) #define CCX(c) (reinterpret_cast(c)) #define BadVal(x) (((x) != (x)) || ((x) > 1e10) || ((x) < -1e10)) -#define Rint(A) floor((A) + (((A) < 0) ? T(-0.5) : T(0.5))) #define Vlen(x) (sizeof(x) / sizeof(*x)) #define SQR(x) ((x) * (x)) #define CUBE(x) ((x) * (x) * (x)) diff --git a/Source/Ember/EmberToXml.h b/Source/Ember/EmberToXml.h index 858f2cc..2dcc99e 100644 --- a/Source/Ember/EmberToXml.h +++ b/Source/Ember/EmberToXml.h @@ -270,9 +270,9 @@ public: for (j = 0; j < 8; j++) { size_t idx = 8 * i + j; - os << hex << setw(2) << setfill('0') << int(Rint(ember.m_Palette[idx][0] * 255)); - os << hex << setw(2) << setfill('0') << int(Rint(ember.m_Palette[idx][1] * 255)); - os << hex << setw(2) << setfill('0') << int(Rint(ember.m_Palette[idx][2] * 255)); + os << hex << setw(2) << setfill('0') << int(std::rint(ember.m_Palette[idx][0] * 255)); + os << hex << setw(2) << setfill('0') << int(std::rint(ember.m_Palette[idx][1] * 255)); + os << hex << setw(2) << setfill('0') << int(std::rint(ember.m_Palette[idx][2] * 255)); } os << endl; @@ -294,14 +294,14 @@ public: if (IsClose(a, 255.0)) { if (intPalette) - os << ""; + os << ""; else os << ""; } else { if (intPalette) - os << " "; + os << " "; else os << " "; } diff --git a/Source/Ember/Utils.h b/Source/Ember/Utils.h index 6f10e9c..02d8b0e 100644 --- a/Source/Ember/Utils.h +++ b/Source/Ember/Utils.h @@ -658,6 +658,22 @@ double SafeTan(double x) return std::tan(x); } +/// +/// If r < EPS, return 1 / r. +/// Else, return q / r. +/// +/// The numerator +/// The denominator +/// The quotient +template +static inline T SafeDivInv(T q, T r) +{ + if (r < EPS) + return 1 / r; + + return q / r; +} + /// /// Return the cube of the passed in value. /// This is useful when the value is a result of a computation diff --git a/Source/Ember/VarFuncs.h b/Source/Ember/VarFuncs.h index c621e6b..a607bb4 100644 --- a/Source/Ember/VarFuncs.h +++ b/Source/Ember/VarFuncs.h @@ -255,7 +255,7 @@ public: if (pmq.x == 0 && pmq.y == 0) return 1; - return 2 * ((u.x - q.x) * pmq.x + (u.y - q.y) * pmq.y) / (SQR(pmq.x) + SQR(pmq.y)); + return 2 * ((u.x - q.x) * pmq.x + (u.y - q.y) * pmq.y) / Zeps(SQR(pmq.x) + SQR(pmq.y)); } /// @@ -279,6 +279,99 @@ public: return ratiomax; } + /// + /// Used in the jac_* variations. + /// + static void JacobiElliptic(T uu, T emmc, T& sn, T& cn, T& dn) + { + //Code is taken from IROIRO++ library, + //released under CC share-alike license. + //Less accurate for faster rendering (still very precise). + T const CA = T(0.0003);//The accuracy is the square of CA. + T a, b, c, d, em[13], en[13]; + int bo; + int l; + int ii; + int i; + T emc = emmc; + T u = uu; + + if (emc != 0) + { + bo = 0; + + if (emc < 0) + bo = 1; + + if (bo != 0) + { + d = 1 - emc; + emc = -emc / d; + d = std::sqrt(d); + u = d * u; + } + + a = 1; + dn = 1; + + for (i = 0; i < 8; i++) + { + l = i; + em[i] = a; + emc = std::sqrt(emc); + en[i] = emc; + c = T(0.5) * (a + emc); + + if (std::abs(a - emc) <= CA * a) + break; + + emc = a * emc; + a = c; + } + + u = c * u; + sincos(u, &sn, &cn); + + if (sn != 0) + { + a = cn / sn; + c = a * c; + + for (ii = l; ii >= 0; --ii) + { + b = em[ii]; + a = c * a; + c = dn * c; + dn = (en[ii] + a) / (b + a); + a = c / b; + } + + a = 1 / std::sqrt(c * c + 1); + + if (sn < 0) + sn = -a; + else + sn = a; + + cn = c * sn; + } + + if (bo != 0) + { + a = dn; + dn = cn; + cn = a; + sn = sn / d; + } + } + else + { + cn = 1 / std::cosh(u); + dn = cn; + sn = std::tanh(u); + } + } + SINGLETON_DERIVED_IMPL(VarFuncs); private: diff --git a/Source/Ember/Variation.h b/Source/Ember/Variation.h index f08c358..7cbb5a7 100644 --- a/Source/Ember/Variation.h +++ b/Source/Ember/Variation.h @@ -136,6 +136,7 @@ enum class eVariationId : et VAR_ENNEPERS , VAR_EPISPIRAL , VAR_EPUSH , + VAR_ERF , VAR_EROTATE , VAR_ESCALE , VAR_ESCHER , @@ -166,6 +167,7 @@ enum class eVariationId : et VAR_FOCI3D , VAR_FOURTH , VAR_FUNNEL , + VAR_GAMMA , VAR_GAUSSIAN_BLUR , VAR_GDOFFS , VAR_GLYNNIA , @@ -193,6 +195,9 @@ enum class eVariationId : et VAR_HYPERTILE3D2 , VAR_IDISC , VAR_INTERFERENCE2 , + VAR_JAC_CN , + VAR_JAC_DN , + VAR_JAC_SN , VAR_JULIA , VAR_JULIA3D , VAR_JULIA3DQ , @@ -216,6 +221,7 @@ enum class eVariationId : et VAR_LINEAR3D , VAR_LISSAJOUS , VAR_LOG , + VAR_LOG_DB , VAR_LOQ , VAR_LOONIE , VAR_LOONIE2 , @@ -260,6 +266,8 @@ enum class eVariationId : et VAR_POPCORN23D , VAR_POW_BLOCK , VAR_POWER , + VAR_PRESSURE_WAVE , + VAR_PROSE3D , VAR_PSPHERE , VAR_Q_ODE , VAR_RADIAL_BLUR , @@ -308,6 +316,7 @@ enum class eVariationId : et VAR_SPLIT , VAR_SPLIT_BRDR , VAR_SPLITS , + VAR_SPLITS3D , VAR_SQUARE , VAR_SQUARE3D , VAR_SQUARIZE , @@ -336,18 +345,24 @@ enum class eVariationId : et VAR_TWO_FACE , VAR_UNPOLAR , VAR_VORON , + VAR_W , VAR_WAFFLE , VAR_WAVES , VAR_WAVES2 , VAR_WAVES23D , + VAR_WAVES2B , VAR_WAVESN , VAR_WDISC , VAR_WEDGE , VAR_WEDGE_JULIA , VAR_WEDGE_SPH , VAR_WHORL , + VAR_X , + VAR_XERF , VAR_XHEART , VAR_XTRB , + VAR_Y , + VAR_Z , VAR_ZBLUR , VAR_ZCONE , VAR_ZSCALE , @@ -445,6 +460,7 @@ enum class eVariationId : et VAR_PRE_ENNEPERS, VAR_PRE_EPISPIRAL, VAR_PRE_EPUSH, + VAR_PRE_ERF, VAR_PRE_EROTATE, VAR_PRE_ESCALE, VAR_PRE_ESCHER, @@ -475,6 +491,7 @@ enum class eVariationId : et VAR_PRE_FOCI3D, VAR_PRE_FOURTH, VAR_PRE_FUNNEL, + VAR_PRE_GAMMA, VAR_PRE_GAUSSIAN_BLUR, VAR_PRE_GDOFFS, VAR_PRE_GLYNNIA, @@ -502,6 +519,9 @@ enum class eVariationId : et VAR_PRE_HYPERTILE3D2, VAR_PRE_IDISC, VAR_PRE_INTERFERENCE2, + VAR_PRE_JAC_CN, + VAR_PRE_JAC_DN, + VAR_PRE_JAC_SN, VAR_PRE_JULIA, VAR_PRE_JULIA3D, VAR_PRE_JULIA3DQ, @@ -525,6 +545,7 @@ enum class eVariationId : et VAR_PRE_LINEAR3D, VAR_PRE_LISSAJOUS, VAR_PRE_LOG, + VAR_PRE_LOG_DB, VAR_PRE_LOQ, VAR_PRE_LOONIE, VAR_PRE_LOONIE2, @@ -569,6 +590,8 @@ enum class eVariationId : et VAR_PRE_POPCORN23D, VAR_PRE_POW_BLOCK, VAR_PRE_POWER, + VAR_PRE_PRESSURE_WAVE, + VAR_PRE_PROSE3D, VAR_PRE_PSPHERE, VAR_PRE_Q_ODE, VAR_PRE_RADIAL_BLUR, @@ -617,6 +640,7 @@ enum class eVariationId : et VAR_PRE_SPLIT, VAR_PRE_SPLIT_BRDR, VAR_PRE_SPLITS, + VAR_PRE_SPLITS3D, VAR_PRE_SQUARE, VAR_PRE_SQUARE3D, VAR_PRE_SQUARIZE, @@ -645,18 +669,24 @@ enum class eVariationId : et VAR_PRE_TWO_FACE, VAR_PRE_UNPOLAR, VAR_PRE_VORON, + VAR_PRE_W, VAR_PRE_WAFFLE, VAR_PRE_WAVES, VAR_PRE_WAVES2, VAR_PRE_WAVES23D, + VAR_PRE_WAVES2B, VAR_PRE_WAVESN, VAR_PRE_WDISC, VAR_PRE_WEDGE, VAR_PRE_WEDGE_JULIA, VAR_PRE_WEDGE_SPH, VAR_PRE_WHORL, + VAR_PRE_X, + VAR_PRE_XERF, VAR_PRE_XHEART, VAR_PRE_XTRB, + VAR_PRE_Y, + VAR_PRE_Z, VAR_PRE_ZBLUR, VAR_PRE_ZCONE, VAR_PRE_ZSCALE, @@ -754,6 +784,7 @@ enum class eVariationId : et VAR_POST_ENNEPERS, VAR_POST_EPISPIRAL, VAR_POST_EPUSH, + VAR_POST_ERF, VAR_POST_EROTATE, VAR_POST_ESCALE, VAR_POST_ESCHER, @@ -784,6 +815,7 @@ enum class eVariationId : et VAR_POST_FOCI3D, VAR_POST_FOURTH, VAR_POST_FUNNEL, + VAR_POST_GAMMA, VAR_POST_GAUSSIAN_BLUR, VAR_POST_GDOFFS, VAR_POST_GLYNNIA, @@ -811,6 +843,9 @@ enum class eVariationId : et VAR_POST_HYPERTILE3D2, VAR_POST_IDISC, VAR_POST_INTERFERENCE2, + VAR_POST_JAC_CN, + VAR_POST_JAC_DN, + VAR_POST_JAC_SN, VAR_POST_JULIA, VAR_POST_JULIA3D, VAR_POST_JULIA3DQ, @@ -834,6 +869,7 @@ enum class eVariationId : et VAR_POST_LINEAR3D, VAR_POST_LISSAJOUS, VAR_POST_LOG, + VAR_POST_LOG_DB, VAR_POST_LOQ, VAR_POST_LOONIE, VAR_POST_LOONIE2, @@ -878,6 +914,8 @@ enum class eVariationId : et VAR_POST_POPCORN23D, VAR_POST_POW_BLOCK, VAR_POST_POWER, + VAR_POST_PRESSURE_WAVE, + VAR_POST_PROSE3D, VAR_POST_PSPHERE, VAR_POST_Q_ODE, VAR_POST_RADIAL_BLUR, @@ -926,6 +964,7 @@ enum class eVariationId : et VAR_POST_SPLIT, VAR_POST_SPLIT_BRDR, VAR_POST_SPLITS, + VAR_POST_SPLITS3D, VAR_POST_SQUARE, VAR_POST_SQUARE3D, VAR_POST_SQUARIZE, @@ -954,18 +993,24 @@ enum class eVariationId : et VAR_POST_TWO_FACE, VAR_POST_UNPOLAR, VAR_POST_VORON, + VAR_POST_W, VAR_POST_WAFFLE, VAR_POST_WAVES, VAR_POST_WAVES2, VAR_POST_WAVES23D, + VAR_POST_WAVES2B, VAR_POST_WAVESN, VAR_POST_WDISC, VAR_POST_WEDGE, VAR_POST_WEDGE_JULIA, VAR_POST_WEDGE_SPH, VAR_POST_WHORL, + VAR_POST_X, + VAR_POST_XERF, VAR_POST_XHEART, VAR_POST_XTRB, + VAR_POST_Y, + VAR_POST_Z, VAR_POST_ZBLUR, VAR_POST_ZCONE, VAR_POST_ZSCALE, @@ -1077,7 +1122,7 @@ public: m_NeedPrecalcSqrtSumSquares = true; } - m_AssignType = eVariationAssignType::ASSIGNTYPE_SET; + m_PrePostAssignType = eVariationAssignType::ASSIGNTYPE_SET; SetType(); } @@ -1131,7 +1176,7 @@ public: { m_Name = variation.Name(); m_VarType = variation.VarType(); - m_AssignType = variation.AssignType(); + m_PrePostAssignType = variation.AssignType(); m_VariationId = variation.VariationId(); m_Weight = T(variation.m_Weight); m_Xform = typeid(T) == typeid(U) ? const_cast*>(reinterpret_cast*>(variation.ParentXform())) : nullptr; @@ -1147,115 +1192,60 @@ public: /// Per-variation precalc used for pre and post variations. /// /// The helper to read values from in the case of pre, and store precalc values to in both cases. - /// The point to read values from in the case of post, ignored for pre. - void PrecalcHelper(IteratorHelper& iteratorHelper, Point* point) + void PrePostPrecalcHelper(IteratorHelper& iteratorHelper) { - if (m_VarType == eVariationType::VARTYPE_PRE) + if (m_NeedPrecalcSumSquares) { - if (m_NeedPrecalcSumSquares) + iteratorHelper.m_PrecalcSumSquares = SQR(iteratorHelper.In.x) + SQR(iteratorHelper.In.y); + + if (m_NeedPrecalcSqrtSumSquares) { - iteratorHelper.m_PrecalcSumSquares = SQR(iteratorHelper.m_TransX) + SQR(iteratorHelper.m_TransY); + iteratorHelper.m_PrecalcSqrtSumSquares = std::sqrt(iteratorHelper.m_PrecalcSumSquares); - if (m_NeedPrecalcSqrtSumSquares) + if (m_NeedPrecalcAngles) { - iteratorHelper.m_PrecalcSqrtSumSquares = std::sqrt(iteratorHelper.m_PrecalcSumSquares); - - if (m_NeedPrecalcAngles) - { - iteratorHelper.m_PrecalcSina = iteratorHelper.m_TransX / iteratorHelper.m_PrecalcSqrtSumSquares; - iteratorHelper.m_PrecalcCosa = iteratorHelper.m_TransY / iteratorHelper.m_PrecalcSqrtSumSquares; - } + iteratorHelper.m_PrecalcSina = iteratorHelper.In.x / iteratorHelper.m_PrecalcSqrtSumSquares; + iteratorHelper.m_PrecalcCosa = iteratorHelper.In.y / iteratorHelper.m_PrecalcSqrtSumSquares; } } - - if (m_NeedPrecalcAtanXY) - iteratorHelper.m_PrecalcAtanxy = atan2(iteratorHelper.m_TransX, iteratorHelper.m_TransY); - - if (m_NeedPrecalcAtanYX) - iteratorHelper.m_PrecalcAtanyx = atan2(iteratorHelper.m_TransY, iteratorHelper.m_TransX); } - else if (m_VarType == eVariationType::VARTYPE_POST) - { - if (m_NeedPrecalcSumSquares) - { - iteratorHelper.m_PrecalcSumSquares = SQR(point->m_X) + SQR(point->m_Y); - if (m_NeedPrecalcSqrtSumSquares) - { - iteratorHelper.m_PrecalcSqrtSumSquares = std::sqrt(iteratorHelper.m_PrecalcSumSquares); + if (m_NeedPrecalcAtanXY) + iteratorHelper.m_PrecalcAtanxy = atan2(iteratorHelper.In.x, iteratorHelper.In.y); - if (m_NeedPrecalcAngles) - { - iteratorHelper.m_PrecalcSina = point->m_X / iteratorHelper.m_PrecalcSqrtSumSquares; - iteratorHelper.m_PrecalcCosa = point->m_Y / iteratorHelper.m_PrecalcSqrtSumSquares; - } - } - } - - if (m_NeedPrecalcAtanXY) - iteratorHelper.m_PrecalcAtanxy = atan2(point->m_X, point->m_Y); - - if (m_NeedPrecalcAtanYX) - iteratorHelper.m_PrecalcAtanyx = atan2(point->m_Y, point->m_X); - } + if (m_NeedPrecalcAtanYX) + iteratorHelper.m_PrecalcAtanyx = atan2(iteratorHelper.In.y, iteratorHelper.In.x); } /// /// Per-variation precalc OpenCL string used for pre and post variations. /// /// The per-variation OpenCL precalc string - string PrecalcOpenCLString() const + string PrePostPrecalcOpenCLString() const { ostringstream ss; - if (m_VarType == eVariationType::VARTYPE_PRE) + if (m_NeedPrecalcSumSquares) { - if (m_NeedPrecalcSumSquares) + ss << "\tprecalcSumSquares = SQR(vIn.x) + SQR(vIn.y);\n"; + + if (m_NeedPrecalcSqrtSumSquares) { - ss << "\tprecalcSumSquares = SQR(transX) + SQR(transY);\n"; + ss << "\tprecalcSqrtSumSquares = sqrt(precalcSumSquares);\n"; - if (m_NeedPrecalcSqrtSumSquares) + if (m_NeedPrecalcAngles) { - ss << "\tprecalcSqrtSumSquares = sqrt(precalcSumSquares);\n"; - - if (m_NeedPrecalcAngles) - { - ss << "\tprecalcSina = transX / precalcSqrtSumSquares;\n"; - ss << "\tprecalcCosa = transY / precalcSqrtSumSquares;\n"; - } + ss << "\tprecalcSina = vIn.x / precalcSqrtSumSquares;\n"; + ss << "\tprecalcCosa = vIn.y / precalcSqrtSumSquares;\n"; } } - - if (m_NeedPrecalcAtanXY) - ss << "\tprecalcAtanxy = atan2(transX, transY);\n"; - - if (m_NeedPrecalcAtanYX) - ss << "\tprecalcAtanyx = atan2(transY, transX);\n"; } - else if (m_VarType == eVariationType::VARTYPE_POST) - { - if (m_NeedPrecalcSumSquares) - { - ss << "\tprecalcSumSquares = SQR(outPoint->m_X) + SQR(outPoint->m_Y);\n"; - if (m_NeedPrecalcSqrtSumSquares) - { - ss << "\tprecalcSqrtSumSquares = sqrt(precalcSumSquares);\n"; + if (m_NeedPrecalcAtanXY) + ss << "\tprecalcAtanxy = atan2(vIn.x, vIn.y);\n"; - if (m_NeedPrecalcAngles) - { - ss << "\tprecalcSina = outPoint->m_X / precalcSqrtSumSquares;\n"; - ss << "\tprecalcCosa = outPoint->m_Y / precalcSqrtSumSquares;\n"; - } - } - } - - if (m_NeedPrecalcAtanXY) - ss << "\tprecalcAtanxy = atan2(outPoint->m_X, outPoint->m_Y);\n"; - - if (m_NeedPrecalcAtanYX) - ss << "\tprecalcAtanyx = atan2(outPoint->m_Y, outPoint->m_X);\n"; - } + if (m_NeedPrecalcAtanYX) + ss << "\tprecalcAtanyx = atan2(vIn.y, vIn.x);\n"; if (NeedAnyPrecalc()) ss << "\n"; @@ -1393,6 +1383,10 @@ public: return ""; } + /// + /// Returns the base name of the variation without the "pre_" or "post_" prefix. + /// + /// The base name of the variation string BaseName() const { string prefix = Prefix(); @@ -1415,7 +1409,7 @@ public: eVariationId VariationId() const { return m_VariationId; } string Name() const { return m_Name; } eVariationType VarType() const { return m_VarType; } - eVariationAssignType AssignType() const { return m_AssignType; } + eVariationAssignType AssignType() const { return m_PrePostAssignType; } const Xform* ParentXform() const { return m_Xform; } void ParentXform(Xform* xform) { m_Xform = xform; } intmax_t IndexInXform() const { return m_Xform ? m_Xform->GetVariationIndex(const_cast*>(this)) : -1; } @@ -1424,6 +1418,10 @@ public: T m_Weight;//The weight of the variation. protected: + /// + /// Sets the type of the variation depending on whether the name starts with "pre_", + /// "post_" or neither. + /// void SetType() { if (m_Name.find("pre_") == 0) @@ -1434,11 +1432,30 @@ protected: m_VarType = eVariationType::VARTYPE_REG; } + /// + /// Return the default Z coordinate assignment value depending on the type of variation and its assign type. + /// + /// The helper used to retrieve the input Z coordinate. + /// The appropriate Z value. + T DefaultZ(const IteratorHelper& helper) const + { + return m_VarType == eVariationType::VARTYPE_REG ? 0 : (m_PrePostAssignType == eVariationAssignType::ASSIGNTYPE_SET ? helper.In.z : 0); + } + + /// + /// OpenCL equivalent of DefaultZ(). + /// + /// The OpenCL string needed to make the proper Z coordinate assignment + string DefaultZCl() const + { + return m_VarType == eVariationType::VARTYPE_REG ? "0;\n" : (m_PrePostAssignType == eVariationAssignType::ASSIGNTYPE_SET ? "vIn.z;\n" : "0;\n"); + } + Xform* m_Xform;//The parent Xform that this variation is a child of. eVariationId m_VariationId;//The unique ID of this variation. string m_Name;//The unique name of this variation. eVariationType m_VarType;//The type of variation: regular, pre or post. - eVariationAssignType m_AssignType;//Whether to assign the results for pre/post, or sum them. + eVariationAssignType m_PrePostAssignType;//Whether to assign the results for pre/post, or sum them. private: bool m_NeedPrecalcSumSquares;//Whether this variation uses the precalc sum squares value in its calculations. @@ -1750,13 +1767,15 @@ private: using Variation::m_VariationId; \ using Variation::m_Name; \ using Variation::m_VarType; \ - using Variation::m_AssignType; \ + using Variation::m_PrePostAssignType; \ using Variation::SetType; \ using Variation::IndexInXform; \ using Variation::XformIndexInEmber; \ using Variation::Prefix; \ using Variation::Precalc; \ - using Variation::StateOpenCLString; + using Variation::StateOpenCLString; \ + using Variation::DefaultZ; \ + using Variation::DefaultZCl; /// /// Parametric variations use parameters in addition to weight. @@ -2147,7 +2166,7 @@ protected: { \ m_VariationId = eVariationId::VAR_PRE_##enumName; \ m_Name = "pre_"#stringName; \ - m_AssignType = assignType; \ + m_PrePostAssignType = assignType; \ SetType(); \ } \ \ @@ -2163,7 +2182,7 @@ protected: { \ m_VariationId = eVariationId::VAR_POST_##enumName; \ m_Name = "post_"#stringName; \ - m_AssignType = assignType; \ + m_PrePostAssignType = assignType; \ SetType(); \ } \ \ @@ -2268,7 +2287,7 @@ protected: { \ m_VariationId = eVariationId::VAR_PRE_##enumName; \ m_Name = "pre_"#stringName; \ - m_AssignType = assignType; \ + m_PrePostAssignType = assignType; \ SetType(); \ Init(); \ } \ @@ -2287,7 +2306,7 @@ protected: { \ m_VariationId = eVariationId::VAR_POST_##enumName; \ m_Name = "post_"#stringName; \ - m_AssignType = assignType; \ + m_PrePostAssignType = assignType; \ SetType(); \ Init(); \ } \ diff --git a/Source/Ember/VariationList.h b/Source/Ember/VariationList.h index 8d17269..c993c94 100644 --- a/Source/Ember/VariationList.h +++ b/Source/Ember/VariationList.h @@ -6,6 +6,7 @@ #include "Variations04.h" #include "Variations05.h" #include "Variations06.h" +#include "Variations07.h" #include "VariationsDC.h" /// @@ -343,6 +344,21 @@ public: ADDPREPOSTREGVAR(Synth) ADDPREPOSTREGVAR(Crackle) m_Variations.push_back(new PostSmartcropVariation());//Post only + ADDPREPOSTREGVAR(Xerf) + ADDPREPOSTREGVAR(Erf) + ADDPREPOSTREGVAR(W) + ADDPREPOSTREGVAR(X) + ADDPREPOSTREGVAR(Y) + ADDPREPOSTREGVAR(Z) + ADDPREPOSTREGVAR(Splits3D) + ADDPREPOSTREGVAR(Waves2B) + ADDPREPOSTREGVAR(JacCn) + ADDPREPOSTREGVAR(JacDn) + ADDPREPOSTREGVAR(JacSn) + ADDPREPOSTREGVAR(PressureWave) + ADDPREPOSTREGVAR(Gamma) + ADDPREPOSTREGVAR(PRose3D) + ADDPREPOSTREGVAR(LogDB) //ADDPREPOSTREGVAR(LinearXZ) //ADDPREPOSTREGVAR(LinearYZ) //DC are special. diff --git a/Source/Ember/Variations01.h b/Source/Ember/Variations01.h index f4c3053..0d8cf58 100644 --- a/Source/Ember/Variations01.h +++ b/Source/Ember/Variations01.h @@ -261,7 +261,7 @@ public: { helper.Out.x = m_Weight * helper.m_PrecalcSqrtSumSquares * std::sin(helper.m_PrecalcAtanxy + helper.m_PrecalcSqrtSumSquares); helper.Out.y = m_Weight * helper.m_PrecalcSqrtSumSquares * std::cos(helper.m_PrecalcAtanxy - helper.m_PrecalcSqrtSumSquares); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -271,7 +271,7 @@ public: ss << "\t{\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares * sin(precalcAtanxy + precalcSqrtSumSquares);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares * cos(precalcAtanxy - precalcSqrtSumSquares);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -299,7 +299,7 @@ public: T r = m_Weight * helper.m_PrecalcSqrtSumSquares; helper.Out.x = r * std::sin(a); helper.Out.y = (-r) * std::cos(a); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -312,7 +312,7 @@ public: << "\n" << "\t\tvOut.x = r * sin(a);\n" << "\t\tvOut.y = (-r) * cos(a);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -489,7 +489,7 @@ public: { helper.Out.x = m_Weight * helper.m_PrecalcSina * std::cos(helper.m_PrecalcSqrtSumSquares); helper.Out.y = m_Weight * helper.m_PrecalcCosa * std::sin(helper.m_PrecalcSqrtSumSquares); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -499,7 +499,7 @@ public: ss << "\t{\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * precalcSina * cos(precalcSqrtSumSquares);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * precalcCosa * sin(precalcSqrtSumSquares);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -534,7 +534,7 @@ public: T m1 = n1 * n1 * n1 * r; helper.Out.x = m_Weight * (m0 + m1); helper.Out.y = m_Weight * (m0 - m1); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -551,7 +551,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (m0 + m1);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (m0 - m1);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -585,7 +585,7 @@ public: helper.Out.x = r * std::cos(a); helper.Out.y = r * std::sin(a); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -601,7 +601,7 @@ public: << "\n" << "\t\tvOut.x = r * cos(a);\n" << "\t\tvOut.y = r * sin(a);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -630,7 +630,7 @@ public: T ny = helper.In.y < T(0.0) ? helper.In.y / 2 : helper.In.y; helper.Out.x = m_Weight * nx; helper.Out.y = m_Weight * ny; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -643,7 +643,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * nx;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * ny;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -678,7 +678,7 @@ public: T ny = helper.In.y + c11 * std::sin(helper.In.x * m_Dy2); helper.Out.x = m_Weight * nx; helper.Out.y = m_Weight * ny; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -697,7 +697,7 @@ public: << "\n" << "\t\tvOut.x = (xform->m_VariationWeights[" << varIndex << "] * nx);\n" << "\t\tvOut.y = (xform->m_VariationWeights[" << varIndex << "] * ny);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -750,7 +750,7 @@ public: T r = 2 * m_Weight / (helper.m_PrecalcSqrtSumSquares + 1); helper.Out.x = r * helper.In.y; helper.Out.y = r * helper.In.x; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -762,7 +762,7 @@ public: << "\n" << "\t\tvOut.x = r * vIn.y;\n" << "\t\tvOut.y = r * vIn.x;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -793,7 +793,7 @@ public: T ny = helper.In.y + m_Xform->m_Affine.F() * std::sin(dy); helper.Out.x = m_Weight * nx; helper.Out.y = m_Weight * ny; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -808,7 +808,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * nx;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * ny;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -837,7 +837,7 @@ public: T dy = T(M_PI) * helper.In.y; helper.Out.x = dx * std::cos(dy); helper.Out.y = dx * std::sin(dy); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -850,7 +850,7 @@ public: << "\n" << "\t\tvOut.x = dx * cos(dy);\n" << "\t\tvOut.y = dx * sin(dy);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -880,7 +880,7 @@ public: T r = m_Weight * std::pow(helper.m_PrecalcSqrtSumSquares, helper.m_PrecalcSina); helper.Out.x = r * helper.m_PrecalcCosa; helper.Out.y = r * helper.m_PrecalcSina; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -892,7 +892,7 @@ public: << "\n" << "\t\tvOut.x = r * precalcCosa;\n" << "\t\tvOut.y = r * precalcSina;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -920,7 +920,7 @@ public: T ny = -std::sin(a) * std::sinh(helper.In.y); helper.Out.x = m_Weight * nx; helper.Out.y = m_Weight * ny; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -934,7 +934,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * nx;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * ny;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -967,7 +967,7 @@ public: r = m_Weight * (fmod(r + dx, 2 * dx) - dx + r * (1 - dx)); helper.Out.x = r * helper.m_PrecalcCosa; helper.Out.y = r * helper.m_PrecalcSina; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -981,7 +981,7 @@ public: << "\t\tr = xform->m_VariationWeights[" << varIndex << "] * (fmod(r + dx, 2 * dx) - dx + r * (1 - dx));\n" << "\t\tvOut.x = r * precalcCosa;\n" << "\t\tvOut.y = r * precalcSina;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1024,7 +1024,7 @@ public: a += (fmod(a + dy, dx) > dx2) ? -dx2 : dx2; helper.Out.x = r * std::cos(a); helper.Out.y = r * std::sin(a); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1040,7 +1040,7 @@ public: << "\n" << "\t\tvOut.x = r * cos(a);\n" << "\t\tvOut.y = r * sin(a);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1078,7 +1078,7 @@ public: T r = helper.m_PrecalcSqrtSumSquares * (m_BlobLow + m_BlobDiff * (T(0.5) + T(0.5) * std::sin(m_BlobWaves * helper.m_PrecalcAtanxy))); helper.Out.x = m_Weight * helper.m_PrecalcSina * r; helper.Out.y = m_Weight * helper.m_PrecalcCosa * r; - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1096,7 +1096,7 @@ public: << "\n" << "\t\tvOut.x = (xform->m_VariationWeights[" << varIndex << "] * precalcSina * r);\n" << "\t\tvOut.y = (xform->m_VariationWeights[" << varIndex << "] * precalcCosa * r);\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1445,7 +1445,7 @@ public: T r = m_Weight / denom; helper.Out.x = r * helper.In.x; helper.Out.y = r * helper.In.y; - helper.Out.z = m_Weight * (2 / denom - 1); + helper.Out.z = m_Weight * (2 / Zeps(denom - 1)); } virtual string OpenCLString() const override @@ -1458,10 +1458,15 @@ public: << "\n" << "\t\tvOut.x = r * vIn.x;\n" << "\t\tvOut.y = r * vIn.y;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * (2 / denom - 1);\n" + << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * (2 / Zeps(denom - 1));\n" << "\t}\n"; return ss.str(); } + + virtual vector OpenCLGlobalFuncNames() const override + { + return vector { "Zeps" }; + } }; /// @@ -1515,7 +1520,7 @@ public: T t = 1 / d; helper.Out.x = m_Weight * m_Dist * helper.In.x * t; helper.Out.y = m_Weight * m_VfCos * helper.In.y * t; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1534,7 +1539,7 @@ public: << "\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.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1786,7 +1791,7 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Dist, prefix + "juliascope_dist", 1));//Params. - m_Params.push_back(ParamWithName(&m_Power, prefix + "juliascope_power", 1)); + m_Params.push_back(ParamWithName(&m_Power, prefix + "juliascope_power", 1, eParamType::REAL_NONZERO)); m_Params.push_back(ParamWithName(true, &m_Rn, prefix + "juliascope_rn"));//Precalc. m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "juliascope_cn")); } @@ -1970,6 +1975,7 @@ public: T r = m_Weight * rand.Frand01(); helper.Out.x = r * std::cos(a); helper.Out.y = r * std::sin(a); + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1988,7 +1994,7 @@ public: << "\n" << "\t\tvOut.x = r * cos(a);\n" << "\t\tvOut.y = r * sin(a);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2148,7 +2154,7 @@ public: T r = m_Weight / Zeps(SQR(re) + SQR(im)); helper.Out.x = (helper.In.x * re + helper.In.y * im) * r; helper.Out.y = (helper.In.y * re - helper.In.x * im) * r; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2167,7 +2173,7 @@ public: << "\n" << "\t\tvOut.x = (vIn.x * re + vIn.y * im) * r;\n" << "\t\tvOut.y = (vIn.y * re - vIn.x * im) * r;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2295,7 +2301,7 @@ public: sincos(angle, &sinr, &cosr); helper.Out.x = m_Weight * sinr; helper.Out.y = m_Weight * (sinr * sinr) / cosr; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2309,7 +2315,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sinr;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (sinr * sinr) / cosr;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2330,7 +2336,7 @@ public: { helper.Out.x = m_Weight * std::sin(helper.In.x) / std::cos(helper.In.y); helper.Out.y = m_Weight * SafeTan(helper.In.y); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2340,7 +2346,7 @@ public: ss << "\t{\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sin(vIn.x) / cos(vIn.y);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * tan(vIn.y);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2395,7 +2401,7 @@ public: T tanr = m_Weight * SafeTan(ang) * r; helper.Out.x = tanr * std::cos(helper.In.x); helper.Out.y = tanr * std::sin(helper.In.y); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2409,7 +2415,7 @@ public: << "\n" << "\t\tvOut.x = tanr * cos(vIn.x);\n" << "\t\tvOut.y = tanr * sin(vIn.y);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2438,7 +2444,7 @@ public: sincos(r, &sinr, &cosr); helper.Out.x = m_Weight * helper.In.x * (cosr + sinr); helper.Out.y = m_Weight * helper.In.x * (cosr - sinr); - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2452,7 +2458,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x * (cosr + sinr);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.x * (cosr - sinr);\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2481,7 +2487,7 @@ public: else helper.Out.y = m_Weight * (icr - 1); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2500,7 +2506,7 @@ public: << "\t\telse\n" << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (icr - (real_t)(1.0));\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2529,7 +2535,7 @@ public: helper.Out.x = m_Weight * helper.In.x * diff; helper.Out.y = m_Weight * helper.In.x * (diff - sinr * T(M_PI)); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2547,7 +2553,7 @@ public: << "\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.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2614,7 +2620,7 @@ public: r = m_Weight * helper.m_PrecalcAtanxy / T(M_PI); helper.Out.x = (sinr + m_CosAdd) * r; helper.Out.y = (cosr + m_SinAdd) * r; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2636,7 +2642,7 @@ public: << "\n" << "\t\tvOut.x = (sinr + " << cosAdd << ") * r;\n" << "\t\tvOut.y = (cosr + " << sinAdd << ") * r;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2714,7 +2720,7 @@ public: * std::pow(t1 + t2, m_PNeg1N1) / helper.m_PrecalcSqrtSumSquares; helper.Out.x = r * helper.In.x; helper.Out.y = r * helper.In.y; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2741,7 +2747,7 @@ public: << "\n" << "\t\tvOut.x = r * vIn.x;\n" << "\t\tvOut.y = r * vIn.y;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2808,7 +2814,7 @@ public: T r = m_Weight * (rand.Frand01() - m_Holes) * std::cos(m_Petals * theta) / helper.m_PrecalcSqrtSumSquares; helper.Out.x = r * helper.In.x; helper.Out.y = r * helper.In.y; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2825,7 +2831,7 @@ public: << "\n" << "\t\tvOut.x = r * vIn.x;\n" << "\t\tvOut.y = r * vIn.y;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2871,7 +2877,7 @@ public: m_Eccentricity / (1 + m_Eccentricity * ct) / helper.m_PrecalcSqrtSumSquares; helper.Out.x = r * helper.In.x; helper.Out.y = r * helper.In.y; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2888,7 +2894,7 @@ public: << "\n" << "\t\tvOut.x = r * vIn.x;\n" << "\t\tvOut.y = r * vIn.y;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2933,7 +2939,7 @@ public: sincos(helper.m_PrecalcSqrtSumSquares, &sr, &cr); helper.Out.x = m_Height * m_Weight * sr * sr * rand.Frand01(); helper.Out.y = m_Width * m_Weight * cr * rand.Frand01(); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2950,7 +2956,7 @@ public: << "\n" << "\t\tvOut.x = " << height << " * (xform->m_VariationWeights[" << varIndex << "] * sr * sr * MwcNext01(mwc));\n" << "\t\tvOut.y = " << width << " * (xform->m_VariationWeights[" << varIndex << "] * cr * MwcNext01(mwc));\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3001,7 +3007,7 @@ public: else helper.Out.y = m_Vy * helper.In.y; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3025,7 +3031,7 @@ public: << "\t\telse\n" << "\t\tvOut.y = " << vy << " * vIn.y;\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3223,12 +3229,12 @@ public: virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override { - T roundX = Rint(helper.In.x); - T roundY = Rint(helper.In.y); + T roundX = std::rint(helper.In.x); + T roundY = std::rint(helper.In.y); T offsetX = helper.In.x - roundX; T offsetY = helper.In.y - roundY; - if (rand.Frand01() >= 0.75) + if (rand.Frand01() >= T(0.75)) { helper.Out.x = m_Weight * (offsetX * T(0.5) + roundX); helper.Out.y = m_Weight * (offsetY * T(0.5) + roundY); @@ -3237,7 +3243,7 @@ public: { if (std::abs(offsetX) >= std::abs(offsetY)) { - if (offsetX >= 0.0) + if (offsetX >= 0) { helper.Out.x = m_Weight * (offsetX * T(0.5) + roundX + T(0.25)); helper.Out.y = m_Weight * (offsetY * T(0.5) + roundY + T(0.25) * offsetY / offsetX); @@ -3250,7 +3256,7 @@ public: } else { - if (offsetY >= 0.0) + if (offsetY >= 0) { helper.Out.y = m_Weight * (offsetY * T(0.5) + roundY + T(0.25)); helper.Out.x = m_Weight * (offsetX * T(0.5) + roundX + offsetX / offsetY * T(0.25)); @@ -3263,7 +3269,7 @@ public: } } - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3271,8 +3277,8 @@ public: ostringstream ss; intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\treal_t roundX = Rint(vIn.x);\n" - << "\t\treal_t roundY = Rint(vIn.y);\n" + << "\t\treal_t roundX = rint(vIn.x);\n" + << "\t\treal_t roundY = rint(vIn.y);\n" << "\t\treal_t offsetX = vIn.x - roundX;\n" << "\t\treal_t offsetY = vIn.y - roundY;\n" << "\n" @@ -3311,7 +3317,7 @@ public: << "\t\t }\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3335,7 +3341,7 @@ public: T r = wx * std::sqrt(std::abs(helper.In.y * helper.In.x) / Zeps(SQR(helper.In.x) + SQR(y2))); helper.Out.x = r * helper.In.x; helper.Out.y = r * y2; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3349,7 +3355,7 @@ public: << "\n" << "\t\tvOut.x = r * vIn.x;\n" << "\t\tvOut.y = r * y2;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3412,7 +3418,7 @@ public: helper.Out.x = m_Weight * (dx + x * m_Size); helper.Out.y = -(m_Weight * (dy + y * m_Size)); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } /// @@ -3469,7 +3475,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (dx + x * " << size << ");\n" << "\t\tvOut.y = -(xform->m_VariationWeights[" << varIndex << "] * (dy + y * " << size << "));\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3513,7 +3519,7 @@ public: T m = m_Weight * std::exp(m_C * lnr - m_D * a); helper.Out.x = m * std::cos(angle); helper.Out.y = m * std::sin(angle); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3536,7 +3542,7 @@ public: << "\n" << "\t\tvOut.x = m * cos(angle);\n" << "\t\tvOut.y = m * sin(angle);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3595,7 +3601,7 @@ public: { helper.Out.x = m_Weight * helper.In.x + m_XAmpV * std::exp(-helper.In.y * helper.In.y * m_XLengthV); helper.Out.y = m_Weight * helper.In.y + m_YAmpV * std::exp(-helper.In.x * helper.In.x * m_YLengthV); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3615,7 +3621,7 @@ public: ss << "\t{\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x + " << xAmpV << " * exp(-vIn.y * vIn.y * " << xLengthV << ");\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y + " << yAmpV << " * exp(-vIn.x * vIn.x * " << yLengthV << ");\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3693,7 +3699,7 @@ public: helper.Out.x = w * cshu * csv; helper.Out.y = w * snhu * snv; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3717,7 +3723,7 @@ public: << "\t\t snv = -snv;\n" << "\t\tvOut.x = w * cshu * csv;\n" << "\t\tvOut.y = w * snhu * snv;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3764,7 +3770,7 @@ public: else helper.Out.y = -(w * std::log(xmax + ssx)); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3800,7 +3806,7 @@ public: << "\t\telse\n" << "\t\t vOut.y = -(w * log(xmax + ssx));\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4179,7 +4185,7 @@ public: else helper.Out.y = m_Weight * helper.In.y; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4207,7 +4213,7 @@ public: << "\t\telse\n" << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4276,7 +4282,7 @@ public: helper.Out.y = m_Weight * helper.In.y; } - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4309,7 +4315,7 @@ public: << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4422,7 +4428,7 @@ public: { helper.Out.x = m_Weight * (helper.In.x + m_X * std::sin(SafeTan(helper.In.y * m_C))); helper.Out.y = m_Weight * (helper.In.y + m_Y * std::sin(SafeTan(helper.In.x * m_C))); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4437,7 +4443,7 @@ public: ss << "\t{\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + " << x << " * sin(tan(vIn.y * " << c << ")));\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + " << y << " * sin(tan(vIn.x * " << c << ")));\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4488,7 +4494,7 @@ public: T r = 1 / Zeps(helper.m_PrecalcSqrtSumSquares * (t + m_InvWeight)); helper.Out.x = helper.In.x * r; helper.Out.y = helper.In.y * r; - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4504,7 +4510,7 @@ public: << "\n" << "\t\tvOut.x = vIn.x * r;\n" << "\t\tvOut.y = vIn.y * r;\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4650,7 +4656,7 @@ public: else helper.Out.y = -(m_Weight * helper.In.y); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4674,7 +4680,7 @@ public: << "\t\telse\n" << "\t\t vOut.y = -(xform->m_VariationWeights[" << varIndex << "] * vIn.y);\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4735,7 +4741,7 @@ public: else helper.Out.y = m_Weight * (helper.In.y - m_Y); - helper.Out.z = m_Weight * helper.In.z;//Original does *not* have this. search through all for this and sync.//TODO! + helper.Out.z = m_Weight * helper.In.z;//Original from flam3 does not have this, but the apo implementation does, so use Apo since it's more recent. } virtual string OpenCLString() const override @@ -4802,7 +4808,7 @@ public: T offsetx = helper.In.x - roundx; helper.Out.x = m_Weight * (offsetx * (1 - m_Space) + roundx); helper.Out.y = m_Weight * (helper.In.y + offsetx * offsetx * m_Warp); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4819,7 +4825,7 @@ public: << "\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.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4951,7 +4957,7 @@ public: a = a * m_Cf + c * m_Angle; helper.Out.x = r * std::cos(a); helper.Out.y = r * std::sin(a); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4976,7 +4982,7 @@ public: << "\t\ta = a * " << cf << " + c * " << angle << ";\n" << "\t\tvOut.x = r * cos(a);\n" << "\t\tvOut.y = r * sin(a);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5038,13 +5044,12 @@ public: { T r = 1 / Zeps(helper.m_PrecalcSqrtSumSquares); T a = helper.m_PrecalcAtanyx + m_Swirl * r; - T c = T(Floor((m_Count * a + T(M_PI)) * T(M_1_PI) * T(0.5))); - T compFac = 1 - m_Angle * m_Count * T(M_1_PI) * T(0.5); - a = a * compFac + c * m_Angle; - r = m_Weight * (r + m_Hole); - helper.Out.x = r * std::cos(a); - helper.Out.y = r * std::sin(a); - helper.Out.z = m_Weight * helper.In.z; + auto c = Floor((m_Count * a + T(M_PI)) * m_C12Pi); + a = a * m_CompFac + c * m_Angle; + T temp = m_Weight * (r + m_Hole); + helper.Out.x = temp * std::cos(a); + helper.Out.y = temp * std::sin(a); + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5053,21 +5058,22 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string angle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string count = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string hole = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string swirl = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string angle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string count = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hole = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string swirl = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c12pi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string compfac = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t r = (real_t)(1.0) / Zeps(precalcSqrtSumSquares);\n" << "\t\treal_t a = precalcAtanyx + " << swirl << " * r;\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 * (real_t)(0.5);\n" + << "\t\treal_t c = floor((" << count << " * a + M_PI) * " << c12pi << "); \n" << "\n" - << "\t\ta = a * compFac + c * " << angle << ";\n" - << "\t\tr = xform->m_VariationWeights[" << varIndex << "] * (r + " << hole << ");\n" - << "\t\tvOut.x = r * cos(a);\n" - << "\t\tvOut.y = r * sin(a);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\ta = a * " << compfac << " + c * " << angle << ";\n" + << "\t\treal_t temp = xform->m_VariationWeights[" << varIndex << "] * (r + " << hole << ");\n" + << "\t\tvOut.x = temp * cos(a);\n" + << "\t\tvOut.y = temp * sin(a);\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5085,15 +5091,23 @@ public: m_Swirl = rand.Frand01(); } + virtual void Precalc() override + { + m_C12Pi = T(M_1_PI) / 2; + m_CompFac = 1 - m_Angle * m_Count * m_C12Pi; + } + protected: void Init() { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Angle, prefix + "wedge_sph_angle")); - m_Params.push_back(ParamWithName(&m_Count, prefix + "wedge_sph_hole", 1)); - m_Params.push_back(ParamWithName(&m_Hole, prefix + "wedge_sph_count")); + m_Params.push_back(ParamWithName(&m_Angle, prefix + "wedge_sph_angle", T(M_PI_2))); + m_Params.push_back(ParamWithName(&m_Count, prefix + "wedge_sph_count", 2, eParamType::INTEGER, 1)); + m_Params.push_back(ParamWithName(&m_Hole, prefix + "wedge_sph_hole")); m_Params.push_back(ParamWithName(&m_Swirl, prefix + "wedge_sph_swirl")); + m_Params.push_back(ParamWithName(true, &m_C12Pi, prefix + "wedge_sph_c1_2pi")); + m_Params.push_back(ParamWithName(true, &m_CompFac, prefix + "wedge_sph_comp_fac")); } private: @@ -5101,6 +5115,8 @@ private: T m_Count; T m_Hole; T m_Swirl; + T m_C12Pi;//Precalc. + T m_CompFac; }; /// @@ -5128,7 +5144,7 @@ public: helper.Out.x = m_Weight * r * std::cos(a); helper.Out.y = m_Weight * r * std::sin(a); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5150,7 +5166,7 @@ public: << "\n" << "\t\tvOut.x = (xform->m_VariationWeights[" << varIndex << "] * r * cos(a));\n" << "\t\tvOut.y = (xform->m_VariationWeights[" << varIndex << "] * r * sin(a));\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5264,7 +5280,7 @@ public: T expe = m_Weight * std::exp(helper.In.x); helper.Out.x = expe * std::cos(helper.In.y); helper.Out.y = expe * std::sin(helper.In.y); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5276,7 +5292,7 @@ public: << "\n" << "\t\tvOut.x = expe * cos(vIn.y);\n" << "\t\tvOut.y = expe * sin(vIn.y);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5353,7 +5369,7 @@ public: { helper.Out.x = m_Weight * std::sin(helper.In.x) * cosh(helper.In.y); helper.Out.y = m_Weight * std::cos(helper.In.x) * sinh(helper.In.y); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5363,7 +5379,7 @@ public: ss << "\t{\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sin(vIn.x) * cosh(vIn.y);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * cos(vIn.x) * sinh(vIn.y);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5385,7 +5401,7 @@ public: //clamp fabs x and y to 7.104760e+002 for cosh, and |x| 7.104760e+002 for sinh helper.Out.x = m_Weight * std::cos(helper.In.x) * cosh(helper.In.y); helper.Out.y = -(m_Weight * std::sin(helper.In.x) * sinh(helper.In.y)); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5395,7 +5411,7 @@ public: ss << "\t{\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cos(vIn.x) * cosh(vIn.y);\n" << "\t\tvOut.y = -(xform->m_VariationWeights[" << varIndex << "] * sin(vIn.x) * sinh(vIn.y));\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5421,7 +5437,7 @@ public: tanden = 1 / (tancos + tancosh); helper.Out.x = m_Weight * tanden * tansin; helper.Out.y = m_Weight * tanden * tansinh; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5437,7 +5453,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * tanden * tansin;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * tanden * tansinh;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5463,7 +5479,7 @@ public: secden = 2 / (cos(2 * helper.In.x) + cosh(2 * helper.In.y)); helper.Out.x = m_Weight * secden * seccos * seccosh; helper.Out.y = m_Weight * secden * secsin * secsinh; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5479,7 +5495,7 @@ public: << "\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.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5505,7 +5521,7 @@ public: cscden = 2 / (std::cosh(2 * helper.In.y) - std::cos(2 * helper.In.x)); helper.Out.x = m_Weight * cscden * cscsin * csccosh; helper.Out.y = -(m_Weight * cscden * csccos * cscsinh); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5521,7 +5537,7 @@ public: << "\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.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5547,7 +5563,7 @@ public: cotden = 1 / (cotcosh - cotcos); helper.Out.x = m_Weight * cotden * cotsin; helper.Out.y = m_Weight * cotden * -1 * cotsinh; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5563,7 +5579,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cotden * cotsin;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * cotden * -1 * cotsinh;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5588,7 +5604,7 @@ public: sinhcosh = cosh(helper.In.x); helper.Out.x = m_Weight * sinhsinh * sinhcos; helper.Out.y = m_Weight * sinhcosh * sinhsin; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5603,7 +5619,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sinhsinh * sinhcos;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sinhcosh * sinhsin;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5628,7 +5644,7 @@ public: coshcosh = cosh(helper.In.x); helper.Out.x = m_Weight * coshcosh * coshcos; helper.Out.y = m_Weight * coshsinh * coshsin; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5643,7 +5659,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * coshcosh * coshcos;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * coshsinh * coshsin;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5669,7 +5685,7 @@ public: tanhden = 1 / (tanhcos + tanhcosh); helper.Out.x = m_Weight * tanhden * tanhsinh; helper.Out.y = m_Weight * tanhden * tanhsin; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5685,7 +5701,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * tanhden * tanhsinh;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * tanhden * tanhsin;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5711,7 +5727,7 @@ public: sechden = 2 / (cos(2 * helper.In.y) + cosh(2 * helper.In.x)); helper.Out.x = m_Weight * sechden * sechcos * sechcosh; helper.Out.y = -(m_Weight * sechden * sechsin * sechsinh); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5727,7 +5743,7 @@ public: << "\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.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5753,7 +5769,7 @@ public: cschden = 2 / (std::cosh(2 * helper.In.x) - std::cos(2 * helper.In.y)); helper.Out.x = m_Weight * cschden * cschsinh * cschcos; helper.Out.y = -(m_Weight * cschden * cschcosh * cschsin); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5769,7 +5785,7 @@ public: << "\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.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5795,7 +5811,7 @@ public: cothden = 1 / (cothcosh - cothcos); helper.Out.x = m_Weight * cothden * cothsinh; helper.Out.y = m_Weight * cothden * cothsin; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5811,7 +5827,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cothden * cothsinh;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * cothden * cothsin;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5919,7 +5935,7 @@ public: T avga = (atan2(helper.In.y, xmw) - atan2(helper.In.y, xpw)) * T(0.5); helper.Out.x = avgr * std::cos(avga); helper.Out.y = avgr * std::sin(avga); - helper.Out.z = helper.In.z; + helper.Out.z = helper.In.z;//Apo does not use weight, sums only z. Sum here for reg, else assign. } virtual string OpenCLString() const override @@ -5944,7 +5960,7 @@ public: << "\n" << "\t\tvOut.x = avgr * cos(avga);\n" << "\t\tvOut.y = avgr * sin(avga);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = vIn.z;\n" << "\t}\n"; return ss.str(); } diff --git a/Source/Ember/Variations02.h b/Source/Ember/Variations02.h index e193e26..cf33d3f 100644 --- a/Source/Ember/Variations02.h +++ b/Source/Ember/Variations02.h @@ -61,14 +61,14 @@ public: { helper.Out.x = m_Weight * t * std::cos(theta); helper.Out.y = m_Weight * t * std::sin(theta); - helper.Out.z = 0; } else { helper.Out.x = 0; helper.Out.y = 0; - helper.Out.z = 0; } + + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -96,6 +96,7 @@ public: << "\t\t\tvOut.y = 0;\n" << "\t\t\tvOut.z = 0;\n" << "\t\t}\n" + << "\t\tvOut.Z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -697,7 +698,7 @@ public: } } - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -736,7 +737,7 @@ public: << "\t\t }\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -781,7 +782,7 @@ public: T r = m_BlurLinearLength * rand.Frand01(); helper.Out.x = m_Weight * (helper.In.x + r * m_C); helper.Out.y = m_Weight * (helper.In.y + r * m_S); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -799,7 +800,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + r * " << c << ");\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + r * " << s << ");\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -845,7 +846,7 @@ public: { helper.Out.x = m_V * (rand.Frand01() - T(0.5)); helper.Out.y = m_V * (rand.Frand01() - T(0.5)); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -858,7 +859,7 @@ public: ss << "\t{\n" << "\t\tvOut.x = " << v << " * (MwcNext01(mwc) - (real_t)(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 = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1361,7 +1362,7 @@ public: } } - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1417,7 +1418,7 @@ public: << "\t\t }\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1473,7 +1474,7 @@ public: T r = m_Weight * std::sqrt(helper.m_PrecalcSumSquares + std::sin(helper.m_PrecalcAtanyx * m_A) + 1); helper.Out.x = r * helper.m_PrecalcCosa; helper.Out.y = r * helper.m_PrecalcSina; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1488,7 +1489,7 @@ public: << "\n" << "\t\tvOut.x = r * precalcCosa;\n" << "\t\tvOut.y = r * precalcSina;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1669,7 +1670,7 @@ public: val = T(M_PI_4) * perimeter / side - T(M_PI_4); helper.Out.x = r * std::cos(val); helper.Out.y = r * std::sin(val); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1710,7 +1711,7 @@ public: << "\n" << "\t\tvOut.x = r * cos(val);\n" << "\t\tvOut.y = r * sin(val);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1778,7 +1779,7 @@ public: T val = T(M_PI_4) * perimeter / side - T(M_PI_4); helper.Out.x = r * std::cos(val); helper.Out.y = r * std::sin(val); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1818,7 +1819,7 @@ public: << "\n" << "\t\tvOut.x = r * cos(val);\n" << "\t\tvOut.y = r * sin(val);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1859,7 +1860,7 @@ public: T oscnapy = Foscn(m_AmountY, m_Py); helper.Out.x = -1 + m_Vv2 * Lerp(Lerp(x, Fosc(x, T(4), m_Px), oscnapx), Fosc(bx, T(4), m_Px), oscnapx);//Original did a direct assignment to outPoint, which is incompatible with Ember's design. helper.Out.y = -1 + m_Vv2 * Lerp(Lerp(y, Fosc(y, T(4), m_Py), oscnapy), Fosc(by, T(4), m_Py), oscnapy); - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1889,7 +1890,7 @@ public: << "\n" << "\t\tvOut.x = -1 + " << vv2 << " * Lerp(Lerp(x, Fosc(x, 4, " << px << "), oscnapx), Fosc(bx, 4, " << px << "), oscnapx);\n" << "\t\tvOut.y = -1 + " << vv2 << " * Lerp(Lerp(y, Fosc(y, 4, " << py << "), oscnapy), Fosc(by, 4, " << py << "), oscnapy);\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1963,7 +1964,7 @@ public: sincos(avga, &s, &c); helper.Out.x = avgr * c; helper.Out.y = avgr * s; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1978,7 +1979,7 @@ public: << "\n" << "\t\tvOut.x = avgr * c;\n" << "\t\tvOut.y = avgr * s;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2006,7 +2007,7 @@ public: T csv = std::cos(temp); helper.Out.x = m_Weight * expor * csv; helper.Out.y = m_Weight * expor * snv; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2027,7 +2028,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * expor * csv;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * expor * snv;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2159,7 +2160,7 @@ public: sincos(a, &s, &c); helper.Out.x = m_Weight * r * c; helper.Out.y = m_Weight * r * s; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2174,7 +2175,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * r * c;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * r * s;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2205,7 +2206,7 @@ public: T eradius2 = std::exp((helper.In.x * m_NatLog - helper.In.y * T(M_PI)) * -1); helper.Out.x = m_Weight * (eradius1 * cnum1 - eradius2 * cnum2) * m_Five; helper.Out.y = m_Weight * (eradius1 * snum1 - eradius2 * snum2) * m_Five; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2228,7 +2229,7 @@ public: << "\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.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2278,7 +2279,7 @@ public: T eradius2 = m_Sc * std::exp(m_Sc2 * ((helper.In.x * m_NatLog - helper.In.y * T(M_PI)) * -1)); helper.Out.x = m_Weight * (eradius1 * cnum1 - eradius2 * cnum2) * m_Five; helper.Out.y = m_Weight * (eradius1 * snum1 - eradius2 * snum2) * m_Five; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2303,7 +2304,7 @@ public: << "\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.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2383,7 +2384,7 @@ public: } } - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2429,7 +2430,7 @@ public: << "\t\t }\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2526,7 +2527,7 @@ public: } } - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2596,7 +2597,7 @@ public: << "\t\t }\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2632,7 +2633,7 @@ public: helper.Out.x = r * helper.m_PrecalcCosa; helper.Out.y = r * helper.m_PrecalcSina; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2653,7 +2654,7 @@ public: << "\n" << "\t\tvOut.x = r * precalcCosa;\n" << "\t\tvOut.y = r * precalcSina;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2695,7 +2696,7 @@ public: T vr = m_Weight / (SQR(c) + SQR(d)); helper.Out.x = vr * (a * c + b * d); helper.Out.y = vr * (b * c - a * d); - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2718,7 +2719,7 @@ public: << "\n" << "\t\tvOut.x = vr * (a * c + b * d);\n" << "\t\tvOut.y = vr * (b * c - a * d);\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2787,7 +2788,7 @@ public: T vr = m_Weight / (SQR(c) + SQR(d)); helper.Out.x = vr * (a * c + b * d); helper.Out.y = vr * (b * c - a * d); - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2814,7 +2815,7 @@ public: << "\n" << "\t\tvOut.x = vr * (a * c + b * d);\n" << "\t\tvOut.y = vr * (b * c - a * d);\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2878,7 +2879,7 @@ public: T cosa = std::cos(temp); helper.Out.x = vr * (x * cosa + y * sina); helper.Out.y = vr * (y * cosa - x * sina); - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2905,7 +2906,7 @@ public: << "\n" << "\t\tvOut.x = vr * (x * cosa + y * sina);\n" << "\t\tvOut.y = vr * (y * cosa - x * sina);\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3286,7 +3287,7 @@ public: T r = helper.m_PrecalcAtanyx * m_V; helper.Out.x = r * c; helper.Out.y = r * s; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3304,7 +3305,7 @@ public: << "\n" << "\t\tvOut.x = r * c;\n" << "\t\tvOut.y = r * s;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3350,7 +3351,7 @@ public: T r = m_Weight * std::pow(SQR(x) + SQR(y), m_Cn); helper.Out.x = r * cosa; helper.Out.y = r * sina; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3379,7 +3380,7 @@ public: << "\n" << "\t\tvOut.x = r * cosa;\n" << "\t\tvOut.y = r * sina;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3445,7 +3446,7 @@ public: T r = m_Weight * std::pow(helper.m_PrecalcSumSquares, m_HalfInvPower); helper.Out.x = r * cosa; helper.Out.y = r * sina; - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3467,7 +3468,7 @@ public: << "\n" << "\t\tvOut.x = r * cosa;\n" << "\t\tvOut.y = r * sina;\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3524,7 +3525,7 @@ public: T r1 = m_Vp / (SQR(re) + SQR(im)); helper.Out.x = r1 * (helper.In.x * re + helper.In.y * im); helper.Out.y = r1 * (helper.In.y * re - helper.In.x * im); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3549,7 +3550,7 @@ public: << "\n" << "\t\tvOut.x = r1 * (vIn.x * re + vIn.y * im);\n" << "\t\tvOut.y = r1 * (vIn.y * re - vIn.x * im);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3616,7 +3617,7 @@ public: T r1 = m_Vp / SQR(r); helper.Out.x = r1 * (helper.In.x * re + helper.In.y * im); helper.Out.y = r1 * (helper.In.y * re - helper.In.x * im); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3650,7 +3651,7 @@ public: << "\n" << "\t\tvOut.x = r1 * (vIn.x * re + vIn.y * im);\n" << "\t\tvOut.y = r1 * (vIn.y * re - vIn.x * im);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3715,7 +3716,7 @@ public: y = (m_IsOdd != 0) ? sina : (m_Vvar * std::atan2(cosa, sina)); helper.Out.x = x; helper.Out.y = y; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3744,7 +3745,7 @@ public: << "\t\ty = (" << isOdd << " != 0) ? sina : (" << vvar << " * atan2(cosa, sina));\n" << "\t\tvOut.x = x;\n" << "\t\tvOut.y = y;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3872,7 +3873,7 @@ public: } } - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3968,7 +3969,7 @@ public: << "\t\t }\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4007,7 +4008,7 @@ public: T y = m_C1y + (SQR(m_C1r) * (helper.In.y - m_C1y)) / (SQR(helper.In.x - m_C1x) + SQR(helper.In.y - m_C1y)); helper.Out.x = m_C2x + (SQR(m_C2r) * (x - m_C2x)) / (SQR(x - m_C2x) + SQR(y - m_C2y)); helper.Out.y = m_C2y + (SQR(m_C2r) * (y - m_C2y)) / (SQR(x - m_C2x) + SQR(y - m_C2y)); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4032,7 +4033,7 @@ public: << "\n" << "\t\tvOut.x = " << c2x << " + (SQR(" << c2r << ") * (x - " << c2x << ")) / (SQR(x - " << c2x << ") + SQR(y - " << c2y << "));\n" << "\t\tvOut.y = " << c2y << " + (SQR(" << c2r << ") * (y - " << c2y << ")) / (SQR(x - " << c2x << ") + SQR(y - " << c2y << "));\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4363,7 +4364,7 @@ public: T r3den = 1 / (br * br + bi * bi); helper.Out.x = m_Weight * (tr * br + ti * bi) * r3den; helper.Out.y = m_Weight * (ti * br - tr * bi) * r3den; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4396,7 +4397,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (tr * br + ti * bi) * r3den;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (ti * br - tr * bi) * r3den;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4466,7 +4467,7 @@ public: //invert the multiplication with scale from before. helper.Out.x = m_Weight * Lerp(u1, u2, m_P) * m_Is;//Original did a direct assignment to outPoint, which is incompatible with Ember's design. helper.Out.y = m_Weight * Lerp(v1, v2, m_P) * m_Is; - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4511,7 +4512,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * Lerp(u1, u2, " << p << ") * " << is << ";\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * Lerp(v1, v2, " << p << ") * " << is << ";\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4596,7 +4597,7 @@ public: T y = (2 * (c1 - T(0.5))); helper.Out.x = m_Vv * x; helper.Out.y = m_Vv * y; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4620,7 +4621,7 @@ public: << "\n" << "\t\tvOut.x = " << vv << " * x;\n" << "\t\tvOut.y = " << vv << " * y;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4713,7 +4714,7 @@ public: T ty = Lerp(helper.In.y, sy, m_Ay); helper.Out.x = m_Weight * tx; helper.Out.y = m_Weight * ty; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4741,7 +4742,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * tx;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * ty;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * tz;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4818,7 +4819,7 @@ public: result /= divident; helper.Out.x = m_Weight * helper.In.x + result; helper.Out.y = m_Weight * helper.In.y + result; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4846,7 +4847,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x + result;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y + result;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4883,7 +4884,7 @@ public: helper.Out.x = r * helper.In.x; helper.Out.y = r * helper.In.y; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4898,7 +4899,7 @@ public: << "\n" << "\t\tvOut.x = r * vIn.x;\n" << "\t\tvOut.y = r * vIn.y;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4925,7 +4926,7 @@ public: T c = std::cos(helper.In.x); helper.Out.x = m_Vvar2 * r * s; helper.Out.y = m_Vvar2 * r * c; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4942,7 +4943,7 @@ public: << "\n" << "\t\tvOut.x = " << vvar2 << " * r * s;\n" << "\t\tvOut.y = " << vvar2 << " * r * c;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4992,7 +4993,7 @@ public: T dy = yn + T(0.5) * (m_ScaleY * sinx + std::abs(yn) * m_IncY * sinx); helper.Out.x = m_Weight * dx; helper.Out.y = m_Weight * dy; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5024,7 +5025,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * dx;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * dy;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5103,7 +5104,7 @@ public: helper.Out.y = -m_Weight * y; } - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5139,7 +5140,7 @@ public: << "\t\t vOut.y = -xform->m_VariationWeights[" << varIndex << "] * y;\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5277,7 +5278,7 @@ public: { helper.Out.x = m_Weight01 / SafeTan(helper.In.x) * std::cos(helper.In.y); helper.Out.y = m_Weight01 / std::sin(helper.In.x) * (-helper.In.y); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5290,7 +5291,7 @@ public: ss << "\t{\n" << "\t\tvOut.x = " << weight01 << " / tan(vIn.x) * cos(vIn.y);\n" << "\t\tvOut.y = " << weight01 << " / sin(vIn.x) * (-vIn.y);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5331,7 +5332,7 @@ public: T coshy1 = std::cosh(helper.In.y) + 1; helper.Out.x = m_Weight * sinx * coshy1 * sinx2; helper.Out.y = m_Weight * cosx * coshy1 * sinx2; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5346,7 +5347,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sinx * coshy1 * sinx2;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * cosx * coshy1 * sinx2;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5377,7 +5378,7 @@ public: T coshy1 = std::cosh(helper.In.y) + 1; helper.Out.x = d * sinx * coshy1 * sinx2; helper.Out.y = d * cosx * coshy1 * sinx2; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5393,7 +5394,7 @@ public: << "\n" << "\t\tvOut.x = d * sinx * coshy1 * sinx2;\n" << "\t\tvOut.y = d * cosx * coshy1 * sinx2;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5436,7 +5437,7 @@ public: T temp = m_C * a + m_HalfD * lnr2 + m_Ang * rand.Rand(); helper.Out.x = r * std::cos(temp); helper.Out.y = r * std::sin(temp); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5474,7 +5475,7 @@ public: << "\n" << "\t\tvOut.x = r * cos(temp);\n" << "\t\tvOut.y = r * sin(temp);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5535,7 +5536,7 @@ MAKEPREPOSTPARVARASSIGN(BlurSquare, blur_square, BLUR_SQUARE, eVariationAssignTy MAKEPREPOSTVAR(Flatten, flatten, FLATTEN) MAKEPREPOSTVARASSIGN(Zblur, zblur, ZBLUR, eVariationAssignType::ASSIGNTYPE_SUM) MAKEPREPOSTVARASSIGN(Blur3D, blur3D, BLUR3D, eVariationAssignType::ASSIGNTYPE_SUM) -MAKEPREPOSTVARASSIGN(ZScale, zscale, ZSCALE, eVariationAssignType::ASSIGNTYPE_SUM) +MAKEPREPOSTVAR(ZScale, zscale, ZSCALE) MAKEPREPOSTVARASSIGN(ZTranslate, ztranslate, ZTRANSLATE, eVariationAssignType::ASSIGNTYPE_SUM) MAKEPREPOSTVAR(ZCone, zcone, ZCONE) MAKEPREPOSTVAR(Spherical3D, Spherical3D, SPHERICAL3D) diff --git a/Source/Ember/Variations03.h b/Source/Ember/Variations03.h index 12aa946..c2619fe 100644 --- a/Source/Ember/Variations03.h +++ b/Source/Ember/Variations03.h @@ -23,7 +23,7 @@ public: T temp = 1 / Zeps(cos(helper.In.y)) + m_Effect * T(M_PI); helper.Out.x = m_Weight * (tanh(helper.In.x) * temp); helper.Out.y = m_Weight * (tanh(helper.In.y) * temp); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -38,7 +38,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (tanh(vIn.x) * temp);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (tanh(vIn.y) * temp);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -111,7 +111,7 @@ public: T ran = (helper.m_PrecalcAtanyx / Zeps(m_Denominator) + (m_Root * M_2PI * Floor(rand.Frand01() * m_Denominator) / Zeps(m_Denominator))) * m_Numerator; helper.Out.x = r2 * std::cos(ran); helper.Out.y = r2 * std::sin(ran); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -132,7 +132,7 @@ public: << "\n" << "\t\tvOut.x = r2 * cos(ran);\n" << "\t\tvOut.y = r2 * sin(ran);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -188,7 +188,7 @@ public: T u = std::sqrt(ClampGte0(Zeps(m_A) * SQR(helper.In.x) + Zeps(m_B) * SQR(helper.In.y)));//Original did not clamp. helper.Out.x = std::cos(u) * SafeTan(helper.In.x) * m_Weight; helper.Out.y = std::sin(u) * SafeTan(helper.In.y) * m_Weight; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -204,7 +204,7 @@ public: << "\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.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -243,7 +243,7 @@ public: { helper.Out.x = m_Weight * (helper.In.x - ((SQR(helper.In.x) * helper.In.x) / 3)) + helper.In.x * SQR(helper.In.y); helper.Out.y = m_Weight * (helper.In.y - ((SQR(helper.In.y) * helper.In.y) / 3)) + helper.In.y * SQR(helper.In.x); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -253,7 +253,7 @@ public: ss << "\t{\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x - ((SQR(vIn.x) * vIn.x) / 3)) + vIn.x * SQR(vIn.y);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y - ((SQR(vIn.y) * vIn.y) / 3)) + vIn.y * SQR(vIn.x);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -282,7 +282,7 @@ public: T cosa = std::cos(alpha); helper.Out.x = m_Weight * cosa / r; helper.Out.y = m_Weight * sina / r; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -302,7 +302,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cosa / r;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sina / r;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -352,7 +352,7 @@ public: else helper.Out.y = (m_Rotate * helper.In.y) * cos45 + helper.In.x * sin45 - m_Pull - m_LineUp; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -377,7 +377,7 @@ public: << "\t\telse\n" << "\t\t vOut.y = (" << rotate << " * vIn.y) * cos45 + vIn.x * sin45 - " << pull << " - " << lineUp << ";\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -456,7 +456,7 @@ public: } } - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -512,7 +512,7 @@ public: << "\t\t }\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -624,7 +624,7 @@ public: } } - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -668,7 +668,7 @@ public: << "\t\t }\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -783,7 +783,7 @@ public: } } - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -825,7 +825,7 @@ public: << "\t\t }\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -936,7 +936,7 @@ public: T temp = angle - T(M_PI_2); helper.Out.x = m_Weight * z * std::cos(temp); helper.Out.y = m_Weight * z * std::sin(temp); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -969,7 +969,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * z * cos(temp);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * z * sin(temp);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1021,7 +1021,7 @@ public: T r = m_Weight * (m_Power == 1 ? std::acos(rand.Frand01() * 2 - 1) / T(M_PI) : std::acos(std::exp(std::log(rand.Frand01()) * m_Power) * 2 - 1) / T(M_PI)); helper.Out.x = r * c; helper.Out.y = r * s; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1039,7 +1039,7 @@ public: << "\n" << "\t\tvOut.x = r * c;\n" << "\t\tvOut.y = r * s;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1073,7 +1073,7 @@ public: T temp = rand.Frand01() * M_2PI; helper.Out.x = m_Weight * std::cos(temp) * rad; helper.Out.y = m_Weight * std::sin(temp) * rad; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1086,7 +1086,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cos(temp) * rad;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sin(temp) * rad;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1190,7 +1190,7 @@ public: helper.Out.y = m_Weight * helper.In.y; } - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1233,7 +1233,7 @@ public: << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1611,7 +1611,7 @@ public: { helper.Out.x = SignNz(helper.In.x) * std::pow(std::abs(helper.In.x), m_PowX) * m_Weight; helper.Out.y = SignNz(helper.In.y) * std::pow(std::abs(helper.In.y), m_PowY) * m_Weight; - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1625,7 +1625,7 @@ public: ss << "\t{\n" << "\t\tvOut.x = SignNz(vIn.x) * pow(fabs(vIn.x), " << powx << ") * xform->m_VariationWeights[" << varIndex << "];\n" << "\t\tvOut.y = SignNz(vIn.y) * pow(fabs(vIn.y), " << powy << ") * xform->m_VariationWeights[" << varIndex << "];\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1722,7 +1722,7 @@ public: T r = m_Weight / Zeps(helper.m_PrecalcSumSquares); helper.Out.x = helper.In.x * r * m_X; helper.Out.y = helper.In.y * r * m_Y; - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1738,7 +1738,7 @@ public: << "\n" << "\t\tvOut.x = vIn.x * r * " << x << ";\n" << "\t\tvOut.y = vIn.y * r * " << y << ";\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1846,7 +1846,7 @@ public: T y1 = (m_A + m_B) * std::sin(t) - m_C2 * std::sin((m_A + m_B) / m_B * t); helper.Out.x = m_Weight * (x1 + m_D * std::cos(t) + y); helper.Out.y = m_Weight * (y1 + m_D * std::sin(t) + y); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1872,7 +1872,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (x1 + " << d << " * cos(t) + y);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (y1 + " << d << " * sin(t) + y);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1925,7 +1925,7 @@ public: T by = Cube(sinX * cosY); helper.Out.x = m_Weight * cosX * bx; helper.Out.y = m_Weight * cosX * by; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1942,7 +1942,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cosX * bx;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * cosX * by;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1969,7 +1969,7 @@ public: T e = 1 / helper.m_PrecalcSumSquares + SQR(T(M_2_PI)); helper.Out.x = m_Weight * (m_Weight / helper.m_PrecalcSumSquares * helper.In.x / e); helper.Out.y = m_Weight * (m_Weight / helper.m_PrecalcSumSquares * helper.In.y / e); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1981,7 +1981,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (xform->m_VariationWeights[" << varIndex << "] / precalcSumSquares * vIn.x / e);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (xform->m_VariationWeights[" << varIndex << "] / precalcSumSquares * vIn.y / e);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2124,7 +2124,7 @@ public: T c2 = Zeps(SQR(helper.In.y)); helper.Out.x = m_Weight * ((1 / d) * std::cos(c1) * std::sin(c2)); helper.Out.y = m_Weight * ((1 / d) * std::sin(c1) * std::sin(c2)); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2138,7 +2138,7 @@ public: << "\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 << "] * (((real_t)(1.0) / d) * sin(c1) * sin(c2));\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2195,7 +2195,7 @@ public: helper.Out.y = -(m_Weight * (8 * helper.m_PrecalcSqrtSumSquares - p)); } - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2236,7 +2236,7 @@ public: << "\t\t vOut.y = -(xform->m_VariationWeights[" << varIndex << "] * (8 * precalcSqrtSumSquares - p));\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2274,7 +2274,7 @@ public: helper.Out.x = m_Weight * (std::sin(helper.In.x) * r + dx); helper.Out.y = m_Weight * (std::sin(helper.In.y) * r + dy); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2305,7 +2305,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (sin(vIn.x) * r + dx);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (sin(vIn.y) * r + dy);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2362,7 +2362,7 @@ public: T r = m_Weight * std::pow(helper.m_PrecalcSumSquares, m_Cn); helper.Out.x = r * std::cos(temp); helper.Out.y = r * std::sin(temp); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2386,7 +2386,7 @@ public: << "\n" << "\t\tvOut.x = r * cos(temp);\n" << "\t\tvOut.y = r * sin(temp);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2542,7 +2542,7 @@ public: alpha = (std::atan2(y, x) + n * M_2PI) / Floor(m_Power); helper.Out.x = m_Weight * r * std::cos(alpha); helper.Out.y = m_Weight * r * std::sin(alpha); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2585,7 +2585,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * r * cos(alpha);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * r * sin(alpha);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2689,7 +2689,7 @@ public: //Add final values in to variations totals. helper.Out.x = m_Weight * mx; helper.Out.y = m_Weight * my; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2752,7 +2752,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * mx;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * my;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2817,7 +2817,7 @@ public: T y1 = sin(m_B * t); helper.Out.x = m_Weight * (x1 + m_C * t + m_E * y); helper.Out.y = m_Weight * (y1 + m_C * t + m_E * y); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2841,7 +2841,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (x1 + " << c << " * t + " << e << " * y);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (y1 + " << c << " * t + " << e << " * y);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2960,7 +2960,7 @@ public: helper.Out.x = helper.m_PrecalcSqrtSumSquares * std::cos(a); helper.Out.y = helper.m_PrecalcSqrtSumSquares * std::sin(a); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2989,7 +2989,7 @@ public: << "\n" << "\t\tvOut.x = precalcSqrtSumSquares * cos(a);\n" << "\t\tvOut.y = precalcSqrtSumSquares * sin(a);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3142,7 +3142,7 @@ public: helper.Out.x = r * std::cos(a); helper.Out.y = r * std::sin(a); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3183,7 +3183,7 @@ public: << "\n" << "\t\tvOut.x = r * cos(a);\n" << "\t\tvOut.y = r * sin(a);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3244,7 +3244,7 @@ public: T temp = std::cosh(tau) - std::cos(sigma); helper.Out.x = m_Weight * std::sinh(tau) / temp; helper.Out.y = m_Weight * std::sin(sigma) / temp; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3266,7 +3266,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sinh(tau) / temp;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sin(sigma) / temp;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3312,7 +3312,7 @@ public: T temp = std::cosh(tau) - std::cos(sigma); helper.Out.x = m_Weight * std::sinh(tau) / temp; helper.Out.y = m_Weight * std::sin(sigma) / temp; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3333,7 +3333,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sinh(tau) / temp;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sin(sigma) / temp;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3385,7 +3385,7 @@ public: T temp = std::cosh(tau) - std::cos(sigma); helper.Out.x = m_Weight * std::sinh(tau) / temp; helper.Out.y = m_Weight * std::sin(sigma) / temp; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3413,7 +3413,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sinh(tau) / temp;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sin(sigma) / temp;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3469,7 +3469,7 @@ public: T temp = std::cosh(tau) - std::cos(sigma); helper.Out.x = m_Weight * sinh(tau) / temp; helper.Out.y = m_Weight * sin(sigma) / temp; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3498,7 +3498,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sinh(tau) / temp;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sin(sigma) / temp;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3582,7 +3582,7 @@ public: helper.Out.y = m_Weight * helper.In.y; } - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3621,7 +3621,7 @@ public: << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3661,7 +3661,7 @@ public: else helper.Out.y = -(m_Weight * helper.In.y); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3679,7 +3679,7 @@ public: << "\t\telse\n" << "\t\t vOut.y = -(xform->m_VariationWeights[" << varIndex << "] * vIn.y);\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3721,7 +3721,7 @@ public: else helper.Out.y = m_Weight * helper.In.y; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3736,7 +3736,7 @@ public: << "\t\telse\n" << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3791,7 +3791,7 @@ public: helper.Out.x = m_Weight * xmax * std::cos(nu); helper.Out.y = m_Weight * std::sqrt(xmax - 1) * std::sqrt(xmax + 1) * sin(nu); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3840,7 +3840,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * xmax * cos(nu);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sqrt(xmax - 1) * sqrt(xmax + 1) * sin(nu);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3922,7 +3922,7 @@ public: mu /= m_Power; helper.Out.x = m_Weight * std::cosh(mu) * std::cos(nu); helper.Out.y = m_Weight * std::sinh(mu) * std::sin(nu); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3964,7 +3964,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cosh(mu) * cos(nu);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sinh(mu) * sin(nu);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4032,7 +4032,7 @@ public: helper.Out.x = m_Weight * std::cosh(mu) * std::cos(nu); helper.Out.y = m_Weight * std::sinh(mu) * std::sin(nu); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4067,7 +4067,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cosh(mu) * cos(nu);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sinh(mu) * sin(nu);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4131,7 +4131,7 @@ public: nu += m_Rotate; helper.Out.x = m_Weight * std::cosh(mu) * std::cos(nu); helper.Out.y = m_Weight * std::sinh(mu) * std::sin(nu); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4171,7 +4171,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cosh(mu) * cos(nu);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sinh(mu) * sin(nu);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4226,7 +4226,7 @@ public: mu += m_Push; helper.Out.x = m_Weight * std::cosh(mu) * std::cos(nu); helper.Out.y = m_Weight * std::sinh(mu) * std::sin(nu); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4258,7 +4258,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cosh(mu) * cos(nu);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sinh(mu) * sin(nu);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4315,7 +4315,7 @@ public: nu = fmod(nu + m_Rotate + T(M_PI), M_2PI) - T(M_PI); helper.Out.x = m_Weight * xmax * std::cos(nu); helper.Out.y = m_Weight * std::sqrt(xmax - 1) * std::sqrt(xmax + 1) * std::sin(nu); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4333,7 +4333,7 @@ public: << "\t\tif (xmax < 1)\n" << "\t\t xmax = 1;\n" << "\n" - << "\t\treal_t nu = acos(clamp(vIn.x / xmax, -(real_t)(1.0), (real_t)(1.0)));\n" + << "\t\treal_t nu = acos(clamp(vIn.x / xmax, (real_t)(-1.0), (real_t)(1.0)));\n" << "\n" << "\t\tif (vIn.y < 0)\n" << "\t\t nu *= -1;\n" @@ -4342,7 +4342,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * xmax * cos(nu);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sqrt(xmax - 1) * sqrt(xmax + 1) * sin(nu);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4401,7 +4401,7 @@ public: helper.Out.x = m_Weight * std::cosh(mu) * std::cos(nu); helper.Out.y = m_Weight * std::sinh(mu) * std::sin(nu); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4437,7 +4437,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cosh(mu) * cos(nu);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sinh(mu) * sin(nu);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } diff --git a/Source/Ember/Variations04.h b/Source/Ember/Variations04.h index b78bca4..6fc82c2 100644 --- a/Source/Ember/Variations04.h +++ b/Source/Ember/Variations04.h @@ -33,7 +33,7 @@ public: nu = nu + mu * m_Out + m_In / mu; helper.Out.x = m_Weight * std::cosh(mu) * std::cos(nu); helper.Out.y = m_Weight * std::sinh(mu) * std::sin(nu); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -62,7 +62,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cosh(mu) * cos(nu);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sinh(mu) * sin(nu);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -204,7 +204,7 @@ public: } } - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -321,7 +321,7 @@ public: << "\t\t }\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -420,7 +420,7 @@ public: helper.Out.y = (m_Weight * (8 * s - p)); } - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -484,7 +484,7 @@ public: << "\t\t vOut.y = -(xform->m_VariationWeights[" << varIndex << "] * (8 * s - p));\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -533,7 +533,7 @@ public: helper.Out.x = m_Weight * r * helper.m_PrecalcCosa; helper.Out.y = m_Weight * r * helper.m_PrecalcSina; - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -554,7 +554,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * r * precalcCosa;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * r * precalcSina;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -594,7 +594,7 @@ public: T d = Zeps(helper.m_PrecalcSumSquares); helper.Out.x = (m_Weight / d) * (tanh(d) * (2 * helper.In.x)); helper.Out.y = (m_Weight / d) * (cos(d) * (2 * helper.In.y)); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -606,7 +606,7 @@ public: << "\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) * ((real_t)(2.0) * vIn.y));\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -633,7 +633,7 @@ public: T d = Zeps(helper.m_PrecalcSumSquares); helper.Out.x = (m_Weight / 2) * (tanh(d) * (2 * helper.In.x)); helper.Out.y = (m_Weight / 2) * (cos(d) * (2 * helper.In.y)); - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -645,7 +645,7 @@ public: << "\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 << "] / (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 = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1134,7 +1134,7 @@ public: r *= m_S2; helper.Out.x = m_Weight * (helper.In.x + (rand.Frand01() - T(0.5)) * r); helper.Out.y = m_Weight * (helper.In.y + (rand.Frand01() - T(0.5)) * r); - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1158,7 +1158,7 @@ public: << "\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) - (real_t)(0.5)) * r);\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1209,7 +1209,10 @@ public: T r = m_Weight * std::pow(helper.m_PrecalcSumSquares, m_Cn * m_A); helper.Out.x = r * std::cos(a) + m_B; helper.Out.y = r * std::sin(a) + m_B; - helper.Out.z = m_Weight * helper.In.z;//Original did not multiply by weight. Do it here to be consistent with others. + helper.Out.z = helper.In.z; + + if (m_VarType == eVariationType::VARTYPE_REG) + outPoint.m_Z = 0; } virtual string OpenCLString() const override @@ -1232,8 +1235,13 @@ public: << "\n" << "\t\tvOut.x = r * cos(a) + " << b << ";\n" << "\t\tvOut.y = r * sin(a) + " << b << ";\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" - << "\t}\n"; + << "\t\tvOut.z = vIn.z;\n"; + + if (m_VarType == eVariationType::VARTYPE_REG) + ss << "\t\toutPoint->m_Z = 0;\n"; + + ss + << "\t}\n"; return ss.str(); } @@ -1292,7 +1300,7 @@ public: T v = (sqX + sqY) * m_W;//Do not use precalcSumSquares here because its components are needed below. helper.Out.x = m_Weight * std::sin(helper.In.x) * (sqX + m_W - v); helper.Out.y = m_Weight * std::sin(helper.In.y) * (sqY + m_W - v); - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1309,7 +1317,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sin(vIn.x) * (sqX + " << w << " - v);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sin(vIn.y) * (sqY + " << w << " - v);\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1378,7 +1386,7 @@ public: helper.Out.x = m_Weight * (m_K * (helper.In.x - x0) + x0); helper.Out.y = m_Weight * (m_K * (helper.In.y - y0) + y0); - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1429,7 +1437,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (" << m_k << " * (vIn.x - x0) + x0);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (" << m_k << " * (vIn.y - y0) + y0);\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1527,7 +1535,7 @@ public: helper.Out.x = m_CosR * a + m_SinR * r; helper.Out.y = -m_SinR * a + m_CosR * r; - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1571,7 +1579,7 @@ public: << "\n" << "\t\tvOut.x = " << cosr << " * a + " << sinr << " * r;\n" << "\t\tvOut.y = -" << sinr << " * a + " << cosr << " * r;\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2240,7 +2248,7 @@ public: helper.Out.y = m_Weight * helper.In.y; } - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2307,7 +2315,7 @@ public: << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2963,7 +2971,7 @@ public: helper.Out.x = m_Weight * (fp1x + fp2x); helper.Out.y = m_Weight * (fp1y + fp2y); - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3030,7 +3038,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (fp1x + fp2x);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (fp1y + fp2y);\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3852,7 +3860,7 @@ public: { helper.Out.x = m_Weight / Zeps(helper.m_PrecalcSqrtSumSquares); helper.Out.y = helper.m_PrecalcAtanyx; - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3862,7 +3870,7 @@ public: ss << "\t{\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] / Zeps(precalcSqrtSumSquares);\n" << "\t\tvOut.y = precalcAtanyx;\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3896,7 +3904,7 @@ public: (m_Q04 * xy + m_Q05 * helper.In.y + m_Q06 * sqy); helper.Out.y = (m_Q07 + m_Q08 * helper.In.x + m_Q09 * sqx) + (m_Q10 * xy + m_Weight * m_Q11 * helper.In.y + m_Q12 * sqy); - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3926,7 +3934,7 @@ public: << "\t\t (" << q04 << " * xy + " << q05 << " * vIn.y + " << q06 << " * sqy);\n" << "\t\tvOut.y = (" << q07 << " + " << q08 << " * vIn.x + " << q09 << " * sqx) + \n" << "\t\t (" << q10 << " * xy + xform->m_VariationWeights[" << varIndex << "] * " << q11 << " * vIn.y + " << q12 << " * sqy);\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4002,7 +4010,7 @@ public: helper.Out.x = xx * m_Weight; helper.Out.y = yy * m_Weight; - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4035,7 +4043,7 @@ public: << "\n" << "\t\tvOut.x = xx * xform->m_VariationWeights[" << varIndex << "];\n" << "\t\tvOut.y = yy * xform->m_VariationWeights[" << varIndex << "];\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4192,7 +4200,7 @@ public: helper.Out.y += m_Size * (y + Floor(helper.In.y)); } - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4329,7 +4337,7 @@ public: << "\t\t vOut.y += " << size << " * (y + floor(vIn.y));\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4732,7 +4740,7 @@ public: } } - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4789,7 +4797,7 @@ public: << "\t\t }\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -4844,7 +4852,7 @@ public: T mod2 = std::exp(lnmod * m_ReInv - arg * m_Im100); helper.Out.x = m_Weight * mod2 * std::cos(temp); helper.Out.y = m_Weight * mod2 * std::sin(temp); - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -4866,7 +4874,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * mod2 * cos(temp);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * mod2 * sin(temp);\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -5036,7 +5044,7 @@ public: a = helper.In.y / Zeps(ymax); b = SafeSqrt(1 - SQR(a)); helper.Out.y = m_Vy * atan2(a, b) * r; - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -5068,7 +5076,7 @@ public: << "\t\tb = SafeSqrt(1 - SQR(a));\n" << "\n" << "\t\tvOut.y = " << vy << " * atan2(a, b) * r;\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } diff --git a/Source/Ember/Variations05.h b/Source/Ember/Variations05.h index 7ab5142..5041573 100644 --- a/Source/Ember/Variations05.h +++ b/Source/Ember/Variations05.h @@ -133,7 +133,7 @@ public: helper.Out.x = m_Weight * (x + (m * 2 + 1) * m_Sc); helper.Out.y = m_Weight * (y + (n * 2 + 1) * m_Sc); - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -195,7 +195,7 @@ public: << "\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.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -292,7 +292,7 @@ public: helper.Out.x = m_Weight * (x + (m * 2 + 1) * m_Sc); helper.Out.y = m_Weight * (y + (n * 2 + 1) * m_Sc); - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -327,7 +327,7 @@ public: << "\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.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -418,7 +418,7 @@ public: helper.Out.x = m_Weight * ux; helper.Out.y = m_Weight * uy; - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -456,7 +456,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * ux;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * uy;\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1086,7 +1086,7 @@ public: T sucv = su * cv; T x = std::pow(std::abs(cucv), m_XPow) + (cucv * m_XPow) + (T(0.25) * atOmegaX);//Must fabs first argument to pow, because negative values will return NaN. T y = std::pow(std::abs(sucv), m_YPow) + (sucv * m_YPow) + (T(0.25) * atOmegaY);//Original did not do this and would frequently return bad values. - T z = std::pow(std::abs(sv), m_ZPow) + sv * m_ZPow; + T z = std::pow(std::abs(sv), m_ZPow) + sv * m_ZPow; helper.Out.x = m_Weight * x; helper.Out.y = m_Weight * y; helper.Out.z = m_Weight * z; @@ -1356,7 +1356,7 @@ public: helper.Out.y = m_Weight * helper.In.y; } - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1417,7 +1417,7 @@ public: << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1498,7 +1498,7 @@ public: helper.Out.y = m_Weight * helper.In.y; } - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1529,7 +1529,7 @@ public: << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1655,7 +1655,7 @@ public: helper.Out.y = helper.In.y * r * m_Y; helper.Out.x += (1 - (m_Twist * SQR(helper.In.x)) + helper.In.y) * m_Weight;//The += is intentional. helper.Out.y += m_Tilt * helper.In.x * m_Weight; - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1676,7 +1676,7 @@ public: << "\t\tvOut.y = vIn.y * r * " << y << ";\n" << "\t\tvOut.x += (1 - (" << twist << " * SQR(vIn.x)) + vIn.y) * xform->m_VariationWeights[" << varIndex << "];\n" << "\t\tvOut.y += " << tilt << " * vIn.x * xform->m_VariationWeights[" << varIndex << "];\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1702,8 +1702,8 @@ private: /// /// waves2_3D. /// Original used a precalc for the input points, but it doesn't -/// work with Ember's design, so it gets calculated on every iter -/// which is slightly slower. +/// work with Ember's design (and is also likely wrong), so it gets calculated on every iter +/// which is slightly slower, but more correct. /// template class EMBER_API Waves23DVariation : public ParametricVariation @@ -2130,8 +2130,8 @@ public: virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override { T b = m_Weight / (helper.m_PrecalcSumSquares * T(0.25) + 1); - T roundX = Rint(helper.In.x); - T roundY = Rint(helper.In.y); + T roundX = std::rint(helper.In.x); + T roundY = std::rint(helper.In.y); T offsetX = helper.In.x - roundX; T offsetY = helper.In.y - roundY; helper.Out.x = helper.In.x * b; @@ -2174,7 +2174,7 @@ public: helper.Out.x += helper.In.x * m_Px; helper.Out.y += helper.In.y * m_Py; - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2234,7 +2234,7 @@ public: << "\n" << "\t\tvOut.x += vIn.x * " << px << ";\n" << "\t\tvOut.y += vIn.y * " << py << ";\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2278,7 +2278,7 @@ public: helper.Out.x = m_Weight * r * std::cos(a); helper.Out.y = m_Weight * r * std::sin(a); - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -2294,7 +2294,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * r * cos(a);\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * r * sin(a);\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2941,7 +2941,7 @@ public: InverseTrilinear(alpha, beta, x, y, rand); helper.Out.x = m_Weight * x; helper.Out.y = m_Weight * y; - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3062,7 +3062,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * x;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * y;\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } diff --git a/Source/Ember/Variations06.h b/Source/Ember/Variations06.h index fb50af5..1fec36c 100644 --- a/Source/Ember/Variations06.h +++ b/Source/Ember/Variations06.h @@ -46,7 +46,12 @@ public: //Infinite number of small cells? No effect . . . if (s == 0) + { + helper.Out.x = 0; + helper.Out.y = 0; + helper.Out.z = DefaultZ(helper); return; + } //Get co-ordinates, and convert to hex co-ordinates. u.x = helper.In.x; @@ -96,7 +101,7 @@ public: DYo = u.y - P[0].y; //Apply "interesting bit" to cell's DXo and DYo co-ordinates. //trgL is the defined value of l, independent of any rotation. - trgL = std::pow(Zeps(L1), m_Power) * m_Scale;//Original added 1e-100, use Zeps to be more precise. + trgL = std::pow(std::abs(L1), m_Power) * m_Scale;//Original added 1e-100, use Zeps to be more precise. //Rotate. v.x = DXo * m_RotCos + DYo * m_RotSin; v.y = -DXo * m_RotSin + DYo * m_RotCos; @@ -110,7 +115,7 @@ public: //L is maximum of L1 or L2 . . . //When L = 0.8 or higher . . . match trgL/L2 exactly. //When L = T(0.5) or less . . . match trgL/L1 exactly. - L = (L1 > L2) ? L1 : L2; + L = std::max(L1, L2); if (L < T(0.5)) { @@ -130,7 +135,7 @@ public: //Finally add values in. helper.Out.x = m_Weight * v.x; helper.Out.y = m_Weight * v.y; - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -155,7 +160,12 @@ public: << "\t\ts = " << cellsize << ";\n" << "\n" << "\t\tif (s == 0)\n" - << "\t\t return;\n" + << "\t\t{\n" + << "\t\t vOut.x = 0;\n" + << "\t\t vOut.y = 0;\n" + << "\t\t vOut.z = " << DefaultZCl() + << "\t\t return;\n" + << "\t\t}\n" << "\n" << "\t\tU.x = vIn.x;\n" << "\t\tU.y = vIn.y;\n" @@ -201,7 +211,7 @@ public: << "\t\tDXo = U.x - P[0].x;\n" << "\t\tDYo = U.y - P[0].y;\n" << "\n" - << "\t\ttrgL = pow(Zeps(L1), " << power << ") * " << scale << ";\n" + << "\t\ttrgL = pow(fabs(L1), " << power << ") * " << scale << ";\n" << "\n" << "\t\tVx = DXo * " << rotcos << " + DYo * " << rotsin << ";\n" << "\t\tVy = -DXo * " << rotsin << " + DYo * " << rotcos << ";\n" @@ -209,8 +219,7 @@ public: << "\t\tU.x = Vx + P[0].x;\n" << "\t\tU.y = Vy + P[0].y;\n" << "\t\tL2 = Voronoi(&P[0], 7, 0, &U);\n" - << "\n" - << "\t\tL = (L1 > L2) ? L1 : L2;\n" + << "\t\tL = max(L1, L2);\n" << "\n" << "\t\tif (L < 0.5)\n" << "\t\t{\n" @@ -232,7 +241,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * Vx;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * Vy;\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -366,7 +375,7 @@ public: params.Y = m_Sina * xTmp + m_Cosa * yTmp; helper.Out.x = m_AdjustedWeight * params.X; helper.Out.y = m_AdjustedWeight * params.Y; - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -441,7 +450,7 @@ public: << "\n" << "\t\tvOut.x = " << adjustedWeight << " * params.X;\n" << "\t\tvOut.y = " << adjustedWeight << " * params.Y;\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -1544,7 +1553,7 @@ public: helper.Out.x = xTmp; helper.Out.y = yTmp; - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1646,7 +1655,7 @@ public: << "\n" << "\t\tvOut.x = xTmp;\n" << "\t\tvOut.y = yTmp;\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -2737,7 +2746,7 @@ public: break; } - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -3092,7 +3101,7 @@ public: << "\t\t break;\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3749,7 +3758,7 @@ public: dO += p[4]; helper.Out.x = m_Weight * dO.x; helper.Out.y = m_Weight * dO.y; - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); } virtual vector OpenCLGlobalFuncNames() const override @@ -3847,7 +3856,7 @@ public: << "\t\tdO += p[4];\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * dO.x;\n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * dO.y;\n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } @@ -3920,7 +3929,7 @@ class EMBER_API PostSmartcropVariation : public ParametricVariation public: PostSmartcropVariation(T weight = 1.0) : ParametricVariation("post_smartcrop", eVariationId::VAR_POST_SMARTCROP, weight) { - m_AssignType = eVariationAssignType::ASSIGNTYPE_SET; + m_PrePostAssignType = eVariationAssignType::ASSIGNTYPE_SET; m_VarType = eVariationType::VARTYPE_POST;//Very special usage, post only. Init(); } @@ -4417,6 +4426,984 @@ private: T m_C; }; +/// +/// erf. +/// +template +class EMBER_API ErfVariation : public Variation +{ +public: + ErfVariation(T weight = 1.0) : Variation("erf", eVariationId::VAR_ERF, weight) { } + + VARCOPY(ErfVariation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + helper.Out.x = m_Weight * std::erf(helper.In.x); + helper.Out.y = m_Weight * std::erf(helper.In.y); + helper.Out.z = DefaultZ(helper); + } + + virtual string OpenCLString() const override + { + ostringstream ss; + intmax_t varIndex = IndexInXform(); + ss << "\t{\n" + << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * erf(vIn.x);\n" + << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * erf(vIn.y);\n" + << "\t\tvOut.z = " << DefaultZCl() + << "\t}\n"; + return ss.str(); + } +}; + +/// +/// xerf. +/// +template +class EMBER_API XerfVariation : public Variation +{ +public: + XerfVariation(T weight = 1.0) : Variation("xerf", eVariationId::VAR_XERF, weight, true) { } + + VARCOPY(XerfVariation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + T r2 = Sqr(std::sqrt(helper.m_PrecalcSumSquares + SQR(helper.In.z))); + helper.Out.x = m_Weight * (std::abs(helper.In.x) >= 2 ? helper.In.x / r2 : std::erf(helper.In.x)); + helper.Out.y = m_Weight * (std::abs(helper.In.y) >= 2 ? helper.In.y / r2 : std::erf(helper.In.y)); + helper.Out.z = m_Weight * (std::abs(helper.In.z) >= 2 ? helper.In.z / r2 : std::erf(helper.In.z)); + } + + virtual string OpenCLString() const override + { + ostringstream ss; + intmax_t varIndex = IndexInXform(); + ss << "\t{\n" + << "\t\treal_t r2 = Sqr(sqrt(precalcSumSquares + SQR(vIn.z)));\n" + << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (fabs(vIn.x) >= 2 ? vIn.x / r2 : erf(vIn.x));\n" + << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (fabs(vIn.y) >= 2 ? vIn.y / r2 : erf(vIn.y));\n" + << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * (fabs(vIn.z) >= 2 ? vIn.z / r2 : erf(vIn.z));\n" + << "\t}\n"; + return ss.str(); + } + + virtual vector OpenCLGlobalFuncNames() const override + { + return vector { "Sqr" }; + } +}; + +template +class EMBER_API WVariation : public ParametricVariation +{ +public: + WVariation(T weight = 1.0) : ParametricVariation("w", eVariationId::VAR_W, weight, true, true, false, false, true) + { + Init(); + } + + PARVARCOPY(WVariation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + T a = helper.m_PrecalcAtanyx; + T r = helper.m_PrecalcSqrtSumSquares; + T a2 = a + m_Angle; + + if (a2 < -T(M_PI)) + a2 += M_2PI; + + if (a2 > T(M_PI)) + a2 -= M_2PI; + + T s, c; + T total = 0; + T total2 = 0; + T temp1, temp2, temp3, temp4; + + if (m_Hypergon != 0) + { + temp1 = fmod(std::abs(a), M_2PI / m_HypergonN) - T(M_PI) / m_HypergonN; + temp2 = Sqr(std::tan(temp1)) + 1; + + if (temp2 >= Sqr(m_HypergonD)) + { + total += m_Hypergon; + } + else + { + temp3 = m_HypergonD; + total += m_Hypergon * (m_HypergonD - std::sqrt(Sqr(m_HypergonD) - temp2)) / std::sqrt(temp2); + } + } + + if (m_Star != 0) + { + temp1 = std::tan(std::abs(fmod(std::abs(a), M_2PI / m_StarN) - T(M_PI) / m_StarN)); + total += m_Star * std::sqrt(Sqr(m_TanStarSlope) * (1 + Sqr(temp1)) / Sqr(temp1 + m_TanStarSlope)); + } + + if (m_Lituus != 0) + { + total += m_Lituus * std::pow(std::abs(a / T(M_PI) + 1), m_InvLituusA); + } + + if (m_Super != 0) + { + temp4 = a * m_SuperM4th; + sincos(temp4, &s, &c); + total += m_Super * std::pow(std::pow(std::abs(c), m_SuperN2) + std::pow(std::abs(s), m_SuperN3), m_OneOverSuperN1); + } + + if (r <= total) + { + if (m_Hypergon != 0.0) + { + temp1 = fmod(std::abs(a2), M_2PI / m_HypergonN) - T(M_PI) / m_HypergonN; + temp2 = Sqr(std::tan(temp1)) + 1; + + if (temp2 >= Sqr(m_HypergonD)) + { + total2 += m_Hypergon; + } + else + { + temp3 = m_HypergonD; + total2 += m_Hypergon * (m_HypergonD - std::sqrt(Sqr(m_HypergonD) - temp2)) / std::sqrt(temp2); + } + } + + if (m_Star != 0) + { + temp1 = std::tan(std::abs(fmod(std::abs(a2), M_2PI / m_StarN) - T(M_PI) / m_StarN)); + total2 += m_Star * std::sqrt(Sqr(m_TanStarSlope) * (1 + Sqr(temp1)) / Sqr(temp1 + m_TanStarSlope)); + } + + if (m_Lituus != 0) + { + total2 += m_Lituus * std::pow(std::abs(a2 / T(M_PI) + 1), m_InvLituusA); + } + + if (m_Super != 0) + { + temp4 = a2 * m_SuperM4th; + sincos(temp4, &s, &c); + total2 += m_Super * std::pow(std::pow(std::abs(c), m_SuperN2) + std::pow(std::abs(s), m_SuperN3), m_OneOverSuperN1); + } + + r = m_Weight * total2 * r / total; + sincos(a2, &s, &c); + helper.Out.x = r * c; + helper.Out.y = r * s; + } + else + { + helper.Out.x = m_Weight * helper.In.x; + helper.Out.y = m_Weight * helper.In.y; + } + + helper.Out.z = DefaultZ(helper); + } + + virtual string OpenCLString() const override + { + ostringstream ss, ss2; + intmax_t i = 0, varIndex = IndexInXform(); + ss2 << "_" << XformIndexInEmber() << "]"; + string index = ss2.str(); + string angle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergon = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonR = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string star = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string starN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string starSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string lituus = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string lituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string super = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superM = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invLituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc + string tanStarSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superM4th = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string oneOverSuperN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + ss << "\t{\n" + << "\t\treal_t a = precalcAtanyx;\n" + << "\t\treal_t r = precalcSqrtSumSquares;\n" + << "\t\treal_t a2 = a + " << angle << ";\n" + << "\n" + << "\t\tif (a2 < -M_PI)\n" + << "\t\t a2 += M_2PI;\n" + << "\n" + << "\t\tif (a2 > M_PI)\n" + << "\t\t a2 -= M_2PI;\n" + << "\n" + << "\t\treal_t s, c;\n" + << "\t\treal_t total = 0;\n" + << "\t\treal_t total2 = 0;\n" + << "\t\treal_t temp1, temp2, temp3, temp4;\n" + << "\n" + << "\t\tif (" << hypergon << " != 0)\n" + << "\t\t{\n" + << "\t\t temp1 = fmod(fabs(a), M_2PI / " << hypergonN << ") - M_PI / " << hypergonN << ";\n" + << "\t\t temp2 = Sqr(tan(temp1)) + 1;\n" + << "\n" + << "\t\t if (temp2 >= Sqr(" << hypergonD << "))\n" + << "\t\t {\n" + << "\t\t total += " << hypergon << ";\n" + << "\t\t }\n" + << "\t\t else\n" + << "\t\t {\n" + << "\t\t temp3 = " << hypergonD << ";\n" + << "\t\t total += " << hypergon << " * (" << hypergonD << " - sqrt(Sqr(" << hypergonD << ") - temp2)) / sqrt(temp2);\n" + << "\t\t }\n" + << "\t\t}\n" + << "\n" + << "\t\tif (" << star << "!= 0)\n" + << "\t\t{\n" + << "\t\t temp1 = tan(fabs(fmod(fabs(a), M_2PI / " << starN << ") - M_PI / " << starN << "));\n" + << "\t\t total += " << star << " * sqrt(Sqr(" << tanStarSlope << ") * (1 + Sqr(temp1)) / Sqr(temp1 + " << tanStarSlope << "));\n" + << "\t\t}\n" + << "\n" + << "\t\tif (" << lituus << " != 0)\n" + << "\t\t{\n" + << "\t\t total += " << lituus << " * pow(fabs(a / M_PI + 1), " << invLituusA << ");\n" + << "\t\t}\n" + << "\n" + << "\t\tif (" << super << " != 0)\n" + << "\t\t{\n" + << "\t\t temp4 = a * " << superM4th << ";\n" + << "\t\t s = sincos(temp4, &c);\n" + << "\t\t total += " << super << " * pow(pow(fabs(c), " << superN2 << ") + pow(fabs(s), " << superN3 << "), " << oneOverSuperN1 << ");\n" + << "\t\t}\n" + << "\n" + << "\t\tif (r <= total)\n" + << "\t\t{\n" + << "\t\t if (" << hypergon << " != 0.0)\n" + << "\t\t {\n" + << "\t\t temp1 = fmod(fabs(a2), M_2PI / " << hypergonN << ") - M_PI / " << hypergonN << ";\n" + << "\t\t temp2 = Sqr(tan(temp1)) + 1;\n" + << "\n" + << "\t\t if (temp2 >= Sqr(" << hypergonD << "))\n" + << "\t\t {\n" + << "\t\t total2 += " << hypergon << ";\n" + << "\t\t }\n" + << "\t\t else\n" + << "\t\t {\n" + << "\t\t temp3 = " << hypergonD << ";\n" + << "\t\t total2 += " << hypergon << " * (" << hypergonD << " - sqrt(Sqr(" << hypergonD << ") - temp2)) / sqrt(temp2);\n" + << "\t\t }\n" + << "\t\t }\n" + << "\n" + << "\t\t if (" << star << " != 0)\n" + << "\t\t {\n" + << "\t\t temp1 = tan(fabs(fmod(fabs(a2), M_2PI / " << starN << ") - M_PI / " << starN << "));\n" + << "\t\t total2 += " << star << " * sqrt(Sqr(" << tanStarSlope << ") * (1 + Sqr(temp1)) / Sqr(temp1 + " << tanStarSlope << "));\n" + << "\t\t }\n" + << "\n" + << "\t\t if (" << lituus << " != 0)\n" + << "\t\t {\n" + << "\t\t total2 += " << lituus << " * pow(fabs(a2 / M_PI + 1), " << invLituusA << ");\n" + << "\t\t }\n" + << "\n" + << "\t\t if (" << super << " != 0)\n" + << "\t\t {\n" + << "\t\t temp4 = a2 * " << superM4th << ";\n" + << "\t\t s = sincos(temp4, &c);\n" + << "\t\t total2 += " << super << " * pow(pow(fabs(c), " << superN2 << ") + pow(fabs(s), " << superN3 << "), " << oneOverSuperN1 << ");\n" + << "\t\t }\n" + << "\n" + << "\t\t r = xform->m_VariationWeights[" << varIndex << "] * total2 * r / total;\n" + << "\t\t s = sincos(a2, &c);\n" + << "\t\t vOut.x = r * c;\n" + << "\t\t vOut.y = r * s;\n" + << "\t\t}\n" + << "\t\telse\n" + << "\t\t{\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}\n" + << "\n" + << "\t\tvOut.z = " << DefaultZCl() + << "\t}\n"; + return ss.str(); + } + + virtual vector OpenCLGlobalFuncNames() const override + { + return vector { "Sqr" }; + } + + virtual void Precalc() override + { + m_HypergonD = std::sqrt(1 + SQR(m_HypergonR)); + m_InvLituusA = -m_LituusA; + + if (IsClose(m_StarSlope, T(M_PI_2))) + m_TanStarSlope = std::tan(m_StarSlope - T(0.05));//Original did not do this, but it makes no sense to take tan(pi/2) because it's undefined. + else + m_TanStarSlope = std::tan(m_StarSlope); + + m_SuperM4th = m_SuperM / 4; + m_OneOverSuperN1 = -1 / Zeps(m_SuperN1); + } + +protected: + void Init() + { + string prefix = Prefix(); + m_Params.clear(); + m_Params.push_back(ParamWithName(&m_Angle, prefix + "w_angle", 0, eParamType::REAL_CYCLIC, T(-M_PI), T(M_PI))); + m_Params.push_back(ParamWithName(&m_Hypergon, prefix + "w_hypergon")); + m_Params.push_back(ParamWithName(&m_HypergonN, prefix + "w_hypergon_n", 4, eParamType::INTEGER, 3)); + m_Params.push_back(ParamWithName(&m_HypergonR, prefix + "w_hypergon_r", 1)); + m_Params.push_back(ParamWithName(&m_Star, prefix + "w_star")); + m_Params.push_back(ParamWithName(&m_StarN, prefix + "w_star_n", 5, eParamType::INTEGER, 3)); + m_Params.push_back(ParamWithName(&m_StarSlope, prefix + "w_star_slope", 2, eParamType::REAL, EPS, T(M_PI_2))); + m_Params.push_back(ParamWithName(&m_Lituus, prefix + "w_lituus")); + m_Params.push_back(ParamWithName(&m_LituusA, prefix + "w_lituus_a", 1)); + m_Params.push_back(ParamWithName(&m_Super, prefix + "w_super")); + m_Params.push_back(ParamWithName(&m_SuperM, prefix + "w_super_m", 1)); + m_Params.push_back(ParamWithName(&m_SuperN1, prefix + "w_super_n1", 1)); + m_Params.push_back(ParamWithName(&m_SuperN2, prefix + "w_super_n2", 1)); + m_Params.push_back(ParamWithName(&m_SuperN3, prefix + "w_super_n3", 1)); + m_Params.push_back(ParamWithName(true, &m_InvLituusA, prefix + "w_inv_lituus_a"));//Precalc + m_Params.push_back(ParamWithName(true, &m_TanStarSlope, prefix + "w_tan_star_slope")); + m_Params.push_back(ParamWithName(true, &m_HypergonD, prefix + "w_hypergon_d")); + m_Params.push_back(ParamWithName(true, &m_SuperM4th, prefix + "w_super_m_4th")); + m_Params.push_back(ParamWithName(true, &m_OneOverSuperN1, prefix + "w_one_over_super_n1")); + } + +private: + T m_Angle; + T m_Hypergon; + T m_HypergonN; + T m_HypergonR; + T m_Star; + T m_StarN; + T m_StarSlope; + T m_Lituus; + T m_LituusA; + T m_Super; + T m_SuperM; + T m_SuperN1; + T m_SuperN2; + T m_SuperN3; + T m_InvLituusA;//Precalc + T m_TanStarSlope; + T m_HypergonD; + T m_SuperM4th; + T m_OneOverSuperN1; +}; + +template +class EMBER_API XVariation : public ParametricVariation +{ +public: + XVariation(T weight = 1.0) : ParametricVariation("x", eVariationId::VAR_X, weight, true, false, false, false, true) + { + Init(); + } + + PARVARCOPY(XVariation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + T a = helper.m_PrecalcAtanyx; + T a90 = atan2(helper.In.x, -helper.In.y); + T r; + T s, c; + T total = 0; + T temp1, temp2, temp3, temp4; + + if (m_Hypergon != 0) + { + temp1 = fmod(std::abs(a), M_2PI / m_HypergonN) - T(M_PI) / m_HypergonN; + temp2 = Sqr(std::tan(temp1)) + 1; + + if (temp2 >= Sqr(m_HypergonD)) + { + total += m_Hypergon; + } + else + { + temp3 = m_HypergonD; + total += m_Hypergon * (m_HypergonD - std::sqrt(Sqr(m_HypergonD) - temp2)) / std::sqrt(temp2); + } + } + + if (m_Star != 0) + { + temp1 = std::tan(std::abs(fmod(std::abs(a), M_2PI / m_StarN) - T(M_PI) / m_StarN)); + total += m_Star * std::sqrt(Sqr(m_TanStarSlope) * (1 + Sqr(temp1)) / Sqr(temp1 + m_TanStarSlope)); + } + + if (m_Lituus != 0) + { + total += m_Lituus * std::pow(std::fabs(a / T(M_PI) + 1), m_InvLituusA); + } + + if (m_Super != 0) + { + temp4 = a * m_SuperM4th; + sincos(temp4, &s, &c); + total += m_Super * std::pow(std::pow(std::abs(c), m_SuperN2) + std::pow(std::abs(s), m_SuperN3), m_OneOverSuperN1); + } + + r = m_Weight * std::sqrt(helper.m_PrecalcSumSquares + Sqr(total)); + sincos(a, &s, &c); + helper.Out.x = r * c; + helper.Out.y = r * s; + helper.Out.z = DefaultZ(helper); + } + + virtual string OpenCLString() const override + { + ostringstream ss, ss2; + intmax_t i = 0, varIndex = IndexInXform(); + ss2 << "_" << XformIndexInEmber() << "]"; + string index = ss2.str(); + string hypergon = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonR = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string star = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string starN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string starSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string lituus = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string lituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string super = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superM = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invLituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc + string tanStarSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superM4th = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string oneOverSuperN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + ss << "\t{\n" + << "\t\treal_t a = precalcAtanyx;\n" + << "\t\treal_t a90 = atan2(vIn.x, -vIn.y);\n" + << "\t\treal_t r;\n" + << "\t\treal_t s, c;\n" + << "\t\treal_t total = 0;\n" + << "\t\treal_t temp1, temp2, temp3, temp4;\n" + << "\n" + << "\t\tif (" << hypergon << " != 0)\n" + << "\t\t{\n" + << "\t\t temp1 = fmod(fabs(a), M_2PI / " << hypergonN << ") - M_PI / " << hypergonN << ";\n" + << "\t\t temp2 = Sqr(tan(temp1)) + 1;\n" + << "\n" + << "\t\t if (temp2 >= Sqr(" << hypergonD << "))\n" + << "\t\t {\n" + << "\t\t total += " << hypergon << ";\n" + << "\t\t }\n" + << "\t\t else\n" + << "\t\t {\n" + << "\t\t temp3 = " << hypergonD << ";\n" + << "\t\t total += " << hypergon << " * (" << hypergonD << " - sqrt(Sqr(" << hypergonD << ") - temp2)) / sqrt(temp2);\n" + << "\t\t }\n" + << "\t\t}\n" + << "\n" + << "\t\tif (" << star << " != 0)\n" + << "\t\t{\n" + << "\t\t temp1 = tan(fabs(fmod(fabs(a), M_2PI / " << starN << ") - M_PI / " << starN << "));\n" + << "\t\t total += " << star << " * sqrt(Sqr(" << tanStarSlope << ") * (1 + Sqr(temp1)) / Sqr(temp1 + " << tanStarSlope << "));\n" + << "\t\t}\n" + << "\n" + << "\t\tif (" << lituus << " != 0)\n" + << "\t\t{\n" + << "\t\t total += " << lituus << " * pow(fabs(a / M_PI + 1), " << invLituusA << ");\n" + << "\t\t}\n" + << "\n" + << "\t\tif (" << super << " != 0)\n" + << "\t\t{\n" + << "\t\t temp4 = a * " << superM4th << ";\n" + << "\t\t s = sincos(temp4, &c);\n" + << "\t\t total += " << super << " * pow(pow(fabs(c), " << superN2 << ") + pow(fabs(s), " << superN3 << "), " << oneOverSuperN1 << ");\n" + << "\t\t}\n" + << "\n" + << "\t\tr = xform->m_VariationWeights[" << varIndex << "] * sqrt(precalcSumSquares + Sqr(total));\n" + << "\t\ts = sincos(a, &c);\n" + << "\t\tvOut.x = r * c;\n" + << "\t\tvOut.y = r * s;\n" + << "\t\tvOut.z = " << DefaultZCl() + << "\t}\n"; + return ss.str(); + } + + virtual vector OpenCLGlobalFuncNames() const override + { + return vector { "Sqr" }; + } + + virtual void Precalc() override + { + m_HypergonD = std::sqrt(1 + SQR(m_HypergonR)); + m_InvLituusA = -m_LituusA; + + if (IsClose(m_StarSlope, T(M_PI_2))) + m_TanStarSlope = std::tan(m_StarSlope - T(0.05));//Original did not do this, but it makes no sense to take tan(pi/2) because it's undefined. + else + m_TanStarSlope = std::tan(m_StarSlope); + + m_SuperM4th = m_SuperM / 4; + m_OneOverSuperN1 = -1 / Zeps(m_SuperN1); + } + +protected: + void Init() + { + string prefix = Prefix(); + m_Params.clear(); + m_Params.push_back(ParamWithName(&m_Hypergon, prefix + "x_hypergon")); + m_Params.push_back(ParamWithName(&m_HypergonN, prefix + "x_hypergon_n", 4, eParamType::INTEGER, 3)); + m_Params.push_back(ParamWithName(&m_HypergonR, prefix + "x_hypergon_r", 1)); + m_Params.push_back(ParamWithName(&m_Star, prefix + "x_star")); + m_Params.push_back(ParamWithName(&m_StarN, prefix + "x_star_n", 5, eParamType::INTEGER, 3)); + m_Params.push_back(ParamWithName(&m_StarSlope, prefix + "x_star_slope", 2, eParamType::REAL, EPS, T(M_PI_2))); + m_Params.push_back(ParamWithName(&m_Lituus, prefix + "x_lituus")); + m_Params.push_back(ParamWithName(&m_LituusA, prefix + "x_lituus_a", 1)); + m_Params.push_back(ParamWithName(&m_Super, prefix + "x_super")); + m_Params.push_back(ParamWithName(&m_SuperM, prefix + "x_super_m", 1)); + m_Params.push_back(ParamWithName(&m_SuperN1, prefix + "x_super_n1", 1)); + m_Params.push_back(ParamWithName(&m_SuperN2, prefix + "x_super_n2", 1)); + m_Params.push_back(ParamWithName(&m_SuperN3, prefix + "x_super_n3", 1)); + m_Params.push_back(ParamWithName(true, &m_InvLituusA, prefix + "x_inv_lituus_a"));//Precalc + m_Params.push_back(ParamWithName(true, &m_TanStarSlope, prefix + "x_tan_star_slope")); + m_Params.push_back(ParamWithName(true, &m_HypergonD, prefix + "x_hypergon_d")); + m_Params.push_back(ParamWithName(true, &m_SuperM4th, prefix + "x_super_m_4th")); + m_Params.push_back(ParamWithName(true, &m_OneOverSuperN1, prefix + "x_one_over_super_n1")); + } + +private: + T m_Hypergon; + T m_HypergonN; + T m_HypergonR; + T m_Star; + T m_StarN; + T m_StarSlope; + T m_Lituus; + T m_LituusA; + T m_Super; + T m_SuperM; + T m_SuperN1; + T m_SuperN2; + T m_SuperN3; + T m_InvLituusA;//Precalc + T m_TanStarSlope; + T m_HypergonD; + T m_SuperM4th; + T m_OneOverSuperN1; +}; + +template +class EMBER_API YVariation : public ParametricVariation +{ +public: + YVariation(T weight = 1.0) : ParametricVariation("y", eVariationId::VAR_Y, weight, true, true, false, false, true) + { + Init(); + } + + PARVARCOPY(YVariation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + T a = helper.m_PrecalcAtanyx; + T a90 = atan2(helper.In.x, -helper.In.y); + T r; + T s, c; + T total = 0; + T temp1, temp2, temp3, temp4; + + if (m_Hypergon != 0) + { + temp1 = fmod(std::abs(a), M_2PI / m_HypergonN) - T(M_PI) / m_HypergonN; + temp2 = Sqr(std::tan(temp1)) + 1; + + if (temp2 >= Sqr(m_HypergonD)) + { + total += m_Hypergon; + } + else + { + temp3 = m_HypergonD; + total += m_Hypergon * (m_HypergonD - std::sqrt(Sqr(m_HypergonD) - temp2)) / std::sqrt(temp2); + } + } + + if (m_Star != 0) + { + temp1 = std::tan(std::abs(fmod(std::abs(a), M_2PI / m_StarN) - T(M_PI) / m_StarN)); + total += m_Star * std::sqrt(Sqr(m_TanStarSlope) * (1 + Sqr(temp1)) / Sqr(temp1 + m_TanStarSlope)); + } + + if (m_Lituus != 0) + { + total += m_Lituus * std::pow(std::abs(a / T(M_PI) + 1), m_InvLituusA); + } + + if (m_Super != 0) + { + temp4 = a * m_SuperM4th; + sincos(temp4, &s, &c); + total += m_Super * std::pow(std::pow(std::abs(c), m_SuperN2) + std::pow(std::abs(s), m_SuperN3), m_OneOverSuperN1); + } + + r = m_Weight * Sqr(total) / helper.m_PrecalcSqrtSumSquares; + sincos(a, &s, &c); + helper.Out.x = r * c; + helper.Out.y = r * s; + helper.Out.z = DefaultZ(helper); + } + + virtual string OpenCLString() const override + { + ostringstream ss, ss2; + intmax_t i = 0, varIndex = IndexInXform(); + ss2 << "_" << XformIndexInEmber() << "]"; + string index = ss2.str(); + string hypergon = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonR = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string star = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string starN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string starSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string lituus = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string lituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string super = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superM = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invLituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc + string tanStarSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superM4th = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string oneOverSuperN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + ss << "\t{\n" + << "\t\treal_t a = precalcAtanyx;\n" + << "\t\treal_t a90 = atan2(vIn.x, -vIn.y);\n" + << "\t\treal_t r;\n" + << "\t\treal_t s, c;\n" + << "\t\treal_t total = 0;\n" + << "\t\treal_t temp1, temp2, temp3, temp4;\n" + << "\n" + << "\t\tif (" << hypergon << " != 0)\n" + << "\t\t{\n" + << "\t\t temp1 = fmod(fabs(a), M_2PI / " << hypergonN << ") - M_PI / " << hypergonN << ";\n" + << "\t\t temp2 = Sqr(tan(temp1)) + 1;\n" + << "\n" + << "\t\t if (temp2 >= Sqr(" << hypergonD << "))\n" + << "\t\t {\n" + << "\t\t total += " << hypergon << ";\n" + << "\t\t }\n" + << "\t\t else\n" + << "\t\t {\n" + << "\t\t temp3 = " << hypergonD << ";\n" + << "\t\t total += " << hypergon << " * (" << hypergonD << " - sqrt(Sqr(" << hypergonD << ") - temp2)) / sqrt(temp2);\n" + << "\t\t }\n" + << "\t\t}\n" + << "\n" + << "\t\tif (" << star << " != 0)\n" + << "\t\t{\n" + << "\t\t temp1 = tan(fabs(fmod(fabs(a), M_2PI / " << starN << ") - M_PI / " << starN << "));\n" + << "\t\t total += " << star << " * sqrt(Sqr(" << tanStarSlope << ") * (1 + Sqr(temp1)) / Sqr(temp1 + " << tanStarSlope << "));\n" + << "\t\t}\n" + << "\n" + << "\t\tif (" << lituus << " != 0)\n" + << "\t\t{\n" + << "\t\t total += " << lituus << " * pow(fabs(a / M_PI + 1), " << invLituusA << ");\n" + << "\t\t}\n" + << "\n" + << "\t\tif (" << super << " != 0)\n" + << "\t\t{\n" + << "\t\t temp4 = a * " << superM4th << ";\n" + << "\t\t s = sincos(temp4, &c);\n" + << "\t\t total += " << super << " * pow(pow(fabs(c), " << superN2 << ") + pow(fabs(s), " << superN3 << "), " << oneOverSuperN1 << ");\n" + << "\t\t}\n" + << "\n" + << "\t\tr = xform->m_VariationWeights[" << varIndex << "] * Sqr(total) / precalcSqrtSumSquares;\n" + << "\t\ts = sincos(a, &c);\n" + << "\t\tvOut.x = r * c;\n" + << "\t\tvOut.y = r * s;\n" + << "\t\tvOut.z = " << DefaultZCl() + << "\t}\n"; + return ss.str(); + } + + virtual vector OpenCLGlobalFuncNames() const override + { + return vector { "Sqr" }; + } + + virtual void Precalc() override + { + m_HypergonD = std::sqrt(1 + SQR(m_HypergonR)); + m_InvLituusA = -m_LituusA; + + if (IsClose(m_StarSlope, T(M_PI_2))) + m_TanStarSlope = std::tan(m_StarSlope - T(0.05));//Original did not do this, but it makes no sense to take tan(pi/2) because it's undefined. + else + m_TanStarSlope = std::tan(m_StarSlope); + + m_SuperM4th = m_SuperM / 4; + m_OneOverSuperN1 = -1 / Zeps(m_SuperN1); + } + +protected: + void Init() + { + string prefix = Prefix(); + m_Params.clear(); + m_Params.push_back(ParamWithName(&m_Hypergon, prefix + "y_hypergon")); + m_Params.push_back(ParamWithName(&m_HypergonN, prefix + "y_hypergon_n", 4, eParamType::INTEGER, 3)); + m_Params.push_back(ParamWithName(&m_HypergonR, prefix + "y_hypergon_r", 1)); + m_Params.push_back(ParamWithName(&m_Star, prefix + "y_star")); + m_Params.push_back(ParamWithName(&m_StarN, prefix + "y_star_n", 5, eParamType::INTEGER, 3)); + m_Params.push_back(ParamWithName(&m_StarSlope, prefix + "y_star_slope", 2, eParamType::REAL, EPS, T(M_PI_2))); + m_Params.push_back(ParamWithName(&m_Lituus, prefix + "y_lituus")); + m_Params.push_back(ParamWithName(&m_LituusA, prefix + "y_lituus_a", 1)); + m_Params.push_back(ParamWithName(&m_Super, prefix + "y_super")); + m_Params.push_back(ParamWithName(&m_SuperM, prefix + "y_super_m", 1)); + m_Params.push_back(ParamWithName(&m_SuperN1, prefix + "y_super_n1", 1)); + m_Params.push_back(ParamWithName(&m_SuperN2, prefix + "y_super_n2", 1)); + m_Params.push_back(ParamWithName(&m_SuperN3, prefix + "y_super_n3", 1)); + m_Params.push_back(ParamWithName(true, &m_InvLituusA, prefix + "y_inv_lituus_a"));//Precalc + m_Params.push_back(ParamWithName(true, &m_TanStarSlope, prefix + "y_tan_star_slope")); + m_Params.push_back(ParamWithName(true, &m_HypergonD, prefix + "y_hypergon_d")); + m_Params.push_back(ParamWithName(true, &m_SuperM4th, prefix + "y_super_m_4th")); + m_Params.push_back(ParamWithName(true, &m_OneOverSuperN1, prefix + "y_one_over_super_n1")); + } + +private: + T m_Hypergon; + T m_HypergonN; + T m_HypergonR; + T m_Star; + T m_StarN; + T m_StarSlope; + T m_Lituus; + T m_LituusA; + T m_Super; + T m_SuperM; + T m_SuperN1; + T m_SuperN2; + T m_SuperN3; + T m_InvLituusA;//Precalc + T m_TanStarSlope; + T m_HypergonD; + T m_SuperM4th; + T m_OneOverSuperN1; +}; + +template +class EMBER_API ZVariation : public ParametricVariation +{ +public: + ZVariation(T weight = 1.0) : ParametricVariation("z", eVariationId::VAR_Z, weight, true, true, false, false, true) + { + Init(); + } + + PARVARCOPY(ZVariation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + T a = helper.m_PrecalcAtanyx; + T a90 = atan2(helper.In.x, -helper.In.y); + T r; + T s, c; + T total = 0; + T temp1, temp2, temp3, temp4; + + if (m_Hypergon != 0) + { + temp1 = fmod(std::abs(a), M_2PI / m_HypergonN) - T(M_PI) / m_HypergonN; + temp2 = Sqr(std::tan(temp1)) + 1; + + if (temp2 >= Sqr(m_HypergonD)) + { + total += m_Hypergon; + } + else + { + temp3 = m_HypergonD; + total += m_Hypergon * (m_HypergonD - std::sqrt(Sqr(m_HypergonD) - temp2)) / std::sqrt(temp2); + } + } + + if (m_Star != 0) + { + temp1 = std::tan(std::abs(fmod(std::abs(a), M_2PI / m_StarN) - T(M_PI) / m_StarN)); + total += m_Star * std::sqrt(Sqr(m_TanStarSlope) * (1 + Sqr(temp1)) / Sqr(temp1 + m_TanStarSlope)); + } + + if (m_Lituus != 0) + { + total += m_Lituus * std::pow(std::abs(a / T(M_PI) + 1), m_InvLituusA); + } + + if (m_Super != 0) + { + temp4 = a * m_SuperM4th; + sincos(temp4, &s, &c); + total += m_Super * std::pow(std::pow(std::abs(c), m_SuperN2) + std::pow(std::abs(s), m_SuperN3), m_OneOverSuperN1); + } + + r = m_Weight * (helper.m_PrecalcSqrtSumSquares + total); + sincos(a, &s, &c); + helper.Out.x = r * c; + helper.Out.y = r * s; + helper.Out.z = DefaultZ(helper); + } + + virtual string OpenCLString() const override + { + ostringstream ss, ss2; + intmax_t i = 0, varIndex = IndexInXform(); + ss2 << "_" << XformIndexInEmber() << "]"; + string index = ss2.str(); + string hypergon = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonR = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string star = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string starN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string starSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string lituus = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string lituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string super = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superM = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invLituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc + string tanStarSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superM4th = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string oneOverSuperN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + ss << "\t{\n" + << "\t\treal_t a = precalcAtanyx;\n" + << "\t\treal_t a90 = atan2(vIn.x, -vIn.y);\n" + << "\t\treal_t r;\n" + << "\t\treal_t s, c;\n" + << "\t\treal_t total = 0;\n" + << "\t\treal_t temp1, temp2, temp3, temp4;\n" + << "\n" + << "\t\tif (" << hypergon << " != 0)\n" + << "\t\t{\n" + << "\t\t temp1 = fmod(fabs(a), M_2PI / " << hypergonN << ") - M_PI / " << hypergonN << ";\n" + << "\t\t temp2 = Sqr(tan(temp1)) + 1;\n" + << "\n" + << "\t\t if (temp2 >= Sqr(" << hypergonD << "))\n" + << "\t\t {\n" + << "\t\t total += " << hypergon << ";\n" + << "\t\t }\n" + << "\t\t else\n" + << "\t\t {\n" + << "\t\t temp3 = " << hypergonD << ";\n" + << "\t\t total += " << hypergon << " * (" << hypergonD << " - sqrt(Sqr(" << hypergonD << ") - temp2)) / sqrt(temp2);\n" + << "\t\t }\n" + << "\t\t}\n" + << "\n" + << "\t\tif (" << star << " != 0)\n" + << "\t\t{\n" + << "\t\t temp1 = tan(fabs(fmod(fabs(a), M_2PI / " << starN << ") - M_PI / " << starN << "));\n" + << "\t\t total += " << star << " * sqrt(Sqr(" << tanStarSlope << ") * (1 + Sqr(temp1)) / Sqr(temp1 + " << tanStarSlope << "));\n" + << "\t\t}\n" + << "\n" + << "\t\tif (" << lituus << " != 0)\n" + << "\t\t{\n" + << "\t\t total += " << lituus << " * pow(fabs(a / M_PI + 1), " << invLituusA << ");\n" + << "\t\t}\n" + << "\n" + << "\t\tif (" << super << " != 0)\n" + << "\t\t{\n" + << "\t\t temp4 = a * " << superM4th << ";\n" + << "\t\t s = sincos(temp4, &c);\n" + << "\t\t total += " << super << " * pow(pow(fabs(c), " << superN2 << ") + pow(fabs(s), " << superN3 << "), " << oneOverSuperN1 << ");\n" + << "\t\t}\n" + << "\n" + << "\t\tr = xform->m_VariationWeights[" << varIndex << "] * (precalcSqrtSumSquares + total);\n" + << "\t\ts = sincos(a, &c);\n" + << "\t\tvOut.x = r * c;\n" + << "\t\tvOut.y = r * s;\n" + << "\t\tvOut.z = " << DefaultZCl() + << "\t}\n"; + return ss.str(); + } + + virtual vector OpenCLGlobalFuncNames() const override + { + return vector { "Sqr" }; + } + + virtual void Precalc() override + { + m_HypergonD = std::sqrt(1 + SQR(m_HypergonR)); + m_InvLituusA = -m_LituusA; + + if (IsClose(m_StarSlope, T(M_PI_2))) + m_TanStarSlope = std::tan(m_StarSlope - T(0.05));//Original did not do this, but it makes no sense to take tan(pi/2) because it's undefined. + else + m_TanStarSlope = std::tan(m_StarSlope); + + m_SuperM4th = m_SuperM / 4; + m_OneOverSuperN1 = -1 / Zeps(m_SuperN1); + } + +protected: + void Init() + { + string prefix = Prefix(); + m_Params.clear(); + m_Params.push_back(ParamWithName(&m_Hypergon, prefix + "z_hypergon")); + m_Params.push_back(ParamWithName(&m_HypergonN, prefix + "z_hypergon_n", 4, eParamType::INTEGER, 3)); + m_Params.push_back(ParamWithName(&m_HypergonR, prefix + "z_hypergon_r", 1)); + m_Params.push_back(ParamWithName(&m_Star, prefix + "z_star")); + m_Params.push_back(ParamWithName(&m_StarN, prefix + "z_star_n", 5, eParamType::INTEGER, 3)); + m_Params.push_back(ParamWithName(&m_StarSlope, prefix + "z_star_slope", 2, eParamType::REAL, EPS, T(M_PI_2))); + m_Params.push_back(ParamWithName(&m_Lituus, prefix + "z_lituus")); + m_Params.push_back(ParamWithName(&m_LituusA, prefix + "z_lituus_a", 1)); + m_Params.push_back(ParamWithName(&m_Super, prefix + "z_super")); + m_Params.push_back(ParamWithName(&m_SuperM, prefix + "z_super_m", 1)); + m_Params.push_back(ParamWithName(&m_SuperN1, prefix + "z_super_n1", 1)); + m_Params.push_back(ParamWithName(&m_SuperN2, prefix + "z_super_n2", 1)); + m_Params.push_back(ParamWithName(&m_SuperN3, prefix + "z_super_n3", 1)); + m_Params.push_back(ParamWithName(true, &m_InvLituusA, prefix + "z_inv_lituus_a"));//Precalc + m_Params.push_back(ParamWithName(true, &m_TanStarSlope, prefix + "z_tan_star_slope")); + m_Params.push_back(ParamWithName(true, &m_HypergonD, prefix + "z_hypergon_d")); + m_Params.push_back(ParamWithName(true, &m_SuperM4th, prefix + "z_super_m_4th")); + m_Params.push_back(ParamWithName(true, &m_OneOverSuperN1, prefix + "z_one_over_super_n1")); + } + +private: + T m_Hypergon; + T m_HypergonN; + T m_HypergonR; + T m_Star; + T m_StarN; + T m_StarSlope; + T m_Lituus; + T m_LituusA; + T m_Super; + T m_SuperM; + T m_SuperN1; + T m_SuperN2; + T m_SuperN3; + T m_InvLituusA;//Precalc + T m_TanStarSlope; + T m_HypergonD; + T m_SuperM4th; + T m_OneOverSuperN1; +}; + MAKEPREPOSTPARVAR(Hexes, hexes, HEXES) MAKEPREPOSTPARVAR(Nblur, nBlur, NBLUR) MAKEPREPOSTPARVAR(Octapol, octapol, OCTAPOL) @@ -4424,4 +5411,10 @@ MAKEPREPOSTPARVAR(Crob, crob, CROB) MAKEPREPOSTPARVAR(BubbleT3D, bubbleT3D, BUBBLET3D) MAKEPREPOSTPARVAR(Synth, synth, SYNTH) MAKEPREPOSTPARVAR(Crackle, crackle, CRACKLE) +MAKEPREPOSTVAR(Erf, erf, ERF) +MAKEPREPOSTVAR(Xerf, xerf, XERF) +MAKEPREPOSTPARVAR(W, w, W) +MAKEPREPOSTPARVAR(X, x, X) +MAKEPREPOSTPARVAR(Y, y, Y) +MAKEPREPOSTPARVAR(Z, z, Z) } diff --git a/Source/Ember/Variations07.h b/Source/Ember/Variations07.h new file mode 100644 index 0000000..f5bcdfa --- /dev/null +++ b/Source/Ember/Variations07.h @@ -0,0 +1,968 @@ +#pragma once + +#include "Variation.h" + +namespace EmberNs +{ +/// +/// splits3D. +/// +template +class EMBER_API Splits3DVariation : public ParametricVariation +{ +public: + Splits3DVariation(T weight = 1.0) : ParametricVariation("splits3D", eVariationId::VAR_SPLITS3D, weight) + { + Init(); + } + + PARVARCOPY(Splits3DVariation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + if (helper.In.x >= 0) + helper.Out.x = m_Weight * (helper.In.x + m_X); + else + helper.Out.x = m_Weight * (helper.In.x - m_X); + + if (helper.In.y >= 0) + helper.Out.y = m_Weight * (helper.In.y + m_Y); + else + helper.Out.y = m_Weight * (helper.In.y - m_Y); + + if (helper.In.z >= 0) + helper.Out.z = m_Weight * (helper.In.z + m_Z); + else + helper.Out.z = m_Weight * (helper.In.z - m_Z); + } + + virtual string OpenCLString() const override + { + ostringstream ss, ss2; + intmax_t i = 0, varIndex = IndexInXform(); + ss2 << "_" << XformIndexInEmber() << "]"; + string index = ss2.str(); + string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string z = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + ss << "\t{\n" + << "\t\tif (vIn.x >= 0)\n" + << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + " << x << ");\n" + << "\t\telse\n" + << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x - " << x << ");\n" + << "\n" + << "\t\tif (vIn.y >= 0)\n" + << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + " << y << ");\n" + << "\t\telse\n" + << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y - " << y << ");\n" + << "\n" + << "\t\tif (vIn.z >= 0)\n" + << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * (vIn.z + " << z << ");\n" + << "\t\telse\n" + << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * (vIn.z - " << z << ");\n" + << "\t}\n"; + return ss.str(); + } + + virtual void Random(QTIsaac& rand) override + { + m_X = rand.Frand11(); + m_Y = rand.Frand11(); + m_Z = rand.Frand11(); + } + +protected: + void Init() + { + string prefix = Prefix(); + m_Params.clear(); + m_Params.push_back(ParamWithName(&m_X, prefix + "splits3D_x")); + m_Params.push_back(ParamWithName(&m_Y, prefix + "splits3D_y")); + m_Params.push_back(ParamWithName(&m_Z, prefix + "splits3D_z")); + } + +private: + T m_X; + T m_Y; + T m_Z; +}; + +/// +/// waves2b. +/// Note that _j1() is not implemented in OpenCL, so that conditional is skipped +/// when running on the GPU. The results might look different. +/// +template +class EMBER_API Waves2BVariation : public ParametricVariation +{ +public: + Waves2BVariation(T weight = 1.0) : ParametricVariation("waves2b", eVariationId::VAR_WAVES2B, weight) + { + Init(); + } + + PARVARCOPY(Waves2BVariation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + T CsX = 1; + T CsY = 1; + T jcbSn = 0, jcbCn, jcbDn; + CsX = SafeDivInv(m_Unity, (m_Unity + Sqr(helper.In.x))); + CsX = CsX * m_Six + m_Scaleinfx; + CsY = SafeDivInv(m_Unity, (m_Unity + Sqr(helper.In.y))); + CsY = CsY * m_Siy + m_Scaleinfy; + + if (m_Pwx >= 0 && m_Pwx < 1e-4) + { + m_VarFuncs->JacobiElliptic(helper.In.y * m_Freqx, m_Jacok, jcbSn, jcbCn, jcbDn); + helper.Out.x = m_Weight * (helper.In.x + CsX * jcbSn); + } + else if (m_Pwx < 0 && m_Pwx > -1e-4) +#ifdef _WIN32 + helper.Out.x = m_Weight * (helper.In.x + CsX * T(_j1(helper.In.y * m_Freqx)));//This is not implemented in OpenCL. + +#else + helper.Out.x = m_Weight * (helper.In.x + CsX * T(j1(helper.In.y * m_Freqx)));//This is not implemented in OpenCL. +#endif + else + helper.Out.x = m_Weight * (helper.In.x + CsX * std::sin(SignNz(helper.In.y) * std::pow(Zeps(std::abs(helper.In.y)), m_Pwx) * m_Freqx)); + + if (m_Pwy >= 0 && m_Pwy < 1e-4) + { + m_VarFuncs->JacobiElliptic(helper.In.x * m_Freqy, m_Jacok, jcbSn, jcbCn, jcbDn); + helper.Out.y = m_Weight * (helper.In.y + CsY * jcbSn); + } + else if (m_Pwy < 0 && m_Pwy > -1e-4) +#ifdef _WIN32 + helper.Out.y = m_Weight * (helper.In.y + CsY * T(_j1(helper.In.x * m_Freqy))); + +#else + helper.Out.y = m_Weight * (helper.In.y + CsY * T(j1(helper.In.x * m_Freqy))); +#endif + else + helper.Out.y = m_Weight * (helper.In.y + CsY * std::sin(SignNz(helper.In.x) * std::pow(Zeps(std::abs(helper.In.x)), m_Pwy) * m_Freqy)); + + helper.Out.z = DefaultZ(helper); + } + + virtual string OpenCLString() const override + { + ostringstream ss, ss2; + intmax_t i = 0, varIndex = IndexInXform(); + ss2 << "_" << XformIndexInEmber() << "]"; + string index = ss2.str(); + string freqx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string freqy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string pwx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string pwy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scalex = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scaleinfx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scaley = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scaleinfy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string unity = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string jacok = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string six = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. + string siy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + ss << "\t{\n" + << "\t\treal_t CsX = 1;\n" + << "\t\treal_t CsY = 1;\n" + << "\t\treal_t jcbSn = 0, jcbCn, jcbDn;\n" + << "\t\tCsX = SafeDivInv(" << unity << ", (" << unity << " + Sqr(vIn.x)));\n" + << "\t\tCsX = CsX * " << six << " + " << scaleinfx << ";\n" + << "\t\tCsY = SafeDivInv(" << unity << ", (" << unity << " + Sqr(vIn.y)));\n" + << "\t\tCsY = CsY * " << siy << " + " << scaleinfy << ";\n" + << "\n" + << "\t\tif (" << pwx << " >= 0 && " << pwx << " < 1e-4)\n" + << "\t\t{\n" + << "\t\t JacobiElliptic(vIn.y * " << freqx << ", " << jacok << ", &jcbSn, &jcbCn, &jcbDn);\n" + << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + CsX * jcbSn);\n" + << "\t\t}\n" + //<< "\t\telse if (" << pwx << " < 0 && " << pwx << " > -1e-4)\n" + //<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + CsX * _j1(vIn.y * " << freqx << "));\n"//This is not implemented in OpenCL. + << "\t\telse\n" + << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + CsX * sin(SignNz(vIn.y) * pow(Zeps(fabs(vIn.y)), " << pwx << ") * " << freqx << "));\n" + << "\n" + << "\t\tif (" << pwy << " >= 0 && " << pwy << " < 1e-4)\n" + << "\t\t{\n" + << "\t\t JacobiElliptic(vIn.x * " << freqy << ", " << jacok << ", &jcbSn, &jcbCn, &jcbDn);\n" + << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + CsY * jcbSn);\n" + << "\t\t}\n" + //<< "\t\telse if (" << pwy << " < 0 && " << pwy << " > -1e-4)\n" + //<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + CsY * _j1(vIn.x * " << freqy << "));\n"//This is not implemented in OpenCL. + << "\t\telse\n" + << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + CsY * sin(SignNz(vIn.x) * pow(Zeps(fabs(vIn.x)), " << pwy << ") * " << freqy << "));\n" + << "\n" + << "\t\tvOut.z = " << DefaultZCl() + << "\t}\n"; + return ss.str(); + } + + virtual vector OpenCLGlobalFuncNames() const override + { + return vector { "Zeps", "Sqr", "SignNz", "SafeDivInv", "JacobiElliptic" }; + } + + virtual void Precalc() override + { + m_Six = m_Scalex - m_Scaleinfx; + m_Siy = m_Scaley - m_Scaleinfy; + } + +protected: + void Init() + { + string prefix = Prefix(); + m_VarFuncs = VarFuncs::Instance(); + m_Params.clear(); + m_Params.push_back(ParamWithName(&m_Freqx, prefix + "waves2b_freqx", 2)); + m_Params.push_back(ParamWithName(&m_Freqy, prefix + "waves2b_freqy", 2)); + m_Params.push_back(ParamWithName(&m_Pwx, prefix + "waves2b_pwx", 1, eParamType::REAL, -10, 10)); + m_Params.push_back(ParamWithName(&m_Pwy, prefix + "waves2b_pwy", 1, eParamType::REAL, -10, 10)); + m_Params.push_back(ParamWithName(&m_Scalex, prefix + "waves2b_scalex", 1)); + m_Params.push_back(ParamWithName(&m_Scaleinfx, prefix + "waves2b_scaleinfx", 1)); + m_Params.push_back(ParamWithName(&m_Scaley, prefix + "waves2b_scaley", 1)); + m_Params.push_back(ParamWithName(&m_Scaleinfy, prefix + "waves2b_scaleinfy", 1)); + m_Params.push_back(ParamWithName(&m_Unity, prefix + "waves2b_unity", 1)); + m_Params.push_back(ParamWithName(&m_Jacok, prefix + "waves2b_jacok", T(0.25), eParamType::REAL, -1, 1)); + m_Params.push_back(ParamWithName(true, &m_Six, prefix + "waves2b_six"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_Siy, prefix + "waves2b_siy")); + } + +private: + T m_Freqx; + T m_Freqy; + T m_Pwx; + T m_Pwy; + T m_Scalex; + T m_Scaleinfx; + T m_Scaley; + T m_Scaleinfy; + T m_Unity; + T m_Jacok; + T m_Six;//Precalc. + T m_Siy; + shared_ptr> m_VarFuncs; +}; + +/// +/// jac_cn. +/// +template +class EMBER_API JacCnVariation : public ParametricVariation +{ +public: + JacCnVariation(T weight = 1.0) : ParametricVariation("jac_cn", eVariationId::VAR_JAC_CN, weight) + { + Init(); + } + + PARVARCOPY(JacCnVariation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + T snx, cnx, dnx; + T sny, cny, dny; + T numX, numY, denom; + m_VarFuncs->JacobiElliptic(helper.In.x, m_K, snx, cnx, dnx); + m_VarFuncs->JacobiElliptic(helper.In.y, 1 - m_K, sny, cny, dny); + numX = cnx * cny; + numY = -dnx * snx * dny * sny; + denom = SQR(snx) * SQR(sny) * m_K + SQR(cny); + denom = m_Weight / Zeps(denom); + helper.Out.x = denom * numX; + helper.Out.y = denom * numY; + helper.Out.z = DefaultZ(helper); + } + + virtual string OpenCLString() const override + { + ostringstream ss, ss2; + intmax_t i = 0, varIndex = IndexInXform(); + ss2 << "_" << XformIndexInEmber() << "]"; + string index = ss2.str(); + string k = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + ss << "\t{\n" + << "\t\treal_t snx, cnx, dnx;\n" + << "\t\treal_t sny, cny, dny;\n" + << "\t\treal_t numX, numY, denom;\n" + << "\t\tJacobiElliptic(vIn.x, " << k << ", &snx, &cnx, &dnx);\n" + << "\t\tJacobiElliptic(vIn.y, 1 - " << k << ", &sny, &cny, &dny);\n" + << "\t\tnumX = cnx * cny;\n" + << "\t\tnumY = -dnx * snx * dny * sny;\n" + << "\t\tdenom = SQR(snx) * SQR(sny) * " << k << " + SQR(cny);\n" + << "\t\tdenom = xform->m_VariationWeights[" << varIndex << "] / Zeps(denom);\n" + << "\t\tvOut.x = denom * numX;\n" + << "\t\tvOut.y = denom * numY;\n" + << "\t\tvOut.z = " << DefaultZCl() + << "\t}\n"; + return ss.str(); + } + + virtual vector OpenCLGlobalFuncNames() const override + { + return vector { "Zeps", "JacobiElliptic" }; + } + +protected: + void Init() + { + string prefix = Prefix(); + m_VarFuncs = VarFuncs::Instance(); + m_Params.clear(); + m_Params.push_back(ParamWithName(&m_K, prefix + "jac_cn_k", T(0.5), eParamType::REAL, -1, 1)); + } + +private: + T m_K; + shared_ptr> m_VarFuncs; +}; + +/// +/// jac_dn. +/// +template +class EMBER_API JacDnVariation : public ParametricVariation +{ +public: + JacDnVariation(T weight = 1.0) : ParametricVariation("jac_dn", eVariationId::VAR_JAC_DN, weight) + { + Init(); + } + + PARVARCOPY(JacDnVariation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + T snx, cnx, dnx; + T sny, cny, dny; + T numX, numY, denom; + m_VarFuncs->JacobiElliptic(helper.In.x, m_K, snx, cnx, dnx); + m_VarFuncs->JacobiElliptic(helper.In.y, 1 - m_K, sny, cny, dny); + numX = dnx * cny * dny; + numY = -cnx * snx * sny * m_K; + denom = SQR(snx) * SQR(sny) * m_K + SQR(cny); + denom = m_Weight / Zeps(denom); + helper.Out.x = denom * numX; + helper.Out.y = denom * numY; + helper.Out.z = DefaultZ(helper); + } + + virtual string OpenCLString() const override + { + ostringstream ss, ss2; + intmax_t i = 0, varIndex = IndexInXform(); + ss2 << "_" << XformIndexInEmber() << "]"; + string index = ss2.str(); + string k = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + ss << "\t{\n" + << "\t\treal_t snx, cnx, dnx;\n" + << "\t\treal_t sny, cny, dny;\n" + << "\t\treal_t numX, numY, denom;\n" + << "\t\tJacobiElliptic(vIn.x, " << k << ", &snx, &cnx, &dnx);\n" + << "\t\tJacobiElliptic(vIn.y, 1 - " << k << ", &sny, &cny, &dny);\n" + << "\t\tnumX = dnx * cny * dny;\n" + << "\t\tnumY = -cnx * snx * sny * " << k << ";\n" + << "\t\tdenom = SQR(snx) * SQR(sny) * " << k << " + SQR(cny);\n" + << "\t\tdenom = xform->m_VariationWeights[" << varIndex << "] / Zeps(denom);\n" + << "\t\tvOut.x = denom * numX;\n" + << "\t\tvOut.y = denom * numY;\n" + << "\t\tvOut.z = " << DefaultZCl() + << "\t}\n"; + return ss.str(); + } + + virtual vector OpenCLGlobalFuncNames() const override + { + return vector { "Zeps", "JacobiElliptic" }; + } + +protected: + void Init() + { + string prefix = Prefix(); + m_VarFuncs = VarFuncs::Instance(); + m_Params.clear(); + m_Params.push_back(ParamWithName(&m_K, prefix + "jac_dn_k", T(0.5), eParamType::REAL, -1, 1)); + } + +private: + T m_K; + shared_ptr> m_VarFuncs; +}; + +/// +/// jac_sn. +/// +template +class EMBER_API JacSnVariation : public ParametricVariation +{ +public: + JacSnVariation(T weight = 1.0) : ParametricVariation("jac_sn", eVariationId::VAR_JAC_SN, weight) + { + Init(); + } + + PARVARCOPY(JacSnVariation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + T snx, cnx, dnx; + T sny, cny, dny; + T numX, numY, denom; + m_VarFuncs->JacobiElliptic(helper.In.x, m_K, snx, cnx, dnx); + m_VarFuncs->JacobiElliptic(helper.In.y, 1 - m_K, sny, cny, dny); + numX = snx * dny; + numY = cnx * dnx * cny * sny; + denom = SQR(snx) * SQR(sny) * m_K + SQR(cny); + denom = m_Weight / Zeps(denom); + helper.Out.x = denom * numX; + helper.Out.y = denom * numY; + helper.Out.z = DefaultZ(helper); + } + + virtual string OpenCLString() const override + { + ostringstream ss, ss2; + intmax_t i = 0, varIndex = IndexInXform(); + ss2 << "_" << XformIndexInEmber() << "]"; + string index = ss2.str(); + string k = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + ss << "\t{\n" + << "\t\treal_t snx, cnx, dnx;\n" + << "\t\treal_t sny, cny, dny;\n" + << "\t\treal_t numX, numY, denom;\n" + << "\t\tJacobiElliptic(vIn.x, " << k << ", &snx, &cnx, &dnx);\n" + << "\t\tJacobiElliptic(vIn.y, 1 - " << k << ", &sny, &cny, &dny);\n" + << "\t\tnumX = snx * dny;\n" + << "\t\tnumY = cnx * dnx * cny * sny;\n" + << "\t\tdenom = SQR(snx) * SQR(sny) * " << k << " + SQR(cny);\n" + << "\t\tdenom = xform->m_VariationWeights[" << varIndex << "] / Zeps(denom);\n" + << "\t\tvOut.x = denom * numX;\n" + << "\t\tvOut.y = denom * numY;\n" + << "\t\tvOut.z = " << DefaultZCl() + << "\t}\n"; + return ss.str(); + } + + virtual vector OpenCLGlobalFuncNames() const override + { + return vector { "Zeps", "JacobiElliptic" }; + } + +protected: + void Init() + { + string prefix = Prefix(); + m_VarFuncs = VarFuncs::Instance(); + m_Params.clear(); + m_Params.push_back(ParamWithName(&m_K, prefix + "jac_sn_k", T(0.5), eParamType::REAL, -1, 1)); + } + +private: + T m_K; + shared_ptr> m_VarFuncs; +}; + +/// +/// pressure_wave. +/// +template +class EMBER_API PressureWaveVariation : public ParametricVariation +{ +public: + PressureWaveVariation(T weight = 1.0) : ParametricVariation("pressure_wave", eVariationId::VAR_PRESSURE_WAVE, weight) + { + Init(); + } + + PARVARCOPY(PressureWaveVariation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + helper.Out.x = m_Weight * (helper.In.x + (1 / Zeps(m_X * M_2PI)) * std::sin(m_X * M_2PI * helper.In.x)); + helper.Out.y = m_Weight * (helper.In.y + (1 / Zeps(m_Y * M_2PI)) * std::sin(m_Y * M_2PI * helper.In.y)); + helper.Out.z = DefaultZ(helper); + } + + virtual string OpenCLString() const override + { + ostringstream ss, ss2; + intmax_t i = 0, varIndex = IndexInXform(); + ss2 << "_" << XformIndexInEmber() << "]"; + string index = ss2.str(); + string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + ss << "\t{\n" + << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + (1 / Zeps(" << x << " * M_2PI)) * sin(" << x << " * M_2PI * vIn.x));\n" + << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + (1 / Zeps(" << y << " * M_2PI)) * sin(" << y << " * M_2PI * vIn.y));\n" + << "\t\tvOut.z = " << DefaultZCl() + << "\t}\n"; + return ss.str(); + } + + virtual vector OpenCLGlobalFuncNames() const override + { + return vector { "Zeps" }; + } + +protected: + void Init() + { + string prefix = Prefix(); + m_Params.clear(); + m_Params.push_back(ParamWithName(&m_X, prefix + "pressure_wave_x_freq", 1)); + m_Params.push_back(ParamWithName(&m_Y, prefix + "pressure_wave_y_freq", 1)); + } + +private: + T m_X; + T m_Y; +}; + +/// +/// gamma. +/// +template +class EMBER_API GammaVariation : public Variation +{ +public: + GammaVariation(T weight = 1.0) : Variation("gamma", eVariationId::VAR_GAMMA, weight, true, true, false, false, true) + { + } + + VARCOPY(GammaVariation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + helper.Out.x = m_Weight * std::lgamma(helper.m_PrecalcSqrtSumSquares); + helper.Out.y = m_Weight * helper.m_PrecalcAtanyx; + helper.Out.z = DefaultZ(helper); + } + + virtual string OpenCLString() const override + { + ostringstream ss, ss2; + intmax_t i = 0, varIndex = IndexInXform(); + ss2 << "_" << XformIndexInEmber() << "]"; + string index = ss2.str(); + ss << "\t{\n" + << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * lgamma(precalcSqrtSumSquares);\n" + << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * precalcAtanyx;\n" + << "\t\tvOut.z = " << DefaultZCl() + << "\t}\n"; + return ss.str(); + } +}; + +/// +/// prose3D. +/// +template +class EMBER_API PRose3DVariation : public ParametricVariation +{ +public: + PRose3DVariation(T weight = 1.0) : ParametricVariation("pRose3D", eVariationId::VAR_PROSE3D, weight, true, true, false, false, true) + { + Init(); + } + + PARVARCOPY(PRose3DVariation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + int posNeg = 1; + T th = 0; + T sth, cth, pang, wig, wag, wag2, wag3, wag12, waggle; + T rad = helper.m_PrecalcSqrtSumSquares; + T curve1 = rad / m_L; + T curve2 = Sqr(curve1); + T curve3 = (rad - m_L * T(0.5)) / m_L; + T curve4 = Sqr(curve2); + th = helper.m_PrecalcAtanyx; + sincos(th, &sth, &cth); + + if (rand.Frand01() < T(0.5)) + posNeg = -1; + + pang = th / Zeps(m_Cycle); + wig = pang * m_Freq * T(0.5) + m_Offset * m_Cycle; + + if (m_OptDir < 0) + { + wag = std::sin(curve1 * T(M_PI) * m_AbsOptSc) + m_Wagsc * T(0.4) * rad + m_Crvsc * T(0.5) * (std::sin(curve2 * T(M_PI))); + wag3 = std::sin(curve4 * T(M_PI) * m_AbsOptSc) + m_Wagsc * SQR(rad) * T(0.4) + m_Crvsc * T(0.5) * (std::cos(curve3 * T(M_PI))); + } + else + { + wag = std::sin(curve1 * T(M_PI) * m_AbsOptSc) + m_Wagsc * T(0.4) * rad + m_Crvsc * T(0.5) * (std::cos(curve3 * T(M_PI))); + wag3 = std::sin(curve4 * T(M_PI) * m_AbsOptSc) + m_Wagsc * SQR(rad) * T(0.4) + m_Crvsc * T(0.5) * (std::sin(curve2 * T(M_PI))); + } + + wag2 = std::sin(curve2 * T(M_PI) * m_AbsOptSc) + m_Wagsc * T(0.4) * rad + m_Crvsc * T(0.5) * (std::cos(curve3 * T(M_PI))); + + if (m_Smooth12 <= 1) + wag12 = wag; + else if (m_Smooth12 <= 2 && m_Smooth12 > 1) + wag12 = wag2 * (1 - m_AntiOpt1) + wag * m_AntiOpt1; + else if (m_Smooth12 > 2) + wag12 = wag2; + + if (m_Smooth3 == 0) + waggle = wag12; + else if (m_Smooth3 > 0) + waggle = wag12 * (1 - m_Smooth3) + wag3 * m_Smooth3; + + if (rand.Frand01() < m_Ghost) + { + if (posNeg < 0) + { + helper.Out.x = m_Weight * T(0.5) * m_RefSc * (m_L * std::cos(m_NumPetals * th + m_C)) * cth; + helper.Out.y = m_Weight * T(0.5) * m_RefSc * (m_L * std::cos(m_NumPetals * th + m_C)) * sth; + helper.Out.z = m_Weight * T(-0.5) * ((m_Z2 * waggle + Sqr(rad * T(0.5)) * std::sin(wig) * m_WigScale) + m_Dist); + } + else + { + helper.Out.x = m_Weight * T(0.5) * (m_L * std::cos(m_NumPetals * th + m_C)) * cth; + helper.Out.y = m_Weight * T(0.5) * (m_L * std::cos(m_NumPetals * th + m_C)) * sth; + helper.Out.z = m_Weight * T(0.5) * ((m_Z1 * waggle + Sqr(rad * T(0.5)) * std::sin(wig) * m_WigScale) + m_Dist); + } + } + else + { + if (posNeg < 0) + { + helper.Out.x = m_Weight * T(0.5) * (m_L * std::cos(m_NumPetals * th + m_C)) * cth; + helper.Out.y = m_Weight * T(0.5) * (m_L * std::cos(m_NumPetals * th + m_C)) * sth; + helper.Out.z = m_Weight * T(0.5) * ((m_Z1 * waggle + Sqr(rad * T(0.5)) * std::sin(wig) * m_WigScale) + m_Dist); + } + else + { + helper.Out.x = m_Weight * T(0.5) * (m_L * std::cos(m_NumPetals * th + m_C)) * cth; + helper.Out.y = m_Weight * T(0.5) * (m_L * std::cos(m_NumPetals * th + m_C)) * sth; + helper.Out.z = m_Weight * T(0.5) * ((m_Z1 * waggle + Sqr(rad * T(0.5)) * std::sin(wig) * m_WigScale) + m_Dist); + } + } + } + + virtual string OpenCLString() const override + { + ostringstream ss, ss2; + intmax_t i = 0, varIndex = IndexInXform(); + ss2 << "_" << XformIndexInEmber() << "]"; + string index = ss2.str(); + string l = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string k = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string z1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string z2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string refSc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string opt = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string optSc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string opt3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string transp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string wagsc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string crvsc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string f = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string wigsc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string offset = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cycle = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. + string optDir = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string petalsSign = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string numPetals = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string absOptSc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string smooth12 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string smooth3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string antiOpt1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ghost = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string freq = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string wigScale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + ss << "\t{\n" + << "\t\tint posNeg = 1;\n" + << "\t\treal_t th = 0;\n" + << "\t\treal_t sth, cth, pang, wig, wag, wag2, wag3, wag12, waggle;\n" + << "\t\treal_t rad = precalcSqrtSumSquares;\n" + << "\t\treal_t curve1 = rad / " << l << ";\n" + << "\t\treal_t curveTwo = Sqr(curve1);\n" + << "\t\treal_t curve3 = (rad - " << l << " * 0.5) / " << l << ";\n" + << "\t\treal_t curve4 = Sqr(curveTwo);\n" + << "\t\tth = precalcAtanyx;\n" + << "\t\tsth = sincos(th, &cth);\n" + << "\n" + << "\t\tif (MwcNext01(mwc) < 0.5)\n" + << "\t\t posNeg = -1;\n" + << "\n" + << "\t\tpang = th / Zeps(" << cycle << ");\n" + << "\t\twig = pang * " << freq << " * 0.5 + " << offset << " * " << cycle << ";\n" + << "\n" + << "\t\tif (" << optDir << " < 0)\n" + << "\t\t{\n" + << "\t\t wag = sin(curve1 * M_PI * " << absOptSc << ") + " << wagsc << " * 0.4 * rad + " << crvsc << " * 0.5 * (sin(curveTwo * M_PI));\n" + << "\t\t wag3 = sin(curve4 * M_PI * " << absOptSc << ") + " << wagsc << " * SQR(rad) * 0.4 + " << crvsc << " * 0.5 * (cos(curve3 * M_PI));\n" + << "\t\t}\n" + << "\t\telse\n" + << "\t\t{\n" + << "\t\t wag = sin(curve1 * M_PI * " << absOptSc << ") + " << wagsc << " * 0.4 * rad + " << crvsc << " * 0.5 * (cos(curve3 * M_PI));\n" + << "\t\t wag3 = sin(curve4 * M_PI * " << absOptSc << ") + " << wagsc << " * SQR(rad) * 0.4 + " << crvsc << " * 0.5 * (sin(curveTwo * M_PI));\n" + << "\t\t}\n" + << "\n" + << "\t\twag2 = sin(curveTwo * M_PI * " << absOptSc << ") + " << wagsc << " * 0.4 * rad + " << crvsc << " * 0.5 * (cos(curve3 * M_PI));\n" + << "\n" + << "\t\tif (" << smooth12 << " <= 1)\n" + << "\t\t wag12 = wag;\n" + << "\t\telse if (" << smooth12 << " <= 2 && " << smooth12 << " > 1)\n" + << "\t\t wag12 = wag2 * (1 - " << antiOpt1 << ") + wag * " << antiOpt1 << ";\n" + << "\t\telse if (" << smooth12 << " > 2)\n" + << "\t\t wag12 = wag2;\n" + << "\n" + << "\t\tif (" << smooth3 << " == 0)\n" + << "\t\t waggle = wag12;\n" + << "\t\telse if (" << smooth3 << " > 0)\n" + << "\t\t waggle = wag12 * (1 - " << smooth3 << ") + wag3 * " << smooth3 << ";\n" + << "\n" + << "\t\tif (MwcNext01(mwc) < " << ghost << ")\n" + << "\t\t{\n" + << "\t\t if (posNeg < 0)\n" + << "\t\t {\n" + << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * 0.5 * " << refSc << " * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * cth;\n" + << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * 0.5 * " << refSc << " * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * sth;\n" + << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * -0.5 * ((" << z2 << " * waggle + Sqr(rad * 0.5) * sin(wig) * " << wigScale << ") + " << dist << ");\n" + << "\t\t }\n" + << "\t\t else\n" + << "\t\t {\n" + << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * 0.5 * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * cth;\n" + << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * 0.5 * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * sth;\n" + << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * 0.5 * ((" << z1 << " * waggle + Sqr(rad * 0.5) * sin(wig) * " << wigScale << ") + " << dist << ");\n" + << "\t\t }\n" + << "\t\t}\n" + << "\t\telse\n" + << "\t\t{\n" + << "\t\t if (posNeg < 0)\n" + << "\t\t {\n" + << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * 0.5 * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * cth;\n" + << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * 0.5 * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * sth;\n" + << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * 0.5 * ((" << z1 << " * waggle + Sqr(rad * 0.5) * sin(wig) * " << wigScale << ") + " << dist << ");\n" + << "\t\t }\n" + << "\t\t else\n" + << "\t\t {\n" + << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * 0.5 * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * cth;\n" + << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * 0.5 * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * sth;\n" + << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * 0.5 * ((" << z1 << " * waggle + Sqr(rad * 0.5) * sin(wig) * " << wigScale << ") + " << dist << ");\n" + << "\t\t }\n" + << "\t\t}\n" + << "\t}\n"; + return ss.str(); + } + + virtual vector OpenCLGlobalFuncNames() const override + { + return vector { "Sqr", "Zeps" }; + } + + virtual void Precalc() override + { + m_Cycle = M_2PI / Zeps(m_K); + m_NumPetals = m_K; + m_Ghost = Sqr(m_Transp); + m_Freq = m_F * M_2PI; + m_WigScale = m_Wigsc * T(0.5); + + if (std::abs(m_NumPetals) < T(0.0001)) + m_NumPetals = T(0.0001) * m_PetalsSign; + + m_Smooth12 = std::abs(m_Opt); + m_Smooth3 = std::abs(m_Opt3); + m_AbsOptSc = std::abs(m_OptSc); + + if (m_Smooth12 > 2) + m_Smooth12 = 2; + + m_AntiOpt1 = 2 - m_Smooth12; + + if (m_Smooth3 > 1) + m_Smooth3 = 1; + + m_OptDir = std::copysign(T(1.0), m_Opt); + m_PetalsSign = std::copysign(T(1.0), m_K); + + if (m_Opt3 < 0) + m_OptDir = -1; + + if (m_OptDir > 0) + m_Ghost = 0; + } + +protected: + void Init() + { + string prefix = Prefix(); + m_Params.clear(); + m_Params.push_back(ParamWithName(&m_L, prefix + "pRose3D_l", 1, eParamType::REAL_NONZERO)); + m_Params.push_back(ParamWithName(&m_K, prefix + "pRose3D_k", 3)); + m_Params.push_back(ParamWithName(&m_C, prefix + "pRose3D_c")); + m_Params.push_back(ParamWithName(&m_Z1, prefix + "pRose3D_z1", 1)); + m_Params.push_back(ParamWithName(&m_Z2, prefix + "pRose3D_z2", 1)); + m_Params.push_back(ParamWithName(&m_RefSc, prefix + "pRose3D_refSc", 1)); + m_Params.push_back(ParamWithName(&m_Opt, prefix + "pRose3D_opt", 1)); + m_Params.push_back(ParamWithName(&m_OptSc, prefix + "pRose3D_optSc", 1)); + m_Params.push_back(ParamWithName(&m_Opt3, prefix + "pRose3D_opt3")); + m_Params.push_back(ParamWithName(&m_Transp, prefix + "pRose3D_transp", T(0.5))); + m_Params.push_back(ParamWithName(&m_Dist, prefix + "pRose3D_dist", 1)); + m_Params.push_back(ParamWithName(&m_Wagsc, prefix + "pRose3D_wagsc", 0)); + m_Params.push_back(ParamWithName(&m_Crvsc, prefix + "pRose3D_crvsc", 0)); + m_Params.push_back(ParamWithName(&m_F, prefix + "pRose3D_f", 3)); + m_Params.push_back(ParamWithName(&m_Wigsc, prefix + "pRose3D_wigsc")); + m_Params.push_back(ParamWithName(&m_Offset, prefix + "pRose3D_offset")); + m_Params.push_back(ParamWithName(true, &m_Cycle, prefix + "pRose3D_cycle")); + m_Params.push_back(ParamWithName(true, &m_OptDir, prefix + "pRose3D_opt_dir")); + m_Params.push_back(ParamWithName(true, &m_PetalsSign, prefix + "pRose3D_petals_sign")); + m_Params.push_back(ParamWithName(true, &m_NumPetals, prefix + "pRose3D_num_petals")); + m_Params.push_back(ParamWithName(true, &m_AbsOptSc, prefix + "pRose3D_abs_optSc")); + m_Params.push_back(ParamWithName(true, &m_Smooth12, prefix + "pRose3D_smooth12")); + m_Params.push_back(ParamWithName(true, &m_Smooth3, prefix + "pRose3D_smooth3")); + m_Params.push_back(ParamWithName(true, &m_AntiOpt1, prefix + "pRose3D_anti_opt1")); + m_Params.push_back(ParamWithName(true, &m_Ghost, prefix + "pRose3D_ghost")); + m_Params.push_back(ParamWithName(true, &m_Freq, prefix + "pRose3D_freq")); + m_Params.push_back(ParamWithName(true, &m_WigScale, prefix + "pRose3D_wig_scale")); + } + +private: + T m_L; + T m_K; + T m_C; + T m_Z1; + T m_Z2; + T m_RefSc; + T m_Opt; + T m_OptSc; + T m_Opt3; + T m_Transp; + T m_Dist; + T m_Wagsc; + T m_Crvsc; + T m_F; + T m_Wigsc; + T m_Offset; + T m_Cycle;//Precalc. + T m_OptDir; + T m_PetalsSign; + T m_NumPetals; + T m_AbsOptSc; + T m_Smooth12; + T m_Smooth3; + T m_AntiOpt1; + T m_Ghost; + T m_Freq; + T m_WigScale; +}; + +/// +/// log_db. +/// By DarkBeam, taken from JWildfire. +/// http://jwildfire.org/forum/viewtopic.php?f=23&t=1450&p=2692#p2692 +/// +template +class EMBER_API LogDBVariation : public ParametricVariation +{ +public: + LogDBVariation(T weight = 1.0) : ParametricVariation("log_db", eVariationId::VAR_LOG_DB, weight, true, false, false, false, true) + { + Init(); + } + + PARVARCOPY(LogDBVariation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + int i, adp; + T atanPeriod = 0; + + for (i = 0; i < 7; i++) + { + adp = rand.Rand(10) - 5; + + if (std::abs(adp) >= 3) + adp = 0; + + atanPeriod += adp; + } + + atanPeriod *= m_FixPe; + helper.Out.x = m_Denom * std::log(helper.m_PrecalcSumSquares); + helper.Out.y = m_Weight * (helper.m_PrecalcAtanyx + atanPeriod); + helper.Out.z = m_Weight * helper.In.z; + } + + virtual string OpenCLString() const override + { + ostringstream ss, ss2; + intmax_t i = 0, varIndex = IndexInXform(); + ss2 << "_" << XformIndexInEmber() << "]"; + string index = ss2.str(); + string base = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string fixPeriod = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string denom = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string fixPe = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + ss << "\t{\n" + << "\t\tint i, adp;\n" + << "\t\treal_t atanPeriod = 0;\n" + << "\n" + << "\t\tfor (i = 0; i < 7; i++)\n" + << "\t\t{\n" + << "\t\t adp = MwcNextRange(mwc, 10) - 5;\n" + << "\n" + << "\t\t if (abs(adp) >= 3)\n" + << "\t\t adp = 0;\n" + << "\n" + << "\t\t atanPeriod += adp;\n" + << "\t\t}\n" + << "\n" + << "\t\tatanPeriod *= " << fixPe << ";\n" + << "\t\tvOut.x = " << denom << " * log(precalcSumSquares);\n" + << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (precalcAtanyx + atanPeriod);\n" + << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t}\n"; + return ss.str(); + } + + virtual void Precalc() override + { + m_Denom = T(0.5); + + if (m_Base > EPS) + m_Denom = m_Denom / std::log(T(M_E) * m_Base); + + m_Denom *= m_Weight; + m_FixPe = T(M_PI); + + if (m_FixPeriod > EPS) + m_FixPe *= m_FixPeriod; + } +protected: + void Init() + { + string prefix = Prefix(); + m_Params.clear(); + m_Params.push_back(ParamWithName(&m_Base, prefix + "log_db_base", 1)); + m_Params.push_back(ParamWithName(&m_FixPeriod, prefix + "log_db_fix_period", 1)); + m_Params.push_back(ParamWithName(true, &m_Denom, prefix + "log_db_denom")); + m_Params.push_back(ParamWithName(true, &m_FixPe, prefix + "log_db_fix_pe")); + } +private: + T m_Base; + T m_FixPeriod; + T m_Denom; + T m_FixPe; +}; + +MAKEPREPOSTPARVAR(Splits3D, splits3D, SPLITS3D) +MAKEPREPOSTPARVAR(Waves2B, waves2b, WAVES2B) +MAKEPREPOSTPARVAR(JacCn, jac_cn, JAC_CN) +MAKEPREPOSTPARVAR(JacDn, jac_dn, JAC_DN) +MAKEPREPOSTPARVAR(JacSn, jac_sn, JAC_SN) +MAKEPREPOSTPARVAR(PressureWave, pressure_wave, PRESSURE_WAVE) +MAKEPREPOSTVAR(Gamma, gamma, GAMMA) +MAKEPREPOSTPARVAR(PRose3D, pRose3D, PROSE3D) +MAKEPREPOSTPARVAR(LogDB, log_db, LOG_DB) +} diff --git a/Source/Ember/VariationsDC.h b/Source/Ember/VariationsDC.h index 4375b4f..728635e 100644 --- a/Source/Ember/VariationsDC.h +++ b/Source/Ember/VariationsDC.h @@ -140,7 +140,7 @@ public: T h = -m_H + (1 - x0_xor_y0) * m_H; helper.Out.x = m_Weight * (m_Xform->m_Affine.A() * x + m_Xform->m_Affine.B() * y + m_Xform->m_Affine.E()); helper.Out.y = m_Weight * (m_Xform->m_Affine.C() * x + m_Xform->m_Affine.D() * y + m_Xform->m_Affine.F()); - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); outPoint.m_ColorX = fmod(std::abs(outPoint.m_ColorX * T(0.5) * (1 + h) + x0_xor_y0 * (1 - h) * T(0.5)), T(1.0)); } @@ -162,7 +162,7 @@ public: << "\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.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\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"; return ss.str(); @@ -588,7 +588,7 @@ public: } } - helper.Out.z = m_Weight * helper.In.z; + helper.Out.z = DefaultZ(helper); outPoint.m_ColorX = fmod(c, T(1.0)); } @@ -668,7 +668,7 @@ public: << "\t\t }\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t\toutPoint->m_ColorX = fmod(c, (real_t)(1.0));\n" << "\t}\n"; return ss.str(); @@ -1242,7 +1242,7 @@ public: // Add blur effect to transform helper.Out.x = m_Weight * vx; helper.Out.y = m_Weight * vy; - helper.Out.z = (m_VarType == eVariationType::VARTYPE_REG) ? 0 : helper.In.z; + helper.Out.z = DefaultZ(helper); col = m_Centre + m_Range * p; outPoint.m_ColorX = col - Floor(col); } @@ -1393,7 +1393,7 @@ public: << "\n" << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vx; \n" << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * vy; \n" - << "\t\tvOut.z = " << ((m_VarType == eVariationType::VARTYPE_REG) ? "0" : "vIn.z") << ";\n" + << "\t\tvOut.z = " << DefaultZCl() << "\t\tcol = " << centre << " + " << range << " * p; \n" << "\t\toutPoint->m_ColorX = col - floor(col); \n" << "\t}\n"; diff --git a/Source/Ember/Xform.h b/Source/Ember/Xform.h index 15dde14..21ee809 100644 --- a/Source/Ember/Xform.h +++ b/Source/Ember/Xform.h @@ -616,7 +616,7 @@ public: iterHelper.In.x = iterHelper.m_TransX;//Read must be done before every pre variation because transX/Y are changing. iterHelper.In.y = iterHelper.m_TransY; iterHelper.In.z = iterHelper.m_TransZ; - m_PreVariations[i]->PrecalcHelper(iterHelper, inPoint);//Apply per-variation precalc, the second parameter is unused for pre variations. + m_PreVariations[i]->PrePostPrecalcHelper(iterHelper);//Apply per-variation precalc, the second parameter is unused for pre variations. m_PreVariations[i]->Func(iterHelper, *outPoint, rand); WritePre(iterHelper, m_PreVariations[i]->AssignType()); } @@ -668,7 +668,7 @@ public: iterHelper.In.x = outPoint->m_X;//Read must be done before every post variation because the out point is changing. iterHelper.In.y = outPoint->m_Y; iterHelper.In.z = outPoint->m_Z; - m_PostVariations[i]->PrecalcHelper(iterHelper, outPoint);//Apply per-variation precalc. + m_PostVariations[i]->PrePostPrecalcHelper(iterHelper);//Apply per-variation precalc. m_PostVariations[i]->Func(iterHelper, *outPoint, rand); WritePost(iterHelper, *outPoint, m_PostVariations[i]->AssignType()); } diff --git a/Source/Ember/XmlToEmber.h b/Source/Ember/XmlToEmber.h index 5c08d84..e2e91d1 100644 --- a/Source/Ember/XmlToEmber.h +++ b/Source/Ember/XmlToEmber.h @@ -268,6 +268,7 @@ public: badParams.push_back("post_scrop_cropmode"); badParams.push_back("post_scrop_static"); m_BadVariationNames.push_back(make_pair(make_pair(string("post_scrop"), string("post_smartcrop")), badParams)); + //Note that splits3D can't be done here because it's param names are also used by splits. badParams.clear(); m_BadVariationNames.push_back(make_pair(make_pair(string("pre_blur"), string("pre_gaussian_blur")), badParams));//No other special params for these. m_BadVariationNames.push_back(make_pair(make_pair(string("pre_spin_z"), string("pre_rotate_z")), badParams)); diff --git a/Source/EmberAnimate/EmberAnimate.cpp b/Source/EmberAnimate/EmberAnimate.cpp index 423a1c6..d244f1a 100644 --- a/Source/EmberAnimate/EmberAnimate.cpp +++ b/Source/EmberAnimate/EmberAnimate.cpp @@ -27,7 +27,8 @@ bool EmberAnimate(EmberOptions& opt) //Regular variables. Timing t; bool unsorted = false; - uint channels, padding; + uint channels; + streamsize padding; size_t i, firstUnsortedIndex = 0; string inputPath = GetPath(opt.Input()); vector> embers; @@ -124,9 +125,13 @@ bool EmberAnimate(EmberOptions& opt) if (!InitPaletteList(opt.PalettePath())) return false; + cout << "Parsing ember file " << opt.Input() << endl; + if (!ParseEmberFile(parser, opt.Input(), embers)) return false; + cout << "Finished parsing.\n"; + if (embers.size() <= 1) { cout << "Read " << embers.size() << " embers from file. At least 2 required to animate, exiting." << endl; @@ -227,6 +232,15 @@ bool EmberAnimate(EmberOptions& opt) if (opt.Supersample() > 0) embers[i].m_Supersample = opt.Supersample(); + if (opt.Quality() > 0) + embers[i].m_Quality = T(opt.Quality()); + + if (opt.DeMin() > -1) + embers[i].m_MinRadDE = T(opt.DeMin()); + + if (opt.DeMax() > -1) + embers[i].m_MaxRadDE = T(opt.DeMax()); + if (opt.SubBatchSize() != DEFAULT_SBS) embers[i].m_SubBatchSize = opt.SubBatchSize(); diff --git a/Source/EmberCL/EmberCLStructs.h b/Source/EmberCL/EmberCLStructs.h index 7d31659..127d4eb 100644 --- a/Source/EmberCL/EmberCLStructs.h +++ b/Source/EmberCL/EmberCLStructs.h @@ -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" diff --git a/Source/EmberCL/FunctionMapper.cpp b/Source/EmberCL/FunctionMapper.cpp index 77068a3..5c5fc17 100644 --- a/Source/EmberCL/FunctionMapper.cpp +++ b/Source/EmberCL/FunctionMapper.cpp @@ -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"; } } diff --git a/Source/EmberCL/IterOpenCLKernelCreator.cpp b/Source/EmberCL/IterOpenCLKernelCreator.cpp index b26a9cd..a047ca2 100644 --- a/Source/EmberCL/IterOpenCLKernelCreator.cpp +++ b/Source/EmberCL/IterOpenCLKernelCreator.cpp @@ -122,8 +122,8 @@ string IterOpenCLKernelCreator::CreateIterKernelString(const Ember& ember, if (Variation* 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::CreateIterKernelString(const Ember& ember, if (Variation* 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"); } diff --git a/Source/EmberCommon/EmberCommon.h b/Source/EmberCommon/EmberCommon.h index 023888f..27c9c1b 100644 --- a/Source/EmberCommon/EmberCommon.h +++ b/Source/EmberCommon/EmberCommon.h @@ -112,8 +112,22 @@ template static bool InitPaletteList(const string& filename) { PaletteList paletteList;//Even though this is local, the members are static so they will remain. + static vector paths = + { + "./" +#ifndef WIN32 + "~/.fractorium" + "~/.config/fractorium" + "/usr/share/fractorium" + "/usr/local/share/fractorium" +#endif + }; bool added = paletteList.Add(filename); + for (auto& p : paths) + if (!added) + added |= paletteList.Add(p + "/" + filename); + if (!added || !paletteList.Size()) { cout << "Error parsing palette file " << filename << ". Reason: " << endl; diff --git a/Source/EmberCommon/EmberOptions.h b/Source/EmberCommon/EmberOptions.h index 6aac54d..ff650a1 100644 --- a/Source/EmberCommon/EmberOptions.h +++ b/Source/EmberCommon/EmberOptions.h @@ -81,6 +81,9 @@ enum class eOptionIDs : et OPT_SS,//Float value args. OPT_QS, + OPT_QUALITY, + OPT_DE_MIN, + OPT_DE_MAX, OPT_PIXEL_ASPECT, OPT_STAGGER, OPT_AVG_THRESH, @@ -322,13 +325,13 @@ public: INITBOOLOPTION(LockAccum, Eob(eOptionUse::OPT_USE_ALL, eOptionIDs::OPT_LOCK_ACCUM, _T("--lock_accum"), false, SO_NONE, "\t--lock_accum Lock threads when accumulating to the histogram using the CPU. This will drop performance to that of single threading [default: false].\n")); INITBOOLOPTION(DumpKernel, Eob(eOptionUse::OPT_USE_RENDER, eOptionIDs::OPT_DUMP_KERNEL, _T("--dump_kernel"), false, SO_NONE, "\t--dump_kernel Print the iteration kernel string when using OpenCL (ignored for CPU) [default: false].\n")); //Int. - INITINTOPTION(Symmetry, Eoi(eOptionUse::OPT_USE_GENOME, eOptionIDs::OPT_SYMMETRY, _T("--symmetry"), 0, SO_REQ_SEP, "\t--symmetry= Set symmetry of result [default: 0].\n")); - INITINTOPTION(SheepGen, Eoi(eOptionUse::OPT_USE_GENOME, eOptionIDs::OPT_SHEEP_GEN, _T("--sheep_gen"), -1, SO_REQ_SEP, "\t--sheep_gen= Sheep generation of this flame [default: -1].\n")); - INITINTOPTION(SheepId, Eoi(eOptionUse::OPT_USE_GENOME, eOptionIDs::OPT_SHEEP_ID, _T("--sheep_id"), -1, SO_REQ_SEP, "\t--sheep_id= Sheep ID of this flame [default: -1].\n")); + INITINTOPTION(Symmetry, Eoi(eOptionUse::OPT_USE_GENOME, eOptionIDs::OPT_SYMMETRY, _T("--symmetry"), 0, SO_REQ_SEP, "\t--symmetry= Set symmetry of result [default: 0].\n")); + INITINTOPTION(SheepGen, Eoi(eOptionUse::OPT_USE_GENOME, eOptionIDs::OPT_SHEEP_GEN, _T("--sheep_gen"), -1, SO_REQ_SEP, "\t--sheep_gen= Sheep generation of this flame [default: -1].\n")); + INITINTOPTION(SheepId, Eoi(eOptionUse::OPT_USE_GENOME, eOptionIDs::OPT_SHEEP_ID, _T("--sheep_id"), -1, SO_REQ_SEP, "\t--sheep_id= Sheep ID of this flame [default: -1].\n")); #ifdef _WIN32 - INITINTOPTION(Priority, Eoi(eOptionUse::OPT_RENDER_ANIM, eOptionIDs::OPT_PRIORITY, _T("--priority"), int(eThreadPriority::NORMAL), SO_REQ_SEP, "\t--priority= The priority of the CPU rendering threads from -2 - 2. This does not apply to OpenCL rendering.\n")); + INITINTOPTION(Priority, Eoi(eOptionUse::OPT_RENDER_ANIM, eOptionIDs::OPT_PRIORITY, _T("--priority"), int(eThreadPriority::NORMAL), SO_REQ_SEP, "\t--priority= The priority of the CPU rendering threads from -2 - 2. This does not apply to OpenCL rendering.\n")); #else - INITINTOPTION(Priority, Eoi(eOptionUse::OPT_RENDER_ANIM, eOptionIDs::OPT_PRIORITY, _T("--priority"), int(eThreadPriority::NORMAL), SO_REQ_SEP, "\t--priority= The priority of the CPU rendering threads, 1, 25, 50, 75, 99. This does not apply to OpenCL rendering.\n")); + INITINTOPTION(Priority, Eoi(eOptionUse::OPT_RENDER_ANIM, eOptionIDs::OPT_PRIORITY, _T("--priority"), int(eThreadPriority::NORMAL), SO_REQ_SEP, "\t--priority= The priority of the CPU rendering threads, 1, 25, 50, 75, 99. This does not apply to OpenCL rendering.\n")); #endif //Uint. INITUINTOPTION(Seed, Eou(eOptionUse::OPT_USE_ALL, eOptionIDs::OPT_SEED, _T("--seed"), 0, SO_REQ_SEP, "\t--seed= Integer seed to use for the random number generator [default: random].\n")); @@ -355,6 +358,9 @@ public: //Double. INITDOUBLEOPTION(SizeScale, Eod(eOptionUse::OPT_RENDER_ANIM, eOptionIDs::OPT_SS, _T("--ss"), 1, SO_REQ_SEP, "\t--ss= Size scale. All dimensions are scaled by this amount [default: 1.0].\n")); INITDOUBLEOPTION(QualityScale, Eod(eOptionUse::OPT_RENDER_ANIM, eOptionIDs::OPT_QS, _T("--qs"), 1, SO_REQ_SEP, "\t--qs= Quality scale. All quality values are scaled by this amount [default: 1.0].\n")); + INITDOUBLEOPTION(Quality, Eod(eOptionUse::OPT_RENDER_ANIM, eOptionIDs::OPT_QUALITY, _T("--quality"), 0, SO_REQ_SEP, "\t--quality= Override the quality of the flame if not 0 [default: 0].\n")); + INITDOUBLEOPTION(DeMin, Eod(eOptionUse::OPT_RENDER_ANIM, eOptionIDs::OPT_DE_MIN, _T("--demin"), -1, SO_REQ_SEP, "\t--demin= Override the minimum size of the density estimator filter radius if not -1 [default: -1].\n")); + INITDOUBLEOPTION(DeMax, Eod(eOptionUse::OPT_RENDER_ANIM, eOptionIDs::OPT_DE_MAX, _T("--demax"), -1, SO_REQ_SEP, "\t--demax= Override the maximum size of the density estimator filter radius if not -1 [default: -1].\n")); INITDOUBLEOPTION(AspectRatio, Eod(eOptionUse::OPT_USE_ALL, eOptionIDs::OPT_PIXEL_ASPECT, _T("--pixel_aspect"), 1, SO_REQ_SEP, "\t--pixel_aspect= Aspect ratio of pixels (width over height), eg. 0.90909 for NTSC [default: 1.0].\n")); INITDOUBLEOPTION(Stagger, Eod(eOptionUse::OPT_USE_GENOME, eOptionIDs::OPT_STAGGER, _T("--stagger"), 0, SO_REQ_SEP, "\t--stagger= Affects simultaneity of xform interpolation during flame interpolation.\n" "\t Represents how 'separate' the xforms are interpolated. Set to 1 for each\n" @@ -374,7 +380,7 @@ public: INITSTRINGOPTION(Out, Eos(eOptionUse::OPT_USE_RENDER, eOptionIDs::OPT_OUT, _T("--out"), "", SO_REQ_SEP, "\t--out= Name of a single output file. Not recommended when rendering more than one image.\n")); INITSTRINGOPTION(Prefix, Eos(eOptionUse::OPT_RENDER_ANIM, eOptionIDs::OPT_PREFIX, _T("--prefix"), "", SO_REQ_SEP, "\t--prefix= Prefix to prepend to all output files.\n")); INITSTRINGOPTION(Suffix, Eos(eOptionUse::OPT_RENDER_ANIM, eOptionIDs::OPT_SUFFIX, _T("--suffix"), "", SO_REQ_SEP, "\t--suffix= Suffix to append to all output files.\n")); - INITSTRINGOPTION(Format, Eos(eOptionUse::OPT_RENDER_ANIM, eOptionIDs::OPT_FORMAT, _T("--format"), "png", SO_REQ_SEP, "\t--format= Format of the output file. Valid values are: bmp, jpg, png, ppm [default: jpg].\n")); + INITSTRINGOPTION(Format, Eos(eOptionUse::OPT_RENDER_ANIM, eOptionIDs::OPT_FORMAT, _T("--format"), "png", SO_REQ_SEP, "\t--format= Format of the output file. Valid values are: bmp, jpg, png, ppm [default: png].\n")); INITSTRINGOPTION(PalettePath, Eos(eOptionUse::OPT_USE_ALL, eOptionIDs::OPT_PALETTE_FILE, _T("--flam3_palettes"), "flam3-palettes.xml", SO_REQ_SEP, "\t--flam3_palettes= Path and name of the palette file [default: flam3-palettes.xml].\n")); //INITSTRINGOPTION(PaletteImage, Eos(eOptionUse::OPT_USE_ALL, eOptionIDs::OPT_PALETTE_IMAGE, _T("--image"), "", SO_REQ_SEP, "\t--image= Replace palette with png, jpg, or ppm image.\n")); INITSTRINGOPTION(Id, Eos(eOptionUse::OPT_USE_ALL, eOptionIDs::OPT_ID, _T("--id"), "", SO_REQ_SEP, "\t--id= ID to use in tags / image comments.\n")); @@ -483,6 +489,9 @@ public: PARSEUINTOPTION(eOptionIDs::OPT_MAX_XFORMS, MaxXforms); PARSEDOUBLEOPTION(eOptionIDs::OPT_SS, SizeScale);//Float args. PARSEDOUBLEOPTION(eOptionIDs::OPT_QS, QualityScale); + PARSEDOUBLEOPTION(eOptionIDs::OPT_QUALITY, Quality); + PARSEDOUBLEOPTION(eOptionIDs::OPT_DE_MIN, DeMin); + PARSEDOUBLEOPTION(eOptionIDs::OPT_DE_MAX, DeMax); PARSEDOUBLEOPTION(eOptionIDs::OPT_PIXEL_ASPECT, AspectRatio); PARSEDOUBLEOPTION(eOptionIDs::OPT_STAGGER, Stagger); PARSEDOUBLEOPTION(eOptionIDs::OPT_AVG_THRESH, AvgThresh); @@ -743,6 +752,9 @@ public: Eod SizeScale;//Value double. Eod QualityScale; + Eod Quality; + Eod DeMin; + Eod DeMax; Eod AspectRatio; Eod Stagger; Eod AvgThresh; diff --git a/Source/EmberGenome/EmberGenome.cpp b/Source/EmberGenome/EmberGenome.cpp index 138c286..b52a819 100644 --- a/Source/EmberGenome/EmberGenome.cpp +++ b/Source/EmberGenome/EmberGenome.cpp @@ -34,6 +34,14 @@ void SetDefaultTestValues(Ember& ember) ember.m_CurveDE = T(0.6); } +template +void FormatName(Ember& result, ostringstream& os, streamsize padding) +{ + os << std::setw(padding) << result.m_Time; + result.m_Name = os.str(); + os.str(""); +} + /// /// The core of the EmberGenome.exe program. /// Template argument expected to be float or double. @@ -381,6 +389,9 @@ bool EmberGenome(EmberOptions& opt) spread = 1 / T(opt.Frames()); frameCount = 0; + os.str(""); + os << setfill('0'); + auto padding = streamsize(std::log10(((opt.Frames() * opt.Loops()) + opt.Frames()) * embers.size())) + 1; for (i = 0; i < embers.size(); i++) { @@ -390,6 +401,7 @@ bool EmberGenome(EmberOptions& opt) { blend = T(frame) / T(opt.Frames()); tools.Spin(embers[i], pTemplate, result, frameCount++, blend);//Result is cleared and reassigned each time inside of Spin(). + FormatName(result, os, padding); cout << emberToXml.ToString(result, opt.Extras(), opt.PrintEditDepth(), !opt.NoEdits(), false, opt.HexPalette()); } @@ -399,6 +411,7 @@ bool EmberGenome(EmberOptions& opt) frame = size_t(std::round(opt.Frames() * opt.Loops())); blend = T(frame) / T(opt.Frames()); tools.Spin(embers[i], pTemplate, result, frameCount, blend);//Do not increment frameCount here. + FormatName(result, os, padding); } if (i < embers.size() - 1) @@ -412,6 +425,7 @@ bool EmberGenome(EmberOptions& opt) blend = frame / T(opt.Frames()); result.Clear(); tools.SpinInter(&embers[i], pTemplate, result, frameCount++, seqFlag, blend); + FormatName(result, os, padding); cout << emberToXml.ToString(result, opt.Extras(), opt.PrintEditDepth(), !opt.NoEdits(), false, opt.HexPalette()); } } @@ -419,6 +433,7 @@ bool EmberGenome(EmberOptions& opt) result = embers.back(); tools.Spin(embers.back(), pTemplate, result, frameCount, 0); + FormatName(result, os, padding); cout << emberToXml.ToString(result, opt.Extras(), opt.PrintEditDepth(), !opt.NoEdits(), false, opt.HexPalette()); if (opt.Enclosed()) diff --git a/Source/EmberRender/EmberRender.cpp b/Source/EmberRender/EmberRender.cpp index a1ccba7..5a9ccfa 100644 --- a/Source/EmberRender/EmberRender.cpp +++ b/Source/EmberRender/EmberRender.cpp @@ -172,6 +172,15 @@ bool EmberRender(EmberOptions& opt) if (opt.Supersample() > 0) embers[i].m_Supersample = opt.Supersample(); + if (opt.Quality() > 0) + embers[i].m_Quality = T(opt.Quality()); + + if (opt.DeMin() > -1) + embers[i].m_MinRadDE = T(opt.DeMin()); + + if (opt.DeMax() > -1) + embers[i].m_MaxRadDE = T(opt.DeMax()); + if (opt.SubBatchSize() != DEFAULT_SBS) embers[i].m_SubBatchSize = opt.SubBatchSize(); diff --git a/Source/EmberTester/EmberTester.cpp b/Source/EmberTester/EmberTester.cpp index 8816ce1..3d44d9e 100644 --- a/Source/EmberTester/EmberTester.cpp +++ b/Source/EmberTester/EmberTester.cpp @@ -567,7 +567,7 @@ bool TestVarEqual(const Variation* var1, const Variation
* var2) { if (!IsClose(params1[i].ParamVal(), (sT)params2[i].ParamVal(), sT(1e-4))) { - cout << "Param " << params1[i].Name() << " Val were not equal: " << params1[i].ParamVal() << " != " << params2[i].ParamVal() << endl; + cout << "Param " << params1[i].Name() << " Vals were not equal: " << params1[i].ParamVal() << " != " << params2[i].ParamVal() << endl; success = false; } } diff --git a/Source/Fractorium/EmberFile.h b/Source/Fractorium/EmberFile.h index 25bfbd8..c69d991 100644 --- a/Source/Fractorium/EmberFile.h +++ b/Source/Fractorium/EmberFile.h @@ -150,7 +150,9 @@ public: { endSection = str.section('_', -1); num = endSection.toULongLong(&ok); - ret.chop(str.size() - lastUnderscore); + + if (ok) + ret.chop(str.size() - lastUnderscore); } ret += "_" + QString::number(num + 1); @@ -180,7 +182,7 @@ public: newPath = path + base + "." + extension; } while (QFile::exists(newPath)); - + return newPath; } diff --git a/Source/Fractorium/Fractorium.h b/Source/Fractorium/Fractorium.h index cf078ad..3604838 100644 --- a/Source/Fractorium/Fractorium.h +++ b/Source/Fractorium/Fractorium.h @@ -149,6 +149,7 @@ public slots: void OnActionSP(bool checked); void OnActionDP(bool checked); void OnActionStyle(bool checked); + void OnActionStartStopRenderer(bool checked); //Library. void OnEmberTreeItemChanged(QTreeWidgetItem* item, int col); @@ -369,6 +370,7 @@ private: void ShutdownAndRecreateFromOptions(); bool CreateRendererFromOptions(); bool CreateControllerFromOptions(); + void EnableRenderControls(bool enable); //Dialogs. QStringList SetupOpenXmlDialog(); diff --git a/Source/Fractorium/Fractorium.qrc b/Source/Fractorium/Fractorium.qrc index b8604ce..2f3fffc 100644 --- a/Source/Fractorium/Fractorium.qrc +++ b/Source/Fractorium/Fractorium.qrc @@ -46,5 +46,7 @@ Icons/table_gear.png Icons/checkbox_checked.png Icons/checkbox_unchecked.png + Icons/control.png + Icons/control-stop-square.png diff --git a/Source/Fractorium/Fractorium.ui b/Source/Fractorium/Fractorium.ui index 34d0728..46a4dfd 100644 --- a/Source/Fractorium/Fractorium.ui +++ b/Source/Fractorium/Fractorium.ui @@ -7,7 +7,7 @@ 0 0 1451 - 953 + 1054 @@ -75,7 +75,7 @@ 0 0 1184 - 886 + 987 @@ -102,7 +102,7 @@ 0 0 240 - 881 + 981 @@ -157,7 +157,7 @@ 0 0 230 - 850 + 950 @@ -176,398 +176,6 @@ 0 - - - - true - - - - 0 - 0 - - - - - 0 - 22 - - - - - 16777215 - 22 - - - - Qt::NoFocus - - - QFrame::Panel - - - QFrame::Plain - - - Qt::ScrollBarAlwaysOff - - - Qt::ScrollBarAlwaysOff - - - false - - - false - - - false - - - 15 - - - false - - - 15 - - - true - - - false - - - 15 - - - false - - - 15 - - - - Filter - - - AlignHCenter|AlignTop - - - - - - - - true - - - - 0 - 0 - - - - - 0 - 22 - - - - - 16777215 - 22 - - - - Qt::NoFocus - - - QFrame::Panel - - - QFrame::Plain - - - Qt::ScrollBarAlwaysOff - - - Qt::ScrollBarAlwaysOff - - - QAbstractItemView::ScrollPerItem - - - QAbstractItemView::ScrollPerItem - - - false - - - false - - - false - - - 15 - - - false - - - 15 - - - true - - - false - - - 15 - - - false - - - 15 - - - - Color - - - AlignHCenter|AlignTop - - - - - - - - - 0 - 0 - - - - - 0 - 154 - - - - - 16777215 - 154 - - - - Qt::NoFocus - - - false - - - QFrame::Panel - - - QFrame::Plain - - - Qt::ScrollBarAlwaysOff - - - Qt::ScrollBarAlwaysOff - - - QAbstractItemView::NoEditTriggers - - - false - - - false - - - QAbstractItemView::NoSelection - - - QAbstractItemView::SelectItems - - - QAbstractItemView::ScrollPerPixel - - - QAbstractItemView::ScrollPerPixel - - - true - - - Qt::SolidLine - - - false - - - false - - - 2 - - - false - - - false - - - 110 - - - false - - - 35 - - - true - - - false - - - 22 - - - false - - - 22 - - - false - - - - Brightness - - - - - Gamma - - - - - Gamma Threshold - - - - - Vibrancy - - - - - Highlight Power - - - - - Background - - - - - Palette Mode - - - - - Field - - - - - - - - - - Brightness - - - - - 0 - - - - - Gamma - - - - - 0 - - - - - Gamma Threshold - - - - - 0 - - - - - Vibrancy - - - - - 0 - - - - - Highlight Power - - - - - 0 - - - - - Background - - - - - 0 - - - - - Palette Mode - - - - - 0 - - - - @@ -579,13 +187,13 @@ 0 - 154 + 88 16777215 - 154 + 88 @@ -686,21 +294,6 @@ Supersample - - - Temporal Samples - - - - - Affine Interpolation - - - - - Interpolation - - Field @@ -751,36 +344,6 @@ 0 - - - Temporal Samples - - - - - 0 - - - - - Affine Interpolation - - - - - 0 - - - - - Interpolation - - - - - 0 - - @@ -945,8 +508,11 @@ - - + + + + true + 0 @@ -956,13 +522,13 @@ 0 - 154 + 22 16777215 - 154 + 22 @@ -980,50 +546,29 @@ Qt::ScrollBarAlwaysOff - - QAbstractItemView::NoEditTriggers - - - false - - - false - - - QAbstractItemView::NoSelection - - QAbstractItemView::ScrollPerPixel + QAbstractItemView::ScrollPerItem - QAbstractItemView::ScrollPerPixel + QAbstractItemView::ScrollPerItem - true - - - Qt::SolidLine + false false - - 2 - false - - false - - 125 + 15 false - 35 + 15 true @@ -1032,136 +577,26 @@ false - 22 + 15 false - 22 + 15 - - false - - - - Spatial Filter Width - - - - - Spatial Filter Type - - - - - Temporal Filter Width - - - - - Temporal Filter Type - - - - - DE Filter Min Radius - - - - - DE Filter Max Radius - - - - - DE Curve - - - Field + Color + + + AlignHCenter|AlignTop - - - - - - - - Spatial Filter Width - - - - - 0 - - - - - Spatial Filter Type - - - - - 0 - - - - - Temporal Filter Width - - - - - 0 - - - - - Temporal Filter Type - - - - - 0 - - - - - DE Filter Min Radius - - - - - 0 - - - - - DE Filter Max Radius - - - - - 0 - - - - - DE Curve - - - - - 0 - - - - + + Qt::Vertical @@ -1176,6 +611,87 @@ + + + + true + + + + 0 + 0 + + + + + 0 + 22 + + + + + 16777215 + 22 + + + + Qt::NoFocus + + + QFrame::Panel + + + QFrame::Plain + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + false + + + false + + + false + + + 15 + + + false + + + 15 + + + true + + + false + + + 15 + + + false + + + 15 + + + + Filter + + + AlignHCenter|AlignTop + + + + @@ -1192,6 +708,22 @@ + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 5 + + + + @@ -1482,8 +1014,498 @@ - - + + + + + 0 + 0 + + + + + 0 + 110 + + + + + 16777215 + 110 + + + + Qt::NoFocus + + + QFrame::Panel + + + QFrame::Plain + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + QAbstractItemView::NoEditTriggers + + + false + + + false + + + QAbstractItemView::NoSelection + + + QAbstractItemView::ScrollPerPixel + + + QAbstractItemView::ScrollPerPixel + + + true + + + Qt::SolidLine + + + false + + + 2 + + + false + + + false + + + 125 + + + false + + + 35 + + + true + + + false + + + 22 + + + false + + + 22 + + + false + + + + Spatial Filter Width + + + + + Spatial Filter Type + + + + + DE Filter Min Radius + + + + + DE Filter Max Radius + + + + + DE Curve + + + + + Field + + + + + + + + + + Spatial Filter Width + + + + + 0 + + + + + Spatial Filter Type + + + + + 0 + + + + + DE Filter Min Radius + + + + + 0 + + + + + DE Filter Max Radius + + + + + 0 + + + + + DE Curve + + + + + 0 + + + + + + + + + 0 + 0 + + + + + 0 + 154 + + + + + 16777215 + 154 + + + + Qt::NoFocus + + + false + + + QFrame::Panel + + + QFrame::Plain + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + QAbstractItemView::NoEditTriggers + + + false + + + false + + + QAbstractItemView::NoSelection + + + QAbstractItemView::SelectItems + + + QAbstractItemView::ScrollPerPixel + + + QAbstractItemView::ScrollPerPixel + + + true + + + Qt::SolidLine + + + false + + + false + + + 2 + + + false + + + false + + + 110 + + + false + + + 35 + + + true + + + false + + + 22 + + + false + + + 22 + + + false + + + + Brightness + + + + + Gamma + + + + + Gamma Threshold + + + + + Vibrancy + + + + + Highlight Power + + + + + Background + + + + + Palette Mode + + + + + Field + + + + + + + + + + Brightness + + + + + 0 + + + + + Gamma + + + + + 0 + + + + + Gamma Threshold + + + + + 0 + + + + + Vibrancy + + + + + 0 + + + + + Highlight Power + + + + + 0 + + + + + Background + + + + + 0 + + + + + Palette Mode + + + + + 0 + + + + + + + + + 0 + 0 + + + + + 0 + 22 + + + + + 16777215 + 22 + + + + Qt::NoFocus + + + QFrame::Panel + + + QFrame::Plain + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + false + + + false + + + 1 + + + false + + + 15 + + + false + + + 15 + + + true + + + false + + + 15 + + + false + + + 15 + + + + Animation + + + AlignHCenter|AlignTop + + + + + + Qt::Vertical @@ -1498,8 +1520,149 @@ - - + + + + + 0 + 0 + + + + + 0 + 110 + + + + + 16777215 + 110 + + + + Qt::NoFocus + + + QFrame::Panel + + + QFrame::Plain + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::NoSelection + + + QAbstractItemView::ScrollPerPixel + + + QAbstractItemView::ScrollPerPixel + + + false + + + 2 + + + false + + + 125 + + + false + + + 35 + + + true + + + false + + + 22 + + + false + + + 22 + + + + Interpolation + + + + + Affine Interpolation + + + + + Temporal Samples + + + + + Temporal Filter Width + + + + + Temporal Filter Type + + + + + Field + + + + + + Interpolation + + + + + Affine Interpolation + + + + + Temporal Samples + + + + + Temporal Filter Width + + + + + Temporal Filter Type + + + + + + Qt::Vertical @@ -1509,7 +1672,7 @@ 20 - 300 + 20 @@ -6472,7 +6635,7 @@ 0 0 256 - 855 + 956 @@ -6561,6 +6724,7 @@ + @@ -6990,6 +7154,30 @@ Show QSS style editor + + + true + + + false + + + true + + + + :/Fractorium/Icons/control-stop-square.png:/Fractorium/Icons/control-stop-square.png + + + Stop Renderer + + + Stop Renderer + + + Ctrl+R + + diff --git a/Source/Fractorium/FractoriumMenus.cpp b/Source/Fractorium/FractoriumMenus.cpp index 3a72374..b8370ad 100644 --- a/Source/Fractorium/FractoriumMenus.cpp +++ b/Source/Fractorium/FractoriumMenus.cpp @@ -823,6 +823,8 @@ void Fractorium::OnFinalRenderClose(int result) { m_RenderStatusLabel->setText("Renderer starting..."); StartRenderTimer();//Re-create the renderer and start rendering again. + ui.ActionStartStopRenderer->setChecked(false);//Re-enable any controls that might have been disabled. + OnActionStartStopRenderer(false); } /// diff --git a/Source/Fractorium/FractoriumParams.cpp b/Source/Fractorium/FractoriumParams.cpp index a2bd65a..25bedef 100644 --- a/Source/Fractorium/FractoriumParams.cpp +++ b/Source/Fractorium/FractoriumParams.cpp @@ -20,8 +20,9 @@ void Fractorium::InitParamsUI() SetFixedTableHeader(ui.GeometryTableHeader->horizontalHeader()); SetFixedTableHeader(ui.FilterTableHeader->horizontalHeader()); SetFixedTableHeader(ui.IterationTableHeader->horizontalHeader()); + SetFixedTableHeader(ui.AnimationTableHeader->horizontalHeader()); //Color. - SetupSpinner(table, this, row, 1, m_BrightnessSpin, spinHeight, 0.05, 100, 1, SIGNAL(valueChanged(double)), SLOT(OnBrightnessChanged(double)), true, 4.0, 4.0, 4.0); + SetupSpinner(table, this, row, 1, m_BrightnessSpin, spinHeight, 0.05, 1000, 1, SIGNAL(valueChanged(double)), SLOT(OnBrightnessChanged(double)), true, 4.0, 4.0, 4.0); SetupSpinner(table, this, row, 1, m_GammaSpin, spinHeight, 1, 9999, 0.5, SIGNAL(valueChanged(double)), SLOT(OnGammaChanged(double)), true, 4.0, 4.0, 4.0); SetupSpinner(table, this, row, 1, m_GammaThresholdSpin, spinHeight, 0, 10, 0.01, SIGNAL(valueChanged(double)), SLOT(OnGammaThresholdChanged(double)), true, 0.1, 0.1, 0.0); SetupSpinner(table, this, row, 1, m_VibrancySpin, spinHeight, 0, 30, 0.01, SIGNAL(valueChanged(double)), SLOT(OnVibrancyChanged(double)), true, 1.0, 1.0, 0.0); @@ -65,9 +66,6 @@ void Fractorium::InitParamsUI() SetupSpinner(table, this, row, 1, m_SpatialFilterWidthSpin, spinHeight, 0.1, 10, 0.1, SIGNAL(valueChanged(double)), SLOT(OnSpatialFilterWidthChanged(double)), true, 1.0, 1.0, 1.0); comboVals = SpatialFilterCreator::FilterTypes(); SetupCombo(table, this, row, 1, m_SpatialFilterTypeCombo, comboVals, SIGNAL(currentIndexChanged(const QString&)), SLOT(OnSpatialFilterTypeComboCurrentIndexChanged(const QString&))); - SetupSpinner(table, this, row, 1, m_TemporalFilterWidthSpin, spinHeight, 1, 10, 1, SIGNAL(valueChanged(double)), SLOT(OnTemporalFilterWidthChanged(double)), true, 1); - comboVals = TemporalFilterCreator::FilterTypes(); - SetupCombo(table, this, row, 1, m_TemporalFilterTypeCombo, comboVals, SIGNAL(currentIndexChanged(const QString&)), SLOT(OnTemporalFilterTypeComboCurrentIndexChanged(const QString&))); SetupSpinner(table, this, row, 1, m_DEFilterMinRadiusSpin, spinHeight, 0, 25, 1, SIGNAL(valueChanged(double)), SLOT(OnDEFilterMinRadiusWidthChanged(double)), true, 0, 0, 0); SetupSpinner(table, this, row, 1, m_DEFilterMaxRadiusSpin, spinHeight, 0, 25, 1, SIGNAL(valueChanged(double)), SLOT(OnDEFilterMaxRadiusWidthChanged(double)), true, 0.0, 9.0, 0); SetupSpinner(table, this, row, 1, m_DECurveSpin, spinHeight, 0.15, 5, 0.1, SIGNAL(valueChanged(double)), SLOT(OnDEFilterCurveWidthChanged(double)), true, 0.4, 0.4, 0.4); @@ -78,15 +76,21 @@ void Fractorium::InitParamsUI() SetupSpinner( table, this, row, 1, m_FuseSpin, spinHeight, 1, 1000, 5, SIGNAL(valueChanged(int)), SLOT(OnFuseChanged(int)), true, 15, 15, 15); SetupSpinner(table, this, row, 1, m_QualitySpin, spinHeight, 1, dmax, 50, SIGNAL(valueChanged(double)), SLOT(OnQualityChanged(double)), true, 10, 10, 10); SetupSpinner( table, this, row, 1, m_SupersampleSpin, spinHeight, 1, 4, 1, SIGNAL(valueChanged(int)), SLOT(OnSupersampleChanged(int)), true, 1, 1, 1); - SetupSpinner( table, this, row, 1, m_TemporalSamplesSpin, spinHeight, 1, 5000, 1, SIGNAL(valueChanged(int)), SLOT(OnTemporalSamplesChanged(int)), true, 1000); - comboVals.clear(); - comboVals.push_back("Step"); - comboVals.push_back("Linear"); - SetupCombo(table, this, row, 1, m_AffineInterpTypeCombo, comboVals, SIGNAL(currentIndexChanged(int)), SLOT(OnAffineInterpTypeComboCurrentIndexChanged(int))); + //Animation. + row = 0; + table = ui.AnimationTable; comboVals.clear(); comboVals.push_back("Linear"); comboVals.push_back("Smooth"); SetupCombo(table, this, row, 1, m_InterpTypeCombo, comboVals, SIGNAL(currentIndexChanged(int)), SLOT(OnInterpTypeComboCurrentIndexChanged(int))); + comboVals.clear(); + comboVals.push_back("Step"); + comboVals.push_back("Linear"); + SetupCombo( table, this, row, 1, m_AffineInterpTypeCombo, comboVals, SIGNAL(currentIndexChanged(int)), SLOT(OnAffineInterpTypeComboCurrentIndexChanged(int))); + SetupSpinner( table, this, row, 1, m_TemporalSamplesSpin, spinHeight, 1, 5000, 1, SIGNAL(valueChanged(int)), SLOT(OnTemporalSamplesChanged(int)), true, 1000); + SetupSpinner(table, this, row, 1, m_TemporalFilterWidthSpin, spinHeight, 1, 10, 1, SIGNAL(valueChanged(double)), SLOT(OnTemporalFilterWidthChanged(double)), true, 1); + comboVals = TemporalFilterCreator::FilterTypes(); + SetupCombo( table, this, row, 1, m_TemporalFilterTypeCombo, comboVals, SIGNAL(currentIndexChanged(const QString&)), SLOT(OnTemporalFilterTypeComboCurrentIndexChanged(const QString&))); } /// diff --git a/Source/Fractorium/FractoriumRender.cpp b/Source/Fractorium/FractoriumRender.cpp index 52e2dd8..2f8e52b 100644 --- a/Source/Fractorium/FractoriumRender.cpp +++ b/Source/Fractorium/FractoriumRender.cpp @@ -606,6 +606,20 @@ bool FractoriumEmberController::CreateRenderer(eRendererType renderType, cons return ok; } +/// +/// Enable or disable the controls related to changing the renderer. +/// Used when pausing and restarting the renderer. +/// +/// True to enable, else false. +void Fractorium::EnableRenderControls(bool enable) +{ + ui.ActionCpu->setEnabled(enable); + ui.ActionCL->setEnabled(enable); + ui.ActionSP->setEnabled(enable); + ui.ActionDP->setEnabled(enable); + ui.ActionOptions->setEnabled(enable); +} + /// /// Wrapper to stop the timer, shutdown the controller and recreate, then restart the controller and renderer from the options. /// diff --git a/Source/Fractorium/FractoriumToolbar.cpp b/Source/Fractorium/FractoriumToolbar.cpp index 94278a6..8683d11 100644 --- a/Source/Fractorium/FractoriumToolbar.cpp +++ b/Source/Fractorium/FractoriumToolbar.cpp @@ -14,11 +14,12 @@ void Fractorium::InitToolbarUI() spGroup->addAction(ui.ActionSP); spGroup->addAction(ui.ActionDP); SyncOptionsToToolbar(); - connect(ui.ActionCpu, SIGNAL(triggered(bool)), this, SLOT(OnActionCpu(bool)), Qt::QueuedConnection); - connect(ui.ActionCL, SIGNAL(triggered(bool)), this, SLOT(OnActionCL(bool)), Qt::QueuedConnection); - connect(ui.ActionSP, SIGNAL(triggered(bool)), this, SLOT(OnActionSP(bool)), Qt::QueuedConnection); - connect(ui.ActionDP, SIGNAL(triggered(bool)), this, SLOT(OnActionDP(bool)), Qt::QueuedConnection); - connect(ui.ActionStyle, SIGNAL(triggered(bool)), this, SLOT(OnActionStyle(bool)), Qt::QueuedConnection); + connect(ui.ActionCpu, SIGNAL(triggered(bool)), this, SLOT(OnActionCpu(bool)), Qt::QueuedConnection); + connect(ui.ActionCL, SIGNAL(triggered(bool)), this, SLOT(OnActionCL(bool)), Qt::QueuedConnection); + connect(ui.ActionSP, SIGNAL(triggered(bool)), this, SLOT(OnActionSP(bool)), Qt::QueuedConnection); + connect(ui.ActionDP, SIGNAL(triggered(bool)), this, SLOT(OnActionDP(bool)), Qt::QueuedConnection); + connect(ui.ActionStyle, SIGNAL(triggered(bool)), this, SLOT(OnActionStyle(bool)), Qt::QueuedConnection); + connect(ui.ActionStartStopRenderer, SIGNAL(triggered(bool)), this, SLOT(OnActionStartStopRenderer(bool)), Qt::QueuedConnection); } /// @@ -82,6 +83,28 @@ void Fractorium::OnActionStyle(bool checked) m_QssDialog->show(); } +/// +/// Called when the start/stop renderer button is clicked. +/// +/// Check state, stop renderer if true, else start. +void Fractorium::OnActionStartStopRenderer(bool checked) +{ + EnableRenderControls(!checked); + + if (checked) + { + m_Controller->StopRenderTimer(true); + ui.ActionStartStopRenderer->setToolTip("Start Renderer"); + ui.ActionStartStopRenderer->setIcon(QIcon(":/Fractorium/Icons/control.png")); + } + else + { + m_Controller->StartRenderTimer(); + ui.ActionStartStopRenderer->setToolTip("Stop Renderer"); + ui.ActionStartStopRenderer->setIcon(QIcon(":/Fractorium/Icons/control-stop-square.png")); + } +} + /// /// Sync options data to the check state of the toolbar buttons. /// This does not trigger a clicked() event. diff --git a/Source/Fractorium/Icons/control-stop-square.png b/Source/Fractorium/Icons/control-stop-square.png new file mode 100644 index 0000000000000000000000000000000000000000..74018fb8f2b79bc40a154d576666a161bcc6d3d3 GIT binary patch literal 404 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL5ULAh?3y^w370~qEv>0#LT=By}Z;C1rt33 zJ2WcBZ7L=tq5p43V58YAstfZW7QD znN$Aj(bfsPF*j4fEevAL$)ri}GyG$<{?nE#$l|zD!EQkc^SakvPY;{;=J!0_VR+v7 zL^AX9&yhTb8=imO>3#pZLO-uWo8qo@hu@an&X~m(8oE$}>q%wb@4tMXZZxcWy(l;O zN@=go=?A~fzK(Lz0imH63UhDYds?)!!NzQX zM%RMfR(+ejWsU<)pW~0#LT=By}Z;C1rt33 zJS{BCOt*ryMOjbI2fN-+S*^C$55k zKL`G+98lc&-ugo4hto_l0`I>|Z_8!gqQs0K}+z;xKaB{cNHHr)$%O?>-=Zuz_t3R;kP>mz5$ zt6k>;oucQ8uUMtkar^DDKqu)~VU4a&E*4%HvtKu@{v$Py{RaEyr?axQo>kZc3_}J_ LS3j3^P6