--User changes

-Add new variations: bubbleT3D, crob, hexaplay3D, hexcrop, hexes, hexnix3D, loonie2, loonie3, nBlur, octapol and synth.
 -Allow for pre/post versions of dc_bubble, dc_cylinder and dc_linear whereas before they were omitted.
 -When saving a file with multiple embers in it, detect if time values are all the same and if so, start them at zero and increment by 1 for each ember.
 -Allow for numerous quality increases to be coalesced into one. It will pick up at the end of the current render.
 -Show selection highlight on variations tree in response to mouse hover. This makes it easier to see for which variation or param the current mouse wheel action will apply.
 -Make default temporal samples be 100, whereas before it was 1000 which was overkill.
 -Require the shift key to be held with delete for deleting an ember to prevent it from triggering when the user enters delete in the edit box.
  -This wasn't otherwise fixable without writing a lot more code.

--Bug fixes
 -EmberGenome was crashing when generating a sequence from a source file with more than 2 embers in it.
 -EmberGenome was improperly handling the first frame of a merge after the last frame of the loop.
  -These bugs were due to a previous commit. Revert parts of that commit.
 -Prevent a zoom value of less than 0 when reading from xml.
 -Slight optimization of the crescents, and mask variations, if the compiler wasn't doing it already.
 -Unique file naming was broken because it was looking for _# and the default names ended with -#.
 -Disallow renaming of an ember in the library tree to an empty string.
 -Severe bug that prevented some variations from being read correctly from params generated outside this program.
 -Severe OpenCL randomization bug. The first x coordinates of the first points in the first kernel call of the first ember of a render since the OpenCL renderer object was created were not random and were mostly -1.
 -Severe bug when populating xform selection distributions that could sometimes cause a crash due to roundoff error. Fix by using double.
 -Limit the max number of variations in a random ember to MAX_CL_VARS, which is 8. This ensures they'll look the same on CPU and GPU.
 -Prevent user from saving stylesheet to default.qss, it's a special reserved filename.

--Code changes
 -Generalize using the running sum output point inside of a variation for all cases: pre, reg and post.
 -Allow for array variables in variations where the address of each element is stored in m_Params.
 -Qualify all math functions with std::
 -No longer use our own Clamp() in OpenCL, instead use the standard clamp().
 -Redesign how functions are used in the variations OpenCL code.
 -Add tests to EmberTester to verify some of the new functionality.
 -Place more const and override qualifiers on functions where appropriate.
 -Add a global rand with a lock to be used very sparingly.
 -Use a map instead of a vector for bad param names in Xml parsing.
 -Prefix affine interpolation mode defines with "AFFINE_" to make their purpose more clear.
 -Allow for variations that change state during iteration by sending a separate copy of the ember to each rendering thread.
 -Implement this same functionality with a local struct in OpenCL. It's members are the total of all variables that need to change state within an ember.
 -Add Contains() function to Utils.h.
 -EmberRender: print names of kernels being printed with --dump_kernel option.
 -Clean up EmberTester to handle some of the recent changes.
 -Fix various casts.
 -Replace % 2 with & 1, even though the compiler was likely doing this already.
 -Add new file Variations06.h to accommodate new variations.
 -General cleanup.
This commit is contained in:
mfeemster
2015-11-22 14:15:07 -08:00
parent 04e72c27de
commit 330074cfb2
62 changed files with 8176 additions and 1877 deletions

View File

@ -321,8 +321,8 @@ bool EmberGenome(EmberOptions& opt)
embers[i].DeleteMotionElements();
}
firstFrame = uint(opt.FirstFrame() == UINT_MAX ? embers[0].m_Time : opt.FirstFrame());
lastFrame = uint(opt.LastFrame() == UINT_MAX ? embers.back().m_Time : opt.LastFrame());
firstFrame = size_t(opt.FirstFrame() == UINT_MAX ? embers[0].m_Time : opt.FirstFrame());
lastFrame = size_t(opt.LastFrame() == UINT_MAX ? embers.back().m_Time : opt.LastFrame());
if (lastFrame < firstFrame)
lastFrame = firstFrame;
@ -335,7 +335,7 @@ bool EmberGenome(EmberOptions& opt)
for (i = 0; i < embers.size(); i++)
{
if (ftime == uint(embers[i].m_Time))
if (ftime == size_t(embers[i].m_Time))
{
interpolated = embers[i];
exactTimeMatch = true;
@ -349,7 +349,7 @@ bool EmberGenome(EmberOptions& opt)
for (i = 0; i < embers.size(); i++)
{
if (ftime == uint(embers[i].m_Time - 1))
if (ftime == size_t(embers[i].m_Time - 1))
{
exactTimeMatch = true;
break;
@ -357,7 +357,7 @@ bool EmberGenome(EmberOptions& opt)
}
if (!exactTimeMatch)
interpolated.m_AffineInterp = INTERP_LINEAR;
interpolated.m_AffineInterp = AFFINE_INTERP_LINEAR;
}
if (pTemplate)
@ -400,23 +400,12 @@ bool EmberGenome(EmberOptions& opt)
if (i < embers.size() - 1)
{
vector<Ember<T>> interpEmbers;
interpEmbers.push_back(embers[i]);
interpEmbers.push_back(embers[i + 1]);
if (opt.Loops() > 0)
{
//We might have looped a non-integral number of times, so store the last result as our flame to interpolate from.
interpEmbers[i] = result;
}
for (frame = 0; frame < opt.Frames(); frame++)
{
seqFlag = (frame == 0 || frame == opt.Frames() - 1);
blend = frame / T(opt.Frames());
result.Clear();
tools.SpinInter(&interpEmbers[i], pTemplate, result, frameCount++, seqFlag, blend);
tools.SpinInter(&embers[i], pTemplate, result, frameCount++, seqFlag, blend);
cout << emberToXml.ToString(result, opt.Extras(), opt.PrintEditDepth(), !opt.NoEdits(), false, opt.HexPalette());
}
}
@ -500,7 +489,7 @@ bool EmberGenome(EmberOptions& opt)
oldX = embers[i].m_CenterX;
oldY = embers[i].m_CenterY;
embers[i].m_FinalRasH = uint(T(embers[i].m_FinalRasH) / T(opt.Frames()));
embers[i].m_FinalRasH = size_t(T(embers[i].m_FinalRasH) / T(opt.Frames()));
embers[i].m_CenterY = embers[i].m_CenterY - ((opt.Frames() - 1) * embers[i].m_FinalRasH) /
(2 * embers[i].m_PixelsPerUnit * pow(T(2.0), embers[i].m_Zoom));
@ -596,7 +585,7 @@ bool EmberGenome(EmberOptions& opt)
mutMeth = MUTATE_NOT_SPECIFIED;
}
os << tools.Mutate(orig, mutMeth, vars, opt.Symmetry(), T(opt.Speed()));
os << tools.Mutate(orig, mutMeth, vars, opt.Symmetry(), T(opt.Speed()), MAX_CL_VARS);
//Scan string returned for 'mutate color'.
if (strstr(os.str().c_str(), "mutate color"))
@ -647,7 +636,7 @@ bool EmberGenome(EmberOptions& opt)
{
os << "random";
randomMode = true;
tools.Random(orig, vars, opt.Symmetry(), 0);
tools.Random(orig, vars, opt.Symmetry(), 0, MAX_CL_VARS);
aselp0 = nullptr;
aselp1 = nullptr;
}