mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2026-01-11 06:21:03 -05:00
--User changes:
-Show common folder locations such as documents, downloads, pictures in the sidebar in all file dialogs. -Warning message about exceeding memory in final render dialog now suggests strips as the solution to the problem. -Strips now has a tooltip explaining what it does. -Allow more digits in the spinners on the color section the flame tab. -Add manually adjustable size spinners in the final render dialog. Percentage scale and absolute size are fully synced. -Default prefix in final render is now the filename when doing animations (coming from sequence section of the library tab). -Changed the elliptic variation back to using a less precise version for float, and a more precise version for double. The last release had it always using double. -New applied xaos table that shows a read-only view of actual weights by taking the base xform weights and multiplying them by the xaos values. -New table in the xaos tab that gives a graphical representation of the probability that each xform is chosen, with and without xaos. -Add button to transpose the xaos rows and columns. -Add support for importing .chaos files from Chaotica. --Pasting back to Chaotica will work for most, but not all, variations due to incompatible parameter names in some. -Curves are now splines instead of Bezier. This adds compatibility with Chaotica, but breaks it for Apophysis. Xmls are still pastable, but the color curves will look different. --The curve editor on the palette tab can now add points by clicking on the lines and remove points by clicking on the points themselves, just like Chaotica. --Splines are saved in four new xml fields: overall_curve, red_curve, green_curve and blue_curve. -Allow for specifying the percentage of a sub batch each thread should iterate through per kernel call when running with OpenCL. This gives a roughly 1% performance increase due to having to make less kernel calls while iterating. --This field is present for interactive editing (where it's not very useful) and in the final render dialog. --On the command line, this is specified as --sbpctth for EmberRender and EmberAnimate. -Allow double clicking to toggle the supersample field in the flame tab between 1 and 2 for easily checking the effect of the field. -When showing affine values as polar coordinates, show angles normalized to 360 to match Chaotica. -Fuse Count spinner now toggles between 15 and 100 when double clicking for easily checking the effect of the field. -Added field for limiting the range in the x and y direction that the initial points are chosen from. -Added a field called K2 which is an alternative way to set brightness, ignored when zero. --This has no effect for many variations, but hs a noticeable effect for some. -Added new variations: arcsech arcsech2 arcsinh arctanh asteria block bwraps_rand circlecrop2 coth_spiral crackle2 depth_blur depth_blur2 depth_gaussian depth_gaussian2 depth_ngon depth_ngon2 depth_sine depth_sine2 dragonfire dspherical dust excinis exp2 flipx flowerdb foci_p gaussian glynnia2 glynnsim4 glynnsim5 henon henon hex_rand hex_truchet hypershift lazyjess lens lozi lozi modulusx modulusy oscilloscope2 point_symmetry pointsymmetry projective pulse rotate scry2 shift smartshape spher squares starblur2 swirl3 swirl3r tanh_spiral target0 target2 tile_hlp truchet_glyph truchet_inv truchet_knot unicorngaloshen vibration vibration2 --hex_truchet, hex_rand should always use double. They are extremely sensitive. --Bug fixes: -Bounds sign was flipped for x coordinate of world space when center was not zero. -Right clicking and dragging spinner showed menu on mouse up, even if it was very far away. -Text boxes for size in final render dialog were hard to type in. Same bug as xform weight used to be so fix the same way. -Fix spelling to be plural in toggle color speed box. -Stop using the blank user palette to generate flames. Either put colored palettes in it, or exclude it from randoms. -Clicking the random palette button for a palette file with only one palette in it would freeze the program. -Clicking none scale in final render did not re-render the preview. -Use less precision on random xaos. No need for 12 decimal places. -The term sub batch is overloaded in the options dialog. Change the naming and tooltip of those settings for cpu and opencl. --Also made clear in the tooltip for the default opencl quality setting that the value is per device. -The arrows spinner in palette editor appears like a read-only label. Made it look like a spinner. -Fix border colors for various spin boxes and table headers in the style sheet. Requires reload. -Fix a bug in the bwraps variation which would produce different results than Chaotica and Apophysis. -Synth was allowed to be selected for random flame generation when using an Nvidia card but it shouldn't have been because Nvidia has a hard time compiling synth. -A casting bug in the OpenCL kernels for log scaling and density filtering was preventing successful compilations on Intel iGPUs. Fixed even though we don't support anything other than AMD and Nvidia. -Palette rotation (click and drag) position was not being reset when loading a new flame. -When the xform circles were hidden, opening and closing the options dialog would improperly reshow them. -Double click toggle was broken on integer spin boxes. -Fixed tab order of some controls. -Creating a palette from a jpg in the palette editor only produced a single color. --Needed to package imageformats/qjpeg.dll with the Windows installer. -The basic memory benchmark test flame was not really testing memory. Make it more spread out. -Remove the temporal samples field from the flame tab, it was never used because it's only an animation parameter which is specified in the final render dialog or on the command line with EmberAnimate. --Code changes: -Add IsEmpty() to Palette to determine if a palette is all black. -Attempt to avoid selecting a blank palette in PaletteList::GetRandomPalette(). -Add function ScanForChaosNodes() and some associated helper functions in XmlToEmber. -Make variation param name correction be case insensitive in XmlToEmber. -Report error when assigning a variation param value in XmlToEmber. -Add SubBatchPercentPerThread() method to RendererCL. -Override enterEvent() and leaveEvent() in DoubleSpinBox and SpinBox to prevent the context menu from showing up on right mouse up after already leaving the spinner. -Filtering the mouse wheel event in TableWidget no longer appears to be needed. It was probably an old Qt bug that has been fixed. -Gui/ember syncing code in the final render dialog needed to be reworked to accommodate absolute sizes.
This commit is contained in:
@ -2,6 +2,9 @@
|
||||
|
||||
#include "Utils.h"
|
||||
#include "Isaac.h"
|
||||
#include "Curves.h"
|
||||
|
||||
#define CURVE_POINTS 5
|
||||
|
||||
/// <summary>
|
||||
/// Curves class.
|
||||
@ -10,8 +13,9 @@
|
||||
namespace EmberNs
|
||||
{
|
||||
/// <summary>
|
||||
/// The Bezier curves used to adjust the colors during final accumulation.
|
||||
/// This functionality was gotten directly from Apophysis.
|
||||
/// The b-spline curves used to adjust the colors during final accumulation.
|
||||
/// This functionality was gotten inferred from Chaotica.
|
||||
/// Note this is now incompatible with Apophysis, which uses Bezier curves instead.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class EMBER_API Curves
|
||||
@ -69,14 +73,23 @@ public:
|
||||
template <typename U>
|
||||
Curves<T>& operator = (const Curves<U>& curves)
|
||||
{
|
||||
for (size_t i = 0; i < 4; i++)
|
||||
int i = 0;
|
||||
|
||||
for (auto& pp : curves.m_Points)
|
||||
{
|
||||
m_Points[i][0].x = T(curves.m_Points[i][0].x); m_Points[i][0].y = T(curves.m_Points[i][0].y); m_Weights[i].x = T(curves.m_Weights[i].x);
|
||||
m_Points[i][1].x = T(curves.m_Points[i][1].x); m_Points[i][1].y = T(curves.m_Points[i][1].y); m_Weights[i].y = T(curves.m_Weights[i].y);
|
||||
m_Points[i][2].x = T(curves.m_Points[i][2].x); m_Points[i][2].y = T(curves.m_Points[i][2].y); m_Weights[i].z = T(curves.m_Weights[i].z);
|
||||
m_Points[i][3].x = T(curves.m_Points[i][3].x); m_Points[i][3].y = T(curves.m_Points[i][3].y); m_Weights[i].w = T(curves.m_Weights[i].w);
|
||||
int j = 0;
|
||||
m_Points[i].clear();
|
||||
|
||||
for (auto& p : pp)
|
||||
{
|
||||
m_Points[i].push_back(p);
|
||||
j++;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -88,13 +101,23 @@ public:
|
||||
template <typename U>
|
||||
Curves<T>& operator += (const Curves<U>& curves)
|
||||
{
|
||||
for (size_t i = 0; i < 4; i++)
|
||||
int i = 0;
|
||||
|
||||
for (auto& pp : m_Points)
|
||||
{
|
||||
m_Points[i][0] += curves.m_Points[i][0];
|
||||
m_Points[i][1] += curves.m_Points[i][1];
|
||||
m_Points[i][2] += curves.m_Points[i][2];
|
||||
m_Points[i][3] += curves.m_Points[i][3];
|
||||
m_Weights[i] += curves.m_Weights[i];
|
||||
int j = 0;
|
||||
|
||||
for (auto& p : pp)
|
||||
{
|
||||
if (j < curves.m_Points[i].size())
|
||||
p += curves.m_Points[i][j];
|
||||
else
|
||||
break;
|
||||
|
||||
j++;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
return *this;
|
||||
@ -108,13 +131,23 @@ public:
|
||||
template <typename U>
|
||||
Curves<T>& operator *= (const Curves<U>& curves)
|
||||
{
|
||||
for (size_t i = 0; i < 4; i++)
|
||||
int i = 0;
|
||||
|
||||
for (auto& pp : m_Points)
|
||||
{
|
||||
m_Points[i][0] *= curves.m_Points[i][0];
|
||||
m_Points[i][1] *= curves.m_Points[i][1];
|
||||
m_Points[i][2] *= curves.m_Points[i][2];
|
||||
m_Points[i][3] *= curves.m_Points[i][3];
|
||||
m_Weights[i] *= curves.m_Weights[i];
|
||||
int j = 0;
|
||||
|
||||
for (auto& p : pp)
|
||||
{
|
||||
if (j < curves.m_Points[i].size())
|
||||
p *= curves.m_Points[i][j];
|
||||
else
|
||||
break;
|
||||
|
||||
j++;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
return *this;
|
||||
@ -128,14 +161,9 @@ public:
|
||||
template <typename U>
|
||||
Curves<T>& operator *= (const U& t)
|
||||
{
|
||||
for (size_t i = 0; i < 4; i++)
|
||||
{
|
||||
m_Points[i][0] *= T(t);
|
||||
m_Points[i][1] *= T(t);
|
||||
m_Points[i][2] *= T(t);
|
||||
m_Points[i][3] *= T(t);
|
||||
m_Weights[i] *= T(t);
|
||||
}
|
||||
for (auto& pp : m_Points)
|
||||
for (auto& p : pp)
|
||||
p *= T(t);
|
||||
|
||||
return *this;
|
||||
}
|
||||
@ -147,11 +175,12 @@ public:
|
||||
{
|
||||
for (size_t i = 0; i < 4; i++)
|
||||
{
|
||||
m_Points[i][0] = v2T(0);//0,0 -> 0,0 -> 1,1 -> 1,1.
|
||||
m_Points[i][1] = v2T(0);
|
||||
m_Points[i][2] = v2T(1);
|
||||
m_Points[i][3] = v2T(1);
|
||||
m_Weights[i] = v4T(1);
|
||||
m_Points[i].resize(5);
|
||||
m_Points[i][0] = v2T(0);
|
||||
m_Points[i][1] = v2T(T(0.25));
|
||||
m_Points[i][2] = v2T(T(0.50));
|
||||
m_Points[i][3] = v2T(T(0.75));
|
||||
m_Points[i][4] = v2T(1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -162,11 +191,12 @@ public:
|
||||
{
|
||||
if (i < 4)
|
||||
{
|
||||
m_Points[i][0] = v2T(0);//0,0 -> 0,0 -> 1,1 -> 1,1.
|
||||
m_Points[i][1] = v2T(0);
|
||||
m_Points[i][2] = v2T(1);
|
||||
m_Points[i][3] = v2T(1);
|
||||
m_Weights[i] = v4T(1);
|
||||
m_Points[i].resize(5);
|
||||
m_Points[i][0] = v2T(0);
|
||||
m_Points[i][1] = v2T(T(0.25));
|
||||
m_Points[i][2] = v2T(T(0.50));
|
||||
m_Points[i][3] = v2T(T(0.75));
|
||||
m_Points[i][4] = v2T(1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -175,8 +205,8 @@ public:
|
||||
/// </summary>
|
||||
void Clear()
|
||||
{
|
||||
memset(&m_Points, 0, sizeof(m_Points));
|
||||
memset(&m_Weights, 0, sizeof(m_Weights));
|
||||
for (auto& p : m_Points)
|
||||
p.clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -189,10 +219,18 @@ public:
|
||||
|
||||
for (size_t i = 0; i < 4; i++)
|
||||
{
|
||||
if (m_Points[i].size() != CURVE_POINTS)
|
||||
{
|
||||
set = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if ((m_Points[i][0] != v2T(0)) ||
|
||||
(m_Points[i][1] != v2T(0)) ||
|
||||
(m_Points[i][2] != v2T(1)) ||
|
||||
(m_Points[i][3] != v2T(1)))
|
||||
(m_Points[i][1] != v2T(T(0.25))) ||
|
||||
(m_Points[i][2] != v2T(T(0.50))) ||
|
||||
(m_Points[i][3] != v2T(T(0.75))) ||
|
||||
(m_Points[i][4] != v2T(1))
|
||||
)
|
||||
{
|
||||
set = true;
|
||||
break;
|
||||
@ -202,52 +240,9 @@ public:
|
||||
return set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper around calling BezierSolve() on each of the 4 weight and point vectors.
|
||||
/// </summary>
|
||||
/// <param name="t">The position to apply</param>
|
||||
/// <returns>vec4<T> that contains the y component of the solution for each vector in each component</returns>
|
||||
v4T BezierFunc(const T& t)
|
||||
{
|
||||
v4T result;
|
||||
v2T solution(0, 0);
|
||||
BezierSolve(t, m_Points[0], &m_Weights[0], solution); result.x = solution.y;
|
||||
BezierSolve(t, m_Points[1], &m_Weights[1], solution); result.y = solution.y;
|
||||
BezierSolve(t, m_Points[2], &m_Weights[2], solution); result.z = solution.y;
|
||||
BezierSolve(t, m_Points[3], &m_Weights[3], solution); result.w = solution.y;
|
||||
return result;
|
||||
}
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
/// Solve the given point and weight vectors for the given position and store
|
||||
/// the output in the solution vec2 passed in.
|
||||
/// </summary>
|
||||
/// <param name="t">The position to apply</param>
|
||||
/// <param name="src">A pointer to an array of 4 vec2</param>
|
||||
/// <param name="w">A pointer to an array of 4 weights</param>
|
||||
/// <param name="solution">The vec2 to store the solution in</param>
|
||||
void BezierSolve(const T& t, v2T* src, v4T* w, v2T& solution)
|
||||
{
|
||||
T s = 1 - t;
|
||||
T s2 = s * s;
|
||||
T s3 = s * s * s;
|
||||
T t2 = t * t;
|
||||
T t3 = t * t * t;
|
||||
T nom_x = (w->x * s3 * src->x) + (w->y * s2 * 3 * t * src[1].x) + (w->z * s * 3 * t2 * src[2].x) + (w->w * t3 * src[3].x);
|
||||
T nom_y = (w->x * s3 * src->y) + (w->y * s2 * 3 * t * src[1].y) + (w->z * s * 3 * t2 * src[2].y) + (w->w * t3 * src[3].y);
|
||||
T denom = (w->x * s3) + (w->y * s2 * 3 * t) + (w->z * s * 3 * t2) + (w->w * t3);
|
||||
|
||||
if (std::isnan(nom_x) || std::isnan(nom_y) || std::isnan(denom) || denom == 0)
|
||||
return;
|
||||
|
||||
solution.x = nom_x / denom;
|
||||
solution.y = nom_y / denom;
|
||||
}
|
||||
|
||||
public:
|
||||
v2T m_Points[4][4];
|
||||
v4T m_Weights[4];
|
||||
std::array<std::vector<v2T>, 4> m_Points;
|
||||
};
|
||||
|
||||
//Must declare this outside of the class to provide for both orders of parameters.
|
||||
@ -264,14 +259,9 @@ Curves<T> operator * (const Curves<T>& curves, const U& t)
|
||||
T tt = T(t);
|
||||
Curves<T> c(curves);
|
||||
|
||||
for (size_t i = 0; i < 4; i++)
|
||||
{
|
||||
c.m_Points[i][0] *= tt;
|
||||
c.m_Points[i][1] *= tt;
|
||||
c.m_Points[i][2] *= tt;
|
||||
c.m_Points[i][3] *= tt;
|
||||
c.m_Weights[i] *= tt;
|
||||
}
|
||||
for (auto& pp : c.m_Points)
|
||||
for (auto& p : pp)
|
||||
p *= tt;
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
@ -31,6 +31,7 @@ template EMBER_API class QTIsaac<ISAAC_SIZE, ISAAC_INT>;
|
||||
#include "Xform.h"
|
||||
#include "EmberMotion.h"
|
||||
#include "EmberToXml.h"
|
||||
#include "Spline.h"
|
||||
#include "XmlToEmber.h"
|
||||
#include "SpatialFilter.h"
|
||||
#include "DensityFilter.h"
|
||||
@ -77,6 +78,8 @@ uint Timing::m_ProcessorCount;
|
||||
EXPORTPREPOSTREGVAR(Sinusoidal, T) \
|
||||
EXPORTPREPOSTREGVAR(Spherical, T) \
|
||||
EXPORTPREPOSTREGVAR(Swirl, T) \
|
||||
EXPORTPREPOSTREGVAR(Swirl3, T) \
|
||||
EXPORTPREPOSTREGVAR(Swirl3r, T) \
|
||||
EXPORTPREPOSTREGVAR(Horseshoe, T) \
|
||||
EXPORTPREPOSTREGVAR(Polar, T) \
|
||||
EXPORTPREPOSTREGVAR(Handkerchief, T) \
|
||||
@ -109,6 +112,7 @@ uint Timing::m_ProcessorCount;
|
||||
EXPORTPREPOSTREGVAR(JuliaScope, T) \
|
||||
EXPORTPREPOSTREGVAR(Blur, T) \
|
||||
EXPORTPREPOSTREGVAR(GaussianBlur, T) \
|
||||
EXPORTPREPOSTREGVAR(Gaussian, T) \
|
||||
EXPORTPREPOSTREGVAR(RadialBlur, T) \
|
||||
EXPORTPREPOSTREGVAR(Pie, T) \
|
||||
EXPORTPREPOSTREGVAR(Ngon, T) \
|
||||
@ -128,6 +132,7 @@ uint Timing::m_ProcessorCount;
|
||||
EXPORTPREPOSTREGVAR(Disc2, T) \
|
||||
EXPORTPREPOSTREGVAR(SuperShape, T) \
|
||||
EXPORTPREPOSTREGVAR(Flower, T) \
|
||||
EXPORTPREPOSTREGVAR(FlowerDb, T) \
|
||||
EXPORTPREPOSTREGVAR(Conic, T) \
|
||||
EXPORTPREPOSTREGVAR(Parabola, T) \
|
||||
EXPORTPREPOSTREGVAR(Bent2, T) \
|
||||
@ -145,9 +150,11 @@ uint Timing::m_ProcessorCount;
|
||||
EXPORTPREPOSTREGVAR(Loonie, T) \
|
||||
EXPORTPREPOSTREGVAR(Modulus, T) \
|
||||
EXPORTPREPOSTREGVAR(Oscilloscope, T) \
|
||||
EXPORTPREPOSTREGVAR(Oscilloscope2, T) \
|
||||
EXPORTPREPOSTREGVAR(Polar2, T) \
|
||||
EXPORTPREPOSTREGVAR(Popcorn2, T) \
|
||||
EXPORTPREPOSTREGVAR(Scry, T) \
|
||||
EXPORTPREPOSTREGVAR(Scry2, T) \
|
||||
EXPORTPREPOSTREGVAR(Separation, T) \
|
||||
EXPORTPREPOSTREGVAR(Split, T) \
|
||||
EXPORTPREPOSTREGVAR(Splits, T) \
|
||||
@ -158,6 +165,7 @@ uint Timing::m_ProcessorCount;
|
||||
EXPORTPREPOSTREGVAR(Whorl, T) \
|
||||
EXPORTPREPOSTREGVAR(Waves2, T) \
|
||||
EXPORTPREPOSTREGVAR(Exp, T) \
|
||||
EXPORTPREPOSTREGVAR(Exp2, T) \
|
||||
EXPORTPREPOSTREGVAR(Log, T) \
|
||||
EXPORTPREPOSTREGVAR(Sin, T) \
|
||||
EXPORTPREPOSTREGVAR(Cos, T) \
|
||||
@ -168,6 +176,7 @@ uint Timing::m_ProcessorCount;
|
||||
EXPORTPREPOSTREGVAR(Sinh, T) \
|
||||
EXPORTPREPOSTREGVAR(Cosh, T) \
|
||||
EXPORTPREPOSTREGVAR(Tanh, T) \
|
||||
EXPORTPREPOSTREGVAR(TanhSpiral, T) \
|
||||
EXPORTPREPOSTREGVAR(Sech, T) \
|
||||
EXPORTPREPOSTREGVAR(Csch, T) \
|
||||
EXPORTPREPOSTREGVAR(Coth, T) \
|
||||
@ -176,6 +185,7 @@ uint Timing::m_ProcessorCount;
|
||||
EXPORTPREPOSTREGVAR(Hemisphere, T) \
|
||||
EXPORTPREPOSTREGVAR(Epispiral, T) \
|
||||
EXPORTPREPOSTREGVAR(Bwraps, T) \
|
||||
EXPORTPREPOSTREGVAR(BwrapsRand, T) \
|
||||
EXPORTPREPOSTREGVAR(Extrude, T) \
|
||||
EXPORTPREPOSTREGVAR(BlurCircle, T) \
|
||||
EXPORTPREPOSTREGVAR(BlurZoom, T) \
|
||||
@ -196,6 +206,7 @@ uint Timing::m_ProcessorCount;
|
||||
EXPORTPREPOSTREGVAR(Fibonacci, T) \
|
||||
EXPORTPREPOSTREGVAR(Fibonacci2, T) \
|
||||
EXPORTPREPOSTREGVAR(Glynnia, T) \
|
||||
EXPORTPREPOSTREGVAR(Glynnia2, T) \
|
||||
EXPORTPREPOSTREGVAR(GridOut, T) \
|
||||
EXPORTPREPOSTREGVAR(Hole, T) \
|
||||
EXPORTPREPOSTREGVAR(Hypertile, T) \
|
||||
@ -241,6 +252,8 @@ uint Timing::m_ProcessorCount;
|
||||
EXPORTPREPOSTREGVAR(GlynnSim1, T) \
|
||||
EXPORTPREPOSTREGVAR(GlynnSim2, T) \
|
||||
EXPORTPREPOSTREGVAR(GlynnSim3, T) \
|
||||
EXPORTPREPOSTREGVAR(GlynnSim4, T) \
|
||||
EXPORTPREPOSTREGVAR(GlynnSim5, T) \
|
||||
EXPORTPREPOSTREGVAR(Starblur, T) \
|
||||
EXPORTPREPOSTREGVAR(Sineblur, T) \
|
||||
EXPORTPREPOSTREGVAR(Circleblur, T) \
|
||||
@ -255,6 +268,7 @@ uint Timing::m_ProcessorCount;
|
||||
EXPORTPREPOSTREGVAR(Ovoid3D, T) \
|
||||
EXPORTPREPOSTREGVAR(Spirograph, T) \
|
||||
EXPORTPREPOSTREGVAR(Petal, T) \
|
||||
EXPORTPREPOSTREGVAR(Spher, T) \
|
||||
EXPORTPREPOSTREGVAR(RoundSpher, T) \
|
||||
EXPORTPREPOSTREGVAR(RoundSpher3D, T) \
|
||||
EXPORTPREPOSTREGVAR(SpiralWing, T) \
|
||||
@ -267,6 +281,8 @@ uint Timing::m_ProcessorCount;
|
||||
EXPORTPREPOSTREGVAR(Lissajous, T) \
|
||||
EXPORTPREPOSTREGVAR(Svf, T) \
|
||||
EXPORTPREPOSTREGVAR(Target, T) \
|
||||
EXPORTPREPOSTREGVAR(Target0, T) \
|
||||
EXPORTPREPOSTREGVAR(Target2, T) \
|
||||
EXPORTPREPOSTREGVAR(Taurus, T) \
|
||||
EXPORTPREPOSTREGVAR(Collideoscope, T) \
|
||||
EXPORTPREPOSTREGVAR(BMod, T) \
|
||||
@ -275,6 +291,7 @@ uint Timing::m_ProcessorCount;
|
||||
EXPORTPREPOSTREGVAR(BCollide, T) \
|
||||
EXPORTPREPOSTREGVAR(Eclipse, T) \
|
||||
EXPORTPREPOSTREGVAR(FlipCircle, T) \
|
||||
EXPORTPREPOSTREGVAR(FlipX, T) \
|
||||
EXPORTPREPOSTREGVAR(FlipY, T) \
|
||||
EXPORTPREPOSTREGVAR(ECollide, T) \
|
||||
EXPORTPREPOSTREGVAR(EJulia, T) \
|
||||
@ -284,6 +301,7 @@ uint Timing::m_ProcessorCount;
|
||||
EXPORTPREPOSTREGVAR(ERotate, T) \
|
||||
EXPORTPREPOSTREGVAR(EScale, T) \
|
||||
EXPORTPREPOSTREGVAR(ESwirl, T) \
|
||||
EXPORTPREPOSTREGVAR(LazyJess, T) \
|
||||
EXPORTPREPOSTREGVAR(LazyTravis, T) \
|
||||
EXPORTPREPOSTREGVAR(Squish, T) \
|
||||
EXPORTPREPOSTREGVAR(Circus, T) \
|
||||
@ -311,6 +329,7 @@ uint Timing::m_ProcessorCount;
|
||||
EXPORTPREPOSTREGVAR(SuperShape3D, T) \
|
||||
EXPORTPREPOSTREGVAR(Sphyp3D, T) \
|
||||
EXPORTPREPOSTREGVAR(Circlecrop, T) \
|
||||
EXPORTPREPOSTREGVAR(Circlecrop2, T) \
|
||||
EXPORTPREPOSTREGVAR(Julian3Dx, T) \
|
||||
EXPORTPREPOSTREGVAR(Fourth, T) \
|
||||
EXPORTPREPOSTREGVAR(Mobiq, T) \
|
||||
@ -336,13 +355,13 @@ uint Timing::m_ProcessorCount;
|
||||
EXPORTPREPOSTREGVAR(Curvature, T) \
|
||||
EXPORTPREPOSTREGVAR(Qode, T) \
|
||||
EXPORTPREPOSTREGVAR(BlurHeart, T) \
|
||||
EXPORTPREPOSTREGVAR(Truchet, T) \
|
||||
EXPORTPREPOSTREGVAR(Gdoffs, T) \
|
||||
EXPORTPREPOSTREGVAR(Octagon, T) \
|
||||
EXPORTPREPOSTREGVAR(Trade, T) \
|
||||
EXPORTPREPOSTREGVAR(Juliac, T) \
|
||||
EXPORTPREPOSTREGVAR(Blade3D, T) \
|
||||
EXPORTPREPOSTREGVAR(Blob3D, T) \
|
||||
EXPORTPREPOSTREGVAR(Block, T) \
|
||||
EXPORTPREPOSTREGVAR(Blocky, T) \
|
||||
EXPORTPREPOSTREGVAR(Bubble2, T) \
|
||||
EXPORTPREPOSTREGVAR(CircleLinear, T) \
|
||||
@ -351,6 +370,7 @@ uint Timing::m_ProcessorCount;
|
||||
EXPORTPREPOSTREGVAR(Cubic3D, T) \
|
||||
EXPORTPREPOSTREGVAR(CubicLattice3D, T) \
|
||||
EXPORTPREPOSTREGVAR(Foci3D, T) \
|
||||
EXPORTPREPOSTREGVAR(FociP, T) \
|
||||
EXPORTPREPOSTREGVAR(Ho, T) \
|
||||
EXPORTPREPOSTREGVAR(Julia3Dq, T) \
|
||||
EXPORTPREPOSTREGVAR(Line, T) \
|
||||
@ -380,6 +400,7 @@ uint Timing::m_ProcessorCount;
|
||||
EXPORTPREPOSTREGVAR(BubbleT3D, T) \
|
||||
EXPORTPREPOSTREGVAR(Synth, T) \
|
||||
EXPORTPREPOSTREGVAR(Crackle, T) \
|
||||
EXPORTPREPOSTREGVAR(Crackle2, T) \
|
||||
EXPORTPREPOSTREGVAR(Erf, T) \
|
||||
EXPORTPREPOSTREGVAR(Xerf, T) \
|
||||
EXPORTPREPOSTREGVAR(W, T) \
|
||||
@ -398,7 +419,12 @@ uint Timing::m_ProcessorCount;
|
||||
EXPORTPREPOSTREGVAR(CircleSplit, T) \
|
||||
EXPORTPREPOSTREGVAR(Cylinder2, T) \
|
||||
EXPORTPREPOSTREGVAR(TileLog, T) \
|
||||
EXPORTPREPOSTREGVAR(TileHlp, T) \
|
||||
EXPORTPREPOSTREGVAR(Truchet, T) \
|
||||
EXPORTPREPOSTREGVAR(TruchetFill, T) \
|
||||
EXPORTPREPOSTREGVAR(TruchetGlyph, T) \
|
||||
EXPORTPREPOSTREGVAR(TruchetInv, T) \
|
||||
EXPORTPREPOSTREGVAR(TruchetKnot, T) \
|
||||
EXPORTPREPOSTREGVAR(Waves2Radial, T) \
|
||||
EXPORTPREPOSTREGVAR(Panorama1, T) \
|
||||
EXPORTPREPOSTREGVAR(Panorama2, T) \
|
||||
@ -408,7 +434,44 @@ uint Timing::m_ProcessorCount;
|
||||
EXPORTPREPOSTREGVAR(Cpow3, T) \
|
||||
EXPORTPREPOSTREGVAR(Concentric, T) \
|
||||
EXPORTPREPOSTREGVAR(Hypercrop, T) \
|
||||
EXPORTPREPOSTREGVAR(Hypershift, T) \
|
||||
EXPORTPREPOSTREGVAR(Hypershift2, T) \
|
||||
EXPORTPREPOSTREGVAR(Lens, T) \
|
||||
EXPORTPREPOSTREGVAR(Projective, T) \
|
||||
EXPORTPREPOSTREGVAR(DepthBlur, T) \
|
||||
EXPORTPREPOSTREGVAR(DepthBlur2, T) \
|
||||
EXPORTPREPOSTREGVAR(DepthGaussian, T) \
|
||||
EXPORTPREPOSTREGVAR(DepthGaussian2, T) \
|
||||
EXPORTPREPOSTREGVAR(DepthNgon, T) \
|
||||
EXPORTPREPOSTREGVAR(DepthNgon2, T) \
|
||||
EXPORTPREPOSTREGVAR(DepthSine, T) \
|
||||
EXPORTPREPOSTREGVAR(DepthSine2, T) \
|
||||
EXPORTPREPOSTREGVAR(CothSpiral, T) \
|
||||
EXPORTPREPOSTREGVAR(Dust, T) \
|
||||
EXPORTPREPOSTREGVAR(Asteria, T) \
|
||||
EXPORTPREPOSTREGVAR(Pulse, T) \
|
||||
EXPORTPREPOSTREGVAR(Excinis, T) \
|
||||
EXPORTPREPOSTREGVAR(Vibration, T) \
|
||||
EXPORTPREPOSTREGVAR(Vibration2, T) \
|
||||
EXPORTPREPOSTREGVAR(Arcsech, T) \
|
||||
EXPORTPREPOSTREGVAR(Arcsech2, T) \
|
||||
EXPORTPREPOSTREGVAR(Arcsinh, T) \
|
||||
EXPORTPREPOSTREGVAR(Arctanh, T) \
|
||||
EXPORTPREPOSTREGVAR(HexTruchet, T) \
|
||||
EXPORTPREPOSTREGVAR(HexRand, T) \
|
||||
EXPORTPREPOSTREGVAR(Smartshape, T) \
|
||||
EXPORTPREPOSTREGVAR(Squares, T) \
|
||||
EXPORTPREPOSTREGVAR(Starblur2, T) \
|
||||
EXPORTPREPOSTREGVAR(UnicornGaloshen, T) \
|
||||
EXPORTPREPOSTREGVAR(Dragonfire, T) \
|
||||
EXPORTPREPOSTREGVAR(Henon, T) \
|
||||
EXPORTPREPOSTREGVAR(Lozi, T) \
|
||||
EXPORTPREPOSTREGVAR(PointSymmetry, T) \
|
||||
EXPORTPREPOSTREGVAR(DSpherical, T) \
|
||||
EXPORTPREPOSTREGVAR(Modulusx, T) \
|
||||
EXPORTPREPOSTREGVAR(Modulusy, T) \
|
||||
EXPORTPREPOSTREGVAR(Rotate, T) \
|
||||
EXPORTPREPOSTREGVAR(Shift, T) \
|
||||
template EMBER_API class PostSmartcropVariation<T>; /*Only implemented as post.*/ \
|
||||
EXPORTPREPOSTREGVAR(DCBubble, T) \
|
||||
EXPORTPREPOSTREGVAR(DCCarpet, T) \
|
||||
@ -460,6 +523,7 @@ EXPORT_TWO_TYPE_EMBER(float, float)
|
||||
//Only ever use float palettes.
|
||||
template EMBER_API class Palette<float>;
|
||||
template EMBER_API class PaletteList<float>;
|
||||
template EMBER_API class Spline<float>;
|
||||
|
||||
#ifdef DO_DOUBLE
|
||||
EXPORT_SINGLE_TYPE_EMBER(double)
|
||||
|
||||
@ -106,6 +106,7 @@ public:
|
||||
m_OrigFinalRasW = ember.m_OrigFinalRasW;
|
||||
m_OrigFinalRasH = ember.m_OrigFinalRasH;
|
||||
m_OrigPixPerUnit = T(ember.m_OrigPixPerUnit);
|
||||
m_RandPointRange = T(ember.m_RandPointRange);
|
||||
m_SubBatchSize = ember.m_SubBatchSize;
|
||||
m_FuseCount = ember.m_FuseCount;
|
||||
m_Supersample = ember.m_Supersample;
|
||||
@ -129,6 +130,7 @@ public:
|
||||
m_Vibrancy = T(ember.m_Vibrancy);
|
||||
m_GammaThresh = T(ember.m_GammaThresh);
|
||||
m_HighlightPower = T(ember.m_HighlightPower);
|
||||
m_K2 = T(ember.m_K2);
|
||||
m_Time = T(ember.m_Time);
|
||||
m_Background = ember.m_Background;
|
||||
m_Interp = ember.m_Interp;
|
||||
@ -530,6 +532,7 @@ public:
|
||||
/// <param name="width">New width</param>
|
||||
/// <param name="height">New height</param>
|
||||
/// <param name="onlyScaleIfNewIsSmaller">True to only scale if the new dimensions are smaller than the original, else always scale.</param>
|
||||
/// <param name="scaleType">Scale type used to specify how the image should be zoomed using the scale variable with respect to the new size. Possible scaling modes are: width, height, none.</param>
|
||||
void SetSizeAndAdjustScale(size_t width, size_t height, bool onlyScaleIfNewIsSmaller, eScaleType scaleType)
|
||||
{
|
||||
if ((onlyScaleIfNewIsSmaller && (width < m_OrigFinalRasW || height < m_OrigFinalRasH)) || !onlyScaleIfNewIsSmaller)
|
||||
@ -538,6 +541,8 @@ public:
|
||||
m_PixelsPerUnit = m_OrigPixPerUnit * (T(width) / T(m_OrigFinalRasW));
|
||||
else if (scaleType == eScaleType::SCALE_HEIGHT)
|
||||
m_PixelsPerUnit = m_OrigPixPerUnit * (T(height) / T(m_OrigFinalRasH));
|
||||
else
|
||||
m_PixelsPerUnit = m_OrigPixPerUnit;
|
||||
}
|
||||
|
||||
m_ScaleType = scaleType;
|
||||
@ -744,6 +749,7 @@ public:
|
||||
InterpI<&Ember<T>::m_FinalRasW>(embers, coefs, size);
|
||||
InterpI<&Ember<T>::m_FinalRasH>(embers, coefs, size);
|
||||
InterpI<&Ember<T>::m_SubBatchSize>(embers, coefs, size);
|
||||
InterpT<&Ember<T>::m_RandPointRange>(embers, coefs, size);
|
||||
InterpI<&Ember<T>::m_FuseCount>(embers, coefs, size);
|
||||
InterpI<&Ember<T>::m_Supersample>(embers, coefs, size);
|
||||
InterpI<&Ember<T>::m_TemporalSamples>(embers, coefs, size);
|
||||
@ -765,6 +771,7 @@ public:
|
||||
InterpT<&Ember<T>::m_Vibrancy>(embers, coefs, size);
|
||||
InterpT<&Ember<T>::m_GammaThresh>(embers, coefs, size);
|
||||
InterpT<&Ember<T>::m_HighlightPower>(embers, coefs, size);
|
||||
InterpT<&Ember<T>::m_K2>(embers, coefs, size);
|
||||
InterpX<Color<T>, &Ember<T>::m_Background>(embers, coefs, size); m_Background.a = bgAlphaSave;//Don't interp alpha.
|
||||
InterpT<&Ember<T>::m_TemporalFilterExp>(embers, coefs, size);
|
||||
InterpT<&Ember<T>::m_TemporalFilterWidth>(embers, coefs, size);
|
||||
@ -1309,6 +1316,14 @@ public:
|
||||
APP_FMP(m_HighlightPower);
|
||||
break;
|
||||
|
||||
case eEmberMotionParam::FLAME_MOTION_K2:
|
||||
APP_FMP(m_K2);
|
||||
break;
|
||||
|
||||
case eEmberMotionParam::FLAME_MOTION_RAND_RANGE:
|
||||
APP_FMP(m_RandPointRange);
|
||||
break;
|
||||
|
||||
case eEmberMotionParam::FLAME_MOTION_BACKGROUND_R:
|
||||
APP_FMP(m_Background.r);
|
||||
break;
|
||||
@ -1359,6 +1374,7 @@ public:
|
||||
{
|
||||
//If defaults are on, set to reasonable values.
|
||||
m_HighlightPower = 1;
|
||||
m_K2 = 0;
|
||||
m_Background.Reset();
|
||||
m_FinalRasW = 100;
|
||||
m_FinalRasH = 100;
|
||||
@ -1375,6 +1391,7 @@ public:
|
||||
m_CamMat = m3T(0);
|
||||
m_Quality = 1;
|
||||
m_SubBatchSize = 10240;
|
||||
m_RandPointRange = 1;
|
||||
m_FuseCount = 15;
|
||||
m_MaxRadDE = T(9.0);
|
||||
m_MinRadDE = 0;
|
||||
@ -1393,6 +1410,7 @@ public:
|
||||
{
|
||||
//Defaults are off, so set to UN-reasonable values.
|
||||
m_HighlightPower = -1;
|
||||
m_K2 = -1;
|
||||
m_Background = Color<T>(-1, -1, -1, 1);
|
||||
m_FinalRasW = 0;
|
||||
m_FinalRasH = 0;
|
||||
@ -1409,6 +1427,7 @@ public:
|
||||
m_CamMat = m3T(999999);
|
||||
m_Quality = -1;
|
||||
m_SubBatchSize = 0;
|
||||
m_RandPointRange = 0;
|
||||
m_FuseCount = 0;
|
||||
m_MaxRadDE = -1;
|
||||
m_MinRadDE = -1;
|
||||
@ -1459,6 +1478,7 @@ public:
|
||||
<< "Quality: " << m_Quality << "\n"
|
||||
<< "Pixels Per Unit: " << m_PixelsPerUnit << "\n"
|
||||
<< "Original Pixels Per Unit: " << m_OrigPixPerUnit << "\n"
|
||||
<< "Initial Point Range: " << m_RandPointRange << "\n"
|
||||
<< "Sub Batch Size: " << m_SubBatchSize << "\n"
|
||||
<< "Fuse Count: " << m_FuseCount << "\n"
|
||||
<< "Zoom: " << m_Zoom << "\n"
|
||||
@ -1476,6 +1496,7 @@ public:
|
||||
<< "Vibrancy: " << m_Vibrancy << "\n"
|
||||
<< "Gamma Threshold: " << m_GammaThresh << "\n"
|
||||
<< "Highlight Power: " << m_HighlightPower << "\n"
|
||||
<< "K2: " << m_K2 << "\n"
|
||||
<< "Time: " << m_Time << "\n"
|
||||
<< "Background: " << m_Background.r << ", " << m_Background.g << ", " << m_Background.b << ", " << m_Background.a << "\n"
|
||||
<< "Interp: " << m_Interp << "\n"
|
||||
@ -1531,6 +1552,10 @@ public:
|
||||
size_t m_OrigFinalRasH = 1080;//the dimension may change in an editor and the originals are needed for the aspect ratio.
|
||||
T m_OrigPixPerUnit = 240;
|
||||
|
||||
//The range in the x and y directions from the center of the world space from which the initial random point will be selected at the start of each sub batch.
|
||||
//Or when recovering from a bad point.
|
||||
T m_RandPointRange = 1;
|
||||
|
||||
//The iteration depth. This was a rendering parameter in flam3 but has been made a member here
|
||||
//so that it can be adjusted more easily.
|
||||
size_t m_SubBatchSize = DEFAULT_SBS;
|
||||
@ -1628,6 +1653,9 @@ public:
|
||||
//Xml field: "highlight_power".
|
||||
T m_HighlightPower = 1;
|
||||
|
||||
//An alternative way to set brightness, ignored when zero.
|
||||
T m_K2 = 0;
|
||||
|
||||
//When animating a file full of many embers, this value is used to specify the time in the animation
|
||||
//that this ember should be rendered. They must all be sequential and increase by a default value of 1.
|
||||
//Xml field: "time".
|
||||
|
||||
@ -37,7 +37,7 @@ static void sincos(float x, float* s, float* c)
|
||||
|
||||
namespace EmberNs
|
||||
{
|
||||
#define EMBER_VERSION "1.0.0.14"
|
||||
#define EMBER_VERSION "1.0.0.15"
|
||||
#define EPS6 T(1e-6)
|
||||
#define EPS std::numeric_limits<T>::epsilon()//Apoplugin.h uses -20, but it's more mathematically correct to do it this way.
|
||||
#define ISAAC_SIZE 4
|
||||
@ -106,6 +106,7 @@ static inline size_t NowMs() { return duration_cast<milliseconds>(Clock::now().t
|
||||
#define v2T glm::tvec2<T, glm::defaultp>
|
||||
#define v3T glm::tvec3<T, glm::defaultp>
|
||||
#define v4T glm::tvec4<T, glm::defaultp>
|
||||
#define v2F glm::tvec2<float, glm::defaultp>
|
||||
#define v4F glm::tvec4<float, glm::defaultp>
|
||||
#define v4D glm::tvec4<double, glm::defaultp>
|
||||
#define v4bT glm::tvec4<bucketT, glm::defaultp>
|
||||
@ -118,6 +119,7 @@ static inline size_t NowMs() { return duration_cast<milliseconds>(Clock::now().t
|
||||
#define v2T glm::detail::tvec2<T, glm::defaultp>
|
||||
#define v3T glm::detail::tvec3<T, glm::defaultp>
|
||||
#define v4T glm::detail::tvec4<T, glm::defaultp>
|
||||
#define v2F glm::detail::tvec2<float, glm::defaultp>
|
||||
#define v4F glm::detail::tvec4<float, glm::defaultp>
|
||||
#define v4D glm::detail::tvec4<double, glm::defaultp>
|
||||
#define v4bT glm::detail::tvec4<bucketT, glm::defaultp>
|
||||
@ -154,6 +156,8 @@ enum class eEmberMotionParam : et//These must remain in this order forever.
|
||||
FLAME_MOTION_GAMMA,
|
||||
FLAME_MOTION_GAMMA_THRESH,
|
||||
FLAME_MOTION_HIGHLIGHT_POWER,
|
||||
FLAME_MOTION_K2,
|
||||
FLAME_MOTION_RAND_RANGE,
|
||||
FLAME_MOTION_BACKGROUND_R,
|
||||
FLAME_MOTION_BACKGROUND_G,
|
||||
FLAME_MOTION_BACKGROUND_B,
|
||||
|
||||
@ -143,10 +143,12 @@ string EmberToXml<T>::ToString(Ember<T>& ember, const string& extraAttributes, s
|
||||
os << " temporal_samples=\"" << ember.m_TemporalSamples << "\"";
|
||||
os << " sub_batch_size=\"" << ember.m_SubBatchSize << "\"";
|
||||
os << " fuse=\"" << ember.m_FuseCount << "\"";
|
||||
os << " rand_range=\"" << ember.m_RandPointRange << "\"";
|
||||
os << " background=\"" << ember.m_Background.r << " " << ember.m_Background.g << " " << ember.m_Background.b << "\"";
|
||||
os << " brightness=\"" << ember.m_Brightness << "\"";
|
||||
os << " gamma=\"" << ember.m_Gamma << "\"";
|
||||
os << " highlight_power=\"" << ember.m_HighlightPower << "\"";
|
||||
os << " logscale_k2=\"" << ember.m_K2 << "\"";
|
||||
os << " vibrancy=\"" << ember.m_Vibrancy << "\"";
|
||||
os << " estimator_radius=\"" << ember.m_MaxRadDE << "\"";
|
||||
os << " estimator_minimum=\"" << ember.m_MinRadDE << "\"";
|
||||
@ -200,10 +202,42 @@ string EmberToXml<T>::ToString(Ember<T>& ember, const string& extraAttributes, s
|
||||
{
|
||||
os << ember.m_Curves.m_Points[ci][cj].x << " ";
|
||||
os << ember.m_Curves.m_Points[ci][cj].y << " ";
|
||||
os << ember.m_Curves.m_Weights[ci][cj] << " ";
|
||||
os << "1 ";
|
||||
}
|
||||
}
|
||||
|
||||
os << "\" overall_curve=\"";
|
||||
|
||||
for (glm::length_t cj = 0; cj < ember.m_Curves.m_Points[0].size(); cj++)
|
||||
{
|
||||
os << ember.m_Curves.m_Points[0][cj].x << " ";
|
||||
os << ember.m_Curves.m_Points[0][cj].y << " ";
|
||||
}
|
||||
|
||||
os << "\" red_curve=\"";
|
||||
|
||||
for (glm::length_t cj = 0; cj < ember.m_Curves.m_Points[1].size(); cj++)
|
||||
{
|
||||
os << ember.m_Curves.m_Points[1][cj].x << " ";
|
||||
os << ember.m_Curves.m_Points[1][cj].y << " ";
|
||||
}
|
||||
|
||||
os << "\" green_curve=\"";
|
||||
|
||||
for (glm::length_t cj = 0; cj < ember.m_Curves.m_Points[2].size(); cj++)
|
||||
{
|
||||
os << ember.m_Curves.m_Points[2][cj].x << " ";
|
||||
os << ember.m_Curves.m_Points[2][cj].y << " ";
|
||||
}
|
||||
|
||||
os << "\" blue_curve=\"";
|
||||
|
||||
for (glm::length_t cj = 0; cj < ember.m_Curves.m_Points[3].size(); cj++)
|
||||
{
|
||||
os << ember.m_Curves.m_Points[3][cj].x << " ";
|
||||
os << ember.m_Curves.m_Points[3][cj].y << " ";
|
||||
}
|
||||
|
||||
os << "\">\n";
|
||||
|
||||
for (i = 0; i < ember.m_EmberMotionElements.size(); ++i)
|
||||
@ -813,6 +847,14 @@ string EmberToXml<T>::ToString(const EmberMotion<T>& motion)
|
||||
os << " highlight_power=\"" << motion.m_MotionParams[i].second << "\"";
|
||||
break;
|
||||
|
||||
case eEmberMotionParam::FLAME_MOTION_K2:
|
||||
os << " logscale_k2=\"" << motion.m_MotionParams[i].second << "\"";
|
||||
break;
|
||||
|
||||
case eEmberMotionParam::FLAME_MOTION_RAND_RANGE:
|
||||
os << " rand_range=\"" << motion.m_MotionParams[i].second << "\"";
|
||||
break;
|
||||
|
||||
case eEmberMotionParam::FLAME_MOTION_BACKGROUND_R:
|
||||
r = motion.m_MotionParams[i].second;
|
||||
break;
|
||||
|
||||
@ -15,9 +15,7 @@ namespace EmberNs
|
||||
using Iterator<T>::NextXformFromIndex; \
|
||||
using Iterator<T>::DoFinalXform; \
|
||||
using Iterator<T>::DoBadVals;
|
||||
|
||||
template <typename T, typename bucketT> class Renderer;
|
||||
|
||||
|
||||
template <typename T>
|
||||
struct IterParams
|
||||
{
|
||||
@ -40,7 +38,7 @@ struct IterParams
|
||||
/// Flam3 needlessly computed the final xform on each fuse iteration only to throw it away. It's omitted here as an optimization.
|
||||
/// Rather than place many conditionals inside the iteration loop, they are broken into separate classes depending
|
||||
/// on what's contained in the ember's xforms.
|
||||
/// The biggest difference is whether xaos is present or not it requires extra work when picking
|
||||
/// The biggest difference is whether xaos is present or not, since it requires extra work when picking
|
||||
/// the next random xform to use. Further, each of those is broken into two loops, one for embers with a final xform
|
||||
/// and one without.
|
||||
/// Last, the fuse loop and real loop are separated and duplicated to omit the conditional check for fuse inside the real loop.
|
||||
@ -52,9 +50,12 @@ class EMBER_API Iterator
|
||||
{
|
||||
public:
|
||||
/// <summary>
|
||||
/// Empty constructor and virtual destructor so proper derived class destructors get called.
|
||||
/// Constructor that takes a pointer to the renderer which is calling this and a virtual destructor so proper derived class destructors get called.
|
||||
/// </summary>
|
||||
Iterator() = default;
|
||||
Iterator()
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~Iterator() = default;
|
||||
Iterator(const Iterator<T>& iter) = delete;
|
||||
|
||||
@ -196,11 +197,12 @@ protected:
|
||||
/// the coordinates of the output point are just set to a random number between -1 and 1.
|
||||
/// </summary>
|
||||
/// <param name="xforms">The xforms array</param>
|
||||
/// <param name="range">The range in the x and y directions from the center of the world spcae from which to select the new random point</param>
|
||||
/// <param name="badVals">The counter for the total number of bad values this sub batch</param>
|
||||
/// <param name="point">The point which initially had the bad values and which will store the newly computed values</param>
|
||||
/// <param name="rand">The random context this iterator is using</param>
|
||||
/// <returns>True if a good value was computed within 5 tries, else false</returns>
|
||||
inline bool DoBadVals(Xform<T>* xforms, size_t& badVals, Point<T>* point, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand)
|
||||
inline bool DoBadVals(Xform<T>* xforms, T range, size_t& badVals, Point<T>* point, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand)
|
||||
{
|
||||
size_t xformIndex, consec = 0;
|
||||
Point<T> firstBadPoint;
|
||||
@ -209,8 +211,8 @@ protected:
|
||||
{
|
||||
consec++;
|
||||
badVals++;
|
||||
firstBadPoint.m_X = rand.Frand11<T>();//Re-randomize points, but keep the computed color and viz.
|
||||
firstBadPoint.m_Y = rand.Frand11<T>();
|
||||
firstBadPoint.m_X = rand.template Frand<T>(-range, range);//Re-randomize points, but keep the computed color and viz.
|
||||
firstBadPoint.m_Y = rand.template Frand<T>(-range, range);
|
||||
firstBadPoint.m_Z = 0;
|
||||
firstBadPoint.m_ColorX = point->m_ColorX;
|
||||
firstBadPoint.m_Opacity = point->m_Opacity;
|
||||
@ -223,8 +225,8 @@ protected:
|
||||
//After 5 tries, nothing worked, so just assign random values between -1 and 1.
|
||||
if (consec == 5)
|
||||
{
|
||||
point->m_X = rand.Frand11<T>();
|
||||
point->m_Y = rand.Frand11<T>();
|
||||
point->m_X = rand.template Frand<T>(-range, range);
|
||||
point->m_Y = rand.template Frand<T>(-range, range);
|
||||
point->m_Z = 0;
|
||||
}
|
||||
|
||||
@ -310,7 +312,7 @@ public:
|
||||
for (i = 0; i < params.m_Skip; i++)//Fuse.
|
||||
{
|
||||
if (xforms[NextXformFromIndex(rand.Rand())].Apply(&p1, &p1, rand))
|
||||
DoBadVals(xforms, badVals, &p1, rand);
|
||||
DoBadVals(xforms, ember.m_RandPointRange, badVals, &p1, rand);
|
||||
}
|
||||
|
||||
DoFinalXform(ember, p1, samples, rand);//Apply to last fuse point and store as the first element in samples.
|
||||
@ -319,7 +321,7 @@ public:
|
||||
for (i = 1; i < params.m_Count; i++)//Real loop.
|
||||
{
|
||||
if (xforms[NextXformFromIndex(rand.Rand())].Apply(&p1, &p1, rand))
|
||||
DoBadVals(xforms, badVals, &p1, rand);
|
||||
DoBadVals(xforms, ember.m_RandPointRange, badVals, &p1, rand);
|
||||
|
||||
DoFinalXform(ember, p1, samples + i, rand);
|
||||
ember.Proj(samples[i], rand);
|
||||
@ -332,7 +334,7 @@ public:
|
||||
for (i = 0; i < params.m_Skip; i++)//Fuse.
|
||||
{
|
||||
if (xforms[NextXformFromIndex(rand.Rand())].Apply(&p1, &p1, rand))
|
||||
DoBadVals(xforms, badVals, &p1, rand);
|
||||
DoBadVals(xforms, ember.m_RandPointRange, badVals, &p1, rand);
|
||||
}
|
||||
|
||||
samples[0] = p1;
|
||||
@ -341,7 +343,7 @@ public:
|
||||
for (i = 1; i < params.m_Count; i++)//Real loop.
|
||||
{
|
||||
if (xforms[NextXformFromIndex(rand.Rand())].Apply(&p1, &samples[i], rand))
|
||||
DoBadVals(xforms, badVals, samples + i, rand);
|
||||
DoBadVals(xforms, ember.m_RandPointRange, badVals, samples + i, rand);
|
||||
|
||||
p1 = samples[i];
|
||||
ember.Proj(samples[i], rand);
|
||||
@ -357,7 +359,7 @@ public:
|
||||
for (i = 0; i < params.m_Skip; i++)//Fuse.
|
||||
{
|
||||
if (xforms[NextXformFromIndex(rand.Rand())].Apply(&p1, &p1, rand))
|
||||
DoBadVals(xforms, badVals, &p1, rand);
|
||||
DoBadVals(xforms, ember.m_RandPointRange, badVals, &p1, rand);
|
||||
}
|
||||
|
||||
DoFinalXform(ember, p1, samples, rand);//Apply to last fuse point and store as the first element in samples.
|
||||
@ -365,7 +367,7 @@ public:
|
||||
for (i = 1; i < params.m_Count; i++)//Real loop.
|
||||
{
|
||||
if (xforms[NextXformFromIndex(rand.Rand())].Apply(&p1, &p1, rand))//Feed the resulting value of applying the randomly selected xform back into the next iter, and not the result of applying the final xform.
|
||||
DoBadVals(xforms, badVals, &p1, rand);
|
||||
DoBadVals(xforms, ember.m_RandPointRange, badVals, &p1, rand);
|
||||
|
||||
DoFinalXform(ember, p1, samples + i, rand);
|
||||
}
|
||||
@ -377,7 +379,7 @@ public:
|
||||
for (i = 0; i < params.m_Skip; i++)//Fuse.
|
||||
{
|
||||
if (xforms[NextXformFromIndex(rand.Rand())].Apply(&p1, &p1, rand))
|
||||
DoBadVals(xforms, badVals, &p1, rand);
|
||||
DoBadVals(xforms, ember.m_RandPointRange, badVals, &p1, rand);
|
||||
}
|
||||
|
||||
samples[0] = p1;
|
||||
@ -385,7 +387,7 @@ public:
|
||||
for (i = 0; i < params.m_Count - 1; i++)//Real loop.
|
||||
{
|
||||
if (xforms[NextXformFromIndex(rand.Rand())].Apply(samples + i, samples + i + 1, rand))
|
||||
DoBadVals(xforms, badVals, samples + i + 1, rand);
|
||||
DoBadVals(xforms, ember.m_RandPointRange, badVals, samples + i + 1, rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -415,12 +417,13 @@ public:
|
||||
/// </summary>
|
||||
/// <param name="xforms">The xforms array</param>
|
||||
/// <param name="xformIndex">Index of the last used xform before calling this function</param>
|
||||
/// <param name="range">The range in the x and y directions from the center of the world spcae from which to select the new random point</param>
|
||||
/// <param name="lastXformUsed">The saved index of the last xform used within this function</param>
|
||||
/// <param name="badVals">The counter for the total number of bad values this sub batch</param>
|
||||
/// <param name="point">The point which initially had the bad values and which will store the newly computed values</param>
|
||||
/// <param name="rand">The random context this iterator is using</param>
|
||||
/// <returns>True if a good value was computed within 5 tries, else false</returns>
|
||||
inline bool DoBadVals(Xform<T>* xforms, size_t& xformIndex, size_t lastXformUsed, size_t& badVals, Point<T>* point, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand)
|
||||
inline bool DoBadVals(Xform<T>* xforms, size_t& xformIndex, T range, size_t lastXformUsed, size_t& badVals, Point<T>* point, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand)
|
||||
{
|
||||
size_t consec = 0;
|
||||
Point<T> firstBadPoint;
|
||||
@ -429,8 +432,8 @@ public:
|
||||
{
|
||||
consec++;
|
||||
badVals++;
|
||||
firstBadPoint.m_X = rand.Frand11<T>();//Re-randomize points, but keep the computed color and viz.
|
||||
firstBadPoint.m_Y = rand.Frand11<T>();
|
||||
firstBadPoint.m_X = rand.template Frand<T>(-range, range);//Re-randomize points, but keep the computed color and viz.
|
||||
firstBadPoint.m_Y = rand.template Frand<T>(-range, range);
|
||||
firstBadPoint.m_Z = 0;
|
||||
firstBadPoint.m_ColorX = point->m_ColorX;
|
||||
firstBadPoint.m_Opacity = point->m_Opacity;
|
||||
@ -443,8 +446,8 @@ public:
|
||||
//After 5 tries, nothing worked, so just assign random.
|
||||
if (consec == 5)
|
||||
{
|
||||
point->m_X = rand.Frand11<T>();
|
||||
point->m_Y = rand.Frand11<T>();
|
||||
point->m_X = rand.template Frand<T>(-range, range);
|
||||
point->m_Y = rand.template Frand<T>(-range, range);
|
||||
point->m_Z = 0;
|
||||
}
|
||||
|
||||
@ -479,7 +482,7 @@ public:
|
||||
xformIndex = NextXformFromIndex(rand.Rand(), lastXformUsed);
|
||||
|
||||
if (xforms[xformIndex].Apply(&p1, &p1, rand))
|
||||
DoBadVals(xforms, xformIndex, lastXformUsed, badVals, &p1, rand);
|
||||
DoBadVals(xforms, xformIndex, ember.m_RandPointRange, lastXformUsed, badVals, &p1, rand);
|
||||
|
||||
lastXformUsed = xformIndex + 1;//Store the last used transform.
|
||||
}
|
||||
@ -492,7 +495,7 @@ public:
|
||||
xformIndex = NextXformFromIndex(rand.Rand(), lastXformUsed);
|
||||
|
||||
if (xforms[xformIndex].Apply(&p1, &p1, rand))//Feed the resulting value of applying the randomly selected xform back into the next iter, and not the result of applying the final xform.
|
||||
DoBadVals(xforms, xformIndex, lastXformUsed, badVals, &p1, rand);
|
||||
DoBadVals(xforms, xformIndex, ember.m_RandPointRange, lastXformUsed, badVals, &p1, rand);
|
||||
|
||||
DoFinalXform(ember, p1, samples + i, rand);
|
||||
ember.Proj(samples[i], rand);
|
||||
@ -508,7 +511,7 @@ public:
|
||||
xformIndex = NextXformFromIndex(rand.Rand(), lastXformUsed);
|
||||
|
||||
if (xforms[xformIndex].Apply(&p1, &p1, rand))
|
||||
DoBadVals(xforms, xformIndex, lastXformUsed, badVals, &p1, rand);
|
||||
DoBadVals(xforms, xformIndex, ember.m_RandPointRange, lastXformUsed, badVals, &p1, rand);
|
||||
|
||||
lastXformUsed = xformIndex + 1;//Store the last used transform.
|
||||
}
|
||||
@ -521,7 +524,7 @@ public:
|
||||
xformIndex = NextXformFromIndex(rand.Rand(), lastXformUsed);
|
||||
|
||||
if (xforms[xformIndex].Apply(&p1, &p1, rand))
|
||||
DoBadVals(xforms, xformIndex, lastXformUsed, badVals, &p1, rand);
|
||||
DoBadVals(xforms, xformIndex, ember.m_RandPointRange, lastXformUsed, badVals, &p1, rand);
|
||||
|
||||
samples[i] = p1;
|
||||
ember.Proj(samples[i], rand);
|
||||
@ -540,7 +543,7 @@ public:
|
||||
xformIndex = NextXformFromIndex(rand.Rand(), lastXformUsed);
|
||||
|
||||
if (xforms[xformIndex].Apply(&p1, &p1, rand))
|
||||
DoBadVals(xforms, xformIndex, lastXformUsed, badVals, &p1, rand);
|
||||
DoBadVals(xforms, xformIndex, ember.m_RandPointRange, lastXformUsed, badVals, &p1, rand);
|
||||
|
||||
lastXformUsed = xformIndex + 1;//Store the last used transform.
|
||||
}
|
||||
@ -552,7 +555,7 @@ public:
|
||||
xformIndex = NextXformFromIndex(rand.Rand(), lastXformUsed);
|
||||
|
||||
if (xforms[xformIndex].Apply(&p1, &p1, rand))//Feed the resulting value of applying the randomly selected xform back into the next iter, and not the result of applying the final xform.
|
||||
DoBadVals(xforms, xformIndex, lastXformUsed, badVals, &p1, rand);
|
||||
DoBadVals(xforms, xformIndex, ember.m_RandPointRange, lastXformUsed, badVals, &p1, rand);
|
||||
|
||||
DoFinalXform(ember, p1, samples + i, rand);
|
||||
lastXformUsed = xformIndex + 1;//Store the last used transform.
|
||||
@ -567,7 +570,7 @@ public:
|
||||
xformIndex = NextXformFromIndex(rand.Rand(), lastXformUsed);
|
||||
|
||||
if (xforms[xformIndex].Apply(&p1, &p1, rand))
|
||||
DoBadVals(xforms, xformIndex, lastXformUsed, badVals, &p1, rand);
|
||||
DoBadVals(xforms, xformIndex, ember.m_RandPointRange, lastXformUsed, badVals, &p1, rand);
|
||||
|
||||
lastXformUsed = xformIndex + 1;//Store the last used transform.
|
||||
}
|
||||
@ -579,7 +582,7 @@ public:
|
||||
xformIndex = NextXformFromIndex(rand.Rand(), lastXformUsed);
|
||||
|
||||
if (xforms[xformIndex].Apply(samples + i, samples + i + 1, rand))
|
||||
DoBadVals(xforms, xformIndex, lastXformUsed, badVals, samples + i + 1, rand);
|
||||
DoBadVals(xforms, xformIndex, ember.m_RandPointRange, lastXformUsed, badVals, samples + i + 1, rand);
|
||||
|
||||
lastXformUsed = xformIndex + 1;//Store the last used transform.
|
||||
}
|
||||
|
||||
@ -415,6 +415,20 @@ public:
|
||||
return v;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determine if a palette is all black.
|
||||
/// </summary>
|
||||
/// <returns>True if all colors are black, else false if at least one component of one color is non zero.</returns>
|
||||
bool IsEmpty()
|
||||
{
|
||||
for (glm::length_t i = 0; i < Size(); i++)
|
||||
for (glm::length_t j = 0; j < 3; j++)
|
||||
if (m_Entries[i][j] != 0)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert RGB to HSV.
|
||||
/// </summary>
|
||||
|
||||
@ -258,30 +258,39 @@ bool PaletteList<T>::Add(const string& filename, bool force)
|
||||
|
||||
/// <summary>
|
||||
/// Get the palette at a random index in a random file in the map.
|
||||
/// Attempt to avoid selecting a palette which is all black.
|
||||
/// </summary>
|
||||
/// <returns>A pointer to a random palette in a random file if successful, else nullptr.</returns>
|
||||
template <typename T>
|
||||
Palette<T>* PaletteList<T>::GetRandomPalette()
|
||||
{
|
||||
auto p = s_Palettes.begin();
|
||||
size_t i = 0, paletteFileIndex = QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand() % Size();
|
||||
size_t attempts = 0;
|
||||
|
||||
//Move p forward i elements.
|
||||
while (i < paletteFileIndex && p != s_Palettes.end())
|
||||
while (attempts < Size() * 10)
|
||||
{
|
||||
++i;
|
||||
++p;
|
||||
auto p = s_Palettes.begin();
|
||||
auto paletteFileIndex = QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand() % Size();
|
||||
size_t i = 0;
|
||||
|
||||
//Move p forward i elements.
|
||||
while (i < paletteFileIndex && p != s_Palettes.end())
|
||||
{
|
||||
++i;
|
||||
++p;
|
||||
}
|
||||
|
||||
if (i < Size())
|
||||
{
|
||||
size_t paletteIndex = QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand() % p->second.size();
|
||||
|
||||
if (paletteIndex < p->second.size() && !p->second[paletteIndex].IsEmpty())
|
||||
return &p->second[paletteIndex];
|
||||
}
|
||||
|
||||
attempts++;
|
||||
}
|
||||
|
||||
if (i < Size())
|
||||
{
|
||||
size_t paletteIndex = QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand() % p->second.size();
|
||||
|
||||
if (paletteIndex < p->second.size())
|
||||
return &p->second[paletteIndex];
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
return Size() ? &s_Palettes[0][0] : nullptr;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -99,7 +99,7 @@ template <typename T, typename bucketT>
|
||||
void Renderer<T, bucketT>::ComputeQuality()
|
||||
{
|
||||
m_Scale = std::pow(T(2.0), Zoom());
|
||||
m_ScaledQuality = Quality() * m_Scale * m_Scale;
|
||||
m_ScaledQuality = Quality() * SQR(m_Scale);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -591,18 +591,23 @@ FilterAndAccum:
|
||||
//Compute k1 and k2.
|
||||
auto fullRun = eRenderStatus::RENDER_OK;//Whether density filtering was run to completion without aborting prematurely or triggering an error.
|
||||
T area = FinalRasW() * FinalRasH() / (m_PixelsPerUnitX * m_PixelsPerUnitY);//Need to use temps from field if ever implemented.
|
||||
m_K1 = bucketT((Brightness() * 268) / 256);
|
||||
m_K1 = Brightness();
|
||||
|
||||
//When doing an interactive render, force output early on in the render process, before all iterations are done.
|
||||
//This presents a problem with the normal calculation of K2 since it relies on the quality value; it will scale the colors
|
||||
//to be very dark. Correct it by pretending the number of iters done is the exact quality desired and then scale according to that.
|
||||
if (forceOutput)
|
||||
if (!m_Ember.m_K2 || forceOutput)
|
||||
{
|
||||
T quality = (T(m_Stats.m_Iters) / T(FinalDimensions())) * (m_Scale * m_Scale);
|
||||
m_K2 = bucketT((Supersample() * Supersample()) / (area * quality * m_TemporalFilter->SumFilt()));
|
||||
//When doing an interactive render, force output early on in the render process, before all iterations are done.
|
||||
//This presents a problem with the normal calculation of K2 since it relies on the quality value; it will scale the colors
|
||||
//to be very dark. Correct it by pretending the number of iters done is the exact quality desired and then scale according to that.
|
||||
if (forceOutput)
|
||||
{
|
||||
T quality = (T(m_Stats.m_Iters) / T(FinalDimensions())) * (m_Scale * m_Scale);
|
||||
m_K2 = bucketT((Supersample() * Supersample()) / (area * quality * m_TemporalFilter->SumFilt()));
|
||||
}
|
||||
else
|
||||
m_K2 = bucketT((Supersample() * Supersample()) / (area * m_ScaledQuality * m_TemporalFilter->SumFilt()));
|
||||
}
|
||||
else
|
||||
m_K2 = bucketT((Supersample() * Supersample()) / (area * m_ScaledQuality * m_TemporalFilter->SumFilt()));
|
||||
m_K2 = bucketT(m_Ember.m_K2);
|
||||
|
||||
if (!ResetBuckets(false, true))//Only the histogram was reset above, now reset the density filtering buffer.
|
||||
{
|
||||
@ -1282,10 +1287,10 @@ EmberStats Renderer<T, bucketT>::Iterate(size_t iterCount, size_t temporalSample
|
||||
//For example, if 51,000 are requested, and the sbs is 10,000, it should run 5 sub batches of 10,000 iters, and one final sub batch of 1,000 iters.
|
||||
params.m_Count = std::min(params.m_Count, totalItersPerThread - m_SubBatch[threadIndex]);
|
||||
//Use first as random point, the rest are iterated points.
|
||||
//Note that this gets reset with a new random point for each subBatchSize iterations.
|
||||
//Note that this gets reset with a new random point for each SubBatchSize iterations.
|
||||
//This helps correct if iteration happens to be on a bad trajectory.
|
||||
m_Samples[threadIndex][0].m_X = m_Rand[threadIndex].template Frand11<T>();
|
||||
m_Samples[threadIndex][0].m_Y = m_Rand[threadIndex].template Frand11<T>();
|
||||
m_Samples[threadIndex][0].m_X = m_Rand[threadIndex].template Frand<T>(-m_ThreadEmbers[threadIndex].m_RandPointRange, m_ThreadEmbers[threadIndex].m_RandPointRange);
|
||||
m_Samples[threadIndex][0].m_Y = m_Rand[threadIndex].template Frand<T>(-m_ThreadEmbers[threadIndex].m_RandPointRange, m_ThreadEmbers[threadIndex].m_RandPointRange);
|
||||
m_Samples[threadIndex][0].m_Z = 0;//m_Ember.m_CamZPos;//Apo set this to 0, then made the user use special variations to kick it. It seems easier to just set it to zpos.
|
||||
m_Samples[threadIndex][0].m_ColorX = m_Rand[threadIndex].template Frand01<T>();
|
||||
|
||||
@ -1727,9 +1732,21 @@ void Renderer<T, bucketT>::ComputeCurves()
|
||||
{
|
||||
//Timing t;
|
||||
auto st = m_Csa.size();
|
||||
vector<glm::tvec2<float, glm::defaultp>> vals;
|
||||
vals.reserve(m_Ember.m_Curves.m_Points[0].size());
|
||||
|
||||
for (size_t i = 0; i < st; i++)
|
||||
m_Csa[i] = m_Ember.m_Curves.BezierFunc(i * ONE_OVER_CURVES_LENGTH_M1);
|
||||
for (glm::length_t i = 0; i < m_Ember.m_Curves.m_Points.size(); i++)//Overall, r, g, b.
|
||||
{
|
||||
for (auto& p : m_Ember.m_Curves.m_Points[i])
|
||||
vals.push_back(p);
|
||||
|
||||
Spline<float> spline(vals);//Will internally sort.
|
||||
|
||||
for (glm::length_t j = 0; j < st; j++)
|
||||
m_Csa[j][i] = spline.Interpolate(j * ONE_OVER_CURVES_LENGTH_M1);
|
||||
|
||||
vals.clear();
|
||||
}
|
||||
|
||||
//t.Toc("ComputeCurves");
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
#include "Interpolate.h"
|
||||
#include "CarToRas.h"
|
||||
#include "EmberToXml.h"
|
||||
#include "Spline.h"
|
||||
|
||||
/// <summary>
|
||||
/// Renderer.
|
||||
@ -157,6 +158,7 @@ private:
|
||||
void VectorizedLogScale(size_t row, size_t rowEnd);
|
||||
|
||||
protected:
|
||||
//public:
|
||||
T m_Scale;
|
||||
T m_PixelsPerUnitX;
|
||||
T m_PixelsPerUnitY;
|
||||
|
||||
@ -198,7 +198,6 @@ public:
|
||||
bool InFinalAccum();
|
||||
|
||||
void* m_ProgressParameter = nullptr;
|
||||
|
||||
protected:
|
||||
bool m_EarlyClip = false;
|
||||
bool m_YAxisUp = false;
|
||||
|
||||
127
Source/Ember/Spline.cpp
Normal file
127
Source/Ember/Spline.cpp
Normal file
@ -0,0 +1,127 @@
|
||||
// This is a combination of this:
|
||||
// https://stackoverflow.com/questions/25379422/b-spline-curves/25379851#25379851
|
||||
// and this, but modified to operate on a spline with any number of points intead of just >= 4:
|
||||
//
|
||||
// Spline.cc
|
||||
// CubicSplineLib/
|
||||
//
|
||||
// Source file for the "CubicSpline" class. This object facilitates natural
|
||||
// cubic spline interpolation. Once instantiated the
|
||||
// constructor builds the spline polynomials on the intervals of the (x, y)
|
||||
// data provided and retains them for later invocation. Parallelized using
|
||||
// OpenMP.
|
||||
//
|
||||
// Copyright (C) Geoffrey Lentner 2015. All rights reserved.
|
||||
// See LICENCE file. (GPL v2.0)
|
||||
//
|
||||
// contact: Geoffrey Lentner, B.S.
|
||||
// Graduate Student / Researcher
|
||||
// 102 Natural Science Building
|
||||
// Department of Physics & Astronomy
|
||||
// University of Louisville
|
||||
// Louisville, KY 40292 USA
|
||||
//
|
||||
// email: geoffrey.lentner@louisville.edu
|
||||
//
|
||||
// updated: 2015-1-19 13:10:30 EST
|
||||
//
|
||||
#include "EmberPch.h"
|
||||
#include "Spline.h"
|
||||
|
||||
namespace EmberNs
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor that takes a vector of x,y points, optionally sorts them
|
||||
/// and builds the spline values.
|
||||
/// </summary>
|
||||
/// <param name="_vals">The vector of x,y points</param>
|
||||
/// <param name="sorted">True to skip sorting, false to sort.</param>
|
||||
template<class T>
|
||||
Spline<T>::Spline(const std::vector<v2T>& _vals, bool sorted)
|
||||
{
|
||||
n = int(_vals.size() - 1);
|
||||
vals = _vals;
|
||||
|
||||
// if not suppressed, ensure 'x' elements are in ascending order
|
||||
if (!sorted)
|
||||
std::sort(vals.begin(), vals.end(), [&](const v2T & lhs, const v2T & rhs) { return lhs.x < rhs.x; });
|
||||
BuildSplines();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compute spline values for the passed in points.
|
||||
/// This only needs to be done once.
|
||||
/// </summary>
|
||||
template<class T>
|
||||
void Spline<T>::BuildSplines()
|
||||
{
|
||||
a.resize(n + 1);
|
||||
b.resize(n + 1);
|
||||
c.resize(n + 1);
|
||||
d.resize(n + 1);
|
||||
std::vector<T> w(n);
|
||||
std::vector<T> h(n);
|
||||
std::vector<T> ftt(n + 1);
|
||||
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
w[i] = (vals[i + 1].x - vals[i].x);
|
||||
h[i] = (vals[i + 1].y - vals[i].y) / w[i];
|
||||
}
|
||||
|
||||
ftt[0] = 0;
|
||||
|
||||
for (int i = 0; i < n - 1; i++)
|
||||
ftt[i + 1] = 3 * (h[i + 1] - h[i]) / (w[i + 1] + w[i]);
|
||||
|
||||
ftt[n] = 0;
|
||||
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
a[i] = (ftt[i + 1] - ftt[i]) / (6 * w[i]);
|
||||
b[i] = ftt[i] / 2;
|
||||
c[i] = h[i] - w[i] * (ftt[i + 1] + 2 * ftt[i]) / 6;
|
||||
d[i] = vals[i].y;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper to generate y points on the spline for a vector of passed in points.
|
||||
/// </summary>
|
||||
/// <param name="newX">The vector of x points to generate spline points for</param>
|
||||
/// <returns>The vector of computed spline y points.</returns>
|
||||
template<class T>
|
||||
std::vector<T> Spline<T>::Interpolate(const std::vector<T>& newX)
|
||||
{
|
||||
std::vector<T> output; output.resize(newX.size());
|
||||
|
||||
for (int i = 0; i < newX.size(); i++)
|
||||
output[i] = Interpolate(newX[i]);
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compute a y point on the spline for a the passed in value of x.
|
||||
/// </summary>
|
||||
/// <param name="newX">The x points to compute the spline point for</param>
|
||||
/// <returns>The computed spline y points.</returns>
|
||||
template<class T>
|
||||
T Spline<T>::Interpolate(T newX)
|
||||
{
|
||||
ClampRef(newX, vals[0].x, vals[n].x);
|
||||
int j = 0;
|
||||
|
||||
while (j < n && newX > vals[j + 1].x)
|
||||
j++;
|
||||
|
||||
auto xmxj = newX - vals[j].x;
|
||||
auto output = a[j] * (xmxj * xmxj * xmxj) +
|
||||
b[j] * (xmxj * xmxj) +
|
||||
c[j] * xmxj +
|
||||
d[j];
|
||||
return output;
|
||||
}
|
||||
|
||||
template EMBER_API class Spline<float>;
|
||||
}
|
||||
55
Source/Ember/Spline.h
Normal file
55
Source/Ember/Spline.h
Normal file
@ -0,0 +1,55 @@
|
||||
// This is a combination of this:
|
||||
// https://stackoverflow.com/questions/25379422/b-spline-curves/25379851#25379851
|
||||
// and this, but modified to operate on a spline with any number of points intead of just >= 4:
|
||||
//
|
||||
// Spline.h
|
||||
// CubicSplineLib/
|
||||
//
|
||||
// Header file for the "CubicSpline" class. This object facilitates natural
|
||||
// cubic spline interpolation. Once instantiated the
|
||||
// constructor builds the spline polynomials on the intervals of the (x, y)
|
||||
// data provided and retains them for later invocation. Parallelized using
|
||||
// OpenMP.
|
||||
//
|
||||
// Copyright (C) Geoffrey Lentner 2015. All rights reserved.
|
||||
// See LICENCE file. (GPL v2.0)
|
||||
//
|
||||
// contact: Geoffrey Lentner, B.S.
|
||||
// Graduate Student / Researcher
|
||||
// 102 Natural Science Building
|
||||
// Department of Physics & Astronomy
|
||||
// University of Louisville
|
||||
// Louisville, KY 40292 USA
|
||||
//
|
||||
// email: geoffrey.lentner@louisville.edu
|
||||
//
|
||||
// updated: 2015-1-19 13:10:30 EST
|
||||
//
|
||||
#pragma once
|
||||
#include "Utils.h"
|
||||
|
||||
namespace EmberNs
|
||||
{
|
||||
/// <summary>
|
||||
/// Class taking passed in x,y points, sorting them, and providing a function
|
||||
/// to compute and return an interpolated spline curve for any value between the
|
||||
/// first and last x.
|
||||
/// Template argument expected to be float.
|
||||
/// </summary>
|
||||
template<class T = float>
|
||||
class EMBER_API Spline
|
||||
{
|
||||
public:
|
||||
Spline(const std::vector<v2T>& _vals, bool sorted = false);
|
||||
std::vector<T> Interpolate(const std::vector<T>& newX);
|
||||
T Interpolate(T newX);
|
||||
|
||||
private:
|
||||
void BuildSplines();
|
||||
std::vector<v2T> vals;
|
||||
std::vector<T> a, b, c, d;
|
||||
std::vector<T> c_prime, d_prime;
|
||||
std::vector<T> k;
|
||||
int n;
|
||||
};
|
||||
}
|
||||
@ -829,6 +829,34 @@ static inline T NormalizeDeg180(T angle)
|
||||
return a;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Put an angular measurement in degrees into the range of 0 - 360.
|
||||
/// </summary>
|
||||
/// <param name="angle">The angle to normalize</param>
|
||||
/// <returns>The normalized angle in a range of 0 - 360</returns>
|
||||
template <typename T>
|
||||
static inline T NormalizeDeg360(T angle)
|
||||
{
|
||||
if (angle > 360 || angle < -360)
|
||||
angle = fmod(angle, T(360));
|
||||
|
||||
if (angle < 0)
|
||||
angle += 360;
|
||||
|
||||
return angle;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert an angle where 0 is up to a trigonometry style angle where 0 is to the right.
|
||||
/// </summary>
|
||||
/// <param name="Angle">The angle to convert</param>
|
||||
/// <returns>The trig equivalent of the angle passed in</returns>
|
||||
template <typename T>
|
||||
static inline T ToTrigAngle(T angle)
|
||||
{
|
||||
return NormalizeDeg360(90 - angle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether the passed in string ends with the passed in suffix, case sensitive.
|
||||
/// </summary>
|
||||
@ -841,6 +869,18 @@ static bool EndsWith(const std::string& str, const std::string& suffix)
|
||||
str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether the passed in string starts with the passed in prefix, case sensitive.
|
||||
/// </summary>
|
||||
/// <param name="str">The string to test</param>
|
||||
/// <param name="suffix">The string to test for</param>
|
||||
/// <returns>True if str starts with suffix, else false.</returns>
|
||||
static bool StartsWith(const std::string& str, const std::string& prefix)
|
||||
{
|
||||
return str.size() >= prefix.size() &&
|
||||
str.compare(0, prefix.size(), prefix) == 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return a lower case copy of a string.
|
||||
/// </summary>
|
||||
|
||||
@ -50,6 +50,16 @@ public:
|
||||
return modf(v, &dummy);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return the fractional part of a real number.
|
||||
/// </summary>
|
||||
/// <param name="v">The real number whose fractional part will be returned</param>
|
||||
/// <returns>The fractional part of the value passed in</returns>
|
||||
static inline T Fract(T x)
|
||||
{
|
||||
return x - T(Floor(x));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Unsure.
|
||||
/// </summary>
|
||||
@ -191,7 +201,7 @@ public:
|
||||
/// </summary>
|
||||
/// <param name="a">The value to hash</param>
|
||||
/// <returns>The hashed value</returns>
|
||||
static T Hash(int a)
|
||||
static inline T Hash(int a)
|
||||
{
|
||||
a = (a ^ 61) ^ (a >> 16);
|
||||
a = a + (a << 3);
|
||||
@ -201,6 +211,128 @@ public:
|
||||
return (T)a / std::numeric_limits<int>::max();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hash function gotten from Chaotica, which takes an x,y pair and hashes it.
|
||||
/// Written by Thomas Ludwig and Tatyana Zabanova.
|
||||
/// </summary>
|
||||
/// <param name="x">The x value to hash</param>
|
||||
/// <param name="y">The y value to hash</param>
|
||||
/// <param name="seed">The seed to hash with</param>
|
||||
/// <returns>The hashed value</returns>
|
||||
static inline T HashShadertoy(T x, T y, T seed)
|
||||
{
|
||||
return Fract(std::sin(x * T(12.9898) + y * T(78.233) + seed) * T(43758.5453));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For the vibration2 variation.
|
||||
/// </summary>
|
||||
/// <returns>T</returns>
|
||||
static inline T Modulate(T amp, T freq, T x)
|
||||
{
|
||||
return amp * std::cos(x * freq * M_2PI);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Divide real by complex.
|
||||
/// </summary>
|
||||
/// <param name="x">The real number</param>
|
||||
/// <param name="a">The complex number</param>
|
||||
/// <returns>x / a</returns>
|
||||
static v2T RealDivComplex(T x, v2T a)
|
||||
{
|
||||
T s = x / Zeps(a.x * a.x + a.y * a.y);
|
||||
return v2T(a.x * s, -a.y * s);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Divide complex by complex.
|
||||
/// </summary>
|
||||
/// <param name="x">The first complex number</param>
|
||||
/// <param name="a">The secondcomplex number</param>
|
||||
/// <returns>a / b</returns>
|
||||
static v2T ComplexDivComplex(v2T a, v2T b)
|
||||
{
|
||||
T s = T(1.0) / Zeps(b.x * b.x + b.y * b.y);
|
||||
return v2T(a.x * b.x + a.y * b.y, a.y * b.x - a.x * b.y) * s;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Multiple complex by real.
|
||||
/// </summary>
|
||||
/// <param name="a">The complex number</param>
|
||||
/// <param name="x">The real number</param>
|
||||
/// <returns>a * x</returns>
|
||||
static v2T ComplexMultReal(v2T a, T x)
|
||||
{
|
||||
return v2T(a.x * x, a.y * x);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Multiply complex by complex.
|
||||
/// </summary>
|
||||
/// <param name="a">The first complex number</param>
|
||||
/// <param name="b">The second complex number</param>
|
||||
/// <returns>a * b</returns>
|
||||
static v2T ComplexMultComplex(v2T a, v2T b)
|
||||
{
|
||||
return v2T(a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add complex to complex.
|
||||
/// </summary>
|
||||
/// <param name="a">The first complex number</param>
|
||||
/// <param name="b">The second complex number</param>
|
||||
/// <returns>a + b</returns>
|
||||
static v2T ComplexPlusComplex(v2T a, v2T b)
|
||||
{
|
||||
return v2T(a.x + b.x, a.y + b.y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add complex to real.
|
||||
/// </summary>
|
||||
/// <param name="a">The complex number</param>
|
||||
/// <param name="x">The real number</param>
|
||||
/// <returns>a + x</returns>
|
||||
static v2T ComplexPlusReal(v2T a, T x)
|
||||
{
|
||||
return v2T(a.x + x, a.y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Subtract real from complex.
|
||||
/// </summary>
|
||||
/// <param name="a">The complex number</param>
|
||||
/// <param name="x">The real number</param>
|
||||
/// <returns>a - x</returns>
|
||||
static v2T ComplexMinusReal(v2T a, T x)
|
||||
{
|
||||
return v2T(a.x - x, a.y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compute the square root of a complex number.
|
||||
/// </summary>
|
||||
/// <param name="a">The complex number</param>
|
||||
/// <returns>sqrt(a)</returns>
|
||||
static v2T ComplexSqrt(v2T a)
|
||||
{
|
||||
T mag = Hypot(a.x, a.y);
|
||||
return ComplexMultReal(v2T(std::sqrt(mag + a.x), Sign(a.y) * std::sqrt(mag - a.x)), T(0.5) * std::sqrt(T(2.0)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compute the natural logarithm of a complex number.
|
||||
/// </summary>
|
||||
/// <param name="a">The complex number</param>
|
||||
/// <returns>log(a)</returns>
|
||||
static v2T ComplexLog(v2T a)
|
||||
{
|
||||
return v2T(T(0.5) * std::log(a.x * a.x + a.y * a.y), std::atan2(a.y, a.x));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve information about a piece of shared data by looking
|
||||
/// up its name.
|
||||
@ -567,9 +699,25 @@ private:
|
||||
m_P = InitInts();
|
||||
m_Grad = InitGrad();
|
||||
m_Offsets = InitOffsets();
|
||||
m_P1 = InitP1();
|
||||
m_Q1 = InitQ1();
|
||||
m_P2 = InitP2();
|
||||
m_Q2 = InitQ2();
|
||||
m_PC = InitPC();
|
||||
m_QC = InitQC();
|
||||
m_PS = InitPS();
|
||||
m_QS = InitQS();
|
||||
m_GlobalMap["NOISE_INDEX"] = make_pair(m_PFloats.data(), m_PFloats.size());
|
||||
m_GlobalMap["NOISE_POINTS"] = make_pair(static_cast<T*>(&(m_Grad[0].x)), SizeOf(m_Grad) / sizeof(T));
|
||||
m_GlobalMap["OFFSETS"] = make_pair(static_cast<T*>(&(m_Offsets[0].x)), SizeOf(m_Offsets) / sizeof(T));
|
||||
m_GlobalMap["P1"] = make_pair(m_P1.data(), m_P1.size());
|
||||
m_GlobalMap["Q1"] = make_pair(m_Q1.data(), m_Q1.size());
|
||||
m_GlobalMap["P2"] = make_pair(m_P2.data(), m_P2.size());
|
||||
m_GlobalMap["Q2"] = make_pair(m_Q2.data(), m_Q2.size());
|
||||
m_GlobalMap["PC"] = make_pair(m_PC.data(), m_PC.size());
|
||||
m_GlobalMap["QC"] = make_pair(m_QC.data(), m_QC.size());
|
||||
m_GlobalMap["PS"] = make_pair(m_PS.data(), m_PS.size());
|
||||
m_GlobalMap["QS"] = make_pair(m_QS.data(), m_QS.size());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -993,8 +1141,179 @@ private:
|
||||
return g;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the P1 vector used in J1().
|
||||
/// Note J1() comes with std in C++, but needed to be manually implemented in OpenCL.
|
||||
/// </summary>
|
||||
/// <returns>A copy of the locally declared vector</returns>
|
||||
std::vector<T> InitP1()
|
||||
{
|
||||
std::vector<T> v =
|
||||
{
|
||||
T(-1.4258509801366645672e+11),
|
||||
T(6.6781041261492395835e+09 ),
|
||||
T(-1.1548696764841276794e+08),
|
||||
T(9.8062904098958257677e+05 ),
|
||||
T(-4.4615792982775076130e+03),
|
||||
T(1.0650724020080236441e+01 ),
|
||||
T(-1.0767857011487300348e-02)
|
||||
};
|
||||
return v;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the Q1 vector used in J1().
|
||||
/// Note J1() comes with std in C++, but needed to be manually implemented in OpenCL.
|
||||
/// </summary>
|
||||
/// <returns>A copy of the locally declared vector</returns>
|
||||
std::vector<T> InitQ1()
|
||||
{
|
||||
std::vector<T> v =
|
||||
{
|
||||
T(4.1868604460820175290e+12),
|
||||
T(4.2091902282580133541e+10),
|
||||
T(2.0228375140097033958e+08),
|
||||
T(5.9117614494174794095e+05),
|
||||
T(1.0742272239517380498e+03),
|
||||
T(1.0),
|
||||
T(0.0)
|
||||
};
|
||||
return v;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the P2 vector used in J1().
|
||||
/// Note J1() comes with std in C++, but needed to be manually implemented in OpenCL.
|
||||
/// </summary>
|
||||
/// <returns>A copy of the locally declared vector</returns>
|
||||
std::vector<T> InitP2()
|
||||
{
|
||||
std::vector<T> v =
|
||||
{
|
||||
T(-1.7527881995806511112e+16),
|
||||
T(1.6608531731299018674e+15 ),
|
||||
T(-3.6658018905416665164e+13),
|
||||
T(3.5580665670910619166e+11 ),
|
||||
T(-1.8113931269860667829e+09),
|
||||
T(5.0793266148011179143e+06 ),
|
||||
T(-7.5023342220781607561e+03),
|
||||
T(4.6179191852758252278e+00)
|
||||
};
|
||||
return v;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the Q2 vector used in J1().
|
||||
/// Note J1() comes with std in C++, but needed to be manually implemented in OpenCL.
|
||||
/// </summary>
|
||||
/// <returns>A copy of the locally declared vector</returns>
|
||||
std::vector<T> InitQ2()
|
||||
{
|
||||
std::vector<T> v =
|
||||
{
|
||||
T(1.7253905888447681194e+18),
|
||||
T(1.7128800897135812012e+16),
|
||||
T(8.4899346165481429307e+13),
|
||||
T(2.7622777286244082666e+11),
|
||||
T(6.4872502899596389593e+08),
|
||||
T(1.1267125065029138050e+06),
|
||||
T(1.3886978985861357615e+03),
|
||||
T(1.0)
|
||||
};
|
||||
return v;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the PC vector used in J1().
|
||||
/// Note J1() comes with std in C++, but needed to be manually implemented in OpenCL.
|
||||
/// </summary>
|
||||
/// <returns>A copy of the locally declared vector</returns>
|
||||
std::vector<T> InitPC()
|
||||
{
|
||||
std::vector<T> v =
|
||||
{
|
||||
T(-4.4357578167941278571e+06),
|
||||
T(-9.9422465050776411957e+06),
|
||||
T(-6.6033732483649391093e+06),
|
||||
T(-1.5235293511811373833e+06),
|
||||
T(-1.0982405543459346727e+05),
|
||||
T(-1.6116166443246101165e+03),
|
||||
T(0.0)
|
||||
};
|
||||
return v;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the QC vector used in J1().
|
||||
/// Note J1() comes with std in C++, but needed to be manually implemented in OpenCL.
|
||||
/// </summary>
|
||||
/// <returns>A copy of the locally declared vector</returns>
|
||||
std::vector<T> InitQC()
|
||||
{
|
||||
std::vector<T> v =
|
||||
{
|
||||
T(-4.4357578167941278568e+06),
|
||||
T(-9.9341243899345856590e+06),
|
||||
T(-6.5853394797230870728e+06),
|
||||
T(-1.5118095066341608816e+06),
|
||||
T(-1.0726385991103820119e+05),
|
||||
T(-1.4550094401904961825e+03),
|
||||
T(1.0)
|
||||
};
|
||||
return v;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the PS vector used in J1().
|
||||
/// Note J1() comes with std in C++, but needed to be manually implemented in OpenCL.
|
||||
/// </summary>
|
||||
/// <returns>A copy of the locally declared vector</returns>
|
||||
std::vector<T> InitPS()
|
||||
{
|
||||
std::vector<T> v =
|
||||
{
|
||||
T(3.3220913409857223519e+04),
|
||||
T(8.5145160675335701966e+04),
|
||||
T(6.6178836581270835179e+04),
|
||||
T(1.8494262873223866797e+04),
|
||||
T(1.7063754290207680021e+03),
|
||||
T(3.5265133846636032186e+01),
|
||||
T(0.0)
|
||||
};
|
||||
return v;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the QS vector used in J1().
|
||||
/// Note J1() comes with std in C++, but needed to be manually implemented in OpenCL.
|
||||
/// </summary>
|
||||
/// <returns>A copy of the locally declared vector</returns>
|
||||
std::vector<T> InitQS()
|
||||
{
|
||||
std::vector<T> v =
|
||||
{
|
||||
T(7.0871281941028743574e+05),
|
||||
T(1.8194580422439972989e+06),
|
||||
T(1.4194606696037208929e+06),
|
||||
T(4.0029443582266975117e+05),
|
||||
T(3.7890229745772202641e+04),
|
||||
T(8.6383677696049909675e+02),
|
||||
T(1.0)
|
||||
|
||||
};
|
||||
return v;
|
||||
}
|
||||
|
||||
std::vector<int> m_P;
|
||||
std::vector<T> m_PFloats;
|
||||
std::vector<T> m_P1;
|
||||
std::vector<T> m_Q1;
|
||||
std::vector<T> m_P2;
|
||||
std::vector<T> m_Q2;
|
||||
std::vector<T> m_PC;
|
||||
std::vector<T> m_QC;
|
||||
std::vector<T> m_PS;
|
||||
std::vector<T> m_QS;
|
||||
std::vector<v2T> m_Offsets;
|
||||
std::vector<v3T> m_Grad;
|
||||
std::unordered_map<string, pair<const T*, size_t>> m_GlobalMap;
|
||||
|
||||
@ -47,6 +47,11 @@ enum class eVariationAssignType : et
|
||||
enum class eVariationId : et
|
||||
{
|
||||
VAR_ARCH,
|
||||
VAR_ARCSECH,
|
||||
VAR_ARCSECH2,
|
||||
VAR_ARCSINH,
|
||||
VAR_ARCTANH,
|
||||
VAR_ASTERIA,
|
||||
//VAR_ARCSINH,
|
||||
//VAR_ARCTANH,
|
||||
VAR_AUGER ,
|
||||
@ -62,6 +67,7 @@ enum class eVariationId : et
|
||||
VAR_BLOB ,
|
||||
VAR_BLOB2 ,
|
||||
VAR_BLOB3D ,
|
||||
VAR_BLOCK ,
|
||||
VAR_BLOCKY ,
|
||||
VAR_BLUR ,
|
||||
VAR_BLUR_CIRCLE ,
|
||||
@ -81,11 +87,13 @@ enum class eVariationId : et
|
||||
VAR_BUBBLET3D ,
|
||||
VAR_BUTTERFLY ,
|
||||
VAR_BWRAPS ,
|
||||
VAR_BWRAPS_RAND ,
|
||||
VAR_CARDIOID ,
|
||||
VAR_CELL ,
|
||||
VAR_CHECKS ,
|
||||
VAR_CIRCLEBLUR ,
|
||||
VAR_CIRCLECROP,
|
||||
VAR_CIRCLECROP2,
|
||||
VAR_CIRCLELINEAR,
|
||||
VAR_CIRCLERAND,
|
||||
VAR_CIRCLESPLIT,
|
||||
@ -104,12 +112,14 @@ enum class eVariationId : et
|
||||
VAR_COSQ,
|
||||
VAR_COT ,
|
||||
VAR_COTH ,
|
||||
VAR_COTH_SPIRAL,
|
||||
VAR_COTHQ ,
|
||||
VAR_COTQ ,
|
||||
VAR_CPOW ,
|
||||
VAR_CPOW2 ,
|
||||
VAR_CPOW3 ,
|
||||
VAR_CRACKLE ,
|
||||
VAR_CRACKLE2 ,
|
||||
VAR_CRESCENTS ,
|
||||
VAR_CROB ,
|
||||
VAR_CROP ,
|
||||
@ -130,10 +140,21 @@ enum class eVariationId : et
|
||||
VAR_CYLINDER2,
|
||||
VAR_DELTA_A ,
|
||||
VAR_DEPTH,
|
||||
VAR_DEPTH_BLUR,
|
||||
VAR_DEPTH_BLUR2,
|
||||
VAR_DEPTH_GAUSSIAN,
|
||||
VAR_DEPTH_GAUSSIAN2,
|
||||
VAR_DEPTH_NGON,
|
||||
VAR_DEPTH_NGON2,
|
||||
VAR_DEPTH_SINE,
|
||||
VAR_DEPTH_SINE2,
|
||||
VAR_DIAMOND ,
|
||||
VAR_DISC ,
|
||||
VAR_DISC2 ,
|
||||
VAR_DISC3D ,
|
||||
VAR_DRAGONFIRE,
|
||||
VAR_DUST ,
|
||||
VAR_D_SPHERICAL ,
|
||||
VAR_ECLIPSE ,
|
||||
VAR_ECOLLIDE ,
|
||||
VAR_EDISC ,
|
||||
@ -151,7 +172,9 @@ enum class eVariationId : et
|
||||
VAR_ESTIQ,
|
||||
VAR_ESWIRL ,
|
||||
VAR_EX ,
|
||||
VAR_EXCINIS ,
|
||||
VAR_EXP ,
|
||||
VAR_EXP2 ,
|
||||
VAR_EXPO ,
|
||||
VAR_EXPONENTIAL ,
|
||||
VAR_EXTRUDE ,
|
||||
@ -168,20 +191,27 @@ enum class eVariationId : et
|
||||
VAR_FISHEYE ,
|
||||
VAR_FLATTEN ,
|
||||
VAR_FLIP_CIRCLE ,
|
||||
VAR_FLIP_X ,
|
||||
VAR_FLIP_Y ,
|
||||
VAR_FLOWER ,
|
||||
VAR_FLOWER_DB ,
|
||||
VAR_FLUX ,
|
||||
VAR_FOCI ,
|
||||
VAR_FOCI3D ,
|
||||
VAR_FOCI_P ,
|
||||
VAR_FOURTH,
|
||||
VAR_FUNNEL ,
|
||||
VAR_GAMMA ,
|
||||
VAR_GAUSSIAN,
|
||||
VAR_GAUSSIAN_BLUR,
|
||||
VAR_GDOFFS,
|
||||
VAR_GLYNNIA ,
|
||||
VAR_GLYNNIA2 ,
|
||||
VAR_GLYNNSIM1 ,
|
||||
VAR_GLYNNSIM2 ,
|
||||
VAR_GLYNNSIM3 ,
|
||||
VAR_GLYNNSIM4 ,
|
||||
VAR_GLYNNSIM5 ,
|
||||
VAR_GRIDOUT ,
|
||||
VAR_HANDKERCHIEF,
|
||||
VAR_HEART ,
|
||||
@ -189,15 +219,19 @@ enum class eVariationId : et
|
||||
VAR_HELICOID,
|
||||
VAR_HELIX,
|
||||
VAR_HEMISPHERE ,
|
||||
VAR_HENON ,
|
||||
VAR_HEXAPLAY3D ,
|
||||
VAR_HEXCROP ,
|
||||
VAR_HEXES ,
|
||||
VAR_HEXNIX3D ,
|
||||
VAR_HEX_RAND,
|
||||
VAR_HEX_TRUCHET,
|
||||
VAR_HO ,
|
||||
VAR_HOLE ,
|
||||
VAR_HORSESHOE ,
|
||||
VAR_HYPERBOLIC ,
|
||||
VAR_HYPERCROP ,
|
||||
VAR_HYPERSHIFT ,
|
||||
VAR_HYPERSHIFT2 ,
|
||||
VAR_HYPERTILE ,
|
||||
VAR_HYPERTILE1 ,
|
||||
@ -222,8 +256,10 @@ enum class eVariationId : et
|
||||
VAR_JULIAQ ,
|
||||
VAR_JULIASCOPE ,
|
||||
VAR_KALEIDOSCOPE,
|
||||
VAR_LAZY_TRAVIS ,
|
||||
VAR_LAZYJESS ,
|
||||
VAR_LAZYSUSAN ,
|
||||
VAR_LAZY_TRAVIS ,
|
||||
VAR_LENS ,
|
||||
VAR_LINE ,
|
||||
VAR_LINEAR ,
|
||||
VAR_LINEAR_T ,
|
||||
@ -239,6 +275,7 @@ enum class eVariationId : et
|
||||
VAR_LOONIE2 ,
|
||||
VAR_LOONIE3 ,
|
||||
VAR_LOONIE3D ,
|
||||
VAR_LOZI ,
|
||||
VAR_MASK ,
|
||||
VAR_MCARPET ,
|
||||
VAR_MIRROR_X,
|
||||
@ -249,6 +286,8 @@ enum class eVariationId : et
|
||||
VAR_MOBIUS_STRIP,
|
||||
VAR_MOBIUSN ,
|
||||
VAR_MODULUS ,
|
||||
VAR_MODULUSX ,
|
||||
VAR_MODULUSY ,
|
||||
VAR_MURL ,
|
||||
VAR_MURL2 ,
|
||||
VAR_NBLUR ,
|
||||
@ -259,6 +298,7 @@ enum class eVariationId : et
|
||||
VAR_OCTAPOL ,
|
||||
VAR_ORTHO ,
|
||||
VAR_OSCILLOSCOPE,
|
||||
VAR_OSCILLOSCOPE2,
|
||||
VAR_OVOID ,
|
||||
VAR_OVOID3D ,
|
||||
VAR_PANORAMA1 ,
|
||||
@ -273,6 +313,7 @@ enum class eVariationId : et
|
||||
VAR_PIXEL_FLOW ,
|
||||
VAR_POINCARE ,
|
||||
VAR_POINCARE3D ,
|
||||
VAR_POINT_SYMMETRY,
|
||||
VAR_POLAR ,
|
||||
VAR_POLAR2 ,
|
||||
VAR_POLYNOMIAL ,
|
||||
@ -282,10 +323,13 @@ enum class eVariationId : et
|
||||
VAR_POW_BLOCK ,
|
||||
VAR_POWER ,
|
||||
VAR_PRESSURE_WAVE,
|
||||
VAR_PROJECTIVE ,
|
||||
VAR_PROSE3D ,
|
||||
VAR_PSPHERE ,
|
||||
VAR_PULSE ,
|
||||
VAR_Q_ODE,
|
||||
VAR_RADIAL_BLUR ,
|
||||
//VAR_RADIAL_GAUSSIAN,
|
||||
VAR_RAND_CUBES ,
|
||||
VAR_RATIONAL3 ,
|
||||
VAR_RAYS ,
|
||||
@ -298,12 +342,14 @@ enum class eVariationId : et
|
||||
VAR_RINGS2 ,
|
||||
VAR_RIPPLE ,
|
||||
VAR_RIPPLED ,
|
||||
VAR_ROTATE,
|
||||
VAR_ROTATE_X,
|
||||
VAR_ROTATE_Y,
|
||||
VAR_ROTATE_Z,
|
||||
VAR_ROUNDSPHER ,
|
||||
VAR_ROUNDSPHER3D,
|
||||
VAR_SCRY ,
|
||||
VAR_SCRY2 ,
|
||||
VAR_SCRY3D ,
|
||||
VAR_SEC ,
|
||||
VAR_SECANT2 ,
|
||||
@ -311,6 +357,7 @@ enum class eVariationId : et
|
||||
VAR_SECHQ,
|
||||
VAR_SECQ,
|
||||
VAR_SEPARATION ,
|
||||
VAR_SHIFT ,
|
||||
VAR_SHRED_RAD ,
|
||||
VAR_SHRED_LIN ,
|
||||
VAR_SIGMOID ,
|
||||
@ -323,7 +370,9 @@ enum class eVariationId : et
|
||||
VAR_SINUS_GRID ,
|
||||
VAR_SINUSOIDAL ,
|
||||
VAR_SINUSOIDAL3D,
|
||||
VAR_SMARTSHAPE,
|
||||
//VAR_SMARTCROP ,
|
||||
VAR_SPHER ,
|
||||
VAR_SPHEREBLUR ,
|
||||
VAR_SPHERICAL ,
|
||||
VAR_SPHERICAL3D ,
|
||||
@ -338,34 +387,48 @@ enum class eVariationId : et
|
||||
VAR_SPLITS ,
|
||||
VAR_SPLITS3D ,
|
||||
VAR_SQUARE ,
|
||||
VAR_SQUARES ,
|
||||
VAR_SQUARE3D ,
|
||||
VAR_SQUARIZE ,
|
||||
VAR_SQUIRREL ,
|
||||
VAR_SQUISH,
|
||||
VAR_SSCHECKS ,
|
||||
VAR_STARBLUR ,
|
||||
VAR_STARBLUR2 ,
|
||||
VAR_STRIPES ,
|
||||
VAR_STWIN ,
|
||||
VAR_SUPER_SHAPE ,
|
||||
VAR_SUPER_SHAPE3D,
|
||||
VAR_SVF ,
|
||||
VAR_SWIRL ,
|
||||
VAR_SWIRL3 ,
|
||||
VAR_SWIRL3R ,
|
||||
VAR_SYNTH ,
|
||||
VAR_TAN ,
|
||||
VAR_TANCOS,
|
||||
VAR_TANGENT ,
|
||||
VAR_TANH ,
|
||||
VAR_TANHQ ,
|
||||
VAR_TANH_SPIRAL ,
|
||||
VAR_TANQ ,
|
||||
VAR_TARGET ,
|
||||
VAR_TARGET0 ,
|
||||
VAR_TARGET2 ,
|
||||
VAR_TAURUS ,
|
||||
VAR_TILE_HLP,
|
||||
VAR_TILE_LOG,
|
||||
VAR_TRADE ,
|
||||
VAR_TRUCHET,
|
||||
VAR_TRUCHET_FILL,
|
||||
VAR_TRUCHET_GLYPH,
|
||||
VAR_TRUCHET_INV,
|
||||
VAR_TRUCHET_KNOT,
|
||||
VAR_TWINTRIAN ,
|
||||
VAR_TWO_FACE ,
|
||||
VAR_UNICORNGALOSHEN,
|
||||
VAR_UNPOLAR ,
|
||||
VAR_VIBRATION,
|
||||
VAR_VIBRATION2,
|
||||
VAR_VORON,
|
||||
VAR_W ,
|
||||
VAR_WAFFLE,
|
||||
@ -392,6 +455,11 @@ enum class eVariationId : et
|
||||
VAR_ZTRANSLATE,
|
||||
|
||||
VAR_PRE_ARCH,
|
||||
VAR_PRE_ARCSECH,
|
||||
VAR_PRE_ARCSECH2,
|
||||
VAR_PRE_ARCSINH,
|
||||
VAR_PRE_ARCTANH,
|
||||
VAR_PRE_ASTERIA,
|
||||
//VAR_PRE_ARCSINH,
|
||||
//VAR_PRE_ARCTANH,
|
||||
VAR_PRE_AUGER,
|
||||
@ -407,6 +475,7 @@ enum class eVariationId : et
|
||||
VAR_PRE_BLOB,
|
||||
VAR_PRE_BLOB2,
|
||||
VAR_PRE_BLOB3D,
|
||||
VAR_PRE_BLOCK,
|
||||
VAR_PRE_BLOCKY,
|
||||
VAR_PRE_BLUR,
|
||||
VAR_PRE_BLUR_CIRCLE,
|
||||
@ -426,11 +495,13 @@ enum class eVariationId : et
|
||||
VAR_PRE_BUBBLET3D,
|
||||
VAR_PRE_BUTTERFLY,
|
||||
VAR_PRE_BWRAPS,
|
||||
VAR_PRE_BWRAPS_RAND,
|
||||
VAR_PRE_CARDIOID,
|
||||
VAR_PRE_CELL,
|
||||
VAR_PRE_CHECKS,
|
||||
VAR_PRE_CIRCLEBLUR,
|
||||
VAR_PRE_CIRCLECROP,
|
||||
VAR_PRE_CIRCLECROP2,
|
||||
VAR_PRE_CIRCLELINEAR,
|
||||
VAR_PRE_CIRCLERAND,
|
||||
VAR_PRE_CIRCLESPLIT,
|
||||
@ -449,12 +520,14 @@ enum class eVariationId : et
|
||||
VAR_PRE_COSQ,
|
||||
VAR_PRE_COT,
|
||||
VAR_PRE_COTH,
|
||||
VAR_PRE_COTH_SPIRAL,
|
||||
VAR_PRE_COTHQ,
|
||||
VAR_PRE_COTQ,
|
||||
VAR_PRE_CPOW,
|
||||
VAR_PRE_CPOW2,
|
||||
VAR_PRE_CPOW3,
|
||||
VAR_PRE_CRACKLE,
|
||||
VAR_PRE_CRACKLE2,
|
||||
VAR_PRE_CRESCENTS,
|
||||
VAR_PRE_CROB,
|
||||
VAR_PRE_CROP,
|
||||
@ -475,10 +548,21 @@ enum class eVariationId : et
|
||||
VAR_PRE_CYLINDER2,
|
||||
VAR_PRE_DELTA_A,
|
||||
VAR_PRE_DEPTH,
|
||||
VAR_PRE_DEPTH_BLUR,
|
||||
VAR_PRE_DEPTH_BLUR2,
|
||||
VAR_PRE_DEPTH_GAUSSIAN,
|
||||
VAR_PRE_DEPTH_GAUSSIAN2,
|
||||
VAR_PRE_DEPTH_NGON,
|
||||
VAR_PRE_DEPTH_NGON2,
|
||||
VAR_PRE_DEPTH_SINE,
|
||||
VAR_PRE_DEPTH_SINE2,
|
||||
VAR_PRE_DIAMOND,
|
||||
VAR_PRE_DISC,
|
||||
VAR_PRE_DISC2,
|
||||
VAR_PRE_DISC3D,
|
||||
VAR_PRE_DRAGONFIRE,
|
||||
VAR_PRE_DUST,
|
||||
VAR_PRE_D_SPHERICAL,
|
||||
VAR_PRE_ECLIPSE,
|
||||
VAR_PRE_ECOLLIDE,
|
||||
VAR_PRE_EDISC,
|
||||
@ -496,7 +580,9 @@ enum class eVariationId : et
|
||||
VAR_PRE_ESTIQ,
|
||||
VAR_PRE_ESWIRL,
|
||||
VAR_PRE_EX,
|
||||
VAR_PRE_EXCINIS,
|
||||
VAR_PRE_EXP,
|
||||
VAR_PRE_EXP2,
|
||||
VAR_PRE_EXPO,
|
||||
VAR_PRE_EXPONENTIAL,
|
||||
VAR_PRE_EXTRUDE,
|
||||
@ -513,20 +599,27 @@ enum class eVariationId : et
|
||||
VAR_PRE_FISHEYE,
|
||||
VAR_PRE_FLATTEN,
|
||||
VAR_PRE_FLIP_CIRCLE,
|
||||
VAR_PRE_FLIP_X,
|
||||
VAR_PRE_FLIP_Y,
|
||||
VAR_PRE_FLOWER,
|
||||
VAR_PRE_FLOWER_DB,
|
||||
VAR_PRE_FLUX,
|
||||
VAR_PRE_FOCI,
|
||||
VAR_PRE_FOCI3D,
|
||||
VAR_PRE_FOCI_P,
|
||||
VAR_PRE_FOURTH,
|
||||
VAR_PRE_FUNNEL,
|
||||
VAR_PRE_GAMMA,
|
||||
VAR_PRE_GAUSSIAN,
|
||||
VAR_PRE_GAUSSIAN_BLUR,
|
||||
VAR_PRE_GDOFFS,
|
||||
VAR_PRE_GLYNNIA,
|
||||
VAR_PRE_GLYNNIA2,
|
||||
VAR_PRE_GLYNNSIM1,
|
||||
VAR_PRE_GLYNNSIM2,
|
||||
VAR_PRE_GLYNNSIM3,
|
||||
VAR_PRE_GLYNNSIM4,
|
||||
VAR_PRE_GLYNNSIM5,
|
||||
VAR_PRE_GRIDOUT,
|
||||
VAR_PRE_HANDKERCHIEF,
|
||||
VAR_PRE_HEART,
|
||||
@ -534,15 +627,19 @@ enum class eVariationId : et
|
||||
VAR_PRE_HELICOID,
|
||||
VAR_PRE_HELIX,
|
||||
VAR_PRE_HEMISPHERE,
|
||||
VAR_PRE_HENON,
|
||||
VAR_PRE_HEXAPLAY3D,
|
||||
VAR_PRE_HEXCROP,
|
||||
VAR_PRE_HEXES,
|
||||
VAR_PRE_HEXNIX3D,
|
||||
VAR_PRE_HEX_RAND,
|
||||
VAR_PRE_HEX_TRUCHET,
|
||||
VAR_PRE_HO,
|
||||
VAR_PRE_HOLE,
|
||||
VAR_PRE_HORSESHOE,
|
||||
VAR_PRE_HYPERBOLIC,
|
||||
VAR_PRE_HYPERCROP,
|
||||
VAR_PRE_HYPERSHIFT,
|
||||
VAR_PRE_HYPERSHIFT2,
|
||||
VAR_PRE_HYPERTILE,
|
||||
VAR_PRE_HYPERTILE1,
|
||||
@ -567,8 +664,10 @@ enum class eVariationId : et
|
||||
VAR_PRE_JULIAQ,
|
||||
VAR_PRE_JULIASCOPE,
|
||||
VAR_PRE_KALEIDOSCOPE,
|
||||
VAR_PRE_LAZY_TRAVIS,
|
||||
VAR_PRE_LAZYJESS,
|
||||
VAR_PRE_LAZYSUSAN,
|
||||
VAR_PRE_LAZY_TRAVIS,
|
||||
VAR_PRE_LENS,
|
||||
VAR_PRE_LINE,
|
||||
VAR_PRE_LINEAR,
|
||||
VAR_PRE_LINEAR_T,
|
||||
@ -584,6 +683,7 @@ enum class eVariationId : et
|
||||
VAR_PRE_LOONIE2,
|
||||
VAR_PRE_LOONIE3,
|
||||
VAR_PRE_LOONIE3D,
|
||||
VAR_PRE_LOZI,
|
||||
VAR_PRE_MASK,
|
||||
VAR_PRE_MCARPET,
|
||||
VAR_PRE_MIRROR_X,
|
||||
@ -594,6 +694,8 @@ enum class eVariationId : et
|
||||
VAR_PRE_MOBIUS_STRIP,
|
||||
VAR_PRE_MOBIUSN,
|
||||
VAR_PRE_MODULUS,
|
||||
VAR_PRE_MODULUSX,
|
||||
VAR_PRE_MODULUSY,
|
||||
VAR_PRE_MURL,
|
||||
VAR_PRE_MURL2,
|
||||
VAR_PRE_NBLUR,
|
||||
@ -604,6 +706,7 @@ enum class eVariationId : et
|
||||
VAR_PRE_OCTAPOL,
|
||||
VAR_PRE_ORTHO,
|
||||
VAR_PRE_OSCILLOSCOPE,
|
||||
VAR_PRE_OSCILLOSCOPE2,
|
||||
VAR_PRE_OVOID,
|
||||
VAR_PRE_OVOID3D,
|
||||
VAR_PRE_PANORAMA1,
|
||||
@ -618,6 +721,7 @@ enum class eVariationId : et
|
||||
VAR_PRE_PIXEL_FLOW,
|
||||
VAR_PRE_POINCARE,
|
||||
VAR_PRE_POINCARE3D,
|
||||
VAR_PRE_POINT_SYMMETRY,
|
||||
VAR_PRE_POLAR,
|
||||
VAR_PRE_POLAR2,
|
||||
VAR_PRE_POLYNOMIAL,
|
||||
@ -627,8 +731,10 @@ enum class eVariationId : et
|
||||
VAR_PRE_POW_BLOCK,
|
||||
VAR_PRE_POWER,
|
||||
VAR_PRE_PRESSURE_WAVE,
|
||||
VAR_PRE_PROJECTIVE,
|
||||
VAR_PRE_PROSE3D,
|
||||
VAR_PRE_PSPHERE,
|
||||
VAR_PRE_PULSE,
|
||||
VAR_PRE_Q_ODE,
|
||||
VAR_PRE_RADIAL_BLUR,
|
||||
VAR_PRE_RAND_CUBES,
|
||||
@ -643,12 +749,14 @@ enum class eVariationId : et
|
||||
VAR_PRE_RINGS2,
|
||||
VAR_PRE_RIPPLE,
|
||||
VAR_PRE_RIPPLED,
|
||||
VAR_PRE_ROTATE,
|
||||
VAR_PRE_ROTATE_X,
|
||||
VAR_PRE_ROTATE_Y,
|
||||
VAR_PRE_ROTATE_Z,
|
||||
VAR_PRE_ROUNDSPHER,
|
||||
VAR_PRE_ROUNDSPHER3D,
|
||||
VAR_PRE_SCRY,
|
||||
VAR_PRE_SCRY2,
|
||||
VAR_PRE_SCRY3D,
|
||||
VAR_PRE_SEC,
|
||||
VAR_PRE_SECANT2,
|
||||
@ -656,6 +764,7 @@ enum class eVariationId : et
|
||||
VAR_PRE_SECHQ,
|
||||
VAR_PRE_SECQ,
|
||||
VAR_PRE_SEPARATION,
|
||||
VAR_PRE_SHIFT,
|
||||
VAR_PRE_SHRED_RAD,
|
||||
VAR_PRE_SHRED_LIN,
|
||||
VAR_PRE_SIGMOID,
|
||||
@ -668,7 +777,9 @@ enum class eVariationId : et
|
||||
VAR_PRE_SINUS_GRID,
|
||||
VAR_PRE_SINUSOIDAL,
|
||||
VAR_PRE_SINUSOIDAL3D,
|
||||
VAR_PRE_SMARTSHAPE,
|
||||
//VAR_PRE_SMARTCROP,
|
||||
VAR_PRE_SPHER,
|
||||
VAR_PRE_SPHEREBLUR,
|
||||
VAR_PRE_SPHERICAL,
|
||||
VAR_PRE_SPHERICAL3D,
|
||||
@ -683,34 +794,48 @@ enum class eVariationId : et
|
||||
VAR_PRE_SPLITS,
|
||||
VAR_PRE_SPLITS3D,
|
||||
VAR_PRE_SQUARE,
|
||||
VAR_PRE_SQUARES,
|
||||
VAR_PRE_SQUARE3D,
|
||||
VAR_PRE_SQUARIZE,
|
||||
VAR_PRE_SQUIRREL,
|
||||
VAR_PRE_SQUISH,
|
||||
VAR_PRE_SSCHECKS,
|
||||
VAR_PRE_STARBLUR,
|
||||
VAR_PRE_STARBLUR2,
|
||||
VAR_PRE_STRIPES,
|
||||
VAR_PRE_STWIN,
|
||||
VAR_PRE_SUPER_SHAPE,
|
||||
VAR_PRE_SUPER_SHAPE3D,
|
||||
VAR_PRE_SVF,
|
||||
VAR_PRE_SWIRL,
|
||||
VAR_PRE_SWIRL3,
|
||||
VAR_PRE_SWIRL3R,
|
||||
VAR_PRE_SYNTH,
|
||||
VAR_PRE_TAN,
|
||||
VAR_PRE_TANCOS,
|
||||
VAR_PRE_TANGENT,
|
||||
VAR_PRE_TANH,
|
||||
VAR_PRE_TANHQ,
|
||||
VAR_PRE_TANH_SPIRAL,
|
||||
VAR_PRE_TANQ,
|
||||
VAR_PRE_TARGET,
|
||||
VAR_PRE_TARGET0,
|
||||
VAR_PRE_TARGET2,
|
||||
VAR_PRE_TAURUS,
|
||||
VAR_PRE_TILE_HLP,
|
||||
VAR_PRE_TILE_LOG,
|
||||
VAR_PRE_TRADE,
|
||||
VAR_PRE_TRUCHET,
|
||||
VAR_PRE_TRUCHET_FILL,
|
||||
VAR_PRE_TRUCHET_GLYPH,
|
||||
VAR_PRE_TRUCHET_INV,
|
||||
VAR_PRE_TRUCHET_KNOT,
|
||||
VAR_PRE_TWINTRIAN,
|
||||
VAR_PRE_TWO_FACE,
|
||||
VAR_PRE_UNICORNGALOSHEN,
|
||||
VAR_PRE_UNPOLAR,
|
||||
VAR_PRE_VIBRATION,
|
||||
VAR_PRE_VIBRATION2,
|
||||
VAR_PRE_VORON,
|
||||
VAR_PRE_W,
|
||||
VAR_PRE_WAFFLE,
|
||||
@ -737,6 +862,11 @@ enum class eVariationId : et
|
||||
VAR_PRE_ZTRANSLATE,
|
||||
|
||||
VAR_POST_ARCH,
|
||||
VAR_POST_ARCSECH,
|
||||
VAR_POST_ARCSECH2,
|
||||
VAR_POST_ARCSINH,
|
||||
VAR_POST_ARCTANH,
|
||||
VAR_POST_ASTERIA,
|
||||
//VAR_POST_ARCSINH,
|
||||
//VAR_POST_ARCTANH,
|
||||
VAR_POST_AUGER,
|
||||
@ -752,6 +882,7 @@ enum class eVariationId : et
|
||||
VAR_POST_BLOB,
|
||||
VAR_POST_BLOB2,
|
||||
VAR_POST_BLOB3D,
|
||||
VAR_POST_BLOCK,
|
||||
VAR_POST_BLOCKY,
|
||||
VAR_POST_BLUR,
|
||||
VAR_POST_BLUR_CIRCLE,
|
||||
@ -771,11 +902,13 @@ enum class eVariationId : et
|
||||
VAR_POST_BUBBLET3D,
|
||||
VAR_POST_BUTTERFLY,
|
||||
VAR_POST_BWRAPS,
|
||||
VAR_POST_BWRAPS_RAND,
|
||||
VAR_POST_CARDIOID,
|
||||
VAR_POST_CELL,
|
||||
VAR_POST_CHECKS,
|
||||
VAR_POST_CIRCLEBLUR,
|
||||
VAR_POST_CIRCLECROP,
|
||||
VAR_POST_CIRCLECROP2,
|
||||
VAR_POST_CIRCLELINEAR,
|
||||
VAR_POST_CIRCLERAND,
|
||||
VAR_POST_CIRCLESPLIT,
|
||||
@ -794,12 +927,14 @@ enum class eVariationId : et
|
||||
VAR_POST_COSQ,
|
||||
VAR_POST_COT,
|
||||
VAR_POST_COTH,
|
||||
VAR_POST_COTH_SPIRAL,
|
||||
VAR_POST_COTHQ,
|
||||
VAR_POST_COTQ,
|
||||
VAR_POST_CPOW,
|
||||
VAR_POST_CPOW2,
|
||||
VAR_POST_CPOW3,
|
||||
VAR_POST_CRACKLE,
|
||||
VAR_POST_CRACKLE2,
|
||||
VAR_POST_CRESCENTS,
|
||||
VAR_POST_CROB,
|
||||
VAR_POST_CROP,
|
||||
@ -820,10 +955,21 @@ enum class eVariationId : et
|
||||
VAR_POST_CYLINDER2,
|
||||
VAR_POST_DELTA_A,
|
||||
VAR_POST_DEPTH,
|
||||
VAR_POST_DEPTH_BLUR,
|
||||
VAR_POST_DEPTH_BLUR2,
|
||||
VAR_POST_DEPTH_GAUSSIAN,
|
||||
VAR_POST_DEPTH_GAUSSIAN2,
|
||||
VAR_POST_DEPTH_NGON,
|
||||
VAR_POST_DEPTH_NGON2,
|
||||
VAR_POST_DEPTH_SINE,
|
||||
VAR_POST_DEPTH_SINE2,
|
||||
VAR_POST_DIAMOND,
|
||||
VAR_POST_DISC,
|
||||
VAR_POST_DISC2,
|
||||
VAR_POST_DISC3D,
|
||||
VAR_POST_DRAGONFIRE,
|
||||
VAR_POST_DUST,
|
||||
VAR_POST_D_SPHERICAL,
|
||||
VAR_POST_ECLIPSE,
|
||||
VAR_POST_ECOLLIDE,
|
||||
VAR_POST_EDISC,
|
||||
@ -841,7 +987,9 @@ enum class eVariationId : et
|
||||
VAR_POST_ESTIQ,
|
||||
VAR_POST_ESWIRL,
|
||||
VAR_POST_EX,
|
||||
VAR_POST_EXCINIS,
|
||||
VAR_POST_EXP,
|
||||
VAR_POST_EXP2,
|
||||
VAR_POST_EXPO,
|
||||
VAR_POST_EXPONENTIAL,
|
||||
VAR_POST_EXTRUDE,
|
||||
@ -858,20 +1006,27 @@ enum class eVariationId : et
|
||||
VAR_POST_FISHEYE,
|
||||
VAR_POST_FLATTEN,
|
||||
VAR_POST_FLIP_CIRCLE,
|
||||
VAR_POST_FLIP_X,
|
||||
VAR_POST_FLIP_Y,
|
||||
VAR_POST_FLOWER,
|
||||
VAR_POST_FLOWER_DB,
|
||||
VAR_POST_FLUX,
|
||||
VAR_POST_FOCI,
|
||||
VAR_POST_FOCI3D,
|
||||
VAR_POST_FOCI_P,
|
||||
VAR_POST_FOURTH,
|
||||
VAR_POST_FUNNEL,
|
||||
VAR_POST_GAMMA,
|
||||
VAR_POST_GAUSSIAN,
|
||||
VAR_POST_GAUSSIAN_BLUR,
|
||||
VAR_POST_GDOFFS,
|
||||
VAR_POST_GLYNNIA,
|
||||
VAR_POST_GLYNNIA2,
|
||||
VAR_POST_GLYNNSIM1,
|
||||
VAR_POST_GLYNNSIM2,
|
||||
VAR_POST_GLYNNSIM3,
|
||||
VAR_POST_GLYNNSIM4,
|
||||
VAR_POST_GLYNNSIM5,
|
||||
VAR_POST_GRIDOUT,
|
||||
VAR_POST_HANDKERCHIEF,
|
||||
VAR_POST_HEART,
|
||||
@ -879,15 +1034,19 @@ enum class eVariationId : et
|
||||
VAR_POST_HELICOID,
|
||||
VAR_POST_HELIX,
|
||||
VAR_POST_HEMISPHERE,
|
||||
VAR_POST_HENON,
|
||||
VAR_POST_HEXAPLAY3D,
|
||||
VAR_POST_HEXCROP,
|
||||
VAR_POST_HEXES,
|
||||
VAR_POST_HEXNIX3D,
|
||||
VAR_POST_HEX_RAND,
|
||||
VAR_POST_HEX_TRUCHET,
|
||||
VAR_POST_HO,
|
||||
VAR_POST_HOLE,
|
||||
VAR_POST_HORSESHOE,
|
||||
VAR_POST_HYPERBOLIC,
|
||||
VAR_POST_HYPERCROP,
|
||||
VAR_POST_HYPERSHIFT,
|
||||
VAR_POST_HYPERSHIFT2,
|
||||
VAR_POST_HYPERTILE,
|
||||
VAR_POST_HYPERTILE1,
|
||||
@ -912,8 +1071,10 @@ enum class eVariationId : et
|
||||
VAR_POST_JULIAQ,
|
||||
VAR_POST_JULIASCOPE,
|
||||
VAR_POST_KALEIDOSCOPE,
|
||||
VAR_POST_LAZY_TRAVIS,
|
||||
VAR_POST_LAZYJESS,
|
||||
VAR_POST_LAZYSUSAN,
|
||||
VAR_POST_LAZY_TRAVIS,
|
||||
VAR_POST_LENS,
|
||||
VAR_POST_LINE,
|
||||
VAR_POST_LINEAR,
|
||||
VAR_POST_LINEAR_T,
|
||||
@ -929,6 +1090,7 @@ enum class eVariationId : et
|
||||
VAR_POST_LOONIE2,
|
||||
VAR_POST_LOONIE3,
|
||||
VAR_POST_LOONIE3D,
|
||||
VAR_POST_LOZI,
|
||||
VAR_POST_MASK,
|
||||
VAR_POST_MCARPET,
|
||||
VAR_POST_MIRROR_X,
|
||||
@ -939,6 +1101,8 @@ enum class eVariationId : et
|
||||
VAR_POST_MOBIUS_STRIP,
|
||||
VAR_POST_MOBIUSN,
|
||||
VAR_POST_MODULUS,
|
||||
VAR_POST_MODULUSX,
|
||||
VAR_POST_MODULUSY,
|
||||
VAR_POST_MURL,
|
||||
VAR_POST_MURL2,
|
||||
VAR_POST_NBLUR,
|
||||
@ -949,6 +1113,7 @@ enum class eVariationId : et
|
||||
VAR_POST_OCTAPOL,
|
||||
VAR_POST_ORTHO,
|
||||
VAR_POST_OSCILLOSCOPE,
|
||||
VAR_POST_OSCILLOSCOPE2,
|
||||
VAR_POST_OVOID,
|
||||
VAR_POST_OVOID3D,
|
||||
VAR_POST_PANORAMA1,
|
||||
@ -963,6 +1128,7 @@ enum class eVariationId : et
|
||||
VAR_POST_PIXEL_FLOW,
|
||||
VAR_POST_POINCARE,
|
||||
VAR_POST_POINCARE3D,
|
||||
VAR_POST_POINT_SYMMETRY,
|
||||
VAR_POST_POLAR,
|
||||
VAR_POST_POLAR2,
|
||||
VAR_POST_POLYNOMIAL,
|
||||
@ -972,8 +1138,10 @@ enum class eVariationId : et
|
||||
VAR_POST_POW_BLOCK,
|
||||
VAR_POST_POWER,
|
||||
VAR_POST_PRESSURE_WAVE,
|
||||
VAR_POST_PROJECTIVE,
|
||||
VAR_POST_PROSE3D,
|
||||
VAR_POST_PSPHERE,
|
||||
VAR_POST_PULSE,
|
||||
VAR_POST_Q_ODE,
|
||||
VAR_POST_RADIAL_BLUR,
|
||||
VAR_POST_RAND_CUBES,
|
||||
@ -988,12 +1156,14 @@ enum class eVariationId : et
|
||||
VAR_POST_RINGS2,
|
||||
VAR_POST_RIPPLE,
|
||||
VAR_POST_RIPPLED,
|
||||
VAR_POST_ROTATE,
|
||||
VAR_POST_ROTATE_X,
|
||||
VAR_POST_ROTATE_Y,
|
||||
VAR_POST_ROTATE_Z,
|
||||
VAR_POST_ROUNDSPHER,
|
||||
VAR_POST_ROUNDSPHER3D,
|
||||
VAR_POST_SCRY,
|
||||
VAR_POST_SCRY2,
|
||||
VAR_POST_SCRY3D,
|
||||
VAR_POST_SEC,
|
||||
VAR_POST_SECANT2,
|
||||
@ -1001,6 +1171,7 @@ enum class eVariationId : et
|
||||
VAR_POST_SECHQ,
|
||||
VAR_POST_SECQ,
|
||||
VAR_POST_SEPARATION,
|
||||
VAR_POST_SHIFT,
|
||||
VAR_POST_SHRED_RAD,
|
||||
VAR_POST_SHRED_LIN,
|
||||
VAR_POST_SIGMOID,
|
||||
@ -1013,7 +1184,9 @@ enum class eVariationId : et
|
||||
VAR_POST_SINUS_GRID,
|
||||
VAR_POST_SINUSOIDAL,
|
||||
VAR_POST_SINUSOIDAL3D,
|
||||
VAR_POST_SMARTSHAPE,
|
||||
VAR_POST_SMARTCROP,
|
||||
VAR_POST_SPHER,
|
||||
VAR_POST_SPHEREBLUR,
|
||||
VAR_POST_SPHERICAL,
|
||||
VAR_POST_SPHERICAL3D,
|
||||
@ -1028,34 +1201,48 @@ enum class eVariationId : et
|
||||
VAR_POST_SPLITS,
|
||||
VAR_POST_SPLITS3D,
|
||||
VAR_POST_SQUARE,
|
||||
VAR_POST_SQUARES,
|
||||
VAR_POST_SQUARE3D,
|
||||
VAR_POST_SQUARIZE,
|
||||
VAR_POST_SQUIRREL,
|
||||
VAR_POST_SQUISH,
|
||||
VAR_POST_SSCHECKS,
|
||||
VAR_POST_STARBLUR,
|
||||
VAR_POST_STARBLUR2,
|
||||
VAR_POST_STRIPES,
|
||||
VAR_POST_STWIN,
|
||||
VAR_POST_SUPER_SHAPE,
|
||||
VAR_POST_SUPER_SHAPE3D,
|
||||
VAR_POST_SVF,
|
||||
VAR_POST_SWIRL,
|
||||
VAR_POST_SWIRL3,
|
||||
VAR_POST_SWIRL3R,
|
||||
VAR_POST_SYNTH,
|
||||
VAR_POST_TAN,
|
||||
VAR_POST_TANCOS,
|
||||
VAR_POST_TANGENT,
|
||||
VAR_POST_TANH,
|
||||
VAR_POST_TANHQ,
|
||||
VAR_POST_TANH_SPIRAL,
|
||||
VAR_POST_TANQ,
|
||||
VAR_POST_TARGET,
|
||||
VAR_POST_TARGET0,
|
||||
VAR_POST_TARGET2,
|
||||
VAR_POST_TAURUS,
|
||||
VAR_POST_TILE_HLP,
|
||||
VAR_POST_TILE_LOG,
|
||||
VAR_POST_TRADE,
|
||||
VAR_POST_TRUCHET,
|
||||
VAR_POST_TRUCHET_FILL,
|
||||
VAR_POST_TRUCHET_GLYPH,
|
||||
VAR_POST_TRUCHET_INV,
|
||||
VAR_POST_TRUCHET_KNOT,
|
||||
VAR_POST_TWINTRIAN,
|
||||
VAR_POST_TWO_FACE,
|
||||
VAR_POST_UNICORNGALOSHEN,
|
||||
VAR_POST_UNPOLAR,
|
||||
VAR_POST_VIBRATION,
|
||||
VAR_POST_VIBRATION2,
|
||||
VAR_POST_VORON,
|
||||
VAR_POST_W,
|
||||
VAR_POST_WAFFLE,
|
||||
|
||||
@ -27,6 +27,8 @@ VariationList<T>::VariationList()
|
||||
ADDPREPOSTREGVAR(Sinusoidal)
|
||||
ADDPREPOSTREGVAR(Spherical)
|
||||
ADDPREPOSTREGVAR(Swirl)
|
||||
ADDPREPOSTREGVAR(Swirl3)
|
||||
ADDPREPOSTREGVAR(Swirl3r)
|
||||
ADDPREPOSTREGVAR(Horseshoe)
|
||||
ADDPREPOSTREGVAR(Polar)
|
||||
ADDPREPOSTREGVAR(Handkerchief)
|
||||
@ -59,6 +61,7 @@ VariationList<T>::VariationList()
|
||||
ADDPREPOSTREGVAR(JuliaScope)
|
||||
ADDPREPOSTREGVAR(Blur)
|
||||
ADDPREPOSTREGVAR(GaussianBlur)
|
||||
ADDPREPOSTREGVAR(Gaussian)
|
||||
ADDPREPOSTREGVAR(RadialBlur)
|
||||
ADDPREPOSTREGVAR(Pie)
|
||||
ADDPREPOSTREGVAR(Ngon)
|
||||
@ -78,6 +81,7 @@ VariationList<T>::VariationList()
|
||||
ADDPREPOSTREGVAR(Disc2)
|
||||
ADDPREPOSTREGVAR(SuperShape)
|
||||
ADDPREPOSTREGVAR(Flower)
|
||||
ADDPREPOSTREGVAR(FlowerDb)
|
||||
ADDPREPOSTREGVAR(Conic)
|
||||
ADDPREPOSTREGVAR(Parabola)
|
||||
ADDPREPOSTREGVAR(Bent2)
|
||||
@ -95,9 +99,11 @@ VariationList<T>::VariationList()
|
||||
ADDPREPOSTREGVAR(Loonie)
|
||||
ADDPREPOSTREGVAR(Modulus)
|
||||
ADDPREPOSTREGVAR(Oscilloscope)
|
||||
ADDPREPOSTREGVAR(Oscilloscope2)
|
||||
ADDPREPOSTREGVAR(Polar2)
|
||||
ADDPREPOSTREGVAR(Popcorn2)
|
||||
ADDPREPOSTREGVAR(Scry)
|
||||
ADDPREPOSTREGVAR(Scry2)
|
||||
ADDPREPOSTREGVAR(Separation)
|
||||
ADDPREPOSTREGVAR(Split)
|
||||
ADDPREPOSTREGVAR(Splits)
|
||||
@ -108,6 +114,7 @@ VariationList<T>::VariationList()
|
||||
ADDPREPOSTREGVAR(Whorl)
|
||||
ADDPREPOSTREGVAR(Waves2)
|
||||
ADDPREPOSTREGVAR(Exp)
|
||||
ADDPREPOSTREGVAR(Exp2)
|
||||
ADDPREPOSTREGVAR(Log)
|
||||
ADDPREPOSTREGVAR(Sin)
|
||||
ADDPREPOSTREGVAR(Cos)
|
||||
@ -118,6 +125,7 @@ VariationList<T>::VariationList()
|
||||
ADDPREPOSTREGVAR(Sinh)
|
||||
ADDPREPOSTREGVAR(Cosh)
|
||||
ADDPREPOSTREGVAR(Tanh)
|
||||
ADDPREPOSTREGVAR(TanhSpiral)
|
||||
ADDPREPOSTREGVAR(Sech)
|
||||
ADDPREPOSTREGVAR(Csch)
|
||||
ADDPREPOSTREGVAR(Coth)
|
||||
@ -126,6 +134,7 @@ VariationList<T>::VariationList()
|
||||
ADDPREPOSTREGVAR(Hemisphere)
|
||||
ADDPREPOSTREGVAR(Epispiral)
|
||||
ADDPREPOSTREGVAR(Bwraps)
|
||||
ADDPREPOSTREGVAR(BwrapsRand)
|
||||
ADDPREPOSTREGVAR(BlurCircle)
|
||||
ADDPREPOSTREGVAR(BlurZoom)
|
||||
ADDPREPOSTREGVAR(BlurPixelize)
|
||||
@ -146,6 +155,7 @@ VariationList<T>::VariationList()
|
||||
ADDPREPOSTREGVAR(Fibonacci)
|
||||
ADDPREPOSTREGVAR(Fibonacci2)
|
||||
ADDPREPOSTREGVAR(Glynnia)
|
||||
ADDPREPOSTREGVAR(Glynnia2)
|
||||
ADDPREPOSTREGVAR(GridOut)
|
||||
ADDPREPOSTREGVAR(Hole)
|
||||
ADDPREPOSTREGVAR(Hypertile)
|
||||
@ -191,6 +201,8 @@ VariationList<T>::VariationList()
|
||||
ADDPREPOSTREGVAR(GlynnSim1)
|
||||
ADDPREPOSTREGVAR(GlynnSim2)
|
||||
ADDPREPOSTREGVAR(GlynnSim3)
|
||||
ADDPREPOSTREGVAR(GlynnSim4)
|
||||
ADDPREPOSTREGVAR(GlynnSim5)
|
||||
ADDPREPOSTREGVAR(Starblur)
|
||||
ADDPREPOSTREGVAR(Sineblur)
|
||||
ADDPREPOSTREGVAR(Circleblur)
|
||||
@ -205,6 +217,7 @@ VariationList<T>::VariationList()
|
||||
ADDPREPOSTREGVAR(Ovoid3D)
|
||||
ADDPREPOSTREGVAR(Spirograph)
|
||||
ADDPREPOSTREGVAR(Petal)
|
||||
ADDPREPOSTREGVAR(Spher)
|
||||
ADDPREPOSTREGVAR(RoundSpher)
|
||||
ADDPREPOSTREGVAR(RoundSpher3D)
|
||||
ADDPREPOSTREGVAR(SpiralWing)
|
||||
@ -217,6 +230,8 @@ VariationList<T>::VariationList()
|
||||
ADDPREPOSTREGVAR(Lissajous)
|
||||
ADDPREPOSTREGVAR(Svf)
|
||||
ADDPREPOSTREGVAR(Target)
|
||||
ADDPREPOSTREGVAR(Target0)
|
||||
ADDPREPOSTREGVAR(Target2)
|
||||
ADDPREPOSTREGVAR(Taurus)
|
||||
ADDPREPOSTREGVAR(Collideoscope)
|
||||
ADDPREPOSTREGVAR(BMod)
|
||||
@ -225,6 +240,7 @@ VariationList<T>::VariationList()
|
||||
ADDPREPOSTREGVAR(BCollide)
|
||||
ADDPREPOSTREGVAR(Eclipse)
|
||||
ADDPREPOSTREGVAR(FlipCircle)
|
||||
ADDPREPOSTREGVAR(FlipX)
|
||||
ADDPREPOSTREGVAR(FlipY)
|
||||
ADDPREPOSTREGVAR(ECollide)
|
||||
ADDPREPOSTREGVAR(EJulia)
|
||||
@ -234,6 +250,7 @@ VariationList<T>::VariationList()
|
||||
ADDPREPOSTREGVAR(ERotate)
|
||||
ADDPREPOSTREGVAR(EScale)
|
||||
ADDPREPOSTREGVAR(ESwirl)
|
||||
ADDPREPOSTREGVAR(LazyJess)
|
||||
ADDPREPOSTREGVAR(LazyTravis)
|
||||
ADDPREPOSTREGVAR(Squish)
|
||||
ADDPREPOSTREGVAR(Circus)
|
||||
@ -262,6 +279,7 @@ VariationList<T>::VariationList()
|
||||
ADDPREPOSTREGVAR(SuperShape3D)
|
||||
ADDPREPOSTREGVAR(Sphyp3D)
|
||||
ADDPREPOSTREGVAR(Circlecrop)
|
||||
ADDPREPOSTREGVAR(Circlecrop2)
|
||||
ADDPREPOSTREGVAR(Julian3Dx)
|
||||
ADDPREPOSTREGVAR(Fourth)
|
||||
ADDPREPOSTREGVAR(Mobiq)
|
||||
@ -288,12 +306,17 @@ VariationList<T>::VariationList()
|
||||
ADDPREPOSTREGVAR(Qode)
|
||||
ADDPREPOSTREGVAR(BlurHeart)
|
||||
ADDPREPOSTREGVAR(Truchet)
|
||||
ADDPREPOSTREGVAR(TruchetFill)
|
||||
ADDPREPOSTREGVAR(TruchetGlyph)
|
||||
ADDPREPOSTREGVAR(TruchetInv)
|
||||
ADDPREPOSTREGVAR(TruchetKnot)
|
||||
ADDPREPOSTREGVAR(Gdoffs)
|
||||
ADDPREPOSTREGVAR(Octagon)
|
||||
ADDPREPOSTREGVAR(Trade)
|
||||
ADDPREPOSTREGVAR(Juliac)
|
||||
ADDPREPOSTREGVAR(Blade3D)
|
||||
ADDPREPOSTREGVAR(Blob3D)
|
||||
ADDPREPOSTREGVAR(Block)
|
||||
ADDPREPOSTREGVAR(Blocky)
|
||||
ADDPREPOSTREGVAR(Bubble2)
|
||||
ADDPREPOSTREGVAR(CircleLinear)
|
||||
@ -302,6 +325,7 @@ VariationList<T>::VariationList()
|
||||
ADDPREPOSTREGVAR(Cubic3D)
|
||||
ADDPREPOSTREGVAR(CubicLattice3D)
|
||||
ADDPREPOSTREGVAR(Foci3D)
|
||||
ADDPREPOSTREGVAR(FociP)
|
||||
ADDPREPOSTREGVAR(Ho)
|
||||
ADDPREPOSTREGVAR(Julia3Dq)
|
||||
ADDPREPOSTREGVAR(Line)
|
||||
@ -331,6 +355,7 @@ VariationList<T>::VariationList()
|
||||
ADDPREPOSTREGVAR(BubbleT3D)
|
||||
ADDPREPOSTREGVAR(Synth)
|
||||
ADDPREPOSTREGVAR(Crackle)
|
||||
ADDPREPOSTREGVAR(Crackle2)
|
||||
m_Variations.push_back(new PostSmartcropVariation<T>());//Post only
|
||||
ADDPREPOSTREGVAR(Xerf)
|
||||
ADDPREPOSTREGVAR(Erf)
|
||||
@ -350,7 +375,7 @@ VariationList<T>::VariationList()
|
||||
ADDPREPOSTREGVAR(CircleSplit)
|
||||
ADDPREPOSTREGVAR(Cylinder2)
|
||||
ADDPREPOSTREGVAR(TileLog)
|
||||
ADDPREPOSTREGVAR(TruchetFill)
|
||||
ADDPREPOSTREGVAR(TileHlp)
|
||||
ADDPREPOSTREGVAR(Waves2Radial)
|
||||
ADDPREPOSTREGVAR(Panorama1)
|
||||
ADDPREPOSTREGVAR(Panorama2)
|
||||
@ -360,7 +385,44 @@ VariationList<T>::VariationList()
|
||||
ADDPREPOSTREGVAR(Cpow3)
|
||||
ADDPREPOSTREGVAR(Concentric)
|
||||
ADDPREPOSTREGVAR(Hypercrop)
|
||||
ADDPREPOSTREGVAR(Hypershift)
|
||||
ADDPREPOSTREGVAR(Hypershift2)
|
||||
ADDPREPOSTREGVAR(Lens)
|
||||
ADDPREPOSTREGVAR(Projective)
|
||||
ADDPREPOSTREGVAR(DepthBlur)
|
||||
ADDPREPOSTREGVAR(DepthBlur2)
|
||||
ADDPREPOSTREGVAR(DepthGaussian)
|
||||
ADDPREPOSTREGVAR(DepthGaussian2)
|
||||
ADDPREPOSTREGVAR(DepthNgon)
|
||||
ADDPREPOSTREGVAR(DepthNgon2)
|
||||
ADDPREPOSTREGVAR(DepthSine)
|
||||
ADDPREPOSTREGVAR(DepthSine2)
|
||||
ADDPREPOSTREGVAR(CothSpiral)
|
||||
ADDPREPOSTREGVAR(Dust)
|
||||
ADDPREPOSTREGVAR(Asteria)
|
||||
ADDPREPOSTREGVAR(Pulse)
|
||||
ADDPREPOSTREGVAR(Excinis)
|
||||
ADDPREPOSTREGVAR(Vibration)
|
||||
ADDPREPOSTREGVAR(Vibration2)
|
||||
ADDPREPOSTREGVAR(Arcsech)
|
||||
ADDPREPOSTREGVAR(Arcsech2)
|
||||
ADDPREPOSTREGVAR(Arcsinh)
|
||||
ADDPREPOSTREGVAR(Arctanh)
|
||||
ADDPREPOSTREGVAR(HexTruchet)
|
||||
ADDPREPOSTREGVAR(HexRand)
|
||||
ADDPREPOSTREGVAR(Smartshape)
|
||||
ADDPREPOSTREGVAR(Squares)
|
||||
ADDPREPOSTREGVAR(Starblur2)
|
||||
ADDPREPOSTREGVAR(UnicornGaloshen)
|
||||
ADDPREPOSTREGVAR(Dragonfire)
|
||||
ADDPREPOSTREGVAR(Henon)
|
||||
ADDPREPOSTREGVAR(Lozi)
|
||||
ADDPREPOSTREGVAR(PointSymmetry)
|
||||
ADDPREPOSTREGVAR(DSpherical)
|
||||
ADDPREPOSTREGVAR(Modulusx)
|
||||
ADDPREPOSTREGVAR(Modulusy)
|
||||
ADDPREPOSTREGVAR(Rotate)
|
||||
ADDPREPOSTREGVAR(Shift)
|
||||
//ADDPREPOSTREGVAR(LinearXZ)
|
||||
//ADDPREPOSTREGVAR(LinearYZ)
|
||||
//DC are special.
|
||||
|
||||
@ -168,6 +168,157 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// swirl3.
|
||||
/// By Zy0rg.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class Swirl3Variation : public ParametricVariation<T>
|
||||
{
|
||||
public:
|
||||
Swirl3Variation(T weight = 1.0) : ParametricVariation<T>("swirl3", eVariationId::VAR_SWIRL3, weight, true, true, false, false, true)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
PARVARCOPY(Swirl3Variation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
T rad = helper.m_PrecalcSqrtSumSquares;
|
||||
T ang = helper.m_PrecalcAtanyx + std::log(rad) * m_Shift;
|
||||
helper.Out.x = m_Weight * rad * std::cos(ang);
|
||||
helper.Out.y = m_Weight * rad * std::sin(ang);
|
||||
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 weight = WeightDefineString();
|
||||
string shift = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t rad = precalcSqrtSumSquares;\n"
|
||||
<< "\t\treal_t ang = fma(log(rad), " << shift << ", precalcAtanyx);\n"
|
||||
<< "\t\tvOut.x = " << weight << " * rad * cos(ang);\n"
|
||||
<< "\t\tvOut.y = " << weight << " * rad * sin(ang);\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
protected:
|
||||
void Init()
|
||||
{
|
||||
string prefix = Prefix();
|
||||
m_Params.clear();
|
||||
m_Params.push_back(ParamWithName<T>(&m_Shift, prefix + "swirl3_shift", T(0.5)));
|
||||
}
|
||||
|
||||
private:
|
||||
T m_Shift;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// swirl3r.
|
||||
/// By Zy0rg.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class Swirl3rVariation : public ParametricVariation<T>
|
||||
{
|
||||
public:
|
||||
Swirl3rVariation(T weight = 1.0) : ParametricVariation<T>("swirl3r", eVariationId::VAR_SWIRL3R, weight, true, true, false, false, true)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
PARVARCOPY(Swirl3rVariation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
T rad = helper.m_PrecalcSqrtSumSquares;
|
||||
T ang = helper.m_PrecalcAtanyx;
|
||||
T ang2;
|
||||
|
||||
if (rad < m_Minr)
|
||||
ang2 = ang + m_Mina;
|
||||
else if (rad > m_Maxr)
|
||||
ang2 = ang + m_Maxa;
|
||||
else
|
||||
ang2 = ang + std::log(rad) * m_Shift;
|
||||
|
||||
helper.Out.x = m_Weight * rad * std::cos(ang2);
|
||||
helper.Out.y = m_Weight * rad * std::sin(ang2);
|
||||
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 weight = WeightDefineString();
|
||||
string shift = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string mmin = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string mmax = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string minr = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string maxr = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string mina = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string maxa = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t rad = precalcSqrtSumSquares;\n"
|
||||
<< "\t\treal_t ang2, ang = precalcAtanyx;\n"
|
||||
<< "\n"
|
||||
<< "\t\tif (rad < " << minr << ")\n"
|
||||
<< "\t\t ang2 = ang + " << mina << ";\n"
|
||||
<< "\t\telse if (rad > " << maxr << ")\n"
|
||||
<< "\t\t ang2 = ang + " << maxa << ";\n"
|
||||
<< "\t\telse\n"
|
||||
<< "\t\t ang2 = ang + log(rad) * " << shift << ";\n"
|
||||
<< "\n"
|
||||
<< "\t\tvOut.x = " << weight << " * rad * cos(ang);\n"
|
||||
<< "\t\tvOut.y = " << weight << " * rad * sin(ang);\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
virtual void Precalc() override
|
||||
{
|
||||
m_Minr = std::min(m_Min, m_Max);
|
||||
m_Maxr = std::max(m_Min, m_Max);
|
||||
m_Mina = m_Minr > 0 ? std::log(m_Minr) * m_Shift : 0;
|
||||
m_Maxa = m_Maxr > 0 ? std::log(m_Maxr) * m_Shift : 0;
|
||||
}
|
||||
|
||||
protected:
|
||||
void Init()
|
||||
{
|
||||
string prefix = Prefix();
|
||||
m_Params.clear();
|
||||
m_Params.push_back(ParamWithName<T>(&m_Shift, prefix + "swirl3r_shift", T(0.5)));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Min, prefix + "swirl3r_min", T(0.5), eParamType::REAL, 0));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Max, prefix + "swirl3r_max", 1, eParamType::REAL, 0));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_Minr, prefix + "swirl3r_minr"));//Precalc.
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_Maxr, prefix + "swirl3r_maxr"));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_Mina, prefix + "swirl3r_mina"));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_Maxa, prefix + "swirl3r_maxa"));
|
||||
}
|
||||
|
||||
private:
|
||||
T m_Shift;
|
||||
T m_Min;
|
||||
T m_Max;
|
||||
T m_Minr;//Precalc.
|
||||
T m_Maxr;
|
||||
T m_Mina;
|
||||
T m_Maxa;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Horseshoe:
|
||||
/// a = atan2(tx, ty);
|
||||
@ -1918,6 +2069,43 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Gaussian.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class GaussianVariation : public Variation<T>
|
||||
{
|
||||
public:
|
||||
GaussianVariation(T weight = 1.0) : Variation<T>("gaussian", eVariationId::VAR_GAUSSIAN, weight) { }
|
||||
|
||||
VARCOPY(GaussianVariation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
T angle = rand.Frand01<T>() * M_2PI;
|
||||
T r = m_Weight * (rand.Frand01<T>() + rand.Frand01<T>() + rand.Frand01<T>() + rand.Frand01<T>() - 2);
|
||||
helper.Out.x = r * std::cos(angle) + helper.In.x;
|
||||
helper.Out.y = r * std::sin(angle) + helper.In.y;
|
||||
helper.Out.z = DefaultZ(helper);
|
||||
}
|
||||
|
||||
virtual string OpenCLString() const override
|
||||
{
|
||||
ostringstream ss;
|
||||
string weight = WeightDefineString();
|
||||
intmax_t varIndex = IndexInXform();
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t angle = MwcNext01(mwc) * M_2PI;\n"
|
||||
<< "\t\treal_t r = " << weight << " * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - (real_t)(2.0));\n"
|
||||
<< "\n"
|
||||
<< "\t\tvOut.x = fma(r, cos(angle), vIn.x);\n"
|
||||
<< "\t\tvOut.y = fma(r, sin(angle), vIn.y);\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Radial blur.
|
||||
/// </summary>
|
||||
@ -2512,7 +2700,7 @@ public:
|
||||
string weight = WeightDefineString();
|
||||
intmax_t varIndex = IndexInXform();
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t u = fma(" << weight << ", SQR(M_2_PI), 1 / Zeps(tan(precalcSqrtSumSquares)));\n";
|
||||
<< "\t\treal_t u = fma(" << weight << ", SQR(M2PI), 1 / Zeps(tan(precalcSqrtSumSquares)));\n";
|
||||
|
||||
if (m_VarType == eVariationType::VARTYPE_REG)
|
||||
ss << "\t\toutPoint->m_X = outPoint->m_Y = 0;\n";
|
||||
@ -3066,6 +3254,77 @@ private:
|
||||
T m_Holes;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// flowerdb.
|
||||
/// By dark-beam.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class FlowerDbVariation : public ParametricVariation<T>
|
||||
{
|
||||
public:
|
||||
FlowerDbVariation(T weight = 1.0) : ParametricVariation<T>("flowerdb", eVariationId::VAR_FLOWER_DB, weight, true, true, false, false, true)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
PARVARCOPY(FlowerDbVariation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
T r = m_Weight * helper.m_PrecalcSqrtSumSquares;
|
||||
T t = helper.m_PrecalcAtanyx;
|
||||
T r2 = r * (std::abs((m_Spread + std::sin(m_Petals * t)) * cos(m_PetalsSplit * t)));
|
||||
helper.Out.x = r2 * std::cos(t);
|
||||
helper.Out.y = r2 * std::sin(t);
|
||||
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 weight = WeightDefineString();
|
||||
string petals = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string split = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string spread = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string petalssplit = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t r = " << weight << " * precalcSqrtSumSquares;\n"
|
||||
<< "\t\treal_t t = precalcAtanyx;\n"
|
||||
<< "\t\treal_t r2 = r * (fabs((" << spread << " + sin(" << petals << " * t)) * cos(" << petalssplit << " * t)));\n"
|
||||
<< "\n"
|
||||
<< "\t\tvOut.x = r * cos(t);\n"
|
||||
<< "\t\tvOut.y = r * sin(t);\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
virtual void Precalc() override
|
||||
{
|
||||
m_PetalsSplit = m_Petals * m_Split;
|
||||
}
|
||||
|
||||
protected:
|
||||
void Init()
|
||||
{
|
||||
string prefix = Prefix();
|
||||
m_Params.clear();
|
||||
m_Params.push_back(ParamWithName<T>(&m_Petals, prefix + "flowerdb_petals", 6));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Split, prefix + "flowerdb_petal_split"));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Spread, prefix + "flowerdb_petal_spread", 1));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_PetalsSplit, prefix + "flowerdb_petal_split_petals"));//Precalc.
|
||||
}
|
||||
|
||||
private:
|
||||
T m_Petals;
|
||||
T m_Split;
|
||||
T m_Spread;
|
||||
T m_PetalsSplit;//Precalc.
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Conic.
|
||||
/// </summary>
|
||||
@ -3985,20 +4244,52 @@ public:
|
||||
//For this to be correct, it must always use double. So there is no point in switching precisions when using this variation.
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
double x2 = 2 * helper.In.x;
|
||||
double u = helper.m_PrecalcSumSquares + x2;
|
||||
double v = helper.m_PrecalcSumSquares - x2;
|
||||
double xmaxm1 = 0.5 * (Sqrt1pm1(u) + Sqrt1pm1(v));
|
||||
double a = helper.In.x / (1 + xmaxm1);
|
||||
double ssx = xmaxm1 < 0 ? 0 : std::sqrt(xmaxm1);
|
||||
helper.Out.x = T(m_WeightDivPiDiv2 * std::asin(Clamp(a, -1.0, 1.0)));
|
||||
if (typeid(T) == typeid(float))
|
||||
{
|
||||
T tmp = helper.m_PrecalcSumSquares + 1;
|
||||
T x2 = 2 * helper.In.x;
|
||||
T xmax = T(0.5) * (std::sqrt(tmp + x2) + std::sqrt(tmp - x2));
|
||||
T a = helper.In.x / xmax;
|
||||
T b = 1 - a * a;
|
||||
T ssx = xmax - 1;
|
||||
const T w = m_WeightDivPiDiv2;
|
||||
|
||||
if (helper.In.y > 0)
|
||||
helper.Out.y = T(m_WeightDivPiDiv2 * std::log1p(xmaxm1 + ssx));
|
||||
if (b < 0)
|
||||
b = 0;
|
||||
else
|
||||
b = std::sqrt(b);
|
||||
|
||||
if (ssx < 0)
|
||||
ssx = 0;
|
||||
else
|
||||
ssx = std::sqrt(ssx);
|
||||
|
||||
helper.Out.x = w * std::atan2(a, b);
|
||||
|
||||
if (helper.In.y > 0)
|
||||
helper.Out.y = w * std::log(xmax + ssx);
|
||||
else
|
||||
helper.Out.y = -(w * std::log(xmax + ssx));
|
||||
|
||||
helper.Out.z = DefaultZ(helper);
|
||||
}
|
||||
else
|
||||
helper.Out.y = T(-(m_WeightDivPiDiv2 * std::log1p(xmaxm1 + ssx)));
|
||||
{
|
||||
double x2 = 2 * helper.In.x;
|
||||
double u = helper.m_PrecalcSumSquares + x2;
|
||||
double v = helper.m_PrecalcSumSquares - x2;
|
||||
double xmaxm1 = 0.5 * (Sqrt1pm1(u) + Sqrt1pm1(v));
|
||||
double a = helper.In.x / (1 + xmaxm1);
|
||||
double ssx = xmaxm1 < 0 ? 0 : std::sqrt(xmaxm1);
|
||||
helper.Out.x = T(m_WeightDivPiDiv2 * std::asin(Clamp(a, -1.0, 1.0)));
|
||||
|
||||
helper.Out.z = DefaultZ(helper);
|
||||
if (helper.In.y > 0)
|
||||
helper.Out.y = T(m_WeightDivPiDiv2 * std::log1p(xmaxm1 + ssx));
|
||||
else
|
||||
helper.Out.y = T(-(m_WeightDivPiDiv2 * std::log1p(xmaxm1 + ssx)));
|
||||
|
||||
helper.Out.z = DefaultZ(helper);
|
||||
}
|
||||
}
|
||||
|
||||
virtual string OpenCLString() const override
|
||||
@ -4009,22 +4300,58 @@ public:
|
||||
string index = ss2.str();
|
||||
string weight = WeightDefineString();
|
||||
string weightDivPiDiv2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
ss << "\t{\n"
|
||||
<< "\t\tdouble x2 = 2.0 * vIn.x;\n"
|
||||
<< "\t\tdouble u = precalcSumSquares + x2;\n"
|
||||
<< "\t\tdouble v = precalcSumSquares - x2;\n"
|
||||
<< "\t\tdouble xmaxm1 = 0.5 * (Sqrt1pm1(u) + Sqrt1pm1(v));\n"
|
||||
<< "\t\tdouble a = vIn.x / (1 + xmaxm1);\n"
|
||||
<< "\t\tdouble ssx = xmaxm1 < 0 ? 0.0 : sqrt(xmaxm1);\n"
|
||||
<< "\t\tvOut.x = (" << weightDivPiDiv2 << " * asin(clamp(a, (double)-1.0, (double)1.0)));\n"
|
||||
<< "\n"
|
||||
<< "\t\tif (vIn.y > 0)\n"
|
||||
<< "\t\t\tvOut.y = " << weightDivPiDiv2 << " * log1p(xmaxm1 + ssx);\n"
|
||||
<< "\t\telse\n"
|
||||
<< "\t\t\tvOut.y = -(" << weightDivPiDiv2 << " * log1p(xmaxm1 + ssx));\n"
|
||||
<< "\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
|
||||
if (typeid(T) == typeid(float))
|
||||
{
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t tmp = precalcSumSquares + (real_t)(1.0);\n"
|
||||
<< "\t\treal_t x2 = (real_t)(2.0) * vIn.x;\n"
|
||||
<< "\t\treal_t xmax = (real_t)(0.5) * (sqrt(tmp + x2) + sqrt(tmp - x2));\n"
|
||||
<< "\t\treal_t a = vIn.x / xmax;\n"
|
||||
<< "\t\treal_t b = (real_t)(1.0) - a * a;\n"
|
||||
<< "\t\treal_t ssx = xmax - (real_t)(1.0);\n"
|
||||
<< "\t\tconst real_t w = " << weightDivPiDiv2 << ";\n"
|
||||
<< "\n"
|
||||
<< "\t\tif (b < 0)\n"
|
||||
<< "\t\t b = 0;\n"
|
||||
<< "\t\telse\n"
|
||||
<< "\t\t b = sqrt(b);\n"
|
||||
<< "\n"
|
||||
<< "\t\tif (ssx < 0)\n"
|
||||
<< "\t\t ssx = 0;\n"
|
||||
<< "\t\telse\n"
|
||||
<< "\t\t ssx = sqrt(ssx);\n"
|
||||
<< "\n"
|
||||
<< "\t\tvOut.x = w * atan2(a, b);\n"
|
||||
<< "\n"
|
||||
<< "\t\tif (vIn.y > 0)\n"
|
||||
<< "\t\t vOut.y = w * log(xmax + ssx);\n"
|
||||
<< "\t\telse\n"
|
||||
<< "\t\t vOut.y = -(w * log(xmax + ssx));\n"
|
||||
<< "\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
ss << "\t{\n"
|
||||
<< "\t\tdouble x2 = 2.0 * vIn.x;\n"
|
||||
<< "\t\tdouble u = precalcSumSquares + x2;\n"
|
||||
<< "\t\tdouble v = precalcSumSquares - x2;\n"
|
||||
<< "\t\tdouble xmaxm1 = 0.5 * (Sqrt1pm1(u) + Sqrt1pm1(v));\n"
|
||||
<< "\t\tdouble a = vIn.x / (1 + xmaxm1);\n"
|
||||
<< "\t\tdouble ssx = xmaxm1 < 0 ? 0.0 : sqrt(xmaxm1);\n"
|
||||
<< "\t\tvOut.x = (" << weightDivPiDiv2 << " * asin(clamp(a, (double)-1.0, (double)1.0)));\n"
|
||||
<< "\n"
|
||||
<< "\t\tif (vIn.y > 0)\n"
|
||||
<< "\t\t\tvOut.y = " << weightDivPiDiv2 << " * log1p(xmaxm1 + ssx);\n"
|
||||
<< "\t\telse\n"
|
||||
<< "\t\t\tvOut.y = -(" << weightDivPiDiv2 << " * log1p(xmaxm1 + ssx));\n"
|
||||
<< "\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
}
|
||||
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
@ -4631,10 +4958,10 @@ protected:
|
||||
{
|
||||
string prefix = Prefix();
|
||||
m_Params.clear();
|
||||
m_Params.push_back(ParamWithName<T>(&m_Separation, prefix + "oscilloscope_separation", 1));//Params.
|
||||
m_Params.push_back(ParamWithName<T>(&m_Frequency, prefix + "oscilloscope_frequency", T(M_PI)));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Amplitude, prefix + "oscilloscope_amplitude", 1));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Damping, prefix + "oscilloscope_damping"));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Separation, prefix + "oscilloscope_separation", 1));//Params.
|
||||
m_Params.push_back(ParamWithName<T>(&m_Frequency, prefix + "oscilloscope_frequency", T(M_PI)));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Amplitude, prefix + "oscilloscope_amplitude", 1));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Damping, prefix + "oscilloscope_damping"));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_2PiFreq, prefix + "oscilloscope_2pifreq"));//Precalc.
|
||||
}
|
||||
|
||||
@ -4646,6 +4973,117 @@ private:
|
||||
T m_2PiFreq;//Precalc.
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Oscilloscope2.
|
||||
/// By dark-beam.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class Oscilloscope2Variation : public ParametricVariation<T>
|
||||
{
|
||||
public:
|
||||
Oscilloscope2Variation(T weight = 1.0) : ParametricVariation<T>("oscilloscope2", eVariationId::VAR_OSCILLOSCOPE2, weight)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
PARVARCOPY(Oscilloscope2Variation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
T t;
|
||||
T pt = m_Perturbation * std::sin(m_Tpf2 * helper.In.y);
|
||||
|
||||
if (!m_Damping)
|
||||
t = m_Amplitude * std::cos(m_Tpf * helper.In.x + pt) + m_Separation;
|
||||
else
|
||||
t = m_Amplitude * std::exp(-std::abs(helper.In.x) * m_Damping) * std::cos(m_Tpf * helper.In.x + pt) + m_Separation;
|
||||
|
||||
if (std::abs(helper.In.y) <= t)
|
||||
{
|
||||
helper.Out.x = -(m_Weight * helper.In.x);
|
||||
helper.Out.y = -(m_Weight * helper.In.y);
|
||||
}
|
||||
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 weight = WeightDefineString();
|
||||
string separation = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string frequencyx = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string frequencyy = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string amplitude = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string perturbation = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string damping = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string tpf = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string tpf2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t t;\n"
|
||||
<< "\t\treal_t pt = " << perturbation << " * sin(" << tpf2 << " * vIn.y);\n"
|
||||
<< "\n"
|
||||
<< "\t\tif (!" << damping << ")\n"
|
||||
<< "\t\t t = fma(" << amplitude << ", cos(fma(" << tpf << ", vIn.x, pt)), " << separation << ");\n"
|
||||
<< "\t\telse\n"
|
||||
<< "\t\t t = fma(" << amplitude << ", exp(-fabs(vIn.x) * " << damping << ") * cos(fma(" << tpf << ", vIn.x, pt)), " << separation << ");\n"
|
||||
<< "\n"
|
||||
<< "\t\tif (fabs(vIn.y) <= t)\n"
|
||||
<< "\t\t{\n"
|
||||
<< "\t\t vOut.x = -(" << weight << " * vIn.x);\n"
|
||||
<< "\t\t vOut.y = -(" << weight << " * vIn.y);\n"
|
||||
<< "\t\t}\n"
|
||||
<< "\t\telse\n"
|
||||
<< "\t\t{\n"
|
||||
<< "\t\t vOut.x = " << weight << " * vIn.x;\n"
|
||||
<< "\t\t vOut.y = " << weight << " * vIn.y;\n"
|
||||
<< "\t\t}\n"
|
||||
<< "\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
virtual void Precalc() override
|
||||
{
|
||||
m_Tpf = M_2PI * m_FrequencyX;
|
||||
m_Tpf2 = M_2PI * m_FrequencyY;
|
||||
}
|
||||
|
||||
protected:
|
||||
void Init()
|
||||
{
|
||||
string prefix = Prefix();
|
||||
m_Params.clear();
|
||||
m_Params.push_back(ParamWithName<T>(&m_Separation, prefix + "oscilloscope2_separation", 1, eParamType::REAL, 0));//Params.
|
||||
m_Params.push_back(ParamWithName<T>(&m_FrequencyX, prefix + "oscilloscope2_frequencyx", T(M_PI)));
|
||||
m_Params.push_back(ParamWithName<T>(&m_FrequencyY, prefix + "oscilloscope2_frequencyy", T(M_PI)));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Amplitude, prefix + "oscilloscope2_amplitude", 1));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Perturbation, prefix + "oscilloscope2_perturbation", 1));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Damping, prefix + "oscilloscope2_damping", 0, eParamType::INTEGER, 0, 1));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_Tpf, prefix + "oscilloscope2_tpf"));//Precalc.
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_Tpf2, prefix + "oscilloscope2_tpf2"));
|
||||
}
|
||||
|
||||
private:
|
||||
T m_Separation;//Params.
|
||||
T m_FrequencyX;
|
||||
T m_FrequencyY;
|
||||
T m_Amplitude;
|
||||
T m_Perturbation;
|
||||
T m_Damping;
|
||||
T m_Tpf;//Precalc.
|
||||
T m_Tpf2;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Polar2.
|
||||
/// </summary>
|
||||
@ -4833,6 +5271,97 @@ private:
|
||||
T m_InvWeight;//Precalcs only, no params.
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// scry2.
|
||||
/// By dark-beam, modified by tatasz to increase the speed.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class Scry2Variation : public ParametricVariation<T>
|
||||
{
|
||||
public:
|
||||
Scry2Variation(T weight = 1.0) : ParametricVariation<T>("scry2", eVariationId::VAR_SCRY2, weight, true)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
PARVARCOPY(Scry2Variation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
T r2 = helper.m_PrecalcSumSquares;
|
||||
T s = 1 / Zeps(std::sqrt(r2) * (r2 + 1));
|
||||
T newX = helper.In.x * s;
|
||||
T newY = helper.In.y * s;
|
||||
T dang = (std::atan2(newY, newX) + T(M_PI)) / m_2PiOverPower;
|
||||
T rad = std::sqrt(SQR(newX) + SQR(newY));
|
||||
T zang1 = T(Floor<T>(dang));
|
||||
T xang1 = dang - zang1;
|
||||
T xang2 = xang1 > 0.5 ? 1 - xang1 : xang1;
|
||||
T zang = xang1 > 0.5 ? zang1 + 1 : zang1;
|
||||
T sign = T(xang1 > 0.5 ? -1 : 1);
|
||||
T xang = std::atan(xang2 * std::tan(m_2PiOverPower * T(0.5)) * 2) / m_2PiOverPower;
|
||||
T coeff = 1 / std::cos(xang * m_2PiOverPower);
|
||||
T ang = (zang + sign * xang) * m_2PiOverPower - T(M_PI);
|
||||
helper.Out.x = m_Weight * coeff * rad * std::cos(ang);
|
||||
helper.Out.y = m_Weight * coeff * rad * std::sin(ang);
|
||||
helper.Out.z = DefaultZ(helper);
|
||||
}
|
||||
|
||||
virtual string OpenCLString() const override
|
||||
{
|
||||
ostringstream ss, ss2;
|
||||
int i = 0;
|
||||
ss2 << "_" << XformIndexInEmber() << "]";
|
||||
string index = ss2.str();
|
||||
string weight = WeightDefineString();
|
||||
string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string twopioverpower = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t r2 = precalcSumSquares;\n"
|
||||
<< "\t\treal_t s = 1 / Zeps(sqrt(r2) * (r2 + 1));\n"
|
||||
<< "\t\treal_t newX = vIn.x * s;\n"
|
||||
<< "\t\treal_t newY = vIn.y * s;\n"
|
||||
<< "\t\treal_t dang = (atan2(newY, newX) + MPI) / " << twopioverpower << ";\n"
|
||||
<< "\t\treal_t rad = sqrt(SQR(newX) + SQR(newY));\n"
|
||||
<< "\t\treal_t zang1 = floor(dang);\n"
|
||||
<< "\t\treal_t xang1 = dang - zang1;\n"
|
||||
<< "\t\treal_t xang2 = xang1 > 0.5 ? 1 - xang1 : xang1;\n"
|
||||
<< "\t\treal_t zang = xang1 > 0.5 ? zang1 + 1 : zang1;\n"
|
||||
<< "\t\treal_t sign = xang1 > 0.5 ? -1.0 : 1.0;\n"
|
||||
<< "\t\treal_t xang = atan(xang2 * tan(" << twopioverpower << " * 0.5) * 2) / " << twopioverpower << ";\n"
|
||||
<< "\t\treal_t coeff = 1 / cos(xang * " << twopioverpower << ");\n"
|
||||
<< "\t\treal_t ang = (zang + sign * xang) * " << twopioverpower << " - MPI;\n"
|
||||
<< "\t\tvOut.x = " << weight << " * coeff * rad * cos(ang);\n"
|
||||
<< "\t\tvOut.y = " << weight << " * coeff * rad * sin(ang);\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
virtual vector<string> OpenCLGlobalFuncNames() const override
|
||||
{
|
||||
return vector<string> { "Zeps" };
|
||||
}
|
||||
|
||||
virtual void Precalc() override
|
||||
{
|
||||
m_2PiOverPower = M_2PI / Zeps(m_Power);
|
||||
}
|
||||
|
||||
protected:
|
||||
void Init()
|
||||
{
|
||||
string prefix = Prefix();
|
||||
m_Params.clear();
|
||||
m_Params.push_back(ParamWithName<T>(&m_Power, prefix + "scry2_power", 4));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_2PiOverPower, prefix + "scry2_2pi_over_power"));//Precalc.
|
||||
}
|
||||
|
||||
private:
|
||||
T m_Power;
|
||||
T m_2PiOverPower;//Precalc.
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Separation.
|
||||
/// </summary>
|
||||
@ -5597,7 +6126,6 @@ public:
|
||||
{
|
||||
ostringstream ss;
|
||||
string weight = WeightDefineString();
|
||||
intmax_t varIndex = IndexInXform();
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t expe = " << weight << " * exp(vIn.x);\n"
|
||||
<< "\n"
|
||||
@ -5609,6 +6137,43 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Exp2.
|
||||
/// By tatasz.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class Exp2Variation : public Variation<T>
|
||||
{
|
||||
public:
|
||||
Exp2Variation(T weight = 1.0) : Variation<T>("exp2", eVariationId::VAR_EXP2, weight) { }
|
||||
|
||||
VARCOPY(Exp2Variation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
T ypi = helper.In.y * T(M_PI);
|
||||
T expe = m_Weight * std::exp(helper.In.x * T(M_PI));
|
||||
helper.Out.x = expe * std::cos(ypi);
|
||||
helper.Out.y = expe * std::sin(ypi);
|
||||
helper.Out.z = DefaultZ(helper);
|
||||
}
|
||||
|
||||
virtual string OpenCLString() const override
|
||||
{
|
||||
ostringstream ss;
|
||||
string weight = WeightDefineString();
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t ypi = vIn.y * MPI;\n"
|
||||
<< "\t\treal_t expe = " << weight << " * exp(vIn.x * MPI);\n"
|
||||
<< "\n"
|
||||
<< "\t\tvOut.x = expe * cos(ypi);\n"
|
||||
<< "\t\tvOut.y = expe * sin(ypi);\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Log.
|
||||
/// </summary>
|
||||
@ -6053,6 +6618,65 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// tanh_spiral.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class TanhSpiralVariation : public ParametricVariation<T>
|
||||
{
|
||||
public:
|
||||
TanhSpiralVariation(T weight = 1.0) : ParametricVariation<T>("tanh_spiral", eVariationId::VAR_TANH_SPIRAL, weight)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
PARVARCOPY(TanhSpiralVariation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
T t2 = (rand.Frand01<T>() - T(0.5)) * M_2PI;
|
||||
T aux = Zeps(std::cos(m_A * t2) + std::cosh(t2));
|
||||
helper.Out.x = m_Weight * (std::sinh(t2) / aux);
|
||||
helper.Out.y = m_Weight * (std::sin(m_A * t2) / aux);
|
||||
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 weight = WeightDefineString();
|
||||
string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t t2 = (MwcNext01(mwc) - 0.5) * M_2PI;\n"
|
||||
<< "\t\treal_t aux = Zeps(cos(" << a << " * t2) + cosh(t2));\n"
|
||||
<< "\n"
|
||||
<< "\t\tvOut.x = " << weight << " * (sinh(t2) / aux);\n"
|
||||
<< "\t\tvOut.y = " << weight << " * (sin(" << a << " * t2) / aux);\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
virtual vector<string> OpenCLGlobalFuncNames() const override
|
||||
{
|
||||
return vector<string> { "Zeps" };
|
||||
}
|
||||
|
||||
protected:
|
||||
void Init()
|
||||
{
|
||||
string prefix = Prefix();
|
||||
m_Params.clear();
|
||||
m_Params.push_back(ParamWithName<T>(&m_A, prefix + "tanh_spiral_a", 4));
|
||||
}
|
||||
|
||||
private:
|
||||
T m_A;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Sech
|
||||
/// </summary>
|
||||
@ -6364,6 +6988,8 @@ MAKEPREPOSTVAR(Linear, linear, LINEAR)
|
||||
MAKEPREPOSTVAR(Sinusoidal, sinusoidal, SINUSOIDAL)
|
||||
MAKEPREPOSTVAR(Spherical, spherical, SPHERICAL)
|
||||
MAKEPREPOSTVAR(Swirl, swirl, SWIRL)
|
||||
MAKEPREPOSTPARVAR(Swirl3, swirl3, SWIRL3)
|
||||
MAKEPREPOSTPARVAR(Swirl3r, swirl3r, SWIRL3R)
|
||||
MAKEPREPOSTVAR(Horseshoe, horseshoe, HORSESHOE)
|
||||
MAKEPREPOSTVAR(Polar, polar, POLAR)
|
||||
MAKEPREPOSTVAR(Handkerchief, handkerchief, HANDKERCHIEF)
|
||||
@ -6396,7 +7022,9 @@ MAKEPREPOSTPARVAR(JuliaNGeneric, julian, JULIAN)
|
||||
MAKEPREPOSTPARVAR(JuliaScope, juliascope, JULIASCOPE)
|
||||
MAKEPREPOSTVARASSIGN(Blur, blur, BLUR, eVariationAssignType::ASSIGNTYPE_SUM)
|
||||
MAKEPREPOSTVARASSIGN(GaussianBlur, gaussian_blur, GAUSSIAN_BLUR, eVariationAssignType::ASSIGNTYPE_SUM)
|
||||
MAKEPREPOSTVAR(Gaussian, gaussian, GAUSSIAN)
|
||||
MAKEPREPOSTPARVAR(RadialBlur, radial_blur, RADIAL_BLUR)
|
||||
//MAKEPREPOSTPARVAR(RadialGaussian, radial_gaussian, RADIAL_GAUSSIAN)
|
||||
MAKEPREPOSTPARVARASSIGN(Pie, pie, PIE, eVariationAssignType::ASSIGNTYPE_SUM)
|
||||
MAKEPREPOSTPARVAR(Ngon, ngon, NGON)
|
||||
MAKEPREPOSTPARVAR(Curl, curl, CURL)
|
||||
@ -6415,6 +7043,7 @@ MAKEPREPOSTVAR(Cross, cross, CROSS)
|
||||
MAKEPREPOSTPARVAR(Disc2, disc2, DISC2)
|
||||
MAKEPREPOSTPARVAR(SuperShape, super_shape, SUPER_SHAPE)
|
||||
MAKEPREPOSTPARVAR(Flower, flower, FLOWER)
|
||||
MAKEPREPOSTPARVAR(FlowerDb, flowerdb, FLOWER_DB)
|
||||
MAKEPREPOSTPARVAR(Conic, conic, CONIC)
|
||||
MAKEPREPOSTPARVAR(Parabola, parabola, PARABOLA)
|
||||
MAKEPREPOSTPARVAR(Bent2, bent2, BENT2)
|
||||
@ -6432,9 +7061,11 @@ MAKEPREPOSTPARVAR(LazySusan, lazysusan, LAZYSUSAN)
|
||||
MAKEPREPOSTPARVAR(Loonie, loonie, LOONIE)
|
||||
MAKEPREPOSTPARVAR(Modulus, modulus, MODULUS)
|
||||
MAKEPREPOSTPARVAR(Oscilloscope, oscilloscope, OSCILLOSCOPE)
|
||||
MAKEPREPOSTPARVAR(Oscilloscope2, oscilloscope2, OSCILLOSCOPE2)
|
||||
MAKEPREPOSTPARVAR(Polar2, polar2, POLAR2)
|
||||
MAKEPREPOSTPARVAR(Popcorn2, popcorn2, POPCORN2)
|
||||
MAKEPREPOSTPARVAR(Scry, scry, SCRY)
|
||||
MAKEPREPOSTPARVAR(Scry2, scry2, SCRY2)
|
||||
MAKEPREPOSTPARVAR(Separation, separation, SEPARATION)
|
||||
MAKEPREPOSTPARVAR(Split, split, SPLIT)
|
||||
MAKEPREPOSTPARVAR(Splits, splits, SPLITS)
|
||||
@ -6445,6 +7076,7 @@ MAKEPREPOSTPARVAR(WedgeSph, wedge_sph, WEDGE_SPH)
|
||||
MAKEPREPOSTPARVAR(Whorl, whorl, WHORL)
|
||||
MAKEPREPOSTPARVAR(Waves2, waves2, WAVES2)
|
||||
MAKEPREPOSTVAR(Exp, exp, EXP)
|
||||
MAKEPREPOSTVAR(Exp2, exp2, EXP2)
|
||||
MAKEPREPOSTPARVAR(Log, log, LOG)
|
||||
MAKEPREPOSTVAR(Sin, sin, SIN)
|
||||
MAKEPREPOSTVAR(Cos, cos, COS)
|
||||
@ -6455,6 +7087,7 @@ MAKEPREPOSTVAR(Cot, cot, COT)
|
||||
MAKEPREPOSTVAR(Sinh, sinh, SINH)
|
||||
MAKEPREPOSTVAR(Cosh, cosh, COSH)
|
||||
MAKEPREPOSTVAR(Tanh, tanh, TANH)
|
||||
MAKEPREPOSTPARVAR(TanhSpiral, tanh_spiral, TANH_SPIRAL)
|
||||
MAKEPREPOSTVAR(Sech, sech, SECH)
|
||||
MAKEPREPOSTVAR(Csch, csch, CSCH)
|
||||
MAKEPREPOSTVAR(Coth, coth, COTH)
|
||||
|
||||
@ -119,7 +119,7 @@ private:
|
||||
|
||||
/// <summary>
|
||||
/// Bwraps.
|
||||
/// Note, this is the same as bwraps2.
|
||||
/// Note, this is the same as bwraps7, which is the same as bwraps2 except for the precalc function.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class BwrapsVariation : public ParametricVariation<T>
|
||||
@ -240,7 +240,7 @@ public:
|
||||
virtual void Precalc() override
|
||||
{
|
||||
T radius = T(0.5) * (m_BwrapsCellsize / (1 + SQR(m_BwrapsSpace)));
|
||||
m_G2 = Zeps(SQR(m_BwrapsGain) / Zeps(radius));
|
||||
m_G2 = SQR(m_BwrapsGain) + T(1.0e-6);
|
||||
T maxBubble = m_G2 * radius;
|
||||
|
||||
if (maxBubble > 2)
|
||||
@ -283,6 +283,195 @@ private:
|
||||
T m_Rfactor;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// bwraps_rand.
|
||||
/// By tatasz.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class BwrapsRandVariation : public ParametricVariation<T>
|
||||
{
|
||||
public:
|
||||
BwrapsRandVariation(T weight = 1.0) : ParametricVariation<T>("bwraps_rand", eVariationId::VAR_BWRAPS_RAND, weight)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
PARVARCOPY(BwrapsRandVariation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
if (m_CellSize == 0)
|
||||
{
|
||||
helper.Out.x = helper.In.x * m_Weight;
|
||||
helper.Out.y = helper.In.y * m_Weight;
|
||||
}
|
||||
else
|
||||
{
|
||||
T Cx = (Floor<T>(helper.In.x * m_InvCellSize) + T(0.5)) * m_CellSize;
|
||||
T Cy = (Floor<T>(helper.In.y * m_InvCellSize) + T(0.5)) * m_CellSize;
|
||||
T Lx = helper.In.x - Cx;
|
||||
T Ly = helper.In.y - Cy;
|
||||
T radius;
|
||||
|
||||
if (m_Symm == 0)
|
||||
radius = m_HalfCellSizeOver1pSpaceSq * VarFuncs<T>::HashShadertoy(Cx, Cy, m_Seed);
|
||||
else
|
||||
radius = m_HalfCellSizeOver1pSpaceSq * VarFuncs<T>::HashShadertoy(SQR(Cx), SQR(Cy), m_Seed);
|
||||
|
||||
T mb = m_G2 * radius;
|
||||
T max_bubble;
|
||||
|
||||
if (mb > 2)
|
||||
max_bubble = 1;
|
||||
else
|
||||
max_bubble = mb / (mb * mb * T(0.25) + 1);
|
||||
|
||||
T r2 = SQR(radius);
|
||||
|
||||
if (SQR(Lx) + SQR(Ly) > r2)
|
||||
{
|
||||
helper.Out.x = helper.In.x * m_Weight;
|
||||
helper.Out.y = helper.In.y * m_Weight;
|
||||
}
|
||||
else
|
||||
{
|
||||
T rfactor = radius / Zeps(max_bubble);
|
||||
T Lx2 = Lx * m_G2;
|
||||
T Ly2 = Ly * m_G2;
|
||||
T r = rfactor / ((SQR(Lx2) + SQR(Ly2)) * T(0.25) + 1);
|
||||
T Lx3 = Lx2 * r;
|
||||
T Ly3 = Ly2 * r;
|
||||
T r_2 = (SQR(Lx3) + SQR(Ly3)) / Zeps(r2);
|
||||
T theta = m_InnerTwist * (1 - r_2) + m_OuterTwist * r_2;
|
||||
T ct = std::cos(theta);
|
||||
T st = std::sin(theta);
|
||||
helper.Out.x = (Cx + ct * Lx3 + st * Ly3) * m_Weight;
|
||||
helper.Out.y = (Cy - st * Lx3 + ct * Ly3) * m_Weight;
|
||||
}
|
||||
}
|
||||
|
||||
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 weight = WeightDefineString();
|
||||
string cellsize = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string space = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string gain = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string innertwist = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string outertwist = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string symm = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string seed = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string invcellsize = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string g2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string spacesq = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string halfcellsizeover1pspacesq = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
ss << "\t{\n"
|
||||
<< "\t\tif (" << cellsize << " == 0)\n"
|
||||
<< "\t\t{\n"
|
||||
<< "\t\t vOut.x = vIn.x * " << weight << ";\n"
|
||||
<< "\t\t vOut.y = vIn.y * " << weight << ";\n"
|
||||
<< "\t\t}\n"
|
||||
<< "\t\telse\n"
|
||||
<< "\t\t{\n"
|
||||
<< "\t\t real_t Cx = (floor(vIn.x * " << invcellsize << ") + 0.5) * " << cellsize << ";\n"
|
||||
<< "\t\t real_t Cy = (floor(vIn.y * " << invcellsize << ") + 0.5) * " << cellsize << ";\n"
|
||||
<< "\t\t real_t Lx = vIn.x - Cx;\n"
|
||||
<< "\t\t real_t Ly = vIn.y - Cy;\n"
|
||||
<< "\t\t real_t radius;\n"
|
||||
<< "\n"
|
||||
<< "\t\t if (" << symm << " == 0)\n"
|
||||
<< "\t\t radius = " << halfcellsizeover1pspacesq << " * HashShadertoy(Cx, Cy, " << seed << ");\n"
|
||||
<< "\t\t else\n"
|
||||
<< "\t\t radius = " << halfcellsizeover1pspacesq << " * HashShadertoy(SQR(Cx), SQR(Cy), " << seed << ");\n"
|
||||
<< "\n"
|
||||
<< "\t\t real_t mb = " << g2 << " * radius;\n"
|
||||
<< "\t\t real_t max_bubble;\n"
|
||||
<< "\n"
|
||||
<< "\t\t if (mb > 2)\n"
|
||||
<< "\t\t max_bubble = 1;\n"
|
||||
<< "\t\t else\n"
|
||||
<< "\t\t max_bubble = mb / fma(SQR(mb), 0.25, 1.0);\n"
|
||||
<< "\n"
|
||||
<< "\t\t real_t r2 = SQR(radius);\n"
|
||||
<< "\n"
|
||||
<< "\t\t if (SQR(Lx) + SQR(Ly) > r2)\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t vOut.x = vIn.x * " << weight << ";\n"
|
||||
<< "\t\t vOut.y = vIn.y * " << weight << ";\n"
|
||||
<< "\t\t }\n"
|
||||
<< "\t\t else\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t real_t rfactor = radius / Zeps(max_bubble);\n"
|
||||
<< "\t\t real_t Lx2 = Lx * " << g2 << ";\n"
|
||||
<< "\t\t real_t Ly2 = Ly * " << g2 << ";\n"
|
||||
<< "\t\t real_t r = rfactor / fma(fma(Lx2, Lx2, SQR(Ly2)), 0.25, 1.0);\n"
|
||||
<< "\t\t real_t Lx3 = Lx2 * r;\n"
|
||||
<< "\t\t real_t Ly3 = Ly2 * r;\n"
|
||||
<< "\t\t real_t r_2 = fma(Lx3, Lx3, SQR(Ly3)) / Zeps(r2);\n"
|
||||
<< "\t\t real_t theta = " << innertwist << " * (1.0 - r_2) + " << outertwist << " * r_2;\n"
|
||||
<< "\t\t real_t ct = cos(theta);\n"
|
||||
<< "\t\t real_t st = sin(theta);\n"
|
||||
<< "\n"
|
||||
<< "\t\t vOut.x = (Cx + ct * Lx3 + st * Ly3) * " << weight << ";\n"
|
||||
<< "\t\t vOut.y = (Cy - st * Lx3 + ct * Ly3) * " << weight << ";\n"
|
||||
<< "\t\t }\n"
|
||||
<< "\t\t}\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
virtual void Precalc() override
|
||||
{
|
||||
m_G2 = SQR(m_Gain);
|
||||
m_InvCellSize = 1 / Zeps(m_CellSize);
|
||||
m_SpaceSq = SQR(m_Space);
|
||||
m_HalfCellSizeOver1pSpaceSq = T(0.5) * (m_CellSize / (1 + m_SpaceSq));
|
||||
}
|
||||
|
||||
virtual vector<string> OpenCLGlobalFuncNames() const override
|
||||
{
|
||||
return vector<string> { "Zeps", "Fract", "HashShadertoy" };
|
||||
}
|
||||
|
||||
protected:
|
||||
void Init()
|
||||
{
|
||||
string prefix = Prefix();
|
||||
m_Params.clear();
|
||||
m_Params.push_back(ParamWithName<T>(&m_CellSize, prefix + "bwraps_rand_cellsize", 1));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Space, prefix + "bwraps_rand_space"));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Gain, prefix + "bwraps_rand_gain", 2));
|
||||
m_Params.push_back(ParamWithName<T>(&m_InnerTwist, prefix + "bwraps_rand_inner_twist"));
|
||||
m_Params.push_back(ParamWithName<T>(&m_OuterTwist, prefix + "bwraps_rand_outer_twist"));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Symm, prefix + "bwraps_rand_symm"));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Seed, prefix + "bwraps_rand_seed", 1));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_InvCellSize, prefix + "bwraps_rand_inv_cellsize"));//Precalc.
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_G2, prefix + "bwraps_rand_g2"));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_SpaceSq, prefix + "bwraps_rand_space_sq"));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_HalfCellSizeOver1pSpaceSq, prefix + "bwraps_rand_half_cellsize_over_1_plus_space_sq"));
|
||||
}
|
||||
|
||||
private:
|
||||
T m_CellSize;
|
||||
T m_Space;
|
||||
T m_Gain;
|
||||
T m_InnerTwist;
|
||||
T m_OuterTwist;
|
||||
T m_Symm;
|
||||
T m_Seed;
|
||||
T m_InvCellSize;//Precalc.
|
||||
T m_G2;
|
||||
T m_SpaceSq;
|
||||
T m_HalfCellSizeOver1pSpaceSq;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// BlurCircle.
|
||||
/// </summary>
|
||||
@ -2452,7 +2641,7 @@ public:
|
||||
<< "\t\t{\n"
|
||||
<< "\t\t if (MwcNext01(mwc) > (real_t)(0.5))\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t d = sqrt(r + vIn.x);\n"
|
||||
<< "\t\t d = Zeps(sqrt(r + vIn.x));\n"
|
||||
<< "\t\t vOut.x = -(" << v2 << " * d);\n"
|
||||
<< "\t\t vOut.y = -(" << v2 << " / d * vIn.y);\n"
|
||||
<< "\t\t }\n"
|
||||
@ -2492,6 +2681,132 @@ private:
|
||||
T m_V2;//Precalcs only, no params.
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Glynnia2.
|
||||
/// By guagapunyaimel.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class Glynnia2Variation : public ParametricVariation<T>
|
||||
{
|
||||
public:
|
||||
Glynnia2Variation(T weight = 1.0) : ParametricVariation<T>("glynnia2", eVariationId::VAR_GLYNNIA2, weight, true, true)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
PARVARCOPY(Glynnia2Variation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
T d, r = helper.m_PrecalcSqrtSumSquares;
|
||||
|
||||
if (r > 0 && helper.In.y > 0)
|
||||
{
|
||||
if (rand.Frand01<T>() > T(0.5))
|
||||
{
|
||||
d = std::sqrt(r + helper.In.x);
|
||||
helper.Out.x = m_V2 * d;
|
||||
helper.Out.y = -(m_V2 / d * helper.In.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
d = r + helper.In.x;
|
||||
r = m_Weight / std::sqrt(r * (SQR(helper.In.y) + SQR(d)));
|
||||
helper.Out.x = r * d;
|
||||
helper.Out.y = r * helper.In.y;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rand.Frand01<T>() > T(0.5))
|
||||
{
|
||||
d = Zeps(std::sqrt(r + helper.In.x));
|
||||
helper.Out.x = -(m_V2 * d);
|
||||
helper.Out.y = -(m_V2 / d * helper.In.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
d = r + helper.In.x;
|
||||
r = m_Weight / Zeps(std::sqrt(r * (SQR(helper.In.y) + SQR(d))));
|
||||
helper.Out.x = -(r * d);
|
||||
helper.Out.y = r * 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 weight = WeightDefineString();
|
||||
string v2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params.
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t d, r = precalcSqrtSumSquares;\n"
|
||||
<< "\n"
|
||||
<< "\t\tif (r > 0 && vIn.y > 0)\n"
|
||||
<< "\t\t{\n"
|
||||
<< "\t\t if (MwcNext01(mwc) > (real_t)(0.5))\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t d = sqrt(r + vIn.x);\n"
|
||||
<< "\t\t vOut.x = " << v2 << " * d;\n"
|
||||
<< "\t\t vOut.y = -(" << v2 << " / d * vIn.y);\n"
|
||||
<< "\t\t }\n"
|
||||
<< "\t\t else\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t d = r + vIn.x;\n"
|
||||
<< "\t\t r = " << weight << " / sqrt(r * fma(vIn.y, vIn.y, SQR(d)));\n"
|
||||
<< "\t\t vOut.x = r * d;\n"
|
||||
<< "\t\t vOut.y = r * vIn.y;\n"
|
||||
<< "\t\t }\n"
|
||||
<< "\t\t}\n"
|
||||
<< "\t\telse\n"
|
||||
<< "\t\t{\n"
|
||||
<< "\t\t if (MwcNext01(mwc) > (real_t)(0.5))\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t d = Zeps(sqrt(r + vIn.x));\n"
|
||||
<< "\t\t vOut.x = -(" << v2 << " * d);\n"
|
||||
<< "\t\t vOut.y = -(" << v2 << " / d * vIn.y);\n"
|
||||
<< "\t\t }\n"
|
||||
<< "\t\t else\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t d = r + vIn.x;\n"
|
||||
<< "\t\t r = " << weight << " / Zeps(sqrt(r * fma(vIn.y, vIn.y, SQR(d))));\n"
|
||||
<< "\t\t vOut.x = -(r * d);\n"
|
||||
<< "\t\t vOut.y = r * vIn.y;\n"
|
||||
<< "\t\t }\n"
|
||||
<< "\t\t}\n"
|
||||
<< "\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
virtual void Precalc() override
|
||||
{
|
||||
m_V2 = m_Weight * std::sqrt(T(2)) / 2;
|
||||
}
|
||||
|
||||
virtual vector<string> OpenCLGlobalFuncNames() const override
|
||||
{
|
||||
return vector<string> { "Zeps" };
|
||||
}
|
||||
|
||||
protected:
|
||||
void Init()
|
||||
{
|
||||
string prefix = Prefix();
|
||||
m_Params.clear();
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_V2, prefix + "glynnia2_v2"));//Precalcs only, no params.
|
||||
}
|
||||
|
||||
private:
|
||||
T m_V2;//Precalcs only, no params.
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// GridOut.
|
||||
/// </summary>
|
||||
@ -5657,6 +5972,7 @@ private:
|
||||
MAKEPREPOSTVAR(Hemisphere, hemisphere, HEMISPHERE)
|
||||
MAKEPREPOSTPARVAR(Epispiral, epispiral, EPISPIRAL)
|
||||
MAKEPREPOSTPARVAR(Bwraps, bwraps, BWRAPS)
|
||||
MAKEPREPOSTPARVAR(BwrapsRand, bwraps_rand, BWRAPS_RAND)
|
||||
MAKEPREPOSTVARASSIGN(BlurCircle, blur_circle, BLUR_CIRCLE, eVariationAssignType::ASSIGNTYPE_SUM)
|
||||
MAKEPREPOSTPARVAR(BlurZoom, blur_zoom, BLUR_ZOOM)
|
||||
MAKEPREPOSTPARVAR(BlurPixelize, blur_pixelize, BLUR_PIXELIZE)
|
||||
@ -5686,6 +6002,7 @@ MAKEPREPOSTVAR(FDisc, fdisc, FDISC)
|
||||
MAKEPREPOSTPARVAR(Fibonacci, fibonacci, FIBONACCI)
|
||||
MAKEPREPOSTPARVAR(Fibonacci2, fibonacci2, FIBONACCI2)
|
||||
MAKEPREPOSTPARVAR(Glynnia, glynnia, GLYNNIA)
|
||||
MAKEPREPOSTPARVAR(Glynnia2, glynnia2, GLYNNIA2)
|
||||
MAKEPREPOSTVAR(GridOut, gridout, GRIDOUT)
|
||||
MAKEPREPOSTPARVAR(Hole, hole, HOLE)
|
||||
MAKEPREPOSTPARVAR(Hypertile, hypertile, HYPERTILE)
|
||||
|
||||
@ -721,7 +721,7 @@ protected:
|
||||
{
|
||||
string prefix = Prefix();
|
||||
m_Params.clear();
|
||||
m_Params.push_back(ParamWithName<T>(&m_Radius, prefix + "GlynnSim2_radius", 1));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Radius, prefix + "GlynnSim2_radius", 1, eParamType::REAL, 0));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Thickness, prefix + "GlynnSim2_thickness", T(0.1), eParamType::REAL, 0, 1));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Contrast, prefix + "GlynnSim2_contrast", T(0.5), eParamType::REAL, 0, 1));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Pow, prefix + "GlynnSim2_pow", T(1.5)));
|
||||
@ -919,6 +919,219 @@ private:
|
||||
T m_Gamma;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// GlynnSim4.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class GlynnSim4Variation : public ParametricVariation<T>
|
||||
{
|
||||
public:
|
||||
GlynnSim4Variation(T weight = 1.0) : ParametricVariation<T>("GlynnSim4", eVariationId::VAR_GLYNNSIM4, weight, true, true)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
PARVARCOPY(GlynnSim4Variation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
if (helper.m_PrecalcSqrtSumSquares < m_Radius)
|
||||
{
|
||||
helper.Out.x = m_Weight * m_X;
|
||||
helper.Out.y = m_Weight * m_Y;
|
||||
}
|
||||
else
|
||||
{
|
||||
T alpha = std::abs(m_Radius / Zeps(helper.m_PrecalcSqrtSumSquares));
|
||||
|
||||
if (rand.Frand01<T>() > m_Contrast * std::pow(alpha, m_Pow))
|
||||
{
|
||||
helper.Out.x = m_Weight * helper.In.x;
|
||||
helper.Out.y = m_Weight * helper.In.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
helper.Out.x = m_Weight * SQR(alpha) * helper.In.x;
|
||||
helper.Out.y = m_Weight * SQR(alpha) * 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 weight = WeightDefineString();
|
||||
string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string contrast = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string pow = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
ss << "\t{\n"
|
||||
<< "\t\tif (precalcSqrtSumSquares < " << radius << ")\n"
|
||||
<< "\t\t{\n"
|
||||
<< "\t\t vOut.x = " << weight << " * " << x << ";\n"
|
||||
<< "\t\t vOut.y = " << weight << " * " << y << ";\n"
|
||||
<< "\t\t}\n"
|
||||
<< "\t\telse\n"
|
||||
<< "\t\t{\n"
|
||||
<< "\t\t real_t alpha = fabs(" << radius << " / Zeps(precalcSqrtSumSquares));\n"
|
||||
<< "\n"
|
||||
<< "\t\t if (MwcNext01(mwc) > " << contrast << " * pow(alpha, " << pow << "))\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t vOut.x = " << weight << " * vIn.x;\n"
|
||||
<< "\t\t vOut.y = " << weight << " * vIn.y;\n"
|
||||
<< "\t\t }\n"
|
||||
<< "\t\t else\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t vOut.x = " << weight << " * SQR(alpha) * vIn.x;\n"
|
||||
<< "\t\t vOut.y = " << weight << " * SQR(alpha) * vIn.y;\n"
|
||||
<< "\t\t }\n"
|
||||
<< "\t\t}\n"
|
||||
<< "\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
virtual vector<string> OpenCLGlobalFuncNames() const override
|
||||
{
|
||||
return vector<string> { "Zeps" };
|
||||
}
|
||||
|
||||
protected:
|
||||
void Init()
|
||||
{
|
||||
string prefix = Prefix();
|
||||
m_Params.clear();
|
||||
m_Params.push_back(ParamWithName<T>(&m_Radius, prefix + "GlynnSim4_radius", 1));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Contrast, prefix + "GlynnSim4_contrast", T(0.5), eParamType::REAL, 0, 1));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Pow, prefix + "GlynnSim4_pow", T(1.5)));
|
||||
m_Params.push_back(ParamWithName<T>(&m_X, prefix + "GlynnSim4_X"));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Y, prefix + "GlynnSim4_Y"));
|
||||
}
|
||||
|
||||
private:
|
||||
T m_Radius;//Params.
|
||||
T m_Contrast;
|
||||
T m_Pow;
|
||||
T m_X;
|
||||
T m_Y;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// GlynnSim5.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class GlynnSim5Variation : public ParametricVariation<T>
|
||||
{
|
||||
public:
|
||||
GlynnSim5Variation(T weight = 1.0) : ParametricVariation<T>("GlynnSim5", eVariationId::VAR_GLYNNSIM5, weight, true, true)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
PARVARCOPY(GlynnSim5Variation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
if (helper.m_PrecalcSqrtSumSquares < m_Radius1)
|
||||
{
|
||||
helper.Out.x = 0;
|
||||
helper.Out.y = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
T alpha = std::abs(m_Radius / Zeps(helper.m_PrecalcSqrtSumSquares));
|
||||
|
||||
if (rand.Frand01<T>() > m_Contrast * std::pow(alpha, m_Pow))
|
||||
{
|
||||
helper.Out.x = m_Weight * helper.In.x;
|
||||
helper.Out.y = m_Weight * helper.In.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
helper.Out.x = m_Weight * SQR(alpha);
|
||||
helper.Out.y = m_Weight * SQR(alpha);
|
||||
}
|
||||
}
|
||||
|
||||
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 weight = WeightDefineString();
|
||||
string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string thickness = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string contrast = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string pow = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string radius1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
ss << "\t{\n"
|
||||
<< "\t\tif (precalcSqrtSumSquares < " << radius1 << ")\n"
|
||||
<< "\t\t{\n"
|
||||
<< "\t\t vOut.x = 0;\n"
|
||||
<< "\t\t vOut.y = 0;\n"
|
||||
<< "\t\t}\n"
|
||||
<< "\t\telse\n"
|
||||
<< "\t\t{\n"
|
||||
<< "\t\t real_t alpha = fabs(" << radius << " / Zeps(precalcSqrtSumSquares));\n"
|
||||
<< "\n"
|
||||
<< "\t\t if (MwcNext01(mwc) > " << contrast << " * pow(alpha, " << pow << "))\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t vOut.x = " << weight << " * vIn.x;\n"
|
||||
<< "\t\t vOut.y = " << weight << " * vIn.y;\n"
|
||||
<< "\t\t }\n"
|
||||
<< "\t\t else\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t vOut.x = " << weight << " * SQR(alpha);\n"
|
||||
<< "\t\t vOut.y = " << weight << " * SQR(alpha);\n"
|
||||
<< "\t\t }\n"
|
||||
<< "\t\t}\n"
|
||||
<< "\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
virtual vector<string> OpenCLGlobalFuncNames() const override
|
||||
{
|
||||
return vector<string> { "Zeps" };
|
||||
}
|
||||
|
||||
virtual void Precalc() override
|
||||
{
|
||||
m_Radius1 = m_Radius + m_Thickness;
|
||||
}
|
||||
|
||||
protected:
|
||||
void Init()
|
||||
{
|
||||
string prefix = Prefix();
|
||||
m_Params.clear();
|
||||
m_Params.push_back(ParamWithName<T>(&m_Radius, prefix + "GlynnSim5_radius", 1));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Thickness, prefix + "GlynnSim5_thickness", T(0.1)));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Contrast, prefix + "GlynnSim5_contrast", T(0.5), eParamType::REAL, 0, 1));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Pow, prefix + "GlynnSim5_pow", T(1.5)));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_Radius1, prefix + "GlynnSim5_radius1"));//Precalc.
|
||||
}
|
||||
|
||||
private:
|
||||
T m_Radius;//Params.
|
||||
T m_Thickness;
|
||||
T m_Contrast;
|
||||
T m_Pow;
|
||||
T m_Radius1;//Precalc.
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Starblur.
|
||||
/// </summary>
|
||||
@ -1986,6 +2199,80 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Spher.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class SpherVariation : public Variation<T>
|
||||
{
|
||||
public:
|
||||
SpherVariation(T weight = 1.0) : Variation<T>("spher", eVariationId::VAR_SPHER, weight, true) { }
|
||||
|
||||
VARCOPY(SpherVariation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
T r2 = Zeps(helper.m_PrecalcSumSquares);
|
||||
|
||||
if (r2 > 1)
|
||||
{
|
||||
if (rand.Frand01<T>() < 0.5)
|
||||
{
|
||||
helper.Out.x = (m_Weight / r2) * helper.In.x;
|
||||
helper.Out.y = (m_Weight / r2) * helper.In.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
helper.Out.x = m_Weight * helper.In.x;
|
||||
helper.Out.y = m_Weight * helper.In.y;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
helper.Out.x = 0;
|
||||
helper.Out.y = 0;
|
||||
}
|
||||
|
||||
helper.Out.z = DefaultZ(helper);
|
||||
}
|
||||
|
||||
virtual string OpenCLString() const override
|
||||
{
|
||||
ostringstream ss;
|
||||
intmax_t varIndex = IndexInXform();
|
||||
string weight = WeightDefineString();
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t r2 = Zeps(precalcSumSquares);\n"
|
||||
<< "\n"
|
||||
<< "\t\tif (r2 > 1)\n"
|
||||
<< "\t\t{\n"
|
||||
<< "\t\t if (MwcNext01(mwc) < 0.5)\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t vOut.x = (" << weight << " / r2) * vIn.x;\n"
|
||||
<< "\t\t vOut.y = (" << weight << " / r2) * vIn.y;\n"
|
||||
<< "\t\t }\n"
|
||||
<< "\t\t else\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t vOut.x = " << weight << " * vIn.x;\n"
|
||||
<< "\t\t vOut.y = " << weight << " * vIn.y;\n"
|
||||
<< "\t\t }\n"
|
||||
<< "\t\t}\n"
|
||||
<< "\t\telse\n"
|
||||
<< "\t\t{\n"
|
||||
<< "\t\t vOut.x = 0;\n"
|
||||
<< "\t\t vOut.y = 0;\n"
|
||||
<< "\t\t}\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
virtual vector<string> OpenCLGlobalFuncNames() const override
|
||||
{
|
||||
return vector<string> { "Zeps" };
|
||||
}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// RoundSpher.
|
||||
/// </summary>
|
||||
@ -3055,9 +3342,9 @@ protected:
|
||||
{
|
||||
string prefix = Prefix();
|
||||
m_Params.clear();
|
||||
m_Params.push_back(ParamWithName<T>(&m_Even, prefix + "target_even", 0, eParamType::REAL_CYCLIC, 0, M_2PI));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Odd, prefix + "target_odd", 0, eParamType::REAL_CYCLIC, 0, M_2PI));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Size, prefix + "target_size", 1, eParamType::REAL, EPS, TMAX));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Even, prefix + "target_even", 0, eParamType::REAL_CYCLIC, 0, M_2PI));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Odd, prefix + "target_odd", 0, eParamType::REAL_CYCLIC, 0, M_2PI));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Size, prefix + "target_size", 1, eParamType::REAL, EPS, TMAX));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_SizeDiv2, prefix + "target_size_2"));//Precalc.
|
||||
}
|
||||
|
||||
@ -3068,6 +3355,191 @@ private:
|
||||
T m_SizeDiv2;//Precalc.
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// target0.
|
||||
/// By Mark Faber.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class Target0Variation : public ParametricVariation<T>
|
||||
{
|
||||
public:
|
||||
Target0Variation(T weight = 1.0) : ParametricVariation<T>("target0", eVariationId::VAR_TARGET0, weight, true, true, false, false, true)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
PARVARCOPY(Target0Variation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
T a = helper.m_PrecalcAtanyx;
|
||||
T t = std::log(helper.m_PrecalcSqrtSumSquares);
|
||||
|
||||
if (t < 0)
|
||||
t -= m_SizeDiv2;
|
||||
|
||||
t = fmod(std::abs(t), m_Size);
|
||||
|
||||
if (t < m_SizeDiv2)
|
||||
a += m_Even;
|
||||
else
|
||||
a += m_Odd;
|
||||
|
||||
helper.Out.x = helper.m_PrecalcSqrtSumSquares * std::cos(a) * m_Weight;
|
||||
helper.Out.y = helper.m_PrecalcSqrtSumSquares * std::sin(a) * m_Weight;
|
||||
helper.Out.z = DefaultZ(helper);
|
||||
}
|
||||
|
||||
virtual string OpenCLString() const override
|
||||
{
|
||||
ostringstream ss, ss2;
|
||||
intmax_t i = 0;
|
||||
ss2 << "_" << XformIndexInEmber() << "]";
|
||||
string index = ss2.str();
|
||||
string weight = WeightDefineString();
|
||||
string even = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string odd = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string size = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string sizeDiv2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t a = precalcAtanyx;\n"
|
||||
<< "\t\treal_t t = log(precalcSqrtSumSquares);\n"
|
||||
<< "\n"
|
||||
<< "\t\tif (t < (real_t)(0.0))\n"
|
||||
<< "\t\t t -= " << sizeDiv2 << ";\n"
|
||||
<< "\n"
|
||||
<< "\t\tt = fmod(fabs(t), " << size << ");\n"
|
||||
<< "\n"
|
||||
<< "\t\tif (t < " << sizeDiv2 << ")\n"
|
||||
<< "\t\t a += " << even << ";\n"
|
||||
<< "\t\telse\n"
|
||||
<< "\t\t a += " << odd << ";\n"
|
||||
<< "\n"
|
||||
<< "\t\tvOut.x = precalcSqrtSumSquares * cos(a) * " << weight << ";\n"
|
||||
<< "\t\tvOut.y = precalcSqrtSumSquares * sin(a) * " << weight << ";\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
virtual void Precalc() override
|
||||
{
|
||||
m_SizeDiv2 = m_Size * T(0.5);
|
||||
}
|
||||
|
||||
protected:
|
||||
void Init()
|
||||
{
|
||||
string prefix = Prefix();
|
||||
m_Params.clear();
|
||||
m_Params.push_back(ParamWithName<T>(&m_Even, prefix + "target0_even", 0, eParamType::REAL_CYCLIC, 0, M_2PI));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Odd, prefix + "target0_odd", 0, eParamType::REAL_CYCLIC, 0, M_2PI));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Size, prefix + "target0_size", 0, eParamType::REAL, 0));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_SizeDiv2, prefix + "target0_size_2"));//Precalc.
|
||||
}
|
||||
|
||||
private:
|
||||
T m_Even;
|
||||
T m_Odd;
|
||||
T m_Size;
|
||||
T m_SizeDiv2;//Precalc.
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// target2.
|
||||
/// By Mark Faber.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class Target2Variation : public ParametricVariation<T>
|
||||
{
|
||||
public:
|
||||
Target2Variation(T weight = 1.0) : ParametricVariation<T>("target2", eVariationId::VAR_TARGET2, weight, true, true, false, false, true)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
PARVARCOPY(Target2Variation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
T a = helper.m_PrecalcAtanyx;
|
||||
T t = std::log(helper.m_PrecalcSqrtSumSquares);
|
||||
t = m_Tightness * std::log(helper.m_PrecalcSqrtSumSquares) + T(M_1_PI) * (a + T(M_PI));
|
||||
|
||||
if (t < 0)
|
||||
t -= m_SizeDiv2;
|
||||
|
||||
t = fmod(std::abs(t), m_Size);
|
||||
|
||||
if (t < m_SizeDiv2)
|
||||
a += m_Even;
|
||||
else
|
||||
a += m_Odd;
|
||||
|
||||
helper.Out.x = helper.m_PrecalcSqrtSumSquares * std::cos(a) * m_Weight;
|
||||
helper.Out.y = helper.m_PrecalcSqrtSumSquares * std::sin(a) * m_Weight;
|
||||
helper.Out.z = DefaultZ(helper);
|
||||
}
|
||||
|
||||
virtual string OpenCLString() const override
|
||||
{
|
||||
ostringstream ss, ss2;
|
||||
intmax_t i = 0;
|
||||
ss2 << "_" << XformIndexInEmber() << "]";
|
||||
string index = ss2.str();
|
||||
string weight = WeightDefineString();
|
||||
string even = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string odd = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string size = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string thightness = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string sizeDiv2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t a = precalcAtanyx;\n"
|
||||
<< "\t\treal_t t = log(precalcSqrtSumSquares);\n"
|
||||
<< "\t\tt = fma(" << thightness << ", log(precalcSqrtSumSquares), M1PI * (a + MPI));\n"
|
||||
<< "\n"
|
||||
<< "\t\tif (t < (real_t)(0.0))\n"
|
||||
<< "\t\t t -= " << sizeDiv2 << ";\n"
|
||||
<< "\n"
|
||||
<< "\t\tt = fmod(fabs(t), " << size << ");\n"
|
||||
<< "\n"
|
||||
<< "\t\tif (t < " << sizeDiv2 << ")\n"
|
||||
<< "\t\t a += " << even << ";\n"
|
||||
<< "\t\telse\n"
|
||||
<< "\t\t a += " << odd << ";\n"
|
||||
<< "\n"
|
||||
<< "\t\tvOut.x = precalcSqrtSumSquares * cos(a) * " << weight << ";\n"
|
||||
<< "\t\tvOut.y = precalcSqrtSumSquares * sin(a) * " << weight << ";\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
virtual void Precalc() override
|
||||
{
|
||||
m_SizeDiv2 = m_Size * T(0.5);
|
||||
}
|
||||
|
||||
protected:
|
||||
void Init()
|
||||
{
|
||||
string prefix = Prefix();
|
||||
m_Params.clear();
|
||||
m_Params.push_back(ParamWithName<T>(&m_Even, prefix + "target2_even", 0, eParamType::REAL_CYCLIC, 0, M_2PI));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Odd, prefix + "target2_odd", 0, eParamType::REAL_CYCLIC, 0, M_2PI));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Size, prefix + "target2_size", 1, eParamType::REAL, EPS, TMAX));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Tightness, prefix + "target2_thightness"));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_SizeDiv2, prefix + "target2_size_2"));//Precalc.
|
||||
}
|
||||
|
||||
private:
|
||||
T m_Even;
|
||||
T m_Odd;
|
||||
T m_Size;
|
||||
T m_Tightness;
|
||||
T m_SizeDiv2;//Precalc.
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// taurus.
|
||||
/// </summary>
|
||||
@ -3780,6 +4252,49 @@ private:
|
||||
T m_WeightSquared;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// flipx.
|
||||
/// By tatasz.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class FlipXVariation : public Variation<T>
|
||||
{
|
||||
public:
|
||||
FlipXVariation(T weight = 1.0) : Variation<T>("flipx", eVariationId::VAR_FLIP_X, weight) { }
|
||||
|
||||
VARCOPY(FlipXVariation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
helper.Out.y = m_Weight * helper.In.y;
|
||||
|
||||
if (helper.In.y > 0)
|
||||
helper.Out.x = -(m_Weight * helper.In.x);
|
||||
else
|
||||
helper.Out.x = m_Weight * helper.In.x;
|
||||
|
||||
helper.Out.z = DefaultZ(helper);
|
||||
}
|
||||
|
||||
virtual string OpenCLString() const override
|
||||
{
|
||||
ostringstream ss;
|
||||
intmax_t varIndex = IndexInXform();
|
||||
string weight = WeightDefineString();
|
||||
ss << "\t{\n"
|
||||
<< "\t\tvOut.y = " << weight << " * vIn.y;\n"
|
||||
<< "\n"
|
||||
<< "\t\tif (vIn.y > 0)\n"
|
||||
<< "\t\t vOut.x = -(" << weight << " * vIn.x);\n"
|
||||
<< "\t\telse\n"
|
||||
<< "\t\t vOut.x = " << weight << " * vIn.x;\n"
|
||||
<< "\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// flipy.
|
||||
/// </summary>
|
||||
@ -4558,6 +5073,8 @@ MAKEPREPOSTPARVAR(Kaleidoscope, Kaleidoscope, KALEIDOSCOPE)
|
||||
MAKEPREPOSTPARVAR(GlynnSim1, GlynnSim1, GLYNNSIM1)
|
||||
MAKEPREPOSTPARVAR(GlynnSim2, GlynnSim2, GLYNNSIM2)
|
||||
MAKEPREPOSTPARVAR(GlynnSim3, GlynnSim3, GLYNNSIM3)
|
||||
MAKEPREPOSTPARVAR(GlynnSim4, GlynnSim4, GLYNNSIM4)
|
||||
MAKEPREPOSTPARVAR(GlynnSim5, GlynnSim5, GLYNNSIM5)
|
||||
MAKEPREPOSTPARVARASSIGN(Starblur, starblur, STARBLUR, eVariationAssignType::ASSIGNTYPE_SUM)
|
||||
MAKEPREPOSTPARVARASSIGN(Sineblur, sineblur, SINEBLUR, eVariationAssignType::ASSIGNTYPE_SUM)
|
||||
MAKEPREPOSTVARASSIGN(Circleblur, circleblur, CIRCLEBLUR, eVariationAssignType::ASSIGNTYPE_SUM)
|
||||
@ -4573,6 +5090,7 @@ MAKEPREPOSTPARVAR(Ovoid, ovoid, OVOID)
|
||||
MAKEPREPOSTPARVAR(Ovoid3D, ovoid3d, OVOID3D)
|
||||
MAKEPREPOSTPARVARASSIGN(Spirograph, Spirograph, SPIROGRAPH, eVariationAssignType::ASSIGNTYPE_SUM)
|
||||
MAKEPREPOSTVAR(Petal, petal, PETAL)
|
||||
MAKEPREPOSTVAR(Spher, spher, SPHER)
|
||||
MAKEPREPOSTVAR(RoundSpher, roundspher, ROUNDSPHER)
|
||||
MAKEPREPOSTVAR(RoundSpher3D, roundspher3D, ROUNDSPHER3D)
|
||||
MAKEPREPOSTVAR(SpiralWing, spiralwing, SPIRAL_WING)
|
||||
@ -4585,6 +5103,8 @@ MAKEPREPOSTPARVAR(MobiusStrip, mobius_strip, MOBIUS_STRIP)
|
||||
MAKEPREPOSTPARVARASSIGN(Lissajous, Lissajous, LISSAJOUS, eVariationAssignType::ASSIGNTYPE_SUM)
|
||||
MAKEPREPOSTPARVAR(Svf, svf, SVF)
|
||||
MAKEPREPOSTPARVAR(Target, target, TARGET)
|
||||
MAKEPREPOSTPARVAR(Target0, target0, TARGET0)
|
||||
MAKEPREPOSTPARVAR(Target2, target2, TARGET2)
|
||||
MAKEPREPOSTPARVAR(Taurus, taurus, TAURUS)
|
||||
MAKEPREPOSTPARVAR(Collideoscope, collideoscope, COLLIDEOSCOPE)
|
||||
MAKEPREPOSTPARVAR(BMod, bMod, BMOD)
|
||||
@ -4593,6 +5113,7 @@ MAKEPREPOSTPARVAR(BTransform, bTransform, BTRANSFORM)
|
||||
MAKEPREPOSTPARVAR(BCollide, bCollide, BCOLLIDE)
|
||||
MAKEPREPOSTPARVAR(Eclipse, eclipse, ECLIPSE)
|
||||
MAKEPREPOSTPARVAR(FlipCircle, flipcircle, FLIP_CIRCLE)
|
||||
MAKEPREPOSTVAR(FlipX, flipx, FLIP_X)
|
||||
MAKEPREPOSTVAR(FlipY, flipy, FLIP_Y)
|
||||
MAKEPREPOSTPARVAR(ECollide, eCollide, ECOLLIDE)
|
||||
MAKEPREPOSTPARVAR(EJulia, eJulia, EJULIA)
|
||||
|
||||
@ -87,6 +87,246 @@ private:
|
||||
T m_Out;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// lazyjess.
|
||||
/// By FarDareisMai.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class LazyJessVariation : public ParametricVariation<T>
|
||||
{
|
||||
public:
|
||||
LazyJessVariation(T weight = 1.0) : ParametricVariation<T>("lazyjess", eVariationId::VAR_LAZYJESS, weight, true, true)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
PARVARCOPY(LazyJessVariation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
T theta, sina, cosa;
|
||||
T x = helper.In.x;
|
||||
T y = helper.In.y;
|
||||
T modulus = helper.m_PrecalcSqrtSumSquares;
|
||||
|
||||
// n==2 requires a special case
|
||||
if (m_N == T(2))
|
||||
{
|
||||
if (std::abs(x) < m_Weight) // If the input point falls inside the designated area...
|
||||
{
|
||||
// // ...then rotate it.
|
||||
theta = std::atan2(y, x) + m_Spin;
|
||||
sina = std::sin(theta);
|
||||
cosa = std::cos(theta);
|
||||
x = m_Weight * modulus * cosa;
|
||||
y = m_Weight * modulus * sina;
|
||||
|
||||
if (std::abs(x) < m_Weight)
|
||||
{
|
||||
helper.Out.x = x;
|
||||
helper.Out.y = y;
|
||||
}
|
||||
else // If it is now part of a corner that falls outside the designated area...
|
||||
{
|
||||
// ...then flip and rotate into place.
|
||||
theta = std::atan2(y, x) - m_Spin + m_CornerRotation;
|
||||
sina = std::sin(theta);
|
||||
cosa = std::cos(theta);
|
||||
helper.Out.x = m_Weight * modulus * cosa;
|
||||
helper.Out.y = -(m_Weight * modulus * sina);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
modulus = 1 + m_Space / Zeps(modulus);
|
||||
helper.Out.x = m_Weight * modulus * x;
|
||||
helper.Out.y = m_Weight * modulus * y;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Calculate the distance r from origin to the edge of the polygon at the angle of the input point.
|
||||
theta = std::atan2(y, x) + M_2PI;
|
||||
T theta_diff = std::fmod(theta + m_HalfSlice, m_PieSlice);
|
||||
T r = m_Weight * T(M_SQRT2) * m_SinVertex / Zeps(std::sin(T(M_PI) - theta_diff - m_Vertex));
|
||||
|
||||
if (modulus < r)
|
||||
{
|
||||
// Again, rotating points within designated area.
|
||||
theta = std::atan2(y, x) + m_Spin + M_2PI;
|
||||
sina = std::sin(theta);
|
||||
cosa = std::cos(theta);
|
||||
x = m_Weight * modulus * cosa;
|
||||
y = m_Weight * modulus * sina;
|
||||
// Calculating r and modulus for our rotated point.
|
||||
theta_diff = std::fmod(theta + m_HalfSlice, m_PieSlice);
|
||||
r = m_Weight * T(M_SQRT2) * m_SinVertex / Zeps(std::sin(T(M_PI) - theta_diff - m_Vertex));
|
||||
modulus = VarFuncs<T>::Hypot(x, y);
|
||||
|
||||
if (modulus < r)
|
||||
{
|
||||
helper.Out.x = x;
|
||||
helper.Out.y = y;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Again, flipping and rotating corners that fall outside the designated area.
|
||||
theta = std::atan2(y, x) - m_Spin + m_CornerRotation + M_2PI;
|
||||
sina = std::sin(theta);
|
||||
cosa = std::cos(theta);
|
||||
helper.Out.x = m_Weight * modulus * cosa;
|
||||
helper.Out.y = -(m_Weight * modulus * sina);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
modulus = 1 + m_Space / Zeps(modulus);
|
||||
helper.Out.x = m_Weight * modulus * x;
|
||||
helper.Out.y = m_Weight * modulus * 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 weight = WeightDefineString();
|
||||
string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string spin = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string space = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string corner = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string vertex = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string sinvertex = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string pieslice = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string halfslice = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string cornerrotation = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t theta, sina, cosa;\n"
|
||||
<< "\t\treal_t x = vIn.x;\n"
|
||||
<< "\t\treal_t y = vIn.y;\n"
|
||||
<< "\t\treal_t modulus = precalcSqrtSumSquares;\n"
|
||||
<< "\n"
|
||||
<< "\t\tif (" << n << " == 2.0)\n"
|
||||
<< "\t\t{\n"
|
||||
<< "\t\t if (fabs(x) < " << weight << ")\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t theta = atan2(y, x) + " << spin << ";\n"
|
||||
<< "\t\t sina = sin(theta);\n"
|
||||
<< "\t\t cosa = cos(theta);\n"
|
||||
<< "\t\t x = " << weight << " * modulus * cosa;\n"
|
||||
<< "\t\t y = " << weight << " * modulus * sina;\n"
|
||||
<< "\n"
|
||||
<< "\t\t if (fabs(x) < " << weight << ")\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t vOut.x = x;\n"
|
||||
<< "\t\t vOut.y = y;\n"
|
||||
<< "\t\t }\n"
|
||||
<< "\t\t else\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t theta = atan2(y, x) - " << spin << " + " << cornerrotation << ";\n"
|
||||
<< "\t\t sina = sin(theta);\n"
|
||||
<< "\t\t cosa = cos(theta);\n"
|
||||
<< "\t\t vOut.x = " << weight << " * modulus * cosa;\n"
|
||||
<< "\t\t vOut.y = -(" << weight << " * modulus * sina);\n"
|
||||
<< "\t\t }\n"
|
||||
<< "\t\t }\n"
|
||||
<< "\t\t else\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t modulus = 1 + " << space << " / Zeps(modulus);\n"
|
||||
<< "\t\t vOut.x = " << weight << " * modulus * x;\n"
|
||||
<< "\t\t vOut.y = " << weight << " * modulus * y;\n"
|
||||
<< "\t\t }\n"
|
||||
<< "\t\t}\n"
|
||||
<< "\t\telse\n"
|
||||
<< "\t\t{\n"
|
||||
<< "\t\t theta = atan2(y, x) + M_2PI;\n"
|
||||
<< "\t\t real_t theta_diff = fmod(theta + " << halfslice << ", " << pieslice << ");\n"
|
||||
<< "\t\t real_t r = " << weight << " * M_SQRT2 * " << sinvertex << " / Zeps(sin(MPI - theta_diff - " << vertex << "));\n"
|
||||
<< "\n"
|
||||
<< "\t\t if (modulus < r)\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t theta = atan2(y, x) + " << spin << " + M_2PI;\n"
|
||||
<< "\t\t sina = sin(theta);\n"
|
||||
<< "\t\t cosa = cos(theta);\n"
|
||||
<< "\t\t x = " << weight << " * modulus * cosa;\n"
|
||||
<< "\t\t y = " << weight << " * modulus * sina;\n"
|
||||
<< "\t\t theta_diff = fmod(theta + " << halfslice << ", " << pieslice << ");\n"
|
||||
<< "\t\t r = " << weight << " * M_SQRT2 * " << sinvertex << " / Zeps(sin(MPI - theta_diff - " << vertex << "));\n"
|
||||
<< "\t\t modulus = Hypot(x, y);\n"
|
||||
<< "\n"
|
||||
<< "\t\t if (modulus < r)\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t vOut.x = x;\n"
|
||||
<< "\t\t vOut.y = y;\n"
|
||||
<< "\t\t }\n"
|
||||
<< "\t\t else\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t theta = atan2(y, x) - " << spin << " + " << cornerrotation << " + M_2PI;\n"
|
||||
<< "\t\t sina = sin(theta);\n"
|
||||
<< "\t\t cosa = cos(theta);\n"
|
||||
<< "\t\t vOut.x = " << weight << " * modulus * cosa;\n"
|
||||
<< "\t\t vOut.y = -(" << weight << " * modulus * sina);\n"
|
||||
<< "\t\t }\n"
|
||||
<< "\t\t }\n"
|
||||
<< "\t\t else\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t modulus = 1 + " << space << " / Zeps(modulus);\n"
|
||||
<< "\t\t vOut.x = " << weight << " * modulus * x;\n"
|
||||
<< "\t\t vOut.y = " << weight << " * modulus * y;\n"
|
||||
<< "\t\t }\n"
|
||||
<< "\t\t}\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
virtual void Precalc() override
|
||||
{
|
||||
m_Vertex = T(M_PI) * (m_N - 2) / Zeps(2 * m_N);
|
||||
m_SinVertex = std::sin(m_Vertex);
|
||||
m_PieSlice = M_2PI / Zeps(m_N);
|
||||
m_HalfSlice = m_PieSlice / 2;
|
||||
m_CornerRotation = (m_Corner - 1) * m_PieSlice;
|
||||
}
|
||||
|
||||
virtual vector<string> OpenCLGlobalFuncNames() const override
|
||||
{
|
||||
return vector<string> { "Zeps", "Hypot" };
|
||||
}
|
||||
|
||||
protected:
|
||||
void Init()
|
||||
{
|
||||
string prefix = Prefix();
|
||||
m_Params.clear();
|
||||
m_Params.push_back(ParamWithName<T>(&m_N, prefix + "lazyjess_n", 4, eParamType::INTEGER_NONZERO, 2));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Spin, prefix + "lazyjess_spin", T(M_PI), eParamType::REAL_CYCLIC, 0, M_2PI));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Space, prefix + "lazyjess_space"));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Corner, prefix + "lazyjess_corner", 1, eParamType::INTEGER_NONZERO));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_Vertex, prefix + "lazyjess_vertex"));//Precalc.
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_SinVertex, prefix + "lazyjess_sin_vertex"));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_PieSlice, prefix + "lazyjess_pie_slice"));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_HalfSlice, prefix + "lazyjess_half_slice"));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_CornerRotation, prefix + "lazyjess_corner_rotation"));
|
||||
}
|
||||
|
||||
private:
|
||||
T m_N;
|
||||
T m_Spin;
|
||||
T m_Space;
|
||||
T m_Corner;
|
||||
T m_Vertex;//Precalc.
|
||||
T m_SinVertex;
|
||||
T m_PieSlice;
|
||||
T m_HalfSlice;
|
||||
T m_CornerRotation;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// lazyTravis.
|
||||
/// </summary>
|
||||
@ -2106,6 +2346,116 @@ private:
|
||||
T m_Ca;//Precalc.
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// circlecrop2.
|
||||
/// By tatasz.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class Circlecrop2Variation : public ParametricVariation<T>
|
||||
{
|
||||
public:
|
||||
Circlecrop2Variation(T weight = 1.0) : ParametricVariation<T>("circlecrop2", eVariationId::VAR_CIRCLECROP2, weight, true, true, false, false, true)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
PARVARCOPY(Circlecrop2Variation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
T rad = helper.m_PrecalcSqrtSumSquares;
|
||||
T ang = helper.m_PrecalcAtanyx;
|
||||
T s = 0;
|
||||
T c = 0;
|
||||
|
||||
if (rad > m_Out || rad < m_In)
|
||||
{
|
||||
if (!m_Zero)
|
||||
{
|
||||
s = std::sin(ang) * m_OutWeight;
|
||||
c = std::cos(ang) * m_OutWeight;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
s = helper.In.x * m_Weight;
|
||||
c = helper.In.y * m_Weight;
|
||||
}
|
||||
|
||||
helper.Out.x = s;
|
||||
helper.Out.y = c;
|
||||
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 weight = WeightDefineString();
|
||||
string inner = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string outer = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string zero = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string in = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string out = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string outweight = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t rad = precalcSqrtSumSquares;\n"
|
||||
<< "\t\treal_t ang = precalcAtanyx;\n"
|
||||
<< "\t\treal_t s = 0;\n"
|
||||
<< "\t\treal_t c = 0;\n"
|
||||
<< "\n"
|
||||
<< "\t\tif (rad > " << out << " || rad < " << in << ")\n"
|
||||
<< "\t\t{\n"
|
||||
<< "\t\t if (!" << zero << ")\n"
|
||||
<< "\t\t {\n"
|
||||
<< "\t\t s = sin(ang) * " << outweight << ";\n"
|
||||
<< "\t\t c = cos(ang) * " << outweight << ";\n"
|
||||
<< "\t\t }\n"
|
||||
<< "\t\t}\n"
|
||||
<< "\t\telse\n"
|
||||
<< "\t\t{\n"
|
||||
<< "\t\t s = vIn.x * " << weight << ";\n"
|
||||
<< "\t\t c = vIn.y * " << weight << ";\n"
|
||||
<< "\t\t}\n"
|
||||
<< "\n"
|
||||
<< "\t\tvOut.x = s;\n"
|
||||
<< "\t\tvOut.y = c;\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
virtual void Precalc() override
|
||||
{
|
||||
m_In = std::min(m_Inner, m_Outer);
|
||||
m_Out = std::max(m_Inner, m_Outer);
|
||||
m_OutWeight = m_Out * m_Weight;
|
||||
}
|
||||
|
||||
protected:
|
||||
void Init()
|
||||
{
|
||||
string prefix = Prefix();
|
||||
m_Params.clear();
|
||||
m_Params.push_back(ParamWithName<T>(&m_Inner, prefix + "circlecrop2_inner", T(0.5)));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Outer, prefix + "circlecrop2_outer", 1));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Zero, prefix + "circlecrop2_zero", 1, eParamType::INTEGER, 0, 1));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_In, prefix + "circlecrop2_in"));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_Out, prefix + "circlecrop2_out"));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_OutWeight, prefix + "circlecrop2_out_weight"));
|
||||
}
|
||||
|
||||
private:
|
||||
T m_Inner;
|
||||
T m_Outer;
|
||||
T m_Zero;
|
||||
T m_In;//Precalc.
|
||||
T m_Out;
|
||||
T m_OutWeight;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// julian3Dx.
|
||||
/// </summary>
|
||||
@ -4453,6 +4803,80 @@ private:
|
||||
T m_Scale;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// truchet_knot.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class TruchetKnotVariation : public Variation<T>
|
||||
{
|
||||
public:
|
||||
TruchetKnotVariation(T weight = 1.0) : Variation<T>("truchet_knot", eVariationId::VAR_TRUCHET_KNOT, weight) { }
|
||||
|
||||
VARCOPY(TruchetKnotVariation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
T wd = T(0.5);
|
||||
T space = T(0.1);
|
||||
T cellx = T(Floor<T>(helper.In.x));
|
||||
T celly = T(Floor<T>(helper.In.y));
|
||||
T xy0x = (rand.Frand01<T>() - T(0.5)) * wd;
|
||||
T xy0y = (rand.Frand01<T>() * 2 - 1) * (1 - space - wd * T(0.5));
|
||||
T dir0 = std::abs(cellx + celly);
|
||||
T dir1 = dir0 - 2 * Floor<T>(dir0 * T(0.5));
|
||||
T xyx, xyy;
|
||||
|
||||
if (dir1 < 0.5)
|
||||
{
|
||||
xyx = xy0x;
|
||||
xyy = xy0y;
|
||||
}
|
||||
else
|
||||
{
|
||||
xyx = -xy0y;//y and x intentionally flipped.
|
||||
xyy = xy0x;
|
||||
}
|
||||
|
||||
helper.Out.x = m_Weight * (cellx + xyx);
|
||||
helper.Out.y = m_Weight * (celly + xyy);
|
||||
helper.Out.z = DefaultZ(helper);
|
||||
}
|
||||
|
||||
virtual string OpenCLString() const override
|
||||
{
|
||||
ostringstream ss;
|
||||
intmax_t varIndex = IndexInXform();
|
||||
string weight = WeightDefineString();
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t wd = 0.5;\n"
|
||||
<< "\t\treal_t space = 0.1;\n"
|
||||
<< "\t\treal_t cellx = floor(vIn.x);\n"
|
||||
<< "\t\treal_t celly = floor(vIn.y);\n"
|
||||
<< "\t\treal_t xy0x = (MwcNext01(mwc) - 0.5) * wd;\n"
|
||||
<< "\t\treal_t xy0y = fma(MwcNext01(mwc), 2.0, -1.0) * (1.0 - space - wd * 0.5);\n"
|
||||
<< "\t\treal_t dir0 = fabs(cellx + celly);\n"
|
||||
<< "\t\treal_t dir1 = dir0 - 2.0 * floor(dir0 / 2.0);\n"
|
||||
<< "\t\treal_t xyx, xyy;\n"
|
||||
<< "\n"
|
||||
<< "\t\tif (dir1 < 0.5)\n"
|
||||
<< "\t\t{\n"
|
||||
<< "\t\t xyx = xy0x;\n"
|
||||
<< "\t\t xyy = xy0y;\n"
|
||||
<< "\t\t}\n"
|
||||
<< "\t\telse\n"
|
||||
<< "\t\t{\n"
|
||||
<< "\t\t xyx = -xy0y;//y and x intentionally flipped.\n"
|
||||
<< "\t\t xyy = xy0x;\n"
|
||||
<< "\t\t}\n"
|
||||
<< "\n"
|
||||
<< "\t\tvOut.x = " << weight << " * (cellx + xyx);\n"
|
||||
<< "\t\tvOut.y = " << weight << " * (celly + xyy);\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// gdoffs.
|
||||
/// </summary>
|
||||
@ -5193,7 +5617,86 @@ private:
|
||||
T m_Vy;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// block.
|
||||
/// By TyrantWave.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class BlockVariation : public ParametricVariation<T>
|
||||
{
|
||||
public:
|
||||
BlockVariation(T weight = 1.0) : ParametricVariation<T>("block", eVariationId::VAR_BLOCK, weight, true)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
PARVARCOPY(BlockVariation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
T tmp = helper.m_PrecalcSumSquares + 1;
|
||||
T x2 = 2 * helper.In.x;
|
||||
T y2 = 2 * helper.In.y;
|
||||
T xmax = T(0.5) * (std::sqrt(tmp + x2) + std::sqrt(tmp - x2));
|
||||
T ymax = T(0.5) * (std::sqrt(tmp + y2) + std::sqrt(tmp - y2));
|
||||
T a = helper.In.x / Zeps(xmax);
|
||||
T b = VarFuncs<T>::SafeSqrt(1 - SQR(a));
|
||||
helper.Out.x = m_WightDivPiOver2 * std::atan2(a, b);
|
||||
a = helper.In.y / Zeps(ymax);
|
||||
b = VarFuncs<T>::SafeSqrt(1 - SQR(a));
|
||||
helper.Out.y = m_WightDivPiOver2 * std::atan2(a, b);
|
||||
helper.Out.z = DefaultZ(helper);
|
||||
}
|
||||
|
||||
virtual string OpenCLString() const override
|
||||
{
|
||||
ostringstream ss, ss2;
|
||||
int i = 0;
|
||||
ss2 << "_" << XformIndexInEmber() << "]";
|
||||
string index = ss2.str();
|
||||
string weight = WeightDefineString();
|
||||
string wdpio2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params.
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t tmp = precalcSumSquares + 1;\n"
|
||||
<< "\t\treal_t x2 = 2 * vIn.x;\n"
|
||||
<< "\t\treal_t y2 = 2 * vIn.y;\n"
|
||||
<< "\t\treal_t xmax = 0.5 * (sqrt(tmp + x2) + sqrt(tmp - x2));\n"
|
||||
<< "\t\treal_t ymax = 0.5 * (sqrt(tmp + y2) + sqrt(tmp - y2));\n"
|
||||
<< "\t\treal_t a = vIn.x / Zeps(xmax);\n"
|
||||
<< "\t\treal_t b = SafeSqrt(1 - SQR(a));\n"
|
||||
<< "\t\tvOut.x = " << wdpio2 << " * atan2(a, b);\n"
|
||||
<< "\t\ta = vIn.y / Zeps(ymax);\n"
|
||||
<< "\t\tb = SafeSqrt(1 - SQR(a));\n"
|
||||
<< "\t\tvOut.y = " << wdpio2 << " * atan2(a, b);\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
virtual vector<string> OpenCLGlobalFuncNames() const override
|
||||
{
|
||||
return vector<string> { "SafeSqrt", "Zeps" };
|
||||
}
|
||||
|
||||
virtual void Precalc() override
|
||||
{
|
||||
m_WightDivPiOver2 = m_Weight * T(M_2_PI);
|
||||
}
|
||||
|
||||
protected:
|
||||
void Init()
|
||||
{
|
||||
string prefix = Prefix();
|
||||
m_Params.clear();
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_WightDivPiOver2, prefix + "block_weightdivpiover2"));//Precalcs only, no params.
|
||||
}
|
||||
|
||||
private:
|
||||
T m_WightDivPiOver2;
|
||||
};
|
||||
|
||||
MAKEPREPOSTPARVAR(ESwirl, eSwirl, ESWIRL)
|
||||
MAKEPREPOSTPARVAR(LazyJess, lazyjess, LAZYJESS)
|
||||
MAKEPREPOSTPARVAR(LazyTravis, lazyTravis, LAZY_TRAVIS)
|
||||
MAKEPREPOSTPARVAR(Squish, squish, SQUISH)
|
||||
MAKEPREPOSTPARVAR(Circus, circus, CIRCUS)
|
||||
@ -5214,6 +5717,7 @@ MAKEPREPOSTVARASSIGN(Square3D, square3D, SQUARE3D, eVariationAssignType::ASSIGNT
|
||||
MAKEPREPOSTPARVARASSIGN(SuperShape3D, SuperShape3D, SUPER_SHAPE3D, eVariationAssignType::ASSIGNTYPE_SUM)
|
||||
MAKEPREPOSTPARVAR(Sphyp3D, sphyp3D, SPHYP3D)
|
||||
MAKEPREPOSTPARVAR(Circlecrop, circlecrop, CIRCLECROP)
|
||||
MAKEPREPOSTPARVAR(Circlecrop2, circlecrop2, CIRCLECROP2)
|
||||
MAKEPREPOSTPARVAR(Julian3Dx, julian3Dx, JULIAN3DX)
|
||||
MAKEPREPOSTPARVAR(Fourth, fourth, FOURTH)
|
||||
MAKEPREPOSTPARVAR(Mobiq, mobiq, MOBIQ)
|
||||
@ -5240,6 +5744,7 @@ MAKEPREPOSTVAR(Curvature, curvature, CURVATURE)
|
||||
MAKEPREPOSTPARVAR(Qode, q_ode, Q_ODE)
|
||||
MAKEPREPOSTPARVARASSIGN(BlurHeart, blur_heart, BLUR_HEART, eVariationAssignType::ASSIGNTYPE_SUM)
|
||||
MAKEPREPOSTPARVAR(Truchet, Truchet, TRUCHET)
|
||||
MAKEPREPOSTVAR(TruchetKnot, truchet_knot, TRUCHET_KNOT)
|
||||
MAKEPREPOSTPARVAR(Gdoffs, gdoffs, GDOFFS)
|
||||
MAKEPREPOSTPARVAR(Octagon, octagon, OCTAGON)
|
||||
MAKEPREPOSTPARVAR(Trade, trade, TRADE)
|
||||
@ -5247,6 +5752,7 @@ MAKEPREPOSTPARVAR(Juliac, Juliac, JULIAC)
|
||||
MAKEPREPOSTVAR(Blade3D, blade3D, BLADE3D)
|
||||
MAKEPREPOSTPARVAR(Blob3D, blob3D, BLOB3D)
|
||||
MAKEPREPOSTPARVAR(Blocky, blocky, BLOCKY)
|
||||
MAKEPREPOSTPARVAR(Block, block, BLOCK)
|
||||
|
||||
|
||||
///// <summary>
|
||||
|
||||
@ -1083,6 +1083,77 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// foci_p.
|
||||
/// Idea by Chaosfissure.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class FociPVariation : public ParametricVariation<T>
|
||||
{
|
||||
public:
|
||||
FociPVariation(T weight = 1.0) : ParametricVariation<T>("foci_p", eVariationId::VAR_FOCI_P, weight)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
PARVARCOPY(FociPVariation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
T exp_x = Zeps(std::exp(helper.In.x));
|
||||
T exp_x_2 = exp_x * m_C1;
|
||||
T exp_nz = m_C2 / exp_x;
|
||||
T cos_y = std::cos(helper.In.y);
|
||||
T sin_y = std::sin(helper.In.y);
|
||||
T r = m_Weight / Zeps(exp_x_2 + exp_nz - cos_y);
|
||||
helper.Out.x = (exp_x_2 - exp_nz) * r;
|
||||
helper.Out.y = sin_y * r;
|
||||
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 weight = WeightDefineString();
|
||||
string c1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string c2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t exp_x = Zeps(exp(vIn.x));\n"
|
||||
<< "\t\treal_t exp_x_2 = exp_x * " << c1 << ";\n"
|
||||
<< "\t\treal_t exp_nz = " << c2 << " / exp_x;\n"
|
||||
<< "\t\treal_t cos_y = cos(vIn.y);\n"
|
||||
<< "\t\treal_t sin_y = sin(vIn.y);\n"
|
||||
<< "\t\treal_t r = " << weight << " / Zeps(exp_x_2 + exp_nz - cos_y);\n"
|
||||
<< "\n"
|
||||
<< "\t\tvOut.x = (exp_x_2 - exp_nz) * r;\n"
|
||||
<< "\t\tvOut.y = sin_y * r;\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
virtual vector<string> OpenCLGlobalFuncNames() const override
|
||||
{
|
||||
return vector<string> { "Zeps" };
|
||||
}
|
||||
|
||||
protected:
|
||||
void Init()
|
||||
{
|
||||
string prefix = Prefix();
|
||||
m_Params.clear();
|
||||
m_Params.push_back(ParamWithName<T>(&m_C1, prefix + "foci_p_c1", T(0.5)));
|
||||
m_Params.push_back(ParamWithName<T>(&m_C2, prefix + "foci_p_c2", T(0.5)));
|
||||
}
|
||||
|
||||
private:
|
||||
T m_C1;
|
||||
T m_C2;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// ho.
|
||||
/// </summary>
|
||||
@ -4330,6 +4401,7 @@ MAKEPREPOSTPARVAR(CircleTrans1, CircleTrans1, CIRCLETRANS1)
|
||||
MAKEPREPOSTPARVAR(Cubic3D, cubic3D, CUBIC3D)
|
||||
MAKEPREPOSTPARVAR(CubicLattice3D, cubicLattice_3D, CUBIC_LATTICE3D)
|
||||
MAKEPREPOSTVAR(Foci3D, foci_3D, FOCI3D)
|
||||
MAKEPREPOSTPARVAR(FociP, foci_p, FOCI_P)
|
||||
MAKEPREPOSTPARVAR(Ho, ho, HO)
|
||||
MAKEPREPOSTPARVAR(Julia3Dq, julia3Dq, JULIA3DQ)
|
||||
MAKEPREPOSTPARVARASSIGN(Line, line, LINE, eVariationAssignType::ASSIGNTYPE_SUM)
|
||||
|
||||
@ -3807,13 +3807,13 @@ public:
|
||||
ss2 << "_" << XformIndexInEmber();
|
||||
string weight = WeightDefineString();
|
||||
string index = ss2.str() + "]";
|
||||
string cellSize = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string distort = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string z = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string cellSize = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string distort = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string z = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string halfCellSize = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string cache = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string cache = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
ss << "\t{\n"
|
||||
<< "\t\tint di = -1, dj = -1;\n"
|
||||
<< "\t\tint i = 0;\n"
|
||||
@ -3884,13 +3884,13 @@ protected:
|
||||
string prefix = Prefix();
|
||||
m_Params.clear();
|
||||
m_Params.reserve(8);
|
||||
m_Params.push_back(ParamWithName<T>(&m_CellSize, prefix + "crackle_cellsize", 1, eParamType::REAL, T(0.0001)));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Power, prefix + "crackle_power", T(0.2)));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Distort, prefix + "crackle_distort"));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Scale, prefix + "crackle_scale", 1));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Z, prefix + "crackle_z"));
|
||||
m_Params.push_back(ParamWithName<T>(&m_CellSize, prefix + "crackle_cellsize", 1, eParamType::REAL, T(0.0001)));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Power, prefix + "crackle_power", T(0.2)));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Distort, prefix + "crackle_distort"));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Scale, prefix + "crackle_scale", 1));
|
||||
m_Params.push_back(ParamWithName<T>(&m_Z, prefix + "crackle_z"));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_HalfCellSize, prefix + "crackle_half_cellsize"));
|
||||
m_Params.push_back(ParamWithName<T>(true, &(m_C[0][0].x), prefix + "crackle_cache", sizeof(m_C)));
|
||||
m_Params.push_back(ParamWithName<T>(true, &(m_C[0][0].x), prefix + "crackle_cache", sizeof(m_C)));
|
||||
}
|
||||
|
||||
private:
|
||||
@ -3927,6 +3927,115 @@ private:
|
||||
shared_ptr<VarFuncs<T>> m_VarFuncs = VarFuncs<T>::Instance();
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// crackle2.
|
||||
/// By tatasz.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class Crackle2Variation : public ParametricVariation<T>
|
||||
{
|
||||
public:
|
||||
Crackle2Variation(T weight = 1.0) : ParametricVariation<T>("crackle2", eVariationId::VAR_CRACKLE2, weight)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
PARVARCOPY(Crackle2Variation)
|
||||
|
||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||
{
|
||||
T seed = 34554;
|
||||
v2T cell(Floor(helper.In.x), Floor(helper.In.y));
|
||||
v2T xy0(cell.x + m_OneOverCellsize * VarFuncs<T>::HashShadertoy(cell.x, cell.y, seed), cell.y + m_OneOverCellsize * VarFuncs<T>::HashShadertoy(cell.y, cell.x * 3, seed + 7));
|
||||
v2T xy1_aux;
|
||||
|
||||
if (rand.Frand01<T>() < 0.5)
|
||||
{
|
||||
if (rand.Frand01<T>() < 0.5)
|
||||
xy1_aux = v2T(cell.x, cell.y + 1);
|
||||
else
|
||||
xy1_aux = v2T(cell.x, cell.y - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rand.Frand01<T>() < 0.5)
|
||||
xy1_aux = v2T(cell.x + 1, cell.y);
|
||||
else
|
||||
xy1_aux = v2T(cell.x - 1, cell.y);
|
||||
}
|
||||
|
||||
v2T xy1(xy1_aux.x + m_OneOverCellsize * VarFuncs<T>::HashShadertoy(xy1_aux.x, xy1_aux.y, seed), xy1_aux.y + m_OneOverCellsize * VarFuncs<T>::HashShadertoy(xy1_aux.y, xy1_aux.x * 3, seed + 7));
|
||||
v2T v = xy1 - xy0;
|
||||
v2T result = (xy0 + v * rand.Frand01<T>()) * m_Cellsize;
|
||||
helper.Out.x = result.x;
|
||||
helper.Out.y = result.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 weight = WeightDefineString();
|
||||
string cellsize = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
string oneovercellsize = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||
ss << "\t{\n"
|
||||
<< "\t\treal_t seed = 34554.0;\n"
|
||||
<< "\t\treal2 cell = (real2)(floor(vIn.x), floor(vIn.y));\n"
|
||||
<< "\t\treal2 xy0 = (real2)(cell.x + " << oneovercellsize << " * HashShadertoy(cell.x, cell.y, seed), cell.y + " << oneovercellsize << " * HashShadertoy(cell.y, cell.x * 3.0, seed + 7.0));\n"
|
||||
<< "\t\treal2 xy1_aux;\n"
|
||||
<< "\t\t\n"
|
||||
<< "\t\tif (MwcNext01(mwc) < 0.5)\n"
|
||||
<< "\t\t{\n"
|
||||
<< "\t\t if (MwcNext01(mwc) < 0.5)\n"
|
||||
<< "\t\t xy1_aux = (real2)(cell.x, cell.y + 1);\n"
|
||||
<< "\t\t else\n"
|
||||
<< "\t\t xy1_aux = (real2)(cell.x, cell.y - 1);\n"
|
||||
<< "\t\t}\n"
|
||||
<< "\t\telse\n"
|
||||
<< "\t\t{\n"
|
||||
<< "\t\t if (MwcNext01(mwc) < 0.5)\n"
|
||||
<< "\t\t xy1_aux = (real2)(cell.x + 1, cell.y);\n"
|
||||
<< "\t\t else\n"
|
||||
<< "\t\t xy1_aux = (real2)(cell.x - 1, cell.y);\n"
|
||||
<< "\t\t}\n"
|
||||
<< "\t\t\n"
|
||||
<< "\t\treal2 xy1 = (real2)(xy1_aux.x + " << oneovercellsize << " * HashShadertoy(xy1_aux.x, xy1_aux.y, seed), xy1_aux.y + " << oneovercellsize << " * HashShadertoy(xy1_aux.y, xy1_aux.x * 3.0, seed + 7.0));\n"
|
||||
<< "\t\treal2 v = xy1 - xy0;\n"
|
||||
<< "\t\treal2 result = (xy0 + v * MwcNext01(mwc)) * " << cellsize << ";\n"
|
||||
<< "\t\tvOut.x = result.x;\n"
|
||||
<< "\t\tvOut.y = result.y;\n"
|
||||
<< "\t\tvOut.z = " << DefaultZCl()
|
||||
<< "\t}\n";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
virtual vector<string> OpenCLGlobalFuncNames() const override
|
||||
{
|
||||
return vector<string> { "Zeps", "Fract", "HashShadertoy" };
|
||||
}
|
||||
|
||||
virtual void Precalc() override
|
||||
{
|
||||
m_OneOverCellsize = 1 / Zeps(m_Cellsize);
|
||||
}
|
||||
|
||||
protected:
|
||||
void Init()
|
||||
{
|
||||
string prefix = Prefix();
|
||||
m_Params.clear();
|
||||
m_Params.push_back(ParamWithName<T>(&m_Cellsize, prefix + "crackle2_cellsize", 1, eParamType::REAL, T(0.0001)));
|
||||
m_Params.push_back(ParamWithName<T>(true, &m_OneOverCellsize, prefix + "crackle2_one_over_cellsize"));
|
||||
}
|
||||
|
||||
private:
|
||||
T m_Cellsize;
|
||||
T m_OneOverCellsize;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// post_smartcrop.
|
||||
/// This variation is special in that it only exists as a post_.
|
||||
@ -5417,6 +5526,7 @@ MAKEPREPOSTPARVAR(Crob, crob, CROB)
|
||||
MAKEPREPOSTPARVAR(BubbleT3D, bubbleT3D, BUBBLET3D)
|
||||
MAKEPREPOSTPARVAR(Synth, synth, SYNTH)
|
||||
MAKEPREPOSTPARVAR(Crackle, crackle, CRACKLE)
|
||||
MAKEPREPOSTPARVAR(Crackle2, crackle2, CRACKLE2)
|
||||
MAKEPREPOSTVAR(Erf, erf, ERF)
|
||||
MAKEPREPOSTVAR(Xerf, xerf, XERF)
|
||||
MAKEPREPOSTPARVAR(W, w, W)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -4,6 +4,7 @@
|
||||
#include "PaletteList.h"
|
||||
#include "VariationList.h"
|
||||
#include "Ember.h"
|
||||
#include "Spline.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <libgen.h>
|
||||
@ -33,7 +34,7 @@ private:
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Class for reading Xml files into ember objects.
|
||||
/// Class for reading standard Xml flame files as well as Chaotica .chaos files into ember objects.
|
||||
/// This class derives from EmberReport, so the caller is able
|
||||
/// to retrieve a text dump of error information if any errors occur.
|
||||
/// Since this class contains a VariationList object, it's important to declare one
|
||||
@ -57,15 +58,22 @@ public:
|
||||
private:
|
||||
template <typename Alloc, template <typename, typename> class C>
|
||||
void ScanForEmberNodes(xmlNode* curNode, const char* parentFile, C<Ember<T>, Alloc>& embers, bool useDefaults);
|
||||
template <typename Alloc, template <typename, typename> class C>
|
||||
void ScanForChaosNodes(xmlNode* curNode, const char* parentFile, C<Ember<T>, Alloc>& embers, bool useDefaults);
|
||||
bool ParseEmberElement(xmlNode* emberNode, Ember<T>& currentEmber);
|
||||
bool ParseEmberElementFromChaos(xmlNode* emberNode, Ember<T>& currentEmber);
|
||||
bool AttToEmberMotionFloat(xmlAttrPtr att, const char* attStr, eEmberMotionParam param, EmberMotion<T>& motion);
|
||||
bool ParseXform(xmlNode* childNode, Xform<T>& xform, bool motion, bool fromEmber);
|
||||
static string GetCorrectedParamName(const unordered_map<string, string>& names, const char* name);
|
||||
static string GetCorrectedVariationName(vector<pair<pair<string, string>, vector<string>>>& vec, xmlAttrPtr att);
|
||||
static string GetCorrectedVariationName(vector<pair<pair<string, string>, vector<string>>>& vec, const string& varname);
|
||||
static bool XmlContainsTag(xmlAttrPtr att, const char* name);
|
||||
bool ParseHexColors(const char* colstr, Ember<T>& ember, size_t numColors, intmax_t chan);
|
||||
template <typename valT>
|
||||
bool ParseAndAssign(const xmlChar* name, const char* attStr, const char* str, valT& val, bool& b);
|
||||
template <typename valT>
|
||||
bool ParseAndAssignContent(xmlNode* node, const char* fieldname, const char* fieldnameval, valT& val);
|
||||
bool ParseAndAssignContent(xmlNode* node, const char* fieldname, const char* fieldnameval, std::string& val);
|
||||
|
||||
static bool m_Init;
|
||||
static unordered_map<string, string> m_BadParamNames;
|
||||
|
||||
Reference in New Issue
Block a user