2014-07-08 03:11:14 -04:00
# include "EmberCommonPch.h"
# include "EmberTester.h"
# include "JpegUtils.h"
# include <queue>
# include <list>
# include <deque>
2017-08-03 22:56:14 -04:00
# ifdef __APPLE__
# include <OpenEXR/ImfRgbaFile.h>
# include <OpenEXR/ImfStringAttribute.h>
# include <OpenEXR/half.h>
# else
# include <ImfRgbaFile.h>
# include <ImfStringAttribute.h>
# include <half.h>
# endif
2017-07-22 16:43:35 -04:00
//#include <ImfStringAttribute.h>
//#include <ImfMatrixAttribute.h>
//#include <ImfArray.h>
//#include <ImfChannelList.h>
//#include "drawImage.h"
//
//#include <iostream>
//#include <algorithm>
//
//
//#include <ImfNamespace.h>
//
//namespace IMF = Imf;
//
using namespace Imf ;
using namespace Imath ;
2014-07-08 03:11:14 -04:00
/// <summary>
/// EmberTester is a scratch area used for on the fly testing.
/// It may become a more formalized automated testing system
/// in the future. At the moment it isn't expected to build or
/// give any useful insight into the workings of Ember.
/// </summary>
using namespace EmberNs ;
2016-06-11 20:47:03 -04:00
using namespace EmberCommon ;
2014-07-08 03:11:14 -04:00
2017-06-11 18:02:44 -04:00
//#define DO_NVIDIA 1
2017-07-22 16:43:35 -04:00
void writeRgba1 ( const char filename [ ] ,
const Rgba * pixels ,
int width ,
int height )
{
//
// Write an RGBA image using class RgbaOutputFile.
//
// - open the file
// - describe the memory layout of the pixels
// - store the pixels in the file
//
//auto& chl = file.header().channels();
//chl.findChannel("R")->type = PixelType::FLOAT;
//Header header(width, height);
//header.channels().insert("R", Channel(IMF::FLOAT));
//header.channels().insert("G", Channel(IMF::FLOAT));
//header.channels().insert("B", Channel(IMF::FLOAT));
////header.channels().insert("A", Channel(IMF::FLOAT));
//FrameBuffer frameBuffer;
//frameBuffer.insert("Z", // name
// Slice(IMF::FLOAT, // type
// (char *)zPixels, // base
// sizeof(*zPixels) * 1, // xStride
// sizeof(*zPixels) * width)); // yStride
try
{
RgbaOutputFile file ( filename , width , height , WRITE_RGBA ) ;
file . setFrameBuffer ( pixels , 1 , width ) ;
file . writePixels ( height ) ;
}
catch ( std : : exception e )
{
cout < < e . what ( ) < < endl ;
}
}
2014-07-08 03:11:14 -04:00
template < typename T >
2014-12-06 00:05:09 -05:00
void SaveFinalImage ( Renderer < T , T > & renderer , vector < byte > & pixels , char * suffix )
2014-07-08 03:11:14 -04:00
{
long newSize ;
2016-12-05 22:04:33 -05:00
ostringstream os ;
os < < " . \\ BasicFlame_ " < < sizeof ( T ) < < " _ " < < suffix " .bmp " ;
2014-07-08 03:11:14 -04:00
BYTE * bgrBuf = ConvertRGBToBMPBuffer ( pixels . data ( ) , renderer . FinalRasW ( ) , renderer . FinalRasH ( ) , newSize ) ;
SaveBMP ( ch , bgrBuf , renderer . FinalRasW ( ) , renderer . FinalRasH ( ) , newSize ) ;
delete [ ] bgrBuf ;
}
template < typename T >
2014-12-06 00:05:09 -05:00
Ember < T > CreateBasicEmber ( uint width , uint height , uint ss , T quality , T centerX , T centerY , T rotate )
2014-07-08 03:11:14 -04:00
{
Timing t ;
QTIsaac < ISAAC_SIZE , ISAAC_INT > rand ;
//t.Tic();
Ember < T > ember1 ;
//t.Toc("TestBasicFlame() : Constructor()");
//t.Tic();
ember1 . m_FinalRasW = width ;
ember1 . m_FinalRasH = height ;
ember1 . m_Supersample = ss ;
ember1 . m_Quality = quality ;
ember1 . m_CenterX = centerX ;
ember1 . m_CenterY = centerY ;
ember1 . m_Rotate = rotate ;
Xform < T > xform1 ( T ( 0.25 ) , rand . Frand01 < T > ( ) , rand . Frand11 < T > ( ) , T ( 1 ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) ) ;
Xform < T > xform2 ( T ( 0.25 ) , rand . Frand01 < T > ( ) , rand . Frand11 < T > ( ) , T ( 1 ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) ) ;
Xform < T > xform3 ( T ( 0.25 ) , rand . Frand01 < T > ( ) , rand . Frand11 < T > ( ) , T ( 1 ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) ) ;
Xform < T > xform4 ( T ( 0.25 ) , rand . Frand01 < T > ( ) , rand . Frand11 < T > ( ) , T ( 1 ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) ) ;
xform1 . AddVariation ( new SphericalVariation < T > ( ) ) ;
xform2 . AddVariation ( new SphericalVariation < T > ( ) ) ;
xform3 . AddVariation ( new SphericalVariation < T > ( ) ) ;
xform4 . AddVariation ( new SphericalVariation < T > ( ) ) ;
xform4 . AddVariation ( new BlobVariation < T > ( ) ) ;
ember1 . AddXform ( xform1 ) ;
ember1 . AddXform ( xform2 ) ;
ember1 . AddXform ( xform3 ) ;
ember1 . AddXform ( xform4 ) ;
//ember1.SetFinalXform(xform4);
return ember1 ;
}
2014-12-06 00:05:09 -05:00
string GetEmberCLKernelString ( Ember < float > & ember , bool iter , bool log , bool de , uint ss , bool accum )
2014-07-08 03:11:14 -04:00
{
ostringstream os ;
2015-08-12 21:51:07 -04:00
IterOpenCLKernelCreator < float > iterCreator ;
2015-08-10 23:10:23 -04:00
DEOpenCLKernelCreator deCreator ( false , false ) ;
FinalAccumOpenCLKernelCreator accumCreator ( false ) ;
2015-12-31 16:41:59 -05:00
pair < string , vector < float > > pair , pair2 ;
2014-07-08 03:11:14 -04:00
iterCreator . ParVarIndexDefines ( ember , pair ) ;
2015-12-31 16:41:59 -05:00
iterCreator . SharedDataIndexDefines ( ember , pair2 ) ;
2014-07-08 03:11:14 -04:00
if ( iter )
2015-12-31 16:41:59 -05:00
os < < " Iter kernel: \n " < < iterCreator . CreateIterKernelString ( ember , pair . first , pair2 . first , true ) ;
2014-07-08 03:11:14 -04:00
if ( log )
os < < " Log scale de kernel: \n " < < deCreator . LogScaleAssignDEKernel ( ) ;
//if (de)
// os << "Gaussian DE kernel: \n" << deCreator.GaussianDEKernel(ss);
//if (accum)
// os << "Accum kernel: \n" << accumCreator.FinalAccumKernelLateClipWithoutAlpha();
return os . str ( ) ;
}
2015-03-22 15:46:10 -04:00
template < typename T >
void MakeTestAllVarsRegPrePost ( vector < Ember < T > > & embers )
2014-07-08 03:11:14 -04:00
{
2014-12-06 00:05:09 -05:00
uint index = 0 ;
2014-07-08 03:11:14 -04:00
ostringstream ss ;
2016-04-13 23:59:57 -04:00
auto varList = VariationList < T > : : Instance ( ) ;
2017-02-26 12:34:43 -05:00
auto paletteList = PaletteList < float > : : Instance ( ) ;
2014-07-08 03:11:14 -04:00
QTIsaac < ISAAC_SIZE , ISAAC_INT > rand ;
2017-02-26 12:34:43 -05:00
paletteList - > Add ( " flam3-palettes.xml " ) ;
2014-07-08 03:11:14 -04:00
Timing t ;
2015-03-22 15:46:10 -04:00
Ember < T > emberNoVars ;
06/04/2017
--User changes
-Make all fonts be MS Shell Dlg 2. This will require reloading dark.qss if users are already using it.
-Limit size of the left side of the palette editor.
-Disable create from image buttons in the palette editor when working on a fixed palette.
--Bug fixes
-The following variations were wrong: coshq, cothq.
-During iteration, the color index could become nan if all xform color speeds were negative. This could lead to bad results on the GPU. Fix to check for nan. Minimal speed difference.
--Code changes
-Make the following variations safer by using Zeps(): sinq, sinhq, secq, sechq, tanq, tanhq, cosq, coshq, cotq, cothq, cscq, cschq, estiq.
-Always pass -cl-no-signed-zeros -cl-denorms-are-zero to kernel compiles for both single and double.
-Flush all denormals to zero for all executable programs. This will likely lead to a speedup for badly behaving programs.
2017-06-04 20:37:29 -04:00
emberNoVars . m_FinalRasW = 1024 ;
emberNoVars . m_FinalRasH = 1024 ;
2014-07-08 03:11:14 -04:00
emberNoVars . m_Quality = 100 ;
2015-03-22 15:46:10 -04:00
Xform < T > xform1 ( 0.25f , rand . Frand01 < T > ( ) , rand . Frand11 < T > ( ) , 1 , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) ) ;
Xform < T > xform2 ( 0.25f , rand . Frand01 < T > ( ) , rand . Frand11 < T > ( ) , 1 , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) ) ;
Xform < T > xform3 ( 0.25f , rand . Frand01 < T > ( ) , rand . Frand11 < T > ( ) , 1 , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) ) ;
06/04/2017
--User changes
-Make all fonts be MS Shell Dlg 2. This will require reloading dark.qss if users are already using it.
-Limit size of the left side of the palette editor.
-Disable create from image buttons in the palette editor when working on a fixed palette.
--Bug fixes
-The following variations were wrong: coshq, cothq.
-During iteration, the color index could become nan if all xform color speeds were negative. This could lead to bad results on the GPU. Fix to check for nan. Minimal speed difference.
--Code changes
-Make the following variations safer by using Zeps(): sinq, sinhq, secq, sechq, tanq, tanhq, cosq, coshq, cotq, cothq, cscq, cschq, estiq.
-Always pass -cl-no-signed-zeros -cl-denorms-are-zero to kernel compiles for both single and double.
-Flush all denormals to zero for all executable programs. This will likely lead to a speedup for badly behaving programs.
2017-06-04 20:37:29 -04:00
//Xform<T> xform4(0.25f, rand.Frand01<T>(), rand.Frand11<T>(), 1, rand.Frand11<T>(), rand.Frand11<T>(), rand.Frand11<T>(), rand.Frand11<T>(), rand.Frand11<T>(), rand.Frand11<T>());
//Xform<T> xform5(0.25f, rand.Frand01<T>(), rand.Frand11<T>(), 1, rand.Frand11<T>(), rand.Frand11<T>(), rand.Frand11<T>(), rand.Frand11<T>(), rand.Frand11<T>(), rand.Frand11<T>());
//Xform<T> xform6(0.25f, rand.Frand01<T>(), rand.Frand11<T>(), 1, rand.Frand11<T>(), rand.Frand11<T>(), rand.Frand11<T>(), rand.Frand11<T>(), rand.Frand11<T>(), rand.Frand11<T>());
//Xform<T> xform7(0.25f, rand.Frand01<T>(), rand.Frand11<T>(), 1, rand.Frand11<T>(), rand.Frand11<T>(), rand.Frand11<T>(), rand.Frand11<T>(), rand.Frand11<T>(), rand.Frand11<T>());
2014-07-08 03:11:14 -04:00
emberNoVars . AddXform ( xform1 ) ;
emberNoVars . AddXform ( xform2 ) ;
emberNoVars . AddXform ( xform3 ) ;
06/04/2017
--User changes
-Make all fonts be MS Shell Dlg 2. This will require reloading dark.qss if users are already using it.
-Limit size of the left side of the palette editor.
-Disable create from image buttons in the palette editor when working on a fixed palette.
--Bug fixes
-The following variations were wrong: coshq, cothq.
-During iteration, the color index could become nan if all xform color speeds were negative. This could lead to bad results on the GPU. Fix to check for nan. Minimal speed difference.
--Code changes
-Make the following variations safer by using Zeps(): sinq, sinhq, secq, sechq, tanq, tanhq, cosq, coshq, cotq, cothq, cscq, cschq, estiq.
-Always pass -cl-no-signed-zeros -cl-denorms-are-zero to kernel compiles for both single and double.
-Flush all denormals to zero for all executable programs. This will likely lead to a speedup for badly behaving programs.
2017-06-04 20:37:29 -04:00
//emberNoVars.AddXform(xform4);
//emberNoVars.AddXform(xform5);
//emberNoVars.AddXform(xform6);
//emberNoVars.AddXform(xform7);
2014-07-08 03:11:14 -04:00
ss < < " NoVars " ;
emberNoVars . m_Name = ss . str ( ) ;
ss . str ( " " ) ;
2017-02-26 12:34:43 -05:00
emberNoVars . m_Palette = * paletteList - > GetPaletteByFilename ( paletteList - > m_DefaultFilename , 0 ) ;
2014-07-08 03:11:14 -04:00
embers . push_back ( emberNoVars ) ;
2016-04-13 23:59:57 -04:00
while ( index < varList - > RegSize ( ) )
2014-07-08 03:11:14 -04:00
{
2016-01-04 19:50:15 -05:00
/* if (index != eVariationId::VAR_SYNTH)
2015-12-31 16:41:59 -05:00
{
--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.
2015-11-22 17:15:07 -05:00
index + + ;
continue ;
2015-12-31 16:41:59 -05:00
}
*/
2015-03-22 15:46:10 -04:00
Ember < T > ember1 ;
2016-04-13 23:59:57 -04:00
unique_ptr < Variation < T > > regVar ( varList - > GetVariationCopy ( index , eVariationType : : VARTYPE_REG ) ) ;
2017-07-05 02:08:06 -04:00
unique_ptr < Variation < T > > preVar ( varList - > GetVariationCopy ( " pre_ " + regVar - > Name ( ) ) ) ;
unique_ptr < Variation < T > > postVar ( varList - > GetVariationCopy ( " post_ " + regVar - > Name ( ) ) ) ;
06/04/2017
--User changes
-Make all fonts be MS Shell Dlg 2. This will require reloading dark.qss if users are already using it.
-Limit size of the left side of the palette editor.
-Disable create from image buttons in the palette editor when working on a fixed palette.
--Bug fixes
-The following variations were wrong: coshq, cothq.
-During iteration, the color index could become nan if all xform color speeds were negative. This could lead to bad results on the GPU. Fix to check for nan. Minimal speed difference.
--Code changes
-Make the following variations safer by using Zeps(): sinq, sinhq, secq, sechq, tanq, tanhq, cosq, coshq, cotq, cothq, cscq, cschq, estiq.
-Always pass -cl-no-signed-zeros -cl-denorms-are-zero to kernel compiles for both single and double.
-Flush all denormals to zero for all executable programs. This will likely lead to a speedup for badly behaving programs.
2017-06-04 20:37:29 -04:00
ember1 . m_FinalRasW = 1024 ;
ember1 . m_FinalRasH = 1024 ;
ember1 . m_Quality = 500 ;
2015-03-22 15:46:10 -04:00
Xform < T > xform1 ( 0.25f , rand . Frand01 < T > ( ) , rand . Frand11 < T > ( ) , 1 , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) ) ;
Xform < T > xform2 ( 0.25f , rand . Frand01 < T > ( ) , rand . Frand11 < T > ( ) , 1 , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) ) ;
Xform < T > xform3 ( 0.25f , rand . Frand01 < T > ( ) , rand . Frand11 < T > ( ) , 1 , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) ) ;
2017-07-05 02:08:06 -04:00
Xform < T > xform4 ( 0.25f , rand . Frand01 < T > ( ) , rand . Frand11 < T > ( ) , 1 , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) ) ;
Xform < T > xform5 ( 0.25f , rand . Frand01 < T > ( ) , rand . Frand11 < T > ( ) , 1 , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) ) ;
Xform < T > xform6 ( 0.25f , rand . Frand01 < T > ( ) , rand . Frand11 < T > ( ) , 1 , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) ) ;
Xform < T > xform7 ( 0.25f , rand . Frand01 < T > ( ) , rand . Frand11 < T > ( ) , 1 , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) ) ;
if ( preVar . get ( ) & & postVar . get ( ) )
{
xform1 . AddVariation ( preVar - > Copy ( ) ) ;
xform2 . AddVariation ( regVar - > Copy ( ) ) ;
xform3 . AddVariation ( postVar - > Copy ( ) ) ;
xform4 . AddVariation ( preVar - > Copy ( ) ) ;
xform4 . AddVariation ( regVar - > Copy ( ) ) ;
xform5 . AddVariation ( preVar - > Copy ( ) ) ;
xform5 . AddVariation ( postVar - > Copy ( ) ) ;
xform6 . AddVariation ( regVar - > Copy ( ) ) ;
xform6 . AddVariation ( postVar - > Copy ( ) ) ;
xform7 . AddVariation ( preVar - > Copy ( ) ) ;
xform7 . AddVariation ( regVar - > Copy ( ) ) ;
xform7 . AddVariation ( postVar - > Copy ( ) ) ;
ember1 . AddXform ( xform1 ) ;
ember1 . AddXform ( xform2 ) ;
ember1 . AddXform ( xform3 ) ;
ember1 . AddXform ( xform4 ) ;
ember1 . AddXform ( xform5 ) ;
ember1 . AddXform ( xform6 ) ;
ember1 . AddXform ( xform7 ) ;
}
else
2014-07-08 03:11:14 -04:00
{
xform1 . AddVariation ( regVar - > Copy ( ) ) ;
xform2 . AddVariation ( regVar - > Copy ( ) ) ;
xform3 . AddVariation ( regVar - > Copy ( ) ) ;
2017-07-05 02:08:06 -04:00
xform4 . AddVariation ( regVar - > Copy ( ) ) ;
2014-07-08 03:11:14 -04:00
ember1 . AddXform ( xform1 ) ;
ember1 . AddXform ( xform2 ) ;
ember1 . AddXform ( xform3 ) ;
2017-07-05 02:08:06 -04:00
ember1 . AddXform ( xform4 ) ;
2014-07-08 03:11:14 -04:00
}
2017-07-05 02:08:06 -04:00
2014-07-08 03:11:14 -04:00
ss < < index < < " _ " < < regVar - > Name ( ) ;
ember1 . m_Name = ss . str ( ) ;
ss . str ( " " ) ;
2017-02-26 12:34:43 -05:00
ember1 . m_Palette = * paletteList - > GetRandomPalette ( ) ;
2014-07-08 03:11:14 -04:00
index + + ;
embers . push_back ( ember1 ) ;
}
t . Toc ( " Creating embers for all possible variations " ) ;
2015-03-22 15:46:10 -04:00
}
2014-07-08 03:11:14 -04:00
2015-03-22 15:46:10 -04:00
void MakeTestAllVarsRegPrePostComboFile ( const string & filename )
{
EmberToXml < float > writer ;
vector < Ember < float > > embers ;
MakeTestAllVarsRegPrePost ( embers ) ;
--User changes
-Support 4k monitors, and in general, properly scale any monitor that is not HD.
-Allow for a spatial filter of radius zero, which means do not use a spatial filter.
-Add new variations: concentric, cpow3, helicoid, helix, rand_cubes, sphereblur.
-Use a new method for computing elliptic which is more precise. Developed by Discord user Claude.
-Remove the 8 variation per xform limitation on the GPU.
-Allow for loading the last flame file on startup, rather than randoms.
-Use two different default quality values in the interactive renderer, one each for CPU and GPU.
-Creating linked xforms was using non-standard behavior. Make it match Apo and also support creating multiple linked xforms at once.
--Bug fixes
-No variations in an xform used to have the same behavior as a single linear variation with weight 1. While sensible, this breaks backward compatibility. No variations now sets the output point to zeroes.
-Prevent crashing the program when adjusting a value on the main window while a final render is in progress.
-The xaos table was inverted.
--Code changes
-Convert projects to Visual Studio 2017.
-Change bad vals from +- 1e10 to +-1e20.
-Reintroduce the symmetry tag in xforms for legacy support in programs that do not use color_speed.
-Compiler will not let us use default values in templated member functions anymore.
2017-11-26 20:27:00 -05:00
writer . Save ( filename , embers , 0 , true , true , false , false , false ) ;
2014-07-08 03:11:14 -04:00
}
void TestAtomicAdd ( )
{
size_t i ;
ostringstream os ;
OpenCLWrapper wrapper ;
vector < float > vec ( 32 ) ;
os < < ConstantDefinesString ( false ) < < UnionCLStructString < < endl ;
os < <
2015-12-31 16:41:59 -05:00
" void AtomicAdd(volatile __global float* source, const float operand) \n "
" { \n "
" union \n "
" { \n "
" uint intVal; \n "
" float floatVal; \n "
" } newVal; \n "
" \n "
" union \n "
" { \n "
" uint intVal; \n "
" float floatVal; \n "
" } prevVal; \n "
" \n "
" do \n "
" { \n "
" prevVal.floatVal = *source; \n "
" newVal.floatVal = prevVal.floatVal + operand; \n "
" } while (atomic_cmpxchg((volatile __global uint*)source, prevVal.intVal, newVal.intVal) != prevVal.intVal); \n "
" } \n "
" \n "
" __kernel void MyKernel( \n "
" __global float* buff, \n "
" uint lockit \n "
" \t ) \n "
" { \n "
" uint index = THREAD_ID_X; \n "
" \n "
" if (lockit) \n "
" { \n "
" AtomicAdd(&(buff[index]), (float)index * 0.54321); \n "
" } \n "
" else \n "
" { \n "
" buff[index] += (float)index * 0.54321; \n "
" } \n "
" } \n " ;
2014-07-08 03:11:14 -04:00
string program = os . str ( ) ;
string entry = " MyKernel " ;
if ( wrapper . Init ( 0 , 0 ) )
{
for ( i = 0 ; i < vec . size ( ) ; i + + )
vec [ i ] = ( i * 10.2234f ) ;
2014-12-06 00:05:09 -05:00
if ( wrapper . AddAndWriteBuffer ( " buff " , ( void * ) vec . data ( ) , ( uint ) vec . size ( ) * sizeof ( vec [ 0 ] ) ) )
2014-07-08 03:11:14 -04:00
{
if ( wrapper . AddProgram ( entry , program , entry , false ) )
{
wrapper . SetBufferArg ( 0 , 0 , 0 ) ;
2014-12-06 00:05:09 -05:00
wrapper . SetArg < uint > ( 0 , 1 , 0 ) ;
2014-07-08 03:11:14 -04:00
if ( wrapper . RunKernel ( 0 ,
2015-12-31 16:41:59 -05:00
32 , //Total grid dims.
1 ,
1 ,
1 , //Individual block dims.
1 ,
1 ) )
2014-07-08 03:11:14 -04:00
{
2014-12-06 00:05:09 -05:00
wrapper . ReadBuffer ( 0 , vec . data ( ) , ( uint ) vec . size ( ) * sizeof ( vec [ 0 ] ) ) ;
2014-07-08 03:11:14 -04:00
cout < < " Vector after unlocked add: " < < endl ;
for ( i = 0 ; i < vec . size ( ) ; i + + )
{
cout < < " vec[ " < < i < < " ] = " < < vec [ i ] < < endl ;
}
for ( i = 0 ; i < vec . size ( ) ; i + + )
vec [ i ] = ( i * 10.2234f ) ;
2014-12-06 00:05:09 -05:00
wrapper . AddAndWriteBuffer ( " buff " , ( void * ) vec . data ( ) , ( uint ) vec . size ( ) * sizeof ( vec [ 0 ] ) ) ;
2014-07-08 03:11:14 -04:00
wrapper . SetBufferArg ( 0 , 0 , 0 ) ;
2014-12-06 00:05:09 -05:00
wrapper . SetArg < uint > ( 0 , 1 , 1 ) ;
2014-07-08 03:11:14 -04:00
if ( wrapper . RunKernel ( 0 ,
2015-12-31 16:41:59 -05:00
32 , //Total grid dims.
1 ,
1 ,
1 , //Individual block dims.
1 ,
1 ) )
2014-07-08 03:11:14 -04:00
{
2014-12-06 00:05:09 -05:00
wrapper . ReadBuffer ( 0 , vec . data ( ) , ( uint ) vec . size ( ) * sizeof ( vec [ 0 ] ) ) ;
2014-07-08 03:11:14 -04:00
cout < < " \n \n Vector after locked add: " < < endl ;
for ( i = 0 ; i < vec . size ( ) ; i + + )
{
cout < < " vec[ " < < i < < " ] = " < < vec [ i ] < < endl ;
}
}
}
}
}
}
}
bool TestVarCounts ( )
{
2016-04-13 23:59:57 -04:00
auto vlf ( VariationList < float > : : Instance ( ) ) ;
2014-07-08 03:11:14 -04:00
# ifdef DO_DOUBLE
2016-04-13 23:59:57 -04:00
auto vld ( VariationList < double > : : Instance ( ) ) ;
bool success ( ( vlf - > Size ( ) = = vld - > Size ( ) ) & & ( vlf - > Size ( ) = = size_t ( eVariationId : : LAST_VAR ) ) ) ;
2014-07-08 03:11:14 -04:00
# else
bool success = true ;
# endif
2016-01-04 19:50:15 -05:00
uint start = et ( eVariationId : : VAR_ARCH ) ;
2014-07-08 03:11:14 -04:00
if ( ! success )
{
2016-04-13 23:59:57 -04:00
cout < < " Variation list size " < < vlf - > Size ( ) < < " does not equal the max var ID enum " < < et ( eVariationId : : LAST_VAR ) < < " . " < < endl ;
2014-07-08 03:11:14 -04:00
}
2016-01-04 19:50:15 -05:00
for ( ; start < et ( eVariationId : : LAST_VAR ) ; start + + )
2014-07-08 03:11:14 -04:00
{
2016-04-13 23:59:57 -04:00
auto var = vlf - > GetVariation ( ( eVariationId ) start ) ;
2014-07-08 03:11:14 -04:00
if ( ! var )
{
cout < < " Variation " < < start < < " was not found. " < < endl ;
success = false ;
}
}
return success ;
}
template < typename T >
bool TestVarUnique ( )
{
bool success = true ;
2016-04-13 23:59:57 -04:00
auto vl = VariationList < T > : : Instance ( ) ;
2014-07-08 03:11:14 -04:00
vector < eVariationId > ids ;
vector < string > names ;
2016-04-13 23:59:57 -04:00
ids . reserve ( vl - > Size ( ) ) ;
names . reserve ( vl - > Size ( ) ) ;
2014-07-08 03:11:14 -04:00
2016-04-13 23:59:57 -04:00
for ( size_t i = 0 ; i < vl - > Size ( ) ; i + + )
2014-07-08 03:11:14 -04:00
{
2016-04-13 23:59:57 -04:00
auto var = vl - > GetVariation ( i ) ;
2014-07-08 03:11:14 -04:00
if ( std : : find ( ids . begin ( ) , ids . end ( ) , var - > VariationId ( ) ) ! = ids . end ( ) )
{
cout < < " Variation " < < var - > Name ( ) < < " was a duplicate ID entry. " < < endl ;
success = false ;
}
else
{
ids . push_back ( var - > VariationId ( ) ) ;
}
if ( std : : find ( names . begin ( ) , names . end ( ) , var - > Name ( ) ) ! = names . end ( ) )
{
cout < < " Variation " < < var - > Name ( ) < < " was a duplicate name entry. " < < endl ;
success = false ;
}
else
{
names . push_back ( var - > Name ( ) ) ;
}
}
return success ;
}
template < typename sT , typename dT >
2015-06-29 23:13:53 -04:00
bool TestVarPrecalcEqual ( const Variation < sT > * var1 , const Variation < dT > * var2 )
2014-07-08 03:11:14 -04:00
{
bool success = true ;
if ( var1 & & var2 )
{
if ( var1 - > NeedPrecalcSumSquares ( ) ! = var2 - > NeedPrecalcSumSquares ( ) )
{
cout < < " NeedPrecalcSumSquares value of " < < var1 - > NeedPrecalcSumSquares ( ) < < " for variation " < < var1 - > Name ( ) < < " != NeedPrecalcSumSquares value of " < < var2 - > NeedPrecalcSumSquares ( ) < < " for variation " < < var2 - > Name ( ) < < endl ;
success = false ;
}
if ( var1 - > NeedPrecalcSqrtSumSquares ( ) ! = var2 - > NeedPrecalcSqrtSumSquares ( ) )
{
cout < < " NeedPrecalcSqrtSumSquares value of " < < var1 - > NeedPrecalcSqrtSumSquares ( ) < < " for variation " < < var1 - > Name ( ) < < " != NeedPrecalcSqrtSumSquares value of " < < var2 - > NeedPrecalcSqrtSumSquares ( ) < < " for variation " < < var2 - > Name ( ) < < endl ;
success = false ;
}
if ( var1 - > NeedPrecalcAngles ( ) ! = var2 - > NeedPrecalcAngles ( ) )
{
cout < < " NeedPrecalcAngles value of " < < var1 - > NeedPrecalcAngles ( ) < < " for variation " < < var1 - > Name ( ) < < " != NeedPrecalcAngles value of " < < var2 - > NeedPrecalcAngles ( ) < < " for variation " < < var2 - > Name ( ) < < endl ;
success = false ;
}
2015-12-31 16:41:59 -05:00
2014-07-08 03:11:14 -04:00
if ( var1 - > NeedPrecalcAtanXY ( ) ! = var2 - > NeedPrecalcAtanXY ( ) )
{
cout < < " NeedPrecalcAtanXY value of " < < var1 - > NeedPrecalcAtanXY ( ) < < " for variation " < < var1 - > Name ( ) < < " != NeedPrecalcAtanXY value of " < < var2 - > NeedPrecalcAtanXY ( ) < < " for variation " < < var2 - > Name ( ) < < endl ;
success = false ;
}
if ( var1 - > NeedPrecalcAtanYX ( ) ! = var2 - > NeedPrecalcAtanYX ( ) )
{
cout < < " NeedPrecalcAtanYX value of " < < var1 - > NeedPrecalcAtanYX ( ) < < " for variation " < < var1 - > Name ( ) < < " != NeedPrecalcAtanYX value of " < < var2 - > NeedPrecalcAtanYX ( ) < < " for variation " < < var2 - > Name ( ) < < endl ;
success = false ;
}
}
return success ;
}
template < typename sT , typename dT >
--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.
2015-11-22 17:15:07 -05:00
bool TestVarEqual ( const Variation < sT > * var1 , const Variation < dT > * var2 )
2014-07-08 03:11:14 -04:00
{
bool success = true ;
if ( ! var1 | | ! var2 )
{
cout < < " Variations were null. " < < endl ;
return false ;
}
if ( var1 - > VariationId ( ) ! = var2 - > VariationId ( ) )
{
2016-01-04 19:50:15 -05:00
cout < < " Variation IDs were not equal: " < < et ( var1 - > VariationId ( ) ) < < " != " < < et ( var2 - > VariationId ( ) ) < < endl ;
2014-07-08 03:11:14 -04:00
success = false ;
}
if ( var1 - > VarType ( ) ! = var2 - > VarType ( ) )
{
2016-01-04 19:50:15 -05:00
cout < < " Variation types were not equal: " < < et ( var1 - > VarType ( ) ) < < " != " < < et ( var2 - > VarType ( ) ) < < endl ;
2014-07-08 03:11:14 -04:00
success = false ;
}
if ( var1 - > Name ( ) ! = var2 - > Name ( ) )
{
cout < < " Variation names were not equal: " < < var1 - > Name ( ) < < " != " < < var2 - > Name ( ) < < endl ;
success = false ;
}
if ( var1 - > Prefix ( ) ! = var2 - > Prefix ( ) )
{
cout < < " Variation prefixes were not equal: " < < var1 - > Prefix ( ) < < " != " < < var2 - > Prefix ( ) < < endl ;
success = false ;
}
if ( ! TestVarPrecalcEqual < sT , dT > ( var1 , var2 ) )
{
cout < < " Variation precalcs were not equal: " < < var1 - > Name ( ) < < " and " < < var2 - > Name ( ) < < " . " < < endl ;
success = false ;
}
--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.
2015-11-22 17:15:07 -05:00
auto parVar1 = dynamic_cast < const ParametricVariation < sT > * > ( var1 ) ;
auto parVar2 = dynamic_cast < const ParametricVariation < dT > * > ( var2 ) ;
2014-07-08 03:11:14 -04:00
if ( parVar1 & & parVar2 )
{
if ( parVar1 - > ParamCount ( ) ! = parVar2 - > ParamCount ( ) )
{
cout < < " Variation ParamCount were not equal: " < < parVar1 - > ParamCount ( ) < < " != " < < parVar2 - > ParamCount ( ) < < endl ;
success = false ;
}
vector < ParamWithName < sT > > params1 = parVar1 - > ParamsVec ( ) ;
vector < ParamWithName < dT > > params2 = parVar2 - > ParamsVec ( ) ;
for ( size_t i = 0 ; i < params1 . size ( ) ; i + + )
{
if ( params1 [ i ] . Name ( ) ! = params2 [ i ] . Name ( ) )
{
cout < < " Param Names were not equal: " < < params1 [ i ] . Name ( ) < < " != " < < params2 [ i ] . Name ( ) < < endl ;
success = false ;
}
if ( params1 [ i ] . Type ( ) ! = params2 [ i ] . Type ( ) )
{
cout < < " Param " < < params1 [ i ] . Name ( ) < < " Types were not equal: " < < params1 [ i ] . Type ( ) < < " != " < < params2 [ i ] . Type ( ) < < endl ;
success = false ;
}
if ( params1 [ i ] . IsPrecalc ( ) ! = params2 [ i ] . IsPrecalc ( ) )
{
cout < < " Param " < < params1 [ i ] . Name ( ) < < " IsPrecalc were not equal: " < < params1 [ i ] . IsPrecalc ( ) < < " != " < < params2 [ i ] . IsPrecalc ( ) < < endl ;
success = false ;
}
if ( ! IsClose < sT > ( params1 [ i ] . Def ( ) , ( sT ) params2 [ i ] . Def ( ) ) )
{
cout < < " Param " < < params1 [ i ] . Name ( ) < < " Def were not equal: " < < params1 [ i ] . Def ( ) < < " != " < < params2 [ i ] . Def ( ) < < endl ;
success = false ;
}
if ( typeid ( sT ) = = typeid ( dT ) ) //Min and max can be different for float and double.
{
if ( ! IsClose < sT > ( params1 [ i ] . Min ( ) , ( sT ) params2 [ i ] . Min ( ) ) )
{
cout < < " Param " < < params1 [ i ] . Name ( ) < < " Min were not equal: " < < params1 [ i ] . Min ( ) < < " != " < < params2 [ i ] . Min ( ) < < endl ;
success = false ;
}
if ( ! IsClose < sT > ( params1 [ i ] . Max ( ) , ( sT ) params2 [ i ] . Max ( ) ) )
{
cout < < " Param " < < params1 [ i ] . Name ( ) < < " Max were not equal: " < < params1 [ i ] . Max ( ) < < " != " < < params2 [ i ] . Max ( ) < < endl ;
success = false ;
}
}
--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.
2015-11-22 17:15:07 -05:00
if ( ! params1 [ i ] . IsState ( ) & & ! params2 [ i ] . IsState ( ) ) //Don't compare state params, they can be different if set to random vals.
2014-07-08 03:11:14 -04:00
{
--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.
2015-11-22 17:15:07 -05:00
if ( ! IsClose < sT > ( params1 [ i ] . ParamVal ( ) , ( sT ) params2 [ i ] . ParamVal ( ) , sT ( 1e-4 ) ) )
{
--User changes
-Allow for pausing the renderer in the main window. This makes is more efficient when entering many parameters, such as when following a tutorial.
-Add support for new variations: erf, gamma, jac_cn, jac_dn, jac_sn, logDB, pressure_wave, pRose3D, splits3D, w, waves2b, x, xerf, y, z.
-Inform user of the start and stop of file parsing in EmberAnimate because the files could potentially be very large.
-Move the follwing fields to a new table called Animation: Interpolation, Affine Interpolation, Temporal Samples, Temporal Filter Width, Temporal Filter Type.
-These currently have no effect on the interactive renderer and instead are used when running flames through EmberGenome to generate sequences, and then animating them in Fractorium or EmberAnimate.
-Add new parameter overrides for EmberRender and EmberAnimate which directly assign values to all flames being rendered, rather than scale:
--quality
--demin
--demax
--Bug fixes
-Left pad instead of right pad names of sequence outputs from EmberGenome.
-Unique file naming was broken for files which already had an underscore in them.
-Properly report that png is the default format of EmberRender and EmberAnimate output instead of erroneously claiming it was jpg.
-Make command line programs search these folders in this order for the palette file:
./
~/.fractorium
~/.config/fractorium
/usr/share/fractorium
/usr/local/share/fractorium
-Fix possible bad values in hexes.
-Better assignment of Z variables.
-Fix boarders due to use of poorly implemented rint() function from flam3. Use std::rint() now.
-wedge_sph was completely wrong due to having accidentally swapped the mapping of two parameters.
-Make juliascope juliascope_power parameter be of type REAL_NONZERO since it's used as a denominator.
-Make Z assignment compatible with the originals in:
-arch, bcircle, bCollide, bent, bent2, bisplit, blob, blur_linear, blur_square, bMod, boarders, boarders2, bSwirl, bTransform, butterfly, cardioid, cell, circleblur, circlize, circlize2, circus, collideoscope, cos, cosine, cosh, coth, cpow, cpow2, crescents, cropn, csc, csch, curl, curve, dc_gridout, deltaa, diamond, disc2, eclipse, eCollide, edisc, eJulia, elliptic, eMod, eMotion, ennepers, epispiral, ePush, eRotate, eScale, eSwirl, ex, exp, expo, exponential, fan, fdisc, fibonacci, fibonacci2, fisheye, flipcircle, flipy, flower, flux, funnel, glynnia, GlynnSim1, GlynnSim2, GlynnSim3, gridout, handkerchief, heart, hole, idisc, julia, julian2, juliaNab, kaleidoscope, lazyTravis, Lissajous, mask, MobiusN, mobius_strip, modulus, murl, murl2, npolar, ortho, oscilloscope, parabola, perspective, petal, phoenix_julia, pie (was also inconsistent between cpu and gpu), poincare, popcorn, popcorn2, power, pow_block, rational3, rays, rblur, rings, rippled, roundspher, sec, secant2, sigmoid, sin, sineblur, sinh, sinusgrid, sphericaln, spiralwing, spirograph, split, squarize, squirrel, squish, sschecks, starblur, stripes, stwin, super_shape, tan, tancos, tangent, tanh, TwinTrian, twoface, unpolar, waves, wavesn, wedge_julia, whorl, xheart, zblur, zscale.
--Code changes
-Generalize Variation::PrecalcHelper() and rename to PrePostPrecalcHelper().
--Do the same for the OpenCL version and rename it PrePostPrecalcOpenCLString().
-Rename Variation::m_AssignType to m_PrePostAssignType since it's only relevant to pre/post variations.
2016-01-29 20:02:15 -05:00
cout < < " Param " < < params1 [ i ] . Name ( ) < < " Vals were not equal: " < < params1 [ i ] . ParamVal ( ) < < " != " < < params2 [ i ] . ParamVal ( ) < < endl ;
--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.
2015-11-22 17:15:07 -05:00
success = false ;
}
2014-07-08 03:11:14 -04:00
}
}
}
return success ;
}
bool TestVarPrePostNames ( )
{
bool success = true ;
2016-04-13 23:59:57 -04:00
auto vlf ( VariationList < float > : : Instance ( ) ) ;
2014-07-08 03:11:14 -04:00
2016-04-13 23:59:57 -04:00
for ( size_t i = 0 ; i < vlf - > Size ( ) ; i + + )
2014-07-08 03:11:14 -04:00
{
2016-04-13 23:59:57 -04:00
auto var = vlf - > GetVariation ( i ) ;
2014-07-08 03:11:14 -04:00
string name = var - > Name ( ) ;
2016-01-04 19:50:15 -05:00
if ( var - > VarType ( ) = = eVariationType : : VARTYPE_REG )
2014-07-08 03:11:14 -04:00
{
if ( name . find ( " pre_ " ) = = 0 )
{
cout < < " Regular variation " < < name < < " must not start with pre_. " < < endl ;
success = false ;
}
if ( name . find ( " post_ " ) = = 0 )
{
cout < < " Regular variation " < < name < < " must not start with post_. " < < endl ;
success = false ;
}
}
2016-01-04 19:50:15 -05:00
else if ( var - > VarType ( ) = = eVariationType : : VARTYPE_PRE )
2014-07-08 03:11:14 -04:00
{
if ( name . find ( " pre_ " ) ! = 0 )
{
cout < < " Pre variation " < < name < < " must start with pre_. " < < endl ;
success = false ;
}
}
2016-01-04 19:50:15 -05:00
else if ( var - > VarType ( ) = = eVariationType : : VARTYPE_POST )
2014-07-08 03:11:14 -04:00
{
if ( name . find ( " post_ " ) ! = 0 )
{
cout < < " Post variation " < < name < < " must start with post_. " < < endl ;
success = false ;
}
}
else
{
cout < < " Invalid variation type. " < < endl ;
success = false ;
break ;
}
2015-06-28 20:48:26 -04:00
if ( auto parVar = dynamic_cast < ParametricVariation < float > * > ( const_cast < Variation < float > * > ( var ) ) )
2014-07-08 03:11:14 -04:00
{
vector < ParamWithName < float > > params = parVar - > ParamsVec ( ) ;
for ( size_t p = 0 ; p < params . size ( ) ; p + + )
{
if ( params [ p ] . Name ( ) . find ( name . c_str ( ) ) ! = 0 )
{
cout < < " Param " < < params [ p ] . Name ( ) < < " must start with " < < name < < endl ;
success = false ;
}
}
}
}
return success ;
}
template < typename sT , typename dT >
bool TestVarCopy ( )
{
bool success = true ;
2016-04-13 23:59:57 -04:00
auto vlf ( VariationList < sT > : : Instance ( ) ) ;
2014-07-08 03:11:14 -04:00
2016-04-13 23:59:57 -04:00
for ( size_t i = 0 ; i < vlf - > Size ( ) ; i + + )
2014-07-08 03:11:14 -04:00
{
2016-04-13 23:59:57 -04:00
auto var = vlf - > GetVariation ( i ) ;
2014-07-08 03:11:14 -04:00
Variation < dT > * destVar = NULL ;
2014-10-18 17:07:07 -04:00
unique_ptr < Variation < sT > > copyVar ( var - > Copy ( ) ) ; //Test Copy().
2015-12-31 16:41:59 -05:00
2014-07-08 03:11:14 -04:00
if ( ! TestVarEqual < sT , sT > ( var , copyVar . get ( ) ) )
{
cout < < " Variations " < < var - > Name ( ) < < " < " < < typeid ( sT ) . name ( ) < < " > and " < < copyVar - > Name ( ) < < " < " < < typeid ( sT ) . name ( ) < < " > (same template type) were not equal after Copy(). " < < endl ;
success = false ;
}
var - > Copy ( destVar ) ; //Test Copy(var*);
2014-10-18 17:07:07 -04:00
unique_ptr < Variation < dT > > destPtr ( destVar ) ; //Just for deletion.
2014-07-08 03:11:14 -04:00
if ( ! TestVarEqual < sT , dT > ( var , destPtr . get ( ) ) )
{
cout < < " Variations " < < var - > Name ( ) < < " < " < < typeid ( sT ) . name ( ) < < " > and " < < destPtr - > Name ( ) < < " < " < < typeid ( dT ) . name ( ) < < " > (different template types) were not equal after Copy(Variation<T>*). " < < endl ;
success = false ;
}
}
return success ;
}
bool TestParVars ( )
{
bool success = true ;
2016-04-13 23:59:57 -04:00
auto vlf ( VariationList < float > : : Instance ( ) ) ;
2014-07-08 03:11:14 -04:00
2016-04-13 23:59:57 -04:00
for ( size_t i = 0 ; i < vlf - > ParametricSize ( ) ; i + + )
2014-07-08 03:11:14 -04:00
{
2016-04-13 23:59:57 -04:00
if ( auto parVar = vlf - > GetParametricVariation ( i ) )
2014-07-08 03:11:14 -04:00
{
if ( parVar - > ParamCount ( ) < 1 )
{
cout < < " Parametric variation " < < parVar - > Name ( ) < < " does not have any parameters. " < < endl ;
success = false ;
}
vector < string > names ;
vector < float * > addresses ;
2015-06-28 20:48:26 -04:00
auto params = parVar - > Params ( ) ;
2014-07-08 03:11:14 -04:00
names . reserve ( parVar - > ParamCount ( ) ) ;
addresses . reserve ( parVar - > ParamCount ( ) ) ;
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
for ( size_t j = 0 ; j < parVar - > ParamCount ( ) ; j + + )
2014-07-08 03:11:14 -04:00
{
if ( std : : find ( names . begin ( ) , names . end ( ) , params [ j ] . Name ( ) ) ! = names . end ( ) )
{
cout < < " Param " < < params [ j ] . Name ( ) < < " for variation " < < parVar - > Name ( ) < < " was a duplicate name entry. " < < endl ;
success = false ;
}
else
{
names . push_back ( params [ j ] . Name ( ) ) ;
}
if ( std : : find ( addresses . begin ( ) , addresses . end ( ) , params [ j ] . Param ( ) ) ! = addresses . end ( ) )
{
cout < < " Param address " < < params [ j ] . Param ( ) < < " for variation " < < parVar - > Name ( ) < < " was a duplicate name entry. " < < endl ;
success = false ;
}
else
{
addresses . push_back ( params [ j ] . Param ( ) ) ;
}
}
}
else
{
cout < < " Parametric variation at index " < < i < < " was NULL. " < < endl ;
success = false ;
}
}
return success ;
}
bool TestVarRegPrePost ( )
{
bool success = true ;
2016-04-13 23:59:57 -04:00
auto vlf ( VariationList < float > : : Instance ( ) ) ;
2014-07-08 03:11:14 -04:00
2016-04-13 23:59:57 -04:00
for ( size_t i = 0 ; i < vlf - > RegSize ( ) ; i + + )
2014-07-08 03:11:14 -04:00
{
2016-04-13 23:59:57 -04:00
auto regVar = vlf - > GetVariation ( i , eVariationType : : VARTYPE_REG ) ;
2015-12-31 16:41:59 -05:00
2014-07-08 03:11:14 -04:00
if ( regVar )
{
if ( regVar - > Name ( ) . find ( " dc_ " ) ! = 0 )
{
string name = regVar - > Name ( ) ;
2016-04-13 23:59:57 -04:00
auto preVar = vlf - > GetVariation ( " pre_ " + name ) ;
auto postVar = vlf - > GetVariation ( " post_ " + name ) ;
2014-07-08 03:11:14 -04:00
if ( ! preVar )
{
cout < < " Pre variation equivalent of " < < name < < " could not be found. " < < endl ;
success = false ;
}
if ( ! postVar )
{
cout < < " Post variation equivalent of " < < name < < " could not be found. " < < endl ;
success = false ;
}
2015-12-31 16:41:59 -05:00
2014-07-08 03:11:14 -04:00
if ( ! TestVarPrecalcEqual < float , float > ( regVar , preVar ) )
{
cout < < " Regular and pre variation precalc test failed for " < < regVar - > Name ( ) < < " and " < < preVar - > Name ( ) < < " . " < < endl ;
success = false ;
}
if ( ! TestVarPrecalcEqual < float , float > ( regVar , postVar ) )
{
cout < < " Regular and post variation precalc test failed for " < < regVar - > Name ( ) < < " and " < < postVar - > Name ( ) < < " . " < < endl ;
success = false ;
}
}
}
else
{
cout < < " Regular variation " < < i < < " was NULL. " < < endl ;
success = false ;
}
}
return success ;
}
bool TestVarPrecalcUsedCL ( )
{
bool success = true ;
2016-04-13 23:59:57 -04:00
auto vlf ( VariationList < float > : : Instance ( ) ) ;
2014-07-08 03:11:14 -04:00
2016-04-13 23:59:57 -04:00
for ( size_t i = 0 ; i < vlf - > Size ( ) ; i + + )
2014-07-08 03:11:14 -04:00
{
2016-04-13 23:59:57 -04:00
auto var = vlf - > GetVariation ( i ) ;
2014-07-08 03:11:14 -04:00
string s = var - > OpenCLString ( ) ;
if ( var - > NeedPrecalcAngles ( ) )
{
if ( s . find ( " precalcSina " ) = = string : : npos )
{
cout < < " Variation " < < var - > Name ( ) < < " needed precalcSina, but it wasn't found in the OpenCL string. " < < endl ;
success = false ;
}
if ( s . find ( " precalcCosa " ) = = string : : npos )
{
cout < < " Variation " < < var - > Name ( ) < < " needed precalcCosa, but it wasn't found in the OpenCL string. " < < endl ;
success = false ;
}
}
else
{
if ( s . find ( " precalcSina " ) ! = string : : npos )
{
cout < < " Variation " < < var - > Name ( ) < < " didn't need precalcSina, but it was found in the OpenCL string. " < < endl ;
success = false ;
}
if ( s . find ( " precalcCosa " ) ! = string : : npos )
{
cout < < " Variation " < < var - > Name ( ) < < " didn't need precalcCosa, but it was found in the OpenCL string. " < < endl ;
success = false ;
}
if ( var - > NeedPrecalcSqrtSumSquares ( ) )
{
if ( s . find ( " precalcSqrtSumSquares " ) = = string : : npos )
{
cout < < " Variation " < < var - > Name ( ) < < " needed precalcSqrtSumSquares, but it wasn't found in the OpenCL string. " < < endl ;
success = false ;
}
}
else
{
if ( s . find ( " precalcSqrtSumSquares " ) ! = string : : npos )
{
cout < < " Variation " < < var - > Name ( ) < < " didn't need precalcSqrtSumSquares, but it was found in the OpenCL string. " < < endl ;
success = false ;
}
if ( var - > NeedPrecalcSumSquares ( ) )
{
if ( s . find ( " precalcSumSquares " ) = = string : : npos )
{
cout < < " Variation " < < var - > Name ( ) < < " needed precalcSumSquares, but it wasn't found in the OpenCL string. " < < endl ;
success = false ;
}
}
else
{
if ( s . find ( " precalcSumSquares " ) ! = string : : npos )
{
cout < < " Variation " < < var - > Name ( ) < < " didn't need precalcSumSquares, but it was found in the OpenCL string. " < < endl ;
success = false ;
}
}
}
}
2015-12-31 16:41:59 -05:00
2014-07-08 03:11:14 -04:00
if ( var - > NeedPrecalcSumSquares ( ) )
{
if ( s . find ( " SQR(vIn.x) + SQR(vIn.y) " ) ! = string : : npos | | s . find ( " vIn.x * vIn.x + vIn.y * vIn.y " ) ! = string : : npos )
{
cout < < " Variation " < < var - > Name ( ) < < " needed precalcSumSquares, but is not using it properly. " < < endl ;
success = false ;
}
}
else
{
if ( s . find ( " precalcSumSquares " ) ! = string : : npos )
{
cout < < " Variation " < < var - > Name ( ) < < " didn't need precalcSumSquares, but it was found in the OpenCL string. " < < endl ;
success = false ;
}
if ( s . find ( " SQR(vIn.x) + SQR(vIn.y) " ) ! = string : : npos | | s . find ( " vIn.x * vIn.x + vIn.y * vIn.y " ) ! = string : : npos )
{
cout < < " Variation " < < var - > Name ( ) < < " did not specify precalcSumSquares, but could benefit from it. " < < endl ;
success = false ;
}
}
if ( var - > NeedPrecalcSqrtSumSquares ( ) )
{
if ( s . find ( " sqrt(SQR(vIn.x) + SQR(vIn.y)) " ) ! = string : : npos | | s . find ( " sqrt(vIn.x * vIn.x + vIn.y * vIn.y) " ) ! = string : : npos )
{
cout < < " Variation " < < var - > Name ( ) < < " needed precalcSqrtSumSquares, but is not using it properly. " < < endl ;
success = false ;
}
}
else
{
if ( s . find ( " precalcSqrtSumSquares " ) ! = string : : npos )
{
cout < < " Variation " < < var - > Name ( ) < < " didn't need precalcSqrtSumSquares, but it was found in the OpenCL string. " < < endl ;
success = false ;
}
if ( s . find ( " sqrt(SQR(vIn.x) + SQR(vIn.y)) " ) ! = string : : npos | | s . find ( " sqrt(vIn.x * vIn.x + vIn.y * vIn.y) " ) ! = string : : npos )
{
cout < < " Variation " < < var - > Name ( ) < < " did not specify precalcSqrtSumSquares, but could benefit from it. " < < endl ;
success = false ;
}
}
if ( var - > NeedPrecalcAtanXY ( ) )
{
if ( s . find ( " precalcAtanxy " ) = = string : : npos )
{
cout < < " Variation " < < var - > Name ( ) < < " needed precalcAtanxy, but it wasn't found in the OpenCL string. " < < endl ;
success = false ;
}
}
else
{
if ( s . find ( " precalcAtanxy " ) ! = string : : npos )
{
cout < < " Variation " < < var - > Name ( ) < < " didn't need precalcAtanxy, but it was found in the OpenCL string. " < < endl ;
success = false ;
}
if ( s . find ( " atan2(vIn.x, vIn.y) " ) ! = string : : npos )
{
cout < < " Variation " < < var - > Name ( ) < < " did not specify precalcAtanxy, but could benefit from it. " < < endl ;
success = false ;
}
}
2015-12-31 16:41:59 -05:00
2014-07-08 03:11:14 -04:00
if ( var - > NeedPrecalcAtanYX ( ) )
{
if ( s . find ( " precalcAtanyx " ) = = string : : npos )
{
cout < < " Variation " < < var - > Name ( ) < < " needed precalcAtanyx, but it wasn't found in the OpenCL string. " < < endl ;
success = false ;
}
}
else
{
if ( s . find ( " precalcAtanyx " ) ! = string : : npos )
{
cout < < " Variation " < < var - > Name ( ) < < " didn't need precalcAtanyx, but it was found in the OpenCL string. " < < endl ;
success = false ;
}
if ( s . find ( " atan2(vIn.y, vIn.x) " ) ! = string : : npos )
{
cout < < " Variation " < < var - > Name ( ) < < " did not specify precalcAtanyx, but could benefit from it. " < < endl ;
success = false ;
}
}
}
return success ;
}
bool TestVarAssignTypes ( )
{
bool success = true ;
2016-04-13 23:59:57 -04:00
auto vlf ( VariationList < float > : : Instance ( ) ) ;
2014-07-08 03:11:14 -04:00
vector < string > vset , vsum ;
vset . push_back ( " vIn.x " ) ;
vset . push_back ( " vIn.y " ) ;
vset . push_back ( " vIn.z " ) ;
vset . push_back ( " precalcSumSquares " ) ;
vset . push_back ( " precalcSqrtSumSquares " ) ;
vset . push_back ( " precalcSina " ) ;
vset . push_back ( " precalcCosa " ) ;
vset . push_back ( " precalcAtanxy " ) ;
vset . push_back ( " precalcAtanyx " ) ;
vsum . push_back ( " vIn.x " ) ;
vsum . push_back ( " vIn.y " ) ;
//vsum.push_back("vIn.z");
vsum . push_back ( " precalcSumSquares " ) ;
vsum . push_back ( " precalcSqrtSumSquares " ) ;
vsum . push_back ( " precalcSina " ) ;
vsum . push_back ( " precalcCosa " ) ;
vsum . push_back ( " precalcAtanxy " ) ;
vsum . push_back ( " precalcAtanyx " ) ;
2016-04-13 23:59:57 -04:00
for ( size_t i = 0 ; i < vlf - > Size ( ) ; i + + )
2014-07-08 03:11:14 -04:00
{
2016-04-13 23:59:57 -04:00
auto var = vlf - > GetVariation ( i ) ;
2014-07-08 03:11:14 -04:00
string s = var - > OpenCLString ( ) ;
//Only test pre and post. The assign type for regular is ignored, and will always be summed.
2016-01-04 19:50:15 -05:00
if ( var - > VarType ( ) ! = eVariationType : : VARTYPE_REG )
2014-07-08 03:11:14 -04:00
{
2016-01-04 19:50:15 -05:00
if ( var - > AssignType ( ) = = eVariationAssignType : : ASSIGNTYPE_SET )
2014-07-08 03:11:14 -04:00
{
if ( ! SearchVar ( var , vset , false ) )
{
cout < < " Variation " < < var - > Name ( ) < < " had an assign type of SET, but did not use its input points. It should have an assign type of SUM. " < < endl ;
success = false ;
}
}
2016-01-04 19:50:15 -05:00
else if ( var - > AssignType ( ) = = eVariationAssignType : : ASSIGNTYPE_SUM )
2014-07-08 03:11:14 -04:00
{
if ( SearchVar ( var , vsum , false ) )
{
cout < < " Variation " < < var - > Name ( ) < < " had an assign type of SUM, but used its input points. It should have an assign type of SET. " < < endl ;
success = false ;
}
}
else
{
2016-01-04 19:50:15 -05:00
cout < < " Variation " < < var - > Name ( ) < < " had an invalid assign type of " < < et ( var - > AssignType ( ) ) < < endl ;
2014-07-08 03:11:14 -04:00
}
}
}
return success ;
}
bool TestVarAssignVals ( )
{
bool success = true ;
2016-04-13 23:59:57 -04:00
auto vlf ( VariationList < float > : : Instance ( ) ) ;
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
vector < string > xout , yout , zout ;
2014-07-08 03:11:14 -04:00
xout . push_back ( " vOut.x = " ) ;
xout . push_back ( " vOut.x += " ) ;
xout . push_back ( " vOut.x -= " ) ;
xout . push_back ( " vOut.x *= " ) ;
xout . push_back ( " vOut.x /= " ) ;
yout . push_back ( " vOut.y = " ) ;
yout . push_back ( " vOut.y += " ) ;
yout . push_back ( " vOut.y -= " ) ;
yout . push_back ( " vOut.y *= " ) ;
yout . push_back ( " vOut.y /= " ) ;
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
zout . push_back ( " vOut.z = " ) ;
zout . push_back ( " vOut.z += " ) ;
zout . push_back ( " vOut.z -= " ) ;
zout . push_back ( " vOut.z *= " ) ;
zout . push_back ( " vOut.z /= " ) ;
2014-07-08 03:11:14 -04:00
2016-04-13 23:59:57 -04:00
for ( size_t i = 0 ; i < vlf - > Size ( ) ; i + + )
2014-07-08 03:11:14 -04:00
{
2016-04-13 23:59:57 -04:00
auto var = vlf - > GetVariation ( i ) ;
2014-07-08 03:11:14 -04:00
if ( ! SearchVar ( var , xout , false ) )
{
cout < < " Variation " < < var - > Name ( ) < < " did not set its x output point. If unused, at least pass through or set to 0. " < < endl ;
success = false ;
}
if ( ! SearchVar ( var , yout , false ) )
{
cout < < " Variation " < < var - > Name ( ) < < " did not set its y output point. If unused, at least pass through or set to 0. " < < endl ;
success = false ;
}
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
if ( ! SearchVar ( var , zout , false ) )
{
cout < < " Variation " < < var - > Name ( ) < < " did not set its z output point. If unused, at least pass through or set to 0. " < < endl ;
success = false ;
}
2014-07-08 03:11:14 -04:00
}
return success ;
}
2018-09-15 06:11:12 -04:00
void FindFmaCandidates ( )
{
auto vlf ( VariationList < float > : : Instance ( ) ) ;
for ( size_t i = 0 ; i < vlf - > Size ( ) ; i + + )
{
auto var = vlf - > GetVariation ( i ) ;
auto cl = var - > OpenCLFuncsString ( ) + " \n " + var - > StateInitOpenCLString ( ) + " \n " + var - > OpenCLString ( ) ;
auto splits = Split ( cl , ' \n ' ) ;
for ( auto & split : splits )
{
if ( ( split . find ( " * " ) ! = string : : npos | | split . find ( " SQR( " ) ! = string : : npos | | split . find ( " Sqr( " ) ! = string : : npos ) & & split . find ( " + " ) ! = string : : npos )
cout < < " Variation " < < var - > Name ( ) < < " is a potential fma() candidate because of line: \n \t " < < split < < endl ;
}
}
}
void FindFmaImplemented ( )
{
auto vlf ( VariationList < float > : : Instance ( ) ) ;
for ( size_t i = 0 ; i < vlf - > Size ( ) ; i + + )
{
auto var = vlf - > GetVariation ( i ) ;
auto cl = var - > OpenCLFuncsString ( ) + " \n " + var - > StateInitOpenCLString ( ) + " \n " + var - > OpenCLString ( ) ;
auto splits = Split ( cl , ' \n ' ) ;
for ( auto & split : splits )
{
if ( ( split . find ( " fma( " ) ! = string : : npos ) )
cout < < " Variation " < < var - > Name ( ) < < " has been implemented with fma(): \n \t " < < split < < endl ;
}
}
}
2014-08-03 19:16:10 -04:00
bool TestZepsFloor ( )
{
bool success = true ;
2016-04-13 23:59:57 -04:00
auto vlf ( VariationList < float > : : Instance ( ) ) ;
2014-08-03 19:16:10 -04:00
vector < string > zeps ;
zeps . push_back ( " Zeps(floor " ) ;
2016-04-13 23:59:57 -04:00
for ( size_t i = 0 ; i < vlf - > Size ( ) ; i + + )
2014-08-03 19:16:10 -04:00
{
2016-04-13 23:59:57 -04:00
auto var = vlf - > GetVariation ( i ) ;
2014-08-03 19:16:10 -04:00
if ( SearchVar ( var , zeps , false ) )
{
cout < < " Variation " < < var - > Name ( ) < < " contains Zeps(floor()). This is fine for the GPU, but ensure the CPU uses Zeps<T>((T)Floor<T>()). " < < endl ;
success = false ;
}
}
return success ;
}
2014-07-08 03:11:14 -04:00
bool TestConstants ( )
{
bool success = true ;
2016-04-13 23:59:57 -04:00
auto vlf ( VariationList < float > : : Instance ( ) ) ;
2014-07-08 03:11:14 -04:00
vector < string > stringVec ;
stringVec . push_back ( " 2 * M_PI " ) ;
stringVec . push_back ( " 2*M_PI " ) ;
stringVec . push_back ( " M_PI*2 " ) ;
stringVec . push_back ( " M_PI * 2 " ) ;
2016-04-13 23:59:57 -04:00
for ( size_t i = 0 ; i < vlf - > Size ( ) ; i + + )
2014-07-08 03:11:14 -04:00
{
2016-04-13 23:59:57 -04:00
auto var = vlf - > GetVariation ( i ) ;
2014-07-08 03:11:14 -04:00
if ( SearchVar ( var , stringVec , false ) )
{
cout < < " Variation " < < var - > Name ( ) < < " should be using M_2PI. " < < endl ;
success = false ;
}
}
return success ;
}
06/09/2017
--User changes
-dark.qss is now per-OS.
-Properly set/reload palette when coming from the palette editor. The latter must be done if they've modified the current palette even if they've clicked cancel.
--Bug fixes
-Make the following variations safer by using Zeps(): conic, bipolar, edisc, whorl, tan, csc, cot, tanh, sech, csch, coth, auger, bwraps, hypertile3d, hypertile3d1, ortho, poincare, rational3, barycentroid, sschecks, cscq, cschq, scry_3D, splitbrdr, hexcrop, nblur, crob.
-Fix bug enabling/disabling overwrite button in palette editor.
-Small optimization for gdoffs, use precalcAtanYX.
-Properly propagate z through circlesplit, cylinder2 and tile_log variations.
-Some values in truchet_fill could've been NaN.
--Code changes
-Make most installation files read only.
-Qualify many calls with std:: to ensure they're not colliding with glm::
-Use auto in more places.
2017-06-09 22:38:06 -04:00
void TestFuncs ( )
{
2017-07-01 12:18:01 -04:00
auto vlf ( VariationList < float > : : Instance ( ) ) ;
vector < string > stringVec ;
2017-07-05 02:08:06 -04:00
stringVec . push_back ( " M_E " ) ;
stringVec . push_back ( " M_LOG2E " ) ;
stringVec . push_back ( " M_LOG10E " ) ;
stringVec . push_back ( " M_LN2 " ) ;
stringVec . push_back ( " M_LN10 " ) ;
2017-07-01 12:18:01 -04:00
stringVec . push_back ( " M_PI " ) ;
2017-07-05 02:08:06 -04:00
stringVec . push_back ( " M_PI_2 " ) ;
stringVec . push_back ( " M_PI_4 " ) ;
stringVec . push_back ( " M_1_PI " ) ;
stringVec . push_back ( " M_2_PI " ) ;
stringVec . push_back ( " M_2_SQRTPI " ) ;
stringVec . push_back ( " M_SQRT2 " ) ;
stringVec . push_back ( " M_SQRT1_2 " ) ;
//stringVec.push_back("M_2PI");
//stringVec.push_back("M_3PI");
//stringVec.push_back("DEG_2_RAD");
2017-07-01 12:18:01 -04:00
for ( size_t i = 0 ; i < vlf - > Size ( ) ; i + + )
{
auto var = vlf - > GetVariation ( i ) ;
if ( SearchVar ( var , stringVec , false ) )
{
cout < < var - > Name ( ) < < endl ;
}
}
06/09/2017
--User changes
-dark.qss is now per-OS.
-Properly set/reload palette when coming from the palette editor. The latter must be done if they've modified the current palette even if they've clicked cancel.
--Bug fixes
-Make the following variations safer by using Zeps(): conic, bipolar, edisc, whorl, tan, csc, cot, tanh, sech, csch, coth, auger, bwraps, hypertile3d, hypertile3d1, ortho, poincare, rational3, barycentroid, sschecks, cscq, cschq, scry_3D, splitbrdr, hexcrop, nblur, crob.
-Fix bug enabling/disabling overwrite button in palette editor.
-Small optimization for gdoffs, use precalcAtanYX.
-Properly propagate z through circlesplit, cylinder2 and tile_log variations.
-Some values in truchet_fill could've been NaN.
--Code changes
-Make most installation files read only.
-Qualify many calls with std:: to ensure they're not colliding with glm::
-Use auto in more places.
2017-06-09 22:38:06 -04:00
}
--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.
2015-11-22 17:15:07 -05:00
bool TestGlobalFuncs ( )
{
bool success = true ;
2016-04-13 23:59:57 -04:00
auto vlf ( VariationList < float > : : Instance ( ) ) ;
--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.
2015-11-22 17:15:07 -05:00
vector < string > funcs ;
FunctionMapper mapper ;
06/09/2017
--User changes
-dark.qss is now per-OS.
-Properly set/reload palette when coming from the palette editor. The latter must be done if they've modified the current palette even if they've clicked cancel.
--Bug fixes
-Make the following variations safer by using Zeps(): conic, bipolar, edisc, whorl, tan, csc, cot, tanh, sech, csch, coth, auger, bwraps, hypertile3d, hypertile3d1, ortho, poincare, rational3, barycentroid, sschecks, cscq, cschq, scry_3D, splitbrdr, hexcrop, nblur, crob.
-Fix bug enabling/disabling overwrite button in palette editor.
-Small optimization for gdoffs, use precalcAtanYX.
-Properly propagate z through circlesplit, cylinder2 and tile_log variations.
-Some values in truchet_fill could've been NaN.
--Code changes
-Make most installation files read only.
-Qualify many calls with std:: to ensure they're not colliding with glm::
-Use auto in more places.
2017-06-09 22:38:06 -04:00
auto funcmap = mapper . GetGlobalMapCopy ( ) ;
--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.
2015-11-22 17:15:07 -05:00
2016-04-13 23:59:57 -04:00
for ( size_t i = 0 ; i < vlf - > Size ( ) ; i + + )
--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.
2015-11-22 17:15:07 -05:00
{
2016-04-13 23:59:57 -04:00
auto var = vlf - > GetVariation ( i ) ;
--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.
2015-11-22 17:15:07 -05:00
funcs = var - > OpenCLGlobalFuncNames ( ) ;
06/09/2017
--User changes
-dark.qss is now per-OS.
-Properly set/reload palette when coming from the palette editor. The latter must be done if they've modified the current palette even if they've clicked cancel.
--Bug fixes
-Make the following variations safer by using Zeps(): conic, bipolar, edisc, whorl, tan, csc, cot, tanh, sech, csch, coth, auger, bwraps, hypertile3d, hypertile3d1, ortho, poincare, rational3, barycentroid, sschecks, cscq, cschq, scry_3D, splitbrdr, hexcrop, nblur, crob.
-Fix bug enabling/disabling overwrite button in palette editor.
-Small optimization for gdoffs, use precalcAtanYX.
-Properly propagate z through circlesplit, cylinder2 and tile_log variations.
-Some values in truchet_fill could've been NaN.
--Code changes
-Make most installation files read only.
-Qualify many calls with std:: to ensure they're not colliding with glm::
-Use auto in more places.
2017-06-09 22:38:06 -04:00
for ( auto & func : funcs ) //Test if the functions the variation says it requires actually exist.
--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.
2015-11-22 17:15:07 -05:00
{
if ( ! mapper . GetGlobalFunc ( func ) )
{
cout < < " Variation " < < var - > Name ( ) < < " used unknown global funcion " < < func < < endl ;
success = false ;
}
else
{
//cout << "Variation " << var->Name() << " used valid global funcion " << func << endl;
}
}
06/09/2017
--User changes
-dark.qss is now per-OS.
-Properly set/reload palette when coming from the palette editor. The latter must be done if they've modified the current palette even if they've clicked cancel.
--Bug fixes
-Make the following variations safer by using Zeps(): conic, bipolar, edisc, whorl, tan, csc, cot, tanh, sech, csch, coth, auger, bwraps, hypertile3d, hypertile3d1, ortho, poincare, rational3, barycentroid, sschecks, cscq, cschq, scry_3D, splitbrdr, hexcrop, nblur, crob.
-Fix bug enabling/disabling overwrite button in palette editor.
-Small optimization for gdoffs, use precalcAtanYX.
-Properly propagate z through circlesplit, cylinder2 and tile_log variations.
-Some values in truchet_fill could've been NaN.
--Code changes
-Make most installation files read only.
-Qualify many calls with std:: to ensure they're not colliding with glm::
-Use auto in more places.
2017-06-09 22:38:06 -04:00
auto str = var - > OpenCLString ( ) ;
auto vec = var - > OpenCLGlobalFuncNames ( ) ;
for ( auto & func : funcmap ) //Test if the functions the variation uses are actually included in those it says are required.
{
if ( Find ( str , func . first + " ( " ) )
{
if ( ! Contains ( vec , func . first ) )
{
cout < < " Variation " < < var - > Name ( ) < < " used global funcion " < < func . first < < " , but it's not found in its global func name vector: " < < endl ;
for ( auto & v : vec )
cout < < v < < endl ;
}
}
}
--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.
2015-11-22 17:15:07 -05:00
}
return success ;
}
2014-07-08 03:11:14 -04:00
void PrintAllVars ( )
{
2014-12-06 00:05:09 -05:00
uint i = 0 ;
2016-04-13 23:59:57 -04:00
auto vlf ( VariationList < float > : : Instance ( ) ) ;
2014-07-08 03:11:14 -04:00
2016-04-13 23:59:57 -04:00
while ( auto var = vlf - > GetVariation ( i + + ) )
2014-07-08 03:11:14 -04:00
cout < < var - > Name ( ) < < endl ;
}
void TestXformsInOutPoints ( )
{
2014-12-06 00:05:09 -05:00
uint index = 0 ;
2017-02-26 12:34:43 -05:00
auto varList = VariationList < float > : : Instance ( ) ;
auto paletteList = PaletteList < float > : : Instance ( ) ;
2014-07-08 03:11:14 -04:00
QTIsaac < ISAAC_SIZE , ISAAC_INT > rand ;
2017-02-26 12:34:43 -05:00
paletteList - > Add ( " flam3-palettes.xml " ) ;
2014-07-08 03:11:14 -04:00
2016-04-13 23:59:57 -04:00
while ( index < varList - > RegSize ( ) )
2014-07-08 03:11:14 -04:00
{
vector < Xform < float > > xforms ;
2016-04-13 23:59:57 -04:00
unique_ptr < Variation < float > > regVar ( varList - > GetVariationCopy ( index , eVariationType : : VARTYPE_REG ) ) ;
2014-07-08 03:11:14 -04:00
string s = regVar - > OpenCLString ( ) + regVar - > OpenCLFuncsString ( ) ;
if ( s . find ( " MwcNext " ) = = string : : npos )
{
2016-04-13 23:59:57 -04:00
unique_ptr < Variation < float > > preVar ( varList - > GetVariationCopy ( " pre_ " + regVar - > Name ( ) ) ) ;
unique_ptr < Variation < float > > postVar ( varList - > GetVariationCopy ( " post_ " + regVar - > Name ( ) ) ) ;
2014-07-08 03:11:14 -04:00
Xform < float > xform0 ( 0.25f , rand . Frand01 < float > ( ) , rand . Frand11 < float > ( ) , 1 , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) ) ;
Xform < float > xform1 ( 0.25f , rand . Frand01 < float > ( ) , rand . Frand11 < float > ( ) , 1 , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) ) ;
Xform < float > xform2 ( 0.25f , rand . Frand01 < float > ( ) , rand . Frand11 < float > ( ) , 1 , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) ) ;
Xform < float > xform3 ( 0.25f , rand . Frand01 < float > ( ) , rand . Frand11 < float > ( ) , 1 , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) ) ;
Xform < float > xform4 ( 0.25f , rand . Frand01 < float > ( ) , rand . Frand11 < float > ( ) , 1 , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) ) ;
Xform < float > xform5 ( 0.25f , rand . Frand01 < float > ( ) , rand . Frand11 < float > ( ) , 1 , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) ) ;
Xform < float > xform6 ( 0.25f , rand . Frand01 < float > ( ) , rand . Frand11 < float > ( ) , 1 , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) ) ;
Xform < float > xform7 ( 0.25f , rand . Frand01 < float > ( ) , rand . Frand11 < float > ( ) , 1 , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) , rand . Frand11 < float > ( ) ) ;
if ( preVar . get ( ) & & postVar . get ( ) )
{
xform1 . AddVariation ( preVar - > Copy ( ) ) ;
xform2 . AddVariation ( regVar - > Copy ( ) ) ;
xform3 . AddVariation ( postVar - > Copy ( ) ) ;
xform4 . AddVariation ( preVar - > Copy ( ) ) ;
xform4 . AddVariation ( regVar - > Copy ( ) ) ;
xform5 . AddVariation ( preVar - > Copy ( ) ) ;
xform5 . AddVariation ( postVar - > Copy ( ) ) ;
xform6 . AddVariation ( regVar - > Copy ( ) ) ;
xform6 . AddVariation ( postVar - > Copy ( ) ) ;
xform7 . AddVariation ( preVar - > Copy ( ) ) ;
xform7 . AddVariation ( regVar - > Copy ( ) ) ;
xform7 . AddVariation ( postVar - > Copy ( ) ) ;
xforms . push_back ( xform0 ) ;
xforms . push_back ( xform1 ) ;
xforms . push_back ( xform2 ) ;
xforms . push_back ( xform3 ) ;
xforms . push_back ( xform4 ) ;
xforms . push_back ( xform5 ) ;
xforms . push_back ( xform6 ) ;
xforms . push_back ( xform7 ) ;
}
else
{
xform1 . AddVariation ( regVar - > Copy ( ) ) ;
xforms . push_back ( xform0 ) ;
xforms . push_back ( xform1 ) ;
}
for ( size_t i = 0 ; i < xforms . size ( ) ; i + + )
{
bool badVals = false ;
Point < float > orig ;
orig . m_X = rand . Frand11 < float > ( ) ;
orig . m_Y = rand . Frand11 < float > ( ) ;
orig . m_Z = rand . Frand11 < float > ( ) ;
orig . m_ColorX = rand . Frand01 < float > ( ) ;
2017-03-27 21:05:06 -04:00
orig . m_Opacity = rand . Frand01 < float > ( ) ;
2014-07-08 03:11:14 -04:00
Point < float > p1 = orig , p2 = orig , p3 ;
xforms [ i ] . Apply ( & p1 , & p1 , rand ) ;
xforms [ i ] . Apply ( & p2 , & p3 , rand ) ;
badVals | = ( p1 . m_X ! = p1 . m_X ) ;
badVals | = ( p1 . m_Y ! = p1 . m_Y ) ;
badVals | = ( p1 . m_Z ! = p1 . m_Z ) ;
badVals | = ( p1 . m_ColorX ! = p1 . m_ColorX ) ;
2017-03-27 21:05:06 -04:00
badVals | = ( p1 . m_Opacity ! = p1 . m_Opacity ) ;
2014-07-08 03:11:14 -04:00
badVals | = ( p3 . m_X ! = p3 . m_X ) ;
badVals | = ( p3 . m_Y ! = p3 . m_Y ) ;
badVals | = ( p3 . m_Z ! = p3 . m_Z ) ;
badVals | = ( p3 . m_ColorX ! = p3 . m_ColorX ) ;
2017-03-27 21:05:06 -04:00
badVals | = ( p3 . m_Opacity ! = p3 . m_Opacity ) ;
2014-07-08 03:11:14 -04:00
if ( badVals )
cout < < " Variation " < < regVar - > Name ( ) < < " : Bad value detected " < < endl ;
if ( ! badVals )
{
if ( p1 . m_X ! = p3 . m_X )
cout < < " Variation " < < regVar - > Name ( ) < < " : p1.m_X " < < p1 . m_X < < " != p3.m_X " < < p3 . m_X < < endl ;
if ( p1 . m_Y ! = p3 . m_Y )
cout < < " Variation " < < regVar - > Name ( ) < < " : p1.m_Y " < < p1 . m_Y < < " != p3.m_Y " < < p3 . m_Y < < endl ;
if ( p1 . m_Z ! = p3 . m_Z )
cout < < " Variation " < < regVar - > Name ( ) < < " : p1.m_Z " < < p1 . m_Z < < " != p3.m_Z " < < p3 . m_Z < < endl ;
if ( p1 . m_ColorX ! = p3 . m_ColorX )
cout < < " Variation " < < regVar - > Name ( ) < < " : p1.m_ColorX " < < p1 . m_ColorX < < " != p3.m_ColorX " < < p3 . m_ColorX < < endl ;
2017-03-27 21:05:06 -04:00
if ( p1 . m_Opacity ! = p3 . m_Opacity )
cout < < " Variation " < < regVar - > Name ( ) < < " : p1.m_Opacity " < < p1 . m_Opacity < < " != p3.m_Opacity " < < p3 . m_Opacity < < endl ;
2014-07-08 03:11:14 -04:00
}
}
}
index + + ;
}
}
static int SortPairByTime ( const pair < string , double > & a , pair < string , double > & b )
{
return a . second < b . second ;
}
template < typename T >
void TestVarTime ( )
{
int i = 0 , iters = 10 ;
Timing t ;
VariationList < T > vlf ;
IteratorHelper < T > helper ;
QTIsaac < ISAAC_SIZE , ISAAC_INT > rand ;
vector < pair < string , double > > times ;
2016-04-13 23:59:57 -04:00
times . reserve ( vlf - > RegSize ( ) ) ;
2014-07-08 03:11:14 -04:00
2016-04-13 23:59:57 -04:00
while ( i < vlf - > RegSize ( ) )
2014-07-08 03:11:14 -04:00
{
double sum = 0 ;
Xform < T > xform ;
2016-04-13 23:59:57 -04:00
Variation < T > * var = vlf - > GetVariationCopy ( i , eVariationType : : VARTYPE_REG ) ;
2014-07-08 03:11:14 -04:00
xform . AddVariation ( var ) ;
for ( int iter = 0 ; iter < iters ; iter + + )
{
Point < T > p ;
xform . m_Affine . A ( rand . Frand < T > ( - 5 , 5 ) ) ;
xform . m_Affine . B ( rand . Frand < T > ( - 5 , 5 ) ) ;
xform . m_Affine . C ( rand . Frand < T > ( - 5 , 5 ) ) ;
xform . m_Affine . D ( rand . Frand < T > ( - 5 , 5 ) ) ;
xform . m_Affine . E ( rand . Frand < T > ( - 5 , 5 ) ) ;
xform . m_Affine . F ( rand . Frand < T > ( - 5 , 5 ) ) ;
p . m_X = rand . Frand < T > ( - 20 , 20 ) ;
p . m_Y = rand . Frand < T > ( - 20 , 20 ) ;
p . m_Z = rand . Frand < T > ( - 20 , 20 ) ;
helper . In . x = helper . m_TransX = ( xform . m_Affine . A ( ) * p . m_X ) + ( xform . m_Affine . B ( ) * p . m_Y ) + xform . m_Affine . C ( ) ;
helper . In . y = helper . m_TransY = ( xform . m_Affine . D ( ) * p . m_X ) + ( xform . m_Affine . E ( ) * p . m_Y ) + xform . m_Affine . F ( ) ;
helper . In . z = helper . m_TransZ = p . m_Z ;
helper . m_Color . x = p . m_ColorX = rand . Frand01 < T > ( ) ;
2017-03-27 21:05:06 -04:00
p . m_Opacity = rand . Frand01 < T > ( ) ;
2014-07-08 03:11:14 -04:00
helper . m_PrecalcSumSquares = SQR ( helper . m_TransX ) + SQR ( helper . m_TransY ) ;
06/09/2017
--User changes
-dark.qss is now per-OS.
-Properly set/reload palette when coming from the palette editor. The latter must be done if they've modified the current palette even if they've clicked cancel.
--Bug fixes
-Make the following variations safer by using Zeps(): conic, bipolar, edisc, whorl, tan, csc, cot, tanh, sech, csch, coth, auger, bwraps, hypertile3d, hypertile3d1, ortho, poincare, rational3, barycentroid, sschecks, cscq, cschq, scry_3D, splitbrdr, hexcrop, nblur, crob.
-Fix bug enabling/disabling overwrite button in palette editor.
-Small optimization for gdoffs, use precalcAtanYX.
-Properly propagate z through circlesplit, cylinder2 and tile_log variations.
-Some values in truchet_fill could've been NaN.
--Code changes
-Make most installation files read only.
-Qualify many calls with std:: to ensure they're not colliding with glm::
-Use auto in more places.
2017-06-09 22:38:06 -04:00
helper . m_PrecalcSqrtSumSquares = std : : sqrt ( helper . m_PrecalcSumSquares ) ;
2014-07-08 03:11:14 -04:00
helper . m_PrecalcSina = helper . m_TransX / helper . m_PrecalcSqrtSumSquares ;
2015-12-31 16:41:59 -05:00
helper . m_PrecalcCosa = helper . m_TransY / helper . m_PrecalcSqrtSumSquares ;
06/09/2017
--User changes
-dark.qss is now per-OS.
-Properly set/reload palette when coming from the palette editor. The latter must be done if they've modified the current palette even if they've clicked cancel.
--Bug fixes
-Make the following variations safer by using Zeps(): conic, bipolar, edisc, whorl, tan, csc, cot, tanh, sech, csch, coth, auger, bwraps, hypertile3d, hypertile3d1, ortho, poincare, rational3, barycentroid, sschecks, cscq, cschq, scry_3D, splitbrdr, hexcrop, nblur, crob.
-Fix bug enabling/disabling overwrite button in palette editor.
-Small optimization for gdoffs, use precalcAtanYX.
-Properly propagate z through circlesplit, cylinder2 and tile_log variations.
-Some values in truchet_fill could've been NaN.
--Code changes
-Make most installation files read only.
-Qualify many calls with std:: to ensure they're not colliding with glm::
-Use auto in more places.
2017-06-09 22:38:06 -04:00
helper . m_PrecalcAtanxy = std : : atan2 ( helper . m_TransX , helper . m_TransY ) ;
helper . m_PrecalcAtanyx = std : : atan2 ( helper . m_TransY , helper . m_TransX ) ;
2014-07-08 03:11:14 -04:00
var - > Random ( rand ) ;
t . Tic ( ) ;
var - > Func ( helper , p , rand ) ;
sum + = t . Toc ( ) ;
}
i + + ;
times . push_back ( pair < string , double > ( var - > Name ( ) , sum / iters ) ) ;
}
std : : sort ( times . begin ( ) , times . end ( ) , & SortPairByTime ) ;
2015-05-03 20:13:14 -04:00
//forr (auto& p : times) cout << p.first << "\t" << p.second << "" << endl;
2014-07-08 03:11:14 -04:00
}
2015-03-22 15:46:10 -04:00
void TestCasting ( )
{
vector < string > stringVec ;
2016-05-15 02:33:08 -04:00
auto varList = VariationList < float > : : Instance ( ) ;
auto & vars = varList - > AllVars ( ) ;
2015-03-22 15:46:10 -04:00
stringVec . push_back ( " T( " ) ;
stringVec . push_back ( " .0f " ) ;
stringVec . push_back ( " .1f " ) ;
stringVec . push_back ( " .2f " ) ;
stringVec . push_back ( " .3f " ) ;
stringVec . push_back ( " .4f " ) ;
stringVec . push_back ( " .5f " ) ;
stringVec . push_back ( " .6f " ) ;
stringVec . push_back ( " .7f " ) ;
stringVec . push_back ( " .8f " ) ;
stringVec . push_back ( " .9f " ) ;
2016-05-15 02:33:08 -04:00
auto varVec = FindVarsWith < float > ( vars , stringVec ) ;
2015-03-22 15:46:10 -04:00
for ( auto & it : varVec )
{
cout < < " Variation " < < it - > Name ( ) < < " contained an improper float cast. " < < endl ;
}
}
2014-07-08 03:11:14 -04:00
template < typename T >
void TestOperations ( )
{
vector < string > stringVec ;
2016-05-15 02:33:08 -04:00
auto varList = VariationList < T > : : Instance ( ) ;
auto & vars = varList - > AllVars ( ) ;
2014-07-08 03:11:14 -04:00
//stringVec.push_back("%");
2014-10-14 11:53:15 -04:00
//varVec = FindVarsWith<T>(Vec);
2014-07-08 03:11:14 -04:00
//
//for (size_t i = 0; i < varVec.size(); i++)
//{
// cout << "Variation " << varVec[i]->Name() << " contained a modulo operation. Ensure its right hand operand is not zero." << endl;
//}
//
//stringVec.clear();
//ClearVec<Variation<T>>(varVec);
stringVec . push_back ( " MwcNext(mwc) % " ) ;
stringVec . push_back ( " MwcNext(mwc)% " ) ;
2016-05-15 02:33:08 -04:00
auto varVec = FindVarsWith < T > ( vars , stringVec ) ;
2014-07-08 03:11:14 -04:00
for ( size_t i = 0 ; i < varVec . size ( ) ; i + + )
{
cout < < " Variation " < < varVec [ i ] - > Name ( ) < < " contained MwcNext(mwc) %. Use MwcNextRange() instead. " < < endl ;
}
}
template < typename T >
void TestVarsSimilar ( )
{
int i = 0 , compIndex = 0 , iters = 10 ;
Timing t ;
VariationList < T > vlf ;
IteratorHelper < T > helper ;
QTIsaac < ISAAC_SIZE , ISAAC_INT > rand ;
vector < pair < string , double > > diffs ;
2016-04-13 23:59:57 -04:00
diffs . reserve ( vlf - > RegSize ( ) ) ;
2014-07-08 03:11:14 -04:00
2016-04-13 23:59:57 -04:00
while ( i < vlf - > RegSize ( ) )
2014-07-08 03:11:14 -04:00
{
double diff = 0 , highest = TMAX ;
Xform < T > xform ;
2016-04-13 23:59:57 -04:00
Variation < T > * var = vlf - > GetVariationCopy ( i , eVariationType : : VARTYPE_REG ) ;
2014-07-08 03:11:14 -04:00
pair < string , double > match ( " " , TMAX ) ;
compIndex = 0 ;
xform . AddVariation ( var ) ;
2016-04-13 23:59:57 -04:00
while ( compIndex < vlf - > RegSize ( ) )
2014-07-08 03:11:14 -04:00
{
if ( compIndex = = i )
{
compIndex + + ;
continue ;
}
double sum = 0 , xdiff = 0 , ydiff = 0 , zdiff = 0 ;
Xform < T > xformComp ;
2016-04-13 23:59:57 -04:00
Variation < T > * varComp = vlf - > GetVariationCopy ( compIndex , eVariationType : : VARTYPE_REG ) ;
2014-07-08 03:11:14 -04:00
xformComp . AddVariation ( varComp ) ;
ParametricVariation < T > * parVar = dynamic_cast < ParametricVariation < T > * > ( var ) ;
ParametricVariation < T > * parVarComp = dynamic_cast < ParametricVariation < T > * > ( varComp ) ;
for ( int iter = 0 ; iter < iters ; iter + + )
{
Point < T > p , pComp ;
xform . m_Affine . A ( rand . Frand < T > ( - 5 , 5 ) ) ;
xform . m_Affine . B ( rand . Frand < T > ( - 5 , 5 ) ) ;
xform . m_Affine . C ( rand . Frand < T > ( - 5 , 5 ) ) ;
xform . m_Affine . D ( rand . Frand < T > ( - 5 , 5 ) ) ;
xform . m_Affine . E ( rand . Frand < T > ( - 5 , 5 ) ) ;
xform . m_Affine . F ( rand . Frand < T > ( - 5 , 5 ) ) ;
xformComp . m_Affine = xform . m_Affine ;
p . m_X = rand . Frand < T > ( - 20 , 20 ) ;
p . m_Y = rand . Frand < T > ( - 20 , 20 ) ;
p . m_Z = rand . Frand < T > ( - 20 , 20 ) ;
helper . In . x = helper . m_TransX = ( xform . m_Affine . A ( ) * p . m_X ) + ( xform . m_Affine . B ( ) * p . m_Y ) + xform . m_Affine . C ( ) ;
helper . In . y = helper . m_TransY = ( xform . m_Affine . D ( ) * p . m_X ) + ( xform . m_Affine . E ( ) * p . m_Y ) + xform . m_Affine . F ( ) ;
helper . In . z = helper . m_TransZ = p . m_Z ;
helper . m_Color . x = p . m_ColorX = rand . Frand01 < T > ( ) ;
2017-03-27 21:05:06 -04:00
p . m_Opacity = rand . Frand01 < T > ( ) ;
2014-07-08 03:11:14 -04:00
pComp = p ;
helper . m_PrecalcSumSquares = SQR ( helper . m_TransX ) + SQR ( helper . m_TransY ) ;
06/09/2017
--User changes
-dark.qss is now per-OS.
-Properly set/reload palette when coming from the palette editor. The latter must be done if they've modified the current palette even if they've clicked cancel.
--Bug fixes
-Make the following variations safer by using Zeps(): conic, bipolar, edisc, whorl, tan, csc, cot, tanh, sech, csch, coth, auger, bwraps, hypertile3d, hypertile3d1, ortho, poincare, rational3, barycentroid, sschecks, cscq, cschq, scry_3D, splitbrdr, hexcrop, nblur, crob.
-Fix bug enabling/disabling overwrite button in palette editor.
-Small optimization for gdoffs, use precalcAtanYX.
-Properly propagate z through circlesplit, cylinder2 and tile_log variations.
-Some values in truchet_fill could've been NaN.
--Code changes
-Make most installation files read only.
-Qualify many calls with std:: to ensure they're not colliding with glm::
-Use auto in more places.
2017-06-09 22:38:06 -04:00
helper . m_PrecalcSqrtSumSquares = std : : sqrt ( helper . m_PrecalcSumSquares ) ;
2014-07-08 03:11:14 -04:00
helper . m_PrecalcSina = helper . m_TransX / helper . m_PrecalcSqrtSumSquares ;
2015-12-31 16:41:59 -05:00
helper . m_PrecalcCosa = helper . m_TransY / helper . m_PrecalcSqrtSumSquares ;
06/09/2017
--User changes
-dark.qss is now per-OS.
-Properly set/reload palette when coming from the palette editor. The latter must be done if they've modified the current palette even if they've clicked cancel.
--Bug fixes
-Make the following variations safer by using Zeps(): conic, bipolar, edisc, whorl, tan, csc, cot, tanh, sech, csch, coth, auger, bwraps, hypertile3d, hypertile3d1, ortho, poincare, rational3, barycentroid, sschecks, cscq, cschq, scry_3D, splitbrdr, hexcrop, nblur, crob.
-Fix bug enabling/disabling overwrite button in palette editor.
-Small optimization for gdoffs, use precalcAtanYX.
-Properly propagate z through circlesplit, cylinder2 and tile_log variations.
-Some values in truchet_fill could've been NaN.
--Code changes
-Make most installation files read only.
-Qualify many calls with std:: to ensure they're not colliding with glm::
-Use auto in more places.
2017-06-09 22:38:06 -04:00
helper . m_PrecalcAtanxy = std : : atan2 ( helper . m_TransX , helper . m_TransY ) ;
helper . m_PrecalcAtanyx = std : : atan2 ( helper . m_TransY , helper . m_TransX ) ;
2014-07-08 03:11:14 -04:00
if ( parVar )
{
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
for ( size_t v = 0 ; v < parVar - > ParamCount ( ) ; v + + )
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
parVar - > SetParamVal ( v , ( T ) iter ) ;
2014-07-08 03:11:14 -04:00
}
if ( parVarComp )
{
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
for ( size_t v = 0 ; v < parVarComp - > ParamCount ( ) ; v + + )
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
parVarComp - > SetParamVal ( v , ( T ) iter ) ;
2014-07-08 03:11:14 -04:00
}
//For debugging.
2016-01-04 19:50:15 -05:00
if ( var - > VariationId ( ) = = eVariationId : : VAR_BWRAPS & & varComp - > VariationId ( ) = = eVariationId : : VAR_ECLIPSE )
2014-07-08 03:11:14 -04:00
{
//cout << "Break." << endl;
}
helper . Out = v4T ( 0 ) ;
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
var - > m_Weight = T ( iter + 1 ) ;
2014-07-08 03:11:14 -04:00
var - > Precalc ( ) ;
var - > Func ( helper , p , rand ) ;
v4T varOut = helper . Out ;
helper . Out = v4T ( 0 ) ;
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
varComp - > m_Weight = T ( iter + 1 ) ;
2014-07-08 03:11:14 -04:00
varComp - > Precalc ( ) ;
varComp - > Func ( helper , pComp , rand ) ;
v4T varCompOut = helper . Out ;
2016-01-12 23:42:12 -05:00
xdiff + = std : : abs ( varOut . x - varCompOut . x ) ;
ydiff + = std : : abs ( varOut . y - varCompOut . y ) ;
zdiff + = std : : abs ( varOut . z - varCompOut . z ) ;
2014-07-08 03:11:14 -04:00
}
sum = ( xdiff + ydiff + zdiff ) / iters ;
if ( sum < highest )
{
match . first = varComp - > Name ( ) ;
match . second = highest = sum ;
}
compIndex + + ;
}
if ( match . second < 0.001 )
cout < < " The closest match to variation " < < var - > Name ( ) < < " is " < < match . first < < " with a total difference of " < < match . second < < endl ;
i + + ;
//times.push_back(pair<string, double>(var->Name(), sum / iters));
}
//std::sort(times.begin(), times.end(), &SortPairByTime);
}
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
# ifdef TEST_CL
2015-03-22 15:46:10 -04:00
template < typename T >
--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.
2015-11-22 17:15:07 -05:00
bool TestAllVarsCLBuild ( size_t platform , size_t device , bool printSuccess = true )
2015-03-22 15:46:10 -04:00
{
--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.
2015-11-22 17:15:07 -05:00
bool success = true ;
2015-03-22 15:46:10 -04:00
vector < Ember < T > > embers ;
QTIsaac < ISAAC_SIZE , ISAAC_INT > rand ;
--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.
2015-11-22 17:15:07 -05:00
vector < pair < size_t , size_t > > devices { std : : make_pair ( platform , device ) } ;
RendererCL < T , float > renderer ( devices ) ;
2015-03-22 15:46:10 -04:00
const char * loc = __FUNCTION__ ;
--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.
2015-11-22 17:15:07 -05:00
if ( ! renderer . Ok ( ) )
2015-03-22 15:46:10 -04:00
{
cout < < loc < < " Creating RendererCL failed, tests will not be run. " < < endl ;
--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.
2015-11-22 17:15:07 -05:00
return false ;
2015-03-22 15:46:10 -04:00
}
MakeTestAllVarsRegPrePost ( embers ) ;
for ( auto & it : embers )
{
renderer . SetEmber ( it ) ;
2017-06-11 18:02:44 -04:00
//if (platform != 0 &&
// ((it.GetXform(0)->GetVariationById(eVariationId::VAR_SYNTH) != nullptr) ||//Nvidia OpenCL driver crashes when building too many synths.
// (it.GetXform(0)->GetVariationById(eVariationId::VAR_PRE_SYNTH) != nullptr) ||
// (it.GetXform(0)->GetVariationById(eVariationId::VAR_POST_SYNTH) != nullptr)))
//{
// cout << "Skipping synth.\n";
// continue;
//}
2016-01-17 19:10:06 -05:00
2015-03-22 15:46:10 -04:00
if ( renderer . BuildIterProgramForEmber ( ) )
{
if ( printSuccess )
cout < < loc < < " : Build succeeded for ember " < < it . m_Name < < endl ;
}
else
--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.
2015-11-22 17:15:07 -05:00
{
success = false ;
cout < < loc < < " : OpenCL program build failed for ember " < < it . m_Name < < " : \n " < < renderer . ErrorReportString ( ) < < endl ;
break ;
}
2015-03-22 15:46:10 -04:00
}
--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.
2015-11-22 17:15:07 -05:00
return success ;
2015-03-22 15:46:10 -04:00
}
2014-07-08 03:11:14 -04:00
template < typename T >
--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.
2015-11-22 17:15:07 -05:00
void TestCpuGpuResults ( size_t platform , size_t device )
2014-07-08 03:11:14 -04:00
{
bool breakOnBad = true ;
2016-01-04 19:50:15 -05:00
int i = 0 ; //(int)eVariationId::VAR_TARGET;//Start at the one you want to test.
2014-07-08 03:11:14 -04:00
int iters = 10 ;
int skipped = 0 ;
T thresh = T ( 1e-3 ) ;
Timing t ;
VariationList < T > vlf ;
QTIsaac < ISAAC_SIZE , ISAAC_INT > rand ;
vector < PointCL < T > > points ;
--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.
2015-11-22 17:15:07 -05:00
vector < pair < size_t , size_t > > devices { std : : make_pair ( platform , device ) } ;
RendererCL < T , float > renderer ( devices ) ;
2014-07-08 03:11:14 -04:00
points . resize ( renderer . TotalIterKernelCount ( ) ) ;
2016-04-13 23:59:57 -04:00
while ( i < vlf - > RegSize ( ) )
2014-07-08 03:11:14 -04:00
{
bool bad = false ;
double sum = 0 ;
2016-04-13 23:59:57 -04:00
Variation < T > * var = vlf - > GetVariation ( i , eVariationType : : VARTYPE_REG ) ;
2014-07-08 03:11:14 -04:00
string s = var - > OpenCLString ( ) + var - > OpenCLFuncsString ( ) ;
if ( s . find ( " MwcNext " ) ! = string : : npos )
{
i + + ;
skipped + + ;
continue ;
}
cout < < " Testing cpu-gpu equality for variation: " < < var - > Name ( ) < < " ( " < < ( int ) var - > VariationId ( ) < < " ) " < < endl ;
for ( int iter = 0 ; iter < iters ; iter + + )
{
Point < T > p , p2 ;
Ember < T > ember ;
Xform < T > xform ;
Variation < T > * varCopy = var - > Copy ( ) ;
p . m_X = rand . Frand < T > ( - 5 , 5 ) ;
p . m_Y = rand . Frand < T > ( - 5 , 5 ) ;
p . m_Z = rand . Frand < T > ( - 5 , 5 ) ;
p . m_ColorX = rand . Frand01 < T > ( ) ;
2017-03-27 21:05:06 -04:00
p . m_Opacity = rand . Frand01 < T > ( ) ;
2014-07-08 03:11:14 -04:00
varCopy - > Random ( rand ) ;
xform . AddVariation ( varCopy ) ;
ember . AddXform ( xform ) ;
ember . CacheXforms ( ) ;
2017-05-12 18:31:48 -04:00
renderer . SetEmber ( ember , eProcessAction : : FULL_RENDER , true ) ;
2014-07-08 03:11:14 -04:00
renderer . AssignIterator ( ) ;
if ( ! renderer . Alloc ( ) )
return ;
points [ 0 ] . m_X = p . m_X ;
points [ 0 ] . m_Y = p . m_Y ;
points [ 0 ] . m_Z = p . m_Z ;
points [ 0 ] . m_ColorX = p . m_ColorX ;
xform . Apply ( & p , & p2 , rand ) ;
renderer . WritePoints ( points ) ;
renderer . Iterate ( 1 , 0 , 1 ) ;
renderer . ReadPoints ( points ) ;
2016-01-12 23:42:12 -05:00
T xdiff = std : : abs ( p2 . m_X - points [ 0 ] . m_X ) ;
T ydiff = std : : abs ( p2 . m_Y - points [ 0 ] . m_Y ) ;
T zdiff = std : : abs ( p2 . m_Z - points [ 0 ] . m_Z ) ;
2014-07-08 03:11:14 -04:00
if ( xdiff > thresh | | ydiff > thresh | | zdiff > thresh )
{
bad = true ;
cout < < __FUNCTION__ < < " : Variation cpu-gpu diff for iter " < < iter < < " : " < < varCopy - > Name ( ) < < " ( " < < ( int ) varCopy - > VariationId ( ) < < " ) xdiff: " < < xdiff < < endl ;
cout < < __FUNCTION__ < < " : Variation cpu-gpu diff for iter " < < iter < < " : " < < varCopy - > Name ( ) < < " ( " < < ( int ) varCopy - > VariationId ( ) < < " ) ydiff: " < < ydiff < < endl ;
cout < < __FUNCTION__ < < " : Variation cpu-gpu diff for iter " < < iter < < " : " < < varCopy - > Name ( ) < < " ( " < < ( int ) varCopy - > VariationId ( ) < < " ) zdiff: " < < zdiff < < endl ;
cout < < varCopy - > ToString ( ) < < endl ;
}
else
{
//cout << "Variation " << var->Name() << " had no difference between cpu and gpu for iter " << iter << endl;
}
}
if ( breakOnBad & & bad )
break ;
i + + ;
bad = false ;
}
cout < < " Skipped " < < skipped < < endl ;
}
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
template < typename T >
--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.
2015-11-22 17:15:07 -05:00
void TestGpuVectorRead ( size_t platform , size_t device )
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
{
T minx = TMAX , miny = TMAX , minz = TMAX , mincolorx = TMAX ;
T maxx = TLOW , maxy = TLOW , maxz = TLOW , maxcolorx = TLOW ;
double sumx = 0 , avgx = 0 ;
double sumy = 0 , avgy = 0 ;
double sumz = 0 , avgz = 0 ;
double sumcolorx = 0 , avgcolorx = 0 ;
Timing t ;
VariationList < T > vlf ;
QTIsaac < ISAAC_SIZE , ISAAC_INT > rand ;
vector < PointCL < T > > points ;
--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.
2015-11-22 17:15:07 -05:00
vector < pair < size_t , size_t > > devices { std : : make_pair ( platform , device ) } ;
RendererCL < T , float > renderer ( devices ) ;
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
points . resize ( renderer . TotalIterKernelCount ( ) ) ;
2016-04-13 23:59:57 -04:00
Variation < T > * var = vlf - > GetVariation ( eVariationId : : VAR_LINEAR ) ;
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
Point < T > p , p2 ;
Ember < T > ember ;
Xform < T > xform ;
Variation < T > * varCopy = var - > Copy ( ) ;
p . m_X = rand . Frand < T > ( - 5 , 5 ) ;
p . m_Y = rand . Frand < T > ( - 5 , 5 ) ;
p . m_Z = rand . Frand < T > ( - 5 , 5 ) ;
p . m_ColorX = rand . Frand01 < T > ( ) ;
2017-03-27 21:05:06 -04:00
p . m_Opacity = rand . Frand01 < T > ( ) ;
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
varCopy - > Random ( rand ) ;
xform . AddVariation ( varCopy ) ;
ember . AddXform ( xform ) ;
ember . CacheXforms ( ) ;
2017-05-12 18:31:48 -04:00
renderer . SetEmber ( ember , eProcessAction : : FULL_RENDER , true ) ;
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
renderer . AssignIterator ( ) ;
if ( ! renderer . Alloc ( ) )
return ;
2014-12-06 00:05:09 -05:00
uint i , iters = renderer . IterCountPerKernel ( ) * renderer . TotalIterKernelCount ( ) ; //Make each thread in each block run at least once.
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
renderer . Iterate ( iters , 0 , 1 ) ;
renderer . ReadPoints ( points ) ;
cout < < __FUNCTION__ < < " : GPU point test value results: " < < endl ;
for ( i = 0 ; i < points . size ( ) ; i + + )
{
cout < < " point[ " < < i < < " ].m_X = " < < points [ i ] . m_X < < endl ;
cout < < " point[ " < < i < < " ].m_Y = " < < points [ i ] . m_Y < < endl ;
cout < < " point[ " < < i < < " ].m_Z = " < < points [ i ] . m_Z < < endl ;
cout < < " point[ " < < i < < " ].m_ColorX = " < < points [ i ] . m_ColorX < < endl < < endl ;
minx = min < T > ( points [ i ] . m_X , minx ) ;
miny = min < T > ( points [ i ] . m_Y , miny ) ;
minz = min < T > ( points [ i ] . m_Z , minz ) ;
mincolorx = min < T > ( points [ i ] . m_ColorX , mincolorx ) ;
maxx = max < T > ( points [ i ] . m_X , maxx ) ;
maxy = max < T > ( points [ i ] . m_Y , maxy ) ;
maxz = max < T > ( points [ i ] . m_Z , maxz ) ;
maxcolorx = max < T > ( points [ i ] . m_ColorX , maxcolorx ) ;
sumx + = points [ i ] . m_X ;
sumy + = points [ i ] . m_Y ;
sumz + = points [ i ] . m_Z ;
sumcolorx + = points [ i ] . m_ColorX ;
}
avgx = sumx / i ;
avgy = sumy / i ;
avgz = sumz / i ;
avgcolorx = sumcolorx / i ;
cout < < " avgx = " < < avgx < < endl ;
cout < < " avgy = " < < avgy < < endl ;
cout < < " avgz = " < < avgz < < endl ;
cout < < " avgcolorx = " < < avgcolorx < < endl ;
cout < < " minx = " < < minx < < endl ;
cout < < " miny = " < < miny < < endl ;
cout < < " minz = " < < minz < < endl ;
cout < < " mincolorx = " < < mincolorx < < endl < < endl ;
cout < < " maxx = " < < maxx < < endl ;
cout < < " maxy = " < < maxy < < endl ;
cout < < " maxz = " < < maxz < < endl ;
cout < < " maxcolorx = " < < maxcolorx < < endl < < endl < < endl ;
}
# endif
template < typename T >
void TestRandomAccess ( size_t vsize , size_t ipp , bool cache )
{
size_t iters = vsize * ipp ;
vector < v4T > vec ;
QTIsaac < ISAAC_SIZE , ISAAC_INT > rand ;
vec . resize ( vsize ) ;
v4T * vdata = vec . data ( ) ;
if ( cache )
{
for ( size_t i = 0 ; i < iters ; i + + )
{
v4T v4 ( rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) ) ;
int index = rand . Rand ( ( ISAAC_INT ) vsize ) ;
v4T v42 = vdata [ index ] ;
06/09/2017
--User changes
-dark.qss is now per-OS.
-Properly set/reload palette when coming from the palette editor. The latter must be done if they've modified the current palette even if they've clicked cancel.
--Bug fixes
-Make the following variations safer by using Zeps(): conic, bipolar, edisc, whorl, tan, csc, cot, tanh, sech, csch, coth, auger, bwraps, hypertile3d, hypertile3d1, ortho, poincare, rational3, barycentroid, sschecks, cscq, cschq, scry_3D, splitbrdr, hexcrop, nblur, crob.
-Fix bug enabling/disabling overwrite button in palette editor.
-Small optimization for gdoffs, use precalcAtanYX.
-Properly propagate z through circlesplit, cylinder2 and tile_log variations.
-Some values in truchet_fill could've been NaN.
--Code changes
-Make most installation files read only.
-Qualify many calls with std:: to ensure they're not colliding with glm::
-Use auto in more places.
2017-06-09 22:38:06 -04:00
v4 . x = std : : log ( v4 . x ) ;
v4 . y = std : : sqrt ( v4 . y ) ;
v4 . z = std : : sin ( v4 . z ) ;
v4 . w = std : : cos ( v4 . w ) ;
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
v4 + = T ( 1.234 ) ;
v4 * = T ( 55.55 ) ;
v4 / = T ( 0.0045 ) ;
vdata [ index ] = v4 + v42 ;
}
}
else
{
for ( size_t i = 0 ; i < iters ; i + + )
{
v4T v4 ( rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) , rand . Frand11 < T > ( ) ) ;
int index = rand . Rand ( ( ISAAC_INT ) vsize ) ;
06/09/2017
--User changes
-dark.qss is now per-OS.
-Properly set/reload palette when coming from the palette editor. The latter must be done if they've modified the current palette even if they've clicked cancel.
--Bug fixes
-Make the following variations safer by using Zeps(): conic, bipolar, edisc, whorl, tan, csc, cot, tanh, sech, csch, coth, auger, bwraps, hypertile3d, hypertile3d1, ortho, poincare, rational3, barycentroid, sschecks, cscq, cschq, scry_3D, splitbrdr, hexcrop, nblur, crob.
-Fix bug enabling/disabling overwrite button in palette editor.
-Small optimization for gdoffs, use precalcAtanYX.
-Properly propagate z through circlesplit, cylinder2 and tile_log variations.
-Some values in truchet_fill could've been NaN.
--Code changes
-Make most installation files read only.
-Qualify many calls with std:: to ensure they're not colliding with glm::
-Use auto in more places.
2017-06-09 22:38:06 -04:00
v4 . x = std : : log ( v4 . x ) ;
v4 . y = std : : sqrt ( v4 . y ) ;
v4 . z = std : : sin ( v4 . z ) ;
v4 . w = std : : cos ( v4 . w ) ;
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
v4 + = T ( 1.234 ) ;
v4 * = T ( 55.55 ) ;
v4 / = T ( 0.0045 ) ;
vdata [ index ] + = v4 ;
}
}
}
template < typename T >
void TestCross ( T x , T y , T weight )
{
T s = x * x - y * y ;
06/09/2017
--User changes
-dark.qss is now per-OS.
-Properly set/reload palette when coming from the palette editor. The latter must be done if they've modified the current palette even if they've clicked cancel.
--Bug fixes
-Make the following variations safer by using Zeps(): conic, bipolar, edisc, whorl, tan, csc, cot, tanh, sech, csch, coth, auger, bwraps, hypertile3d, hypertile3d1, ortho, poincare, rational3, barycentroid, sschecks, cscq, cschq, scry_3D, splitbrdr, hexcrop, nblur, crob.
-Fix bug enabling/disabling overwrite button in palette editor.
-Small optimization for gdoffs, use precalcAtanYX.
-Properly propagate z through circlesplit, cylinder2 and tile_log variations.
-Some values in truchet_fill could've been NaN.
--Code changes
-Make most installation files read only.
-Qualify many calls with std:: to ensure they're not colliding with glm::
-Use auto in more places.
2017-06-09 22:38:06 -04:00
T r = weight * std : : sqrt ( 1 / ( s * s + EPS ) ) ;
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
T outX = x * r ;
T outY = y * r ;
cout < < " First way, outX, outY == " < < outX < < " , " < < outY < < endl ;
2016-01-12 23:42:12 -05:00
r = std : : abs ( ( x - y ) * ( x + y ) + EPS ) ;
2015-12-31 16:41:59 -05:00
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
if ( r < 0 )
r = - r ;
r = weight / r ;
outX = x * r ;
outY = y * r ;
cout < < " Second way, outX, outY == " < < outX < < " , " < < outY < < endl ;
}
2014-07-26 20:26:15 -04:00
double RandD ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand )
{
2015-12-31 16:41:59 -05:00
return ( ( ( ( rand . Rand ( ) ^ ( rand . Rand ( ) < < 15 ) ) & 0xfffffff ) * 3.72529e-09 ) - 0.5 ) ;
2014-07-26 20:26:15 -04:00
}
2015-03-22 15:46:10 -04:00
//
//#define BEZ_POINT_LENGTH 4
//
//void BezierSolve(double t, glm::vec2* src, double* w, glm::vec2& solution)
//{
// double s, s2, s3, t2, t3, nom_x, nom_y, denom;
2015-12-31 16:41:59 -05:00
//
2015-03-22 15:46:10 -04:00
// s = 1 - t;
// s2 = s * s;
// s3 = s * s * s;
// t2 = t * t;
// t3 = t * t * t;
//
// nom_x = w[0] * s3 * src[0].x + w[1] * s2 * 3 * t * src[1].x + w[2] * s * 3 * t2 * src[2].x + w[3] * t3 * src[3].x;
//
// nom_y = w[0] * s3 * src[0].y + w[1] * s2 * 3 * t * src[1].y + w[2] * s * 3 * t2 * src[2].y + w[3] * t3 * src[3].y;
//
// denom = w[0] * s3 + w[1] * s2 * 3 * t + w[2] * s * 3 * t2 + w[3] * t3;
//
2015-12-31 16:41:59 -05:00
//
2015-03-22 15:46:10 -04:00
// if (isnan(nom_x) || isnan(nom_y) || isnan(denom) || denom == 0)
// return;
//
// solution.x = nom_x / denom;
// solution.y = nom_y / denom;
//}
//
//void BezierSetRect(glm::vec2* points, bool flip, glm::vec4& rect)
//{
// double f;
//
// for (int i = 0; i < BEZ_POINT_LENGTH; i++)
// {
// if (flip)
// f = 1 - points[i].y;
// else
// f = points[i].y;
//
// points[i].x = points[i].x * (rect.z - rect.x) + rect.x;
// points[i].y = f * (rect.w - rect.y) + rect.y;
// }
//}
//
//void BezierUnsetRect(glm::vec2* points, bool flip, glm::vec4& rect)
//{
// if ((rect.z - rect.x) == 0 || (rect.w - rect.y) == 0)
// return;
//
// for (int i = 0; i < BEZ_POINT_LENGTH; i++)
// {
// points[i].x = (points[i].x - rect.x) / (rect.z - rect.x);
// points[i].y = (points[i].y - rect.y) / (rect.w - rect.y);
//
// if (flip)
// points[i].y = 1 - points[i].y;
// }
//}
//
//struct BezierPoints
//{
// glm::vec2 points[4];
//};
//
//struct BezierWeights
//{
// double points[4];
//};
2015-03-21 18:27:37 -04:00
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
void TestThreadedKernel ( )
{
OpenCLWrapper wrapper1 , wrapper2 ;
if ( wrapper1 . Init ( 1 , 0 ) & & wrapper2 . Init ( 2 , 0 ) )
{
string k = ConstantDefinesString ( false ) + " \n __kernel void Kern() \n "
2015-12-31 16:41:59 -05:00
" { \n "
" int gid = GLOBAL_ID_X + GLOBAL_ID_Y; \n "
" } \n "
" \n " ;
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
if ( wrapper1 . AddProgram ( " prog1 " , k , " Kern " , false ) & &
2015-12-31 16:41:59 -05:00
wrapper2 . AddProgram ( " prog1 " , k , " Kern " , false ) )
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
{
cout < < " Builds ok, now run... " < < endl ;
std : : thread th1 ( [ & ] ( )
{
if ( wrapper1 . RunKernel ( 0 , 256 , 16 , 1 , 16 , 16 , 1 ) )
{
cout < < " Successful run inside thread 1... " < < endl ;
}
} ) ;
std : : thread th2 ( [ & ] ( )
{
if ( wrapper2 . RunKernel ( 0 , 256 , 16 , 1 , 16 , 16 , 1 ) )
{
cout < < " Successful run inside thread 2... " < < endl ;
}
} ) ;
2016-04-23 12:02:09 -04:00
Join ( th1 ) ;
Join ( th2 ) ;
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
cout < < " Successful join of kernel thread... " < < endl ;
}
}
}
--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.
2015-11-22 17:15:07 -05:00
template < typename T >
void DistribTester ( )
{
size_t i ;
size_t distribCount = 1 ;
size_t xformCount = 3 ;
vector < byte > m_XformDistributions ;
size_t j = 0 ;
vector < T > weights { T ( 0.333333 ) , T ( 1.0 ) , T ( 0.25 ) } ;
double tempDensity = 0 , currentDensityLimit = 0 , densityPerElement ;
if ( m_XformDistributions . size ( ) < CHOOSE_XFORM_GRAIN * distribCount )
m_XformDistributions . resize ( CHOOSE_XFORM_GRAIN * distribCount ) ;
if ( m_XformDistributions . size ( ) < CHOOSE_XFORM_GRAIN * distribCount )
return ;
for ( size_t distrib = 0 ; distrib < distribCount ; distrib + + )
{
double totalDensity = 0 ;
//First find the total densities of all xforms.
for ( i = 0 ; i < xformCount ; i + + )
{
T d = weights [ i ] ;
totalDensity + = d ;
}
//Original returned false if all were 0, but it's allowed here
//which will just end up setting all elements to 0 which means
//only the first xform will get used.
//Calculate how much of a fraction of a the total density each element represents.
j = 0 ;
tempDensity = 0 ;
currentDensityLimit = 0 ;
densityPerElement = totalDensity / CHOOSE_XFORM_GRAIN ;
//Assign xform indices in order to each element of m_XformDistributions.
//The number of elements assigned a given index is proportional to that xform's
//density relative to the sum of all densities.
for ( i = 0 ; i < xformCount ; i + + )
{
T temp = weights [ i ] ;
currentDensityLimit + = temp ;
//Populate points corresponding to this xform's weight/density.
//Also check that j is within the bounds of the distribution array just to be safe in the case of a rounding error.
while ( tempDensity < currentDensityLimit & & j < CHOOSE_XFORM_GRAIN )
{
# ifdef _DEBUG
2015-12-31 16:41:59 -05:00
--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.
2015-11-22 17:15:07 -05:00
//Ensure distribution contains no out of bounds indices.
if ( byte ( i ) > = xformCount )
throw " Out of bounds xform index in selection distribution. " ;
2015-12-31 16:41:59 -05:00
--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.
2015-11-22 17:15:07 -05:00
# endif
2016-12-05 22:04:33 -05:00
//cout << "offset = " << j << ", xform = " << i << ", running sum = " << tempDensity << "\n";
--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.
2015-11-22 17:15:07 -05:00
m_XformDistributions [ ( distrib * CHOOSE_XFORM_GRAIN ) + j ] = byte ( i ) ;
tempDensity + = densityPerElement ;
j + + ;
}
}
//Flam3 did this, which gives the same result.
//T t = xforms[0].m_Weight;
//
//if (distrib > 0)
// t *= xforms[distrib - 1].Xaos(0);
//
//T r = 0;
//
//for (i = 0; i < CHOOSE_XFORM_GRAIN; i++)
//{
// while (r >= t)
// {
// j++;
//
// if (distrib > 0)
// t += xforms[j].m_Weight * xforms[distrib - 1].Xaos(j);
// else
// t += xforms[j].m_Weight;
// }
//
// m_XformDistributions[(distrib * CHOOSE_XFORM_GRAIN) + i] = j;
// r += densityPerElement;
//}
}
}
2016-02-12 00:38:21 -05:00
template < typename T >
void TestAffine ( )
{
v2T x ( 1 , 0 ) , y ( 0 , 1 ) , t ( 1 , 0 ) ;
Affine2D < T > af ( x , y , t ) ;
auto af2 = af ;
cout < < af . ToString ( ) < < " \n \n " ;
af . RotateTrans ( 90 ) ;
cout < < af . ToString ( ) < < " \n \n " ;
af2 . RotateTrans ( - 90 ) ;
cout < < af2 . ToString ( ) < < " \n \n " ;
}
template < typename T >
void TestRotate ( )
{
T angle = 45 ;
v3T x ( 1 , 0 , 0 ) , y ( 0 , 1 , 0 ) , xy ( 1 , 1 , 0 ) ;
auto xtrans = glm : : translate ( m4T ( 1 ) , xy ) ;
auto xrot = glm : : rotate ( xtrans , angle * DEG_2_RAD_T , v3T ( 0 , 0 , 1 ) ) ;
}
2016-04-03 21:55:12 -04:00
template < typename T >
class EmberContainerTester
{
public :
template < typename Alloc , template < typename , typename > class C >
static void TestEmberContainer ( C < Ember < T > , Alloc > & cont )
{
Ember < T > e ;
cont . push_back ( e ) ;
}
} ;
2014-07-08 03:11:14 -04:00
int _tmain ( int argc , _TCHAR * argv [ ] )
{
2014-09-10 01:41:26 -04:00
//int i;
--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.
2015-11-22 17:15:07 -05:00
bool b = true ;
2014-07-08 03:11:14 -04:00
Timing t ( 4 ) ;
2018-09-15 06:11:12 -04:00
/* vector<Ember<float>> fv;
vector < Ember < double > > dv ;
list < Ember < float > > fl ;
list < Ember < double > > dl ;
int w = 1000 , h = 1000 ;
string filename = " . \\ testexr.exr " ;
vector < Rgba > pixels ;
pixels . resize ( w * h ) ;
for ( auto & pix : pixels )
{
2018-09-18 23:49:38 -04:00
pix . r = 1.0 ;
pix . b = 0.0 ;
pix . a = 1.0 ;
//pix.r = std::numeric_limits<float>::max();
2018-09-15 06:11:12 -04:00
}
2017-07-22 16:43:35 -04:00
2018-09-15 06:11:12 -04:00
writeRgba1 ( filename . c_str ( ) , pixels . data ( ) , w , h ) ;
TestFuncs ( ) ;
2017-07-05 02:08:06 -04:00
string line = " title= \" cj_aerie \" smooth=no " , delim = " = \" " ;
06/04/2017
--User changes
-Make all fonts be MS Shell Dlg 2. This will require reloading dark.qss if users are already using it.
-Limit size of the left side of the palette editor.
-Disable create from image buttons in the palette editor when working on a fixed palette.
--Bug fixes
-The following variations were wrong: coshq, cothq.
-During iteration, the color index could become nan if all xform color speeds were negative. This could lead to bad results on the GPU. Fix to check for nan. Minimal speed difference.
--Code changes
-Make the following variations safer by using Zeps(): sinq, sinhq, secq, sechq, tanq, tanhq, cosq, coshq, cotq, cothq, cscq, cschq, estiq.
-Always pass -cl-no-signed-zeros -cl-denorms-are-zero to kernel compiles for both single and double.
-Flush all denormals to zero for all executable programs. This will likely lead to a speedup for badly behaving programs.
2017-06-04 20:37:29 -04:00
auto vec = Split ( line , delim , true ) ;
--User changes
-Add a palette editor.
-Add support for reading .ugr/.gradient/.gradients palette files.
-Allow toggling on spinners whose minimum value is not zero.
-Allow toggling display of image, affines and grid.
-Add new variations: cylinder2, circlesplit, tile_log, truchet_fill, waves2_radial.
--Bug fixes
-cpow2 was wrong.
-Palettes with rapid changes in color would produce slightly different outputs from Apo/Chaotica. This was due to a long standing bug from flam3.
-Use exec() on Apple and show() on all other OSes for dialog boxes.
-Trying to render a sequence with no frames would crash.
-Selecting multiple xforms and rotating them would produce the wrong rotation.
-Better handling when parsing flames using different encoding, such as unicode and UTF-8.
-Switching between SP/DP didn't reselect the selected flame in the Library tab.
--Code changes
-Make all types concerning palettes be floats, including PaletteTableWidgetItem.
-PaletteTableWidgetItem is no longer templated because all palettes are float.
-Include the source colors for user created gradients.
-Change parallel_for() calls to work with very old versions of TBB which are lingering on some systems.
-Split conditional out of accumulation loop on the CPU for better performance.
-Vectorize summing when doing density filter for better performance.
-Make all usage of palettes be of type float, double is pointless.
-Allow palettes to reside in multiple folders, while ensuring only one of each name is added.
-Refactor some palette path searching code.
-Make ReadFile() throw and catch an exception if the file operation fails.
-A little extra safety in foci and foci3D with a call to Zeps().
-Cast to (real_t) in the OpenCL string for the w variation, which was having trouble compiling on Mac.
-Fixing missing comma between paths in InitPaletteList().
-Move Xml and PaletteList classes into cpp to shorten build times when working on them.
-Remove default param values for IterOpenCLKernelCreator<T>::SharedDataIndexDefines in cpp file.
-Change more NULL to nullptr.
2017-02-26 03:02:21 -05:00
06/04/2017
--User changes
-Make all fonts be MS Shell Dlg 2. This will require reloading dark.qss if users are already using it.
-Limit size of the left side of the palette editor.
-Disable create from image buttons in the palette editor when working on a fixed palette.
--Bug fixes
-The following variations were wrong: coshq, cothq.
-During iteration, the color index could become nan if all xform color speeds were negative. This could lead to bad results on the GPU. Fix to check for nan. Minimal speed difference.
--Code changes
-Make the following variations safer by using Zeps(): sinq, sinhq, secq, sechq, tanq, tanhq, cosq, coshq, cotq, cothq, cscq, cschq, estiq.
-Always pass -cl-no-signed-zeros -cl-denorms-are-zero to kernel compiles for both single and double.
-Flush all denormals to zero for all executable programs. This will likely lead to a speedup for badly behaving programs.
2017-06-04 20:37:29 -04:00
for ( auto & s : vec ) cout < < s < < endl ;
--User changes
-Add a palette editor.
-Add support for reading .ugr/.gradient/.gradients palette files.
-Allow toggling on spinners whose minimum value is not zero.
-Allow toggling display of image, affines and grid.
-Add new variations: cylinder2, circlesplit, tile_log, truchet_fill, waves2_radial.
--Bug fixes
-cpow2 was wrong.
-Palettes with rapid changes in color would produce slightly different outputs from Apo/Chaotica. This was due to a long standing bug from flam3.
-Use exec() on Apple and show() on all other OSes for dialog boxes.
-Trying to render a sequence with no frames would crash.
-Selecting multiple xforms and rotating them would produce the wrong rotation.
-Better handling when parsing flames using different encoding, such as unicode and UTF-8.
-Switching between SP/DP didn't reselect the selected flame in the Library tab.
--Code changes
-Make all types concerning palettes be floats, including PaletteTableWidgetItem.
-PaletteTableWidgetItem is no longer templated because all palettes are float.
-Include the source colors for user created gradients.
-Change parallel_for() calls to work with very old versions of TBB which are lingering on some systems.
-Split conditional out of accumulation loop on the CPU for better performance.
-Vectorize summing when doing density filter for better performance.
-Make all usage of palettes be of type float, double is pointless.
-Allow palettes to reside in multiple folders, while ensuring only one of each name is added.
-Refactor some palette path searching code.
-Make ReadFile() throw and catch an exception if the file operation fails.
-A little extra safety in foci and foci3D with a call to Zeps().
-Cast to (real_t) in the OpenCL string for the w variation, which was having trouble compiling on Mac.
-Fixing missing comma between paths in InitPaletteList().
-Move Xml and PaletteList classes into cpp to shorten build times when working on them.
-Remove default param values for IterOpenCLKernelCreator<T>::SharedDataIndexDefines in cpp file.
-Change more NULL to nullptr.
2017-02-26 03:02:21 -05:00
06/04/2017
--User changes
-Make all fonts be MS Shell Dlg 2. This will require reloading dark.qss if users are already using it.
-Limit size of the left side of the palette editor.
-Disable create from image buttons in the palette editor when working on a fixed palette.
--Bug fixes
-The following variations were wrong: coshq, cothq.
-During iteration, the color index could become nan if all xform color speeds were negative. This could lead to bad results on the GPU. Fix to check for nan. Minimal speed difference.
--Code changes
-Make the following variations safer by using Zeps(): sinq, sinhq, secq, sechq, tanq, tanhq, cosq, coshq, cotq, cothq, cscq, cschq, estiq.
-Always pass -cl-no-signed-zeros -cl-denorms-are-zero to kernel compiles for both single and double.
-Flush all denormals to zero for all executable programs. This will likely lead to a speedup for badly behaving programs.
2017-06-04 20:37:29 -04:00
line = " index=0 color=2177354 " , delim = " = " ;
vec = Split ( line , delim , true ) ;
for ( auto & s : vec ) cout < < s < < endl ;
--User changes
-Add a palette editor.
-Add support for reading .ugr/.gradient/.gradients palette files.
-Allow toggling on spinners whose minimum value is not zero.
-Allow toggling display of image, affines and grid.
-Add new variations: cylinder2, circlesplit, tile_log, truchet_fill, waves2_radial.
--Bug fixes
-cpow2 was wrong.
-Palettes with rapid changes in color would produce slightly different outputs from Apo/Chaotica. This was due to a long standing bug from flam3.
-Use exec() on Apple and show() on all other OSes for dialog boxes.
-Trying to render a sequence with no frames would crash.
-Selecting multiple xforms and rotating them would produce the wrong rotation.
-Better handling when parsing flames using different encoding, such as unicode and UTF-8.
-Switching between SP/DP didn't reselect the selected flame in the Library tab.
--Code changes
-Make all types concerning palettes be floats, including PaletteTableWidgetItem.
-PaletteTableWidgetItem is no longer templated because all palettes are float.
-Include the source colors for user created gradients.
-Change parallel_for() calls to work with very old versions of TBB which are lingering on some systems.
-Split conditional out of accumulation loop on the CPU for better performance.
-Vectorize summing when doing density filter for better performance.
-Make all usage of palettes be of type float, double is pointless.
-Allow palettes to reside in multiple folders, while ensuring only one of each name is added.
-Refactor some palette path searching code.
-Make ReadFile() throw and catch an exception if the file operation fails.
-A little extra safety in foci and foci3D with a call to Zeps().
-Cast to (real_t) in the OpenCL string for the w variation, which was having trouble compiling on Mac.
-Fixing missing comma between paths in InitPaletteList().
-Move Xml and PaletteList classes into cpp to shorten build times when working on them.
-Remove default param values for IterOpenCLKernelCreator<T>::SharedDataIndexDefines in cpp file.
-Change more NULL to nullptr.
2017-02-26 03:02:21 -05:00
EmberContainerTester < float > : : TestEmberContainer ( fv ) ;
EmberContainerTester < double > : : TestEmberContainer ( dv ) ;
EmberContainerTester < float > : : TestEmberContainer ( fl ) ;
EmberContainerTester < double > : : TestEmberContainer ( dl ) ;
CopyCont ( fv , fl ) ;
*/
2016-04-03 21:55:12 -04:00
//QTIsaac<ISAAC_SIZE, ISAAC_INT> rand(1, 2, 3);
//mt19937 meow(1729);
2016-02-12 00:38:21 -05:00
/* TestAffine<float>();
TestAffine < double > ( ) ; */
/* TestRotate<float>();
TestRotate < double > ( ) ;
return 1 ;
06/04/2017
--User changes
-Make all fonts be MS Shell Dlg 2. This will require reloading dark.qss if users are already using it.
-Limit size of the left side of the palette editor.
-Disable create from image buttons in the palette editor when working on a fixed palette.
--Bug fixes
-The following variations were wrong: coshq, cothq.
-During iteration, the color index could become nan if all xform color speeds were negative. This could lead to bad results on the GPU. Fix to check for nan. Minimal speed difference.
--Code changes
-Make the following variations safer by using Zeps(): sinq, sinhq, secq, sechq, tanq, tanhq, cosq, coshq, cotq, cothq, cscq, cschq, estiq.
-Always pass -cl-no-signed-zeros -cl-denorms-are-zero to kernel compiles for both single and double.
-Flush all denormals to zero for all executable programs. This will likely lead to a speedup for badly behaving programs.
2017-06-04 20:37:29 -04:00
*/
06/09/2017
--User changes
-dark.qss is now per-OS.
-Properly set/reload palette when coming from the palette editor. The latter must be done if they've modified the current palette even if they've clicked cancel.
--Bug fixes
-Make the following variations safer by using Zeps(): conic, bipolar, edisc, whorl, tan, csc, cot, tanh, sech, csch, coth, auger, bwraps, hypertile3d, hypertile3d1, ortho, poincare, rational3, barycentroid, sschecks, cscq, cschq, scry_3D, splitbrdr, hexcrop, nblur, crob.
-Fix bug enabling/disabling overwrite button in palette editor.
-Small optimization for gdoffs, use precalcAtanYX.
-Properly propagate z through circlesplit, cylinder2 and tile_log variations.
-Some values in truchet_fill could've been NaN.
--Code changes
-Make most installation files read only.
-Qualify many calls with std:: to ensure they're not colliding with glm::
-Use auto in more places.
2017-06-09 22:38:06 -04:00
//MakeTestAllVarsRegPrePostComboFile("testallvarsout.flame");
2018-09-15 06:11:12 -04:00
//cout << (10.0 / 2.0 * 5.0) << endl;
2018-09-18 23:49:38 -04:00
//FindFmaCandidates();
2018-09-15 06:11:12 -04:00
//FindFmaImplemented();
//cout << 5 * 3 + 2 << endl;
//cout << 2 + 5 * 3 << endl;
2018-09-18 23:49:38 -04:00
/* return 0;
2017-07-22 16:43:35 -04:00
TestThreadedKernel ( ) ;
2015-09-19 21:03:25 -04:00
2017-07-22 16:43:35 -04:00
auto palf = PaletteList < float > : : Instance ( ) ;
Palette < float > * pal = palf - > GetRandomPalette ( ) ;
2015-04-08 21:23:29 -04:00
2017-07-22 16:43:35 -04:00
cout < < pal - > Size ( ) < < endl ;
2015-04-08 21:23:29 -04:00
2017-07-22 16:43:35 -04:00
double d = 1 ;
2015-03-30 20:46:52 -04:00
2017-07-22 16:43:35 -04:00
for ( int i = 0 ; i < 10 ; i + + )
{
cout < < " log10( " < < d < < " ) = " < < std : : max < uint > ( 1u , uint ( std : : log10 ( d ) ) + 1u ) < < endl ;
d * = 10 ;
}
2015-03-30 20:46:52 -04:00
2017-07-22 16:43:35 -04:00
return 0 ; */
2015-04-08 21:23:29 -04:00
/*
2015-12-31 16:41:59 -05:00
uint i , iters = ( uint ) 10e7 ;
size_t total = 0 ;
2015-04-08 21:23:29 -04:00
2015-12-31 16:41:59 -05:00
t . Tic ( ) ;
for ( i = 0 ; i < iters ; i + + )
{
2015-04-08 21:23:29 -04:00
total + = rand . RandByte ( ) ;
total + = rand . Rand ( ) ;
2015-12-31 16:41:59 -05:00
}
t . Toc ( " Isaac sum " ) ;
2015-04-08 21:23:29 -04:00
2015-12-31 16:41:59 -05:00
cout < < " Isaac total = " < < total < < " for " < < i < < " iters. " < < endl ;
2015-04-08 21:23:29 -04:00
2015-12-31 16:41:59 -05:00
total = 0 ;
2015-04-08 21:23:29 -04:00
2015-12-31 16:41:59 -05:00
t . Tic ( ) ;
for ( i = 0 ; i < iters ; i + + )
{
2015-04-08 21:23:29 -04:00
total + = meow ( ) ;
2015-12-31 16:41:59 -05:00
}
t . Toc ( " Mt sum " ) ;
2015-04-08 21:23:29 -04:00
2015-12-31 16:41:59 -05:00
cout < < " Mt total = " < < total < < " for " < < i < < " iters. " < < endl ;
2015-04-08 21:23:29 -04:00
*/
2015-03-22 15:46:10 -04:00
//glm::vec2 solution, src[4];
//double bezT = 1, w[4];
//BezierPoints curvePoints[4];
//BezierWeights curveWeights[4];
//
//BezierSolve(bezT, src, w, solution);
2014-07-08 03:11:14 -04:00
//cout << pow(-1, 5.1) << endl;
2015-12-31 16:41:59 -05:00
/* for (i = 0; i < 2500000000; i++)
{
2016-01-12 23:42:12 -05:00
double d = std : : abs ( RandD ( rand ) ) ;
2014-07-26 20:26:15 -04:00
if ( d > = 0.5 )
cout < < d < < endl ;
2015-12-31 16:41:59 -05:00
}
2014-07-26 20:26:15 -04:00
2015-12-31 16:41:59 -05:00
return 0 ; */
2014-07-08 03:11:14 -04:00
//cout << "sizeof(Ember<float>): " << sizeof(Ember<float>) << endl;
//cout << "sizeof(Ember<double>): " << sizeof(Ember<double>) << endl;
//
//cout << "sizeof(Renderer<float>): " << sizeof(Renderer<float, float>) << endl;
//cout << "sizeof(Renderer<double>): " << sizeof(Renderer<double, double>) << endl;
//
//cout << "sizeof(RendererCL<float>): " << sizeof(RendererCL<float>) << endl;
//cout << "sizeof(RendererCL<double>): " << sizeof(RendererCL<double>) << endl;
2015-12-31 16:41:59 -05:00
/* unique_ptr<LinearVariation<float>> linV(new LinearVariation<float>());
unique_ptr < PreLinearVariation < float > > preLinV ( new PreLinearVariation < float > ( ) ) ;
unique_ptr < PostLinearVariation < float > > postLinV ( new PostLinearVariation < float > ( ) ) ;
2014-07-08 03:11:14 -04:00
2015-12-31 16:41:59 -05:00
cout < < linV - > BaseName ( ) < < endl ;
cout < < preLinV - > BaseName ( ) < < endl ;
cout < < postLinV - > BaseName ( ) < < endl ; */
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
//float num = 1;
//float denom = 4294967296.0f;
//float frac = num / denom;
//
//cout << "num, denom, frac = " << num << ", " << denom << ", " << frac << endl;
//TestGpuVectorRead<double>();
//TestGpuVectorRead<float>();
//return 0;
2014-10-18 17:07:07 -04:00
//unique_ptr<PreFarblurVariation<float>> preFarblurV(new PreFarblurVariation<float>());
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
//size_t vsize = 1024 * 1024;
//
//t.Tic();
//TestRandomAccess<float>(vsize, 10, true);
//t.Toc("TestRandomAccess<float>(true)");
//
//t.Tic();
//TestRandomAccess<float>(vsize, 10, false);
//t.Toc("TestRandomAccess<float>(false)");
//
//t.Tic();
//TestRandomAccess<double>(vsize, 10, true);
//t.Toc("TestRandomAccess<double>(true)");
//
//t.Tic();
//TestRandomAccess<double>(vsize, 10, false);
//t.Toc("TestRandomAccess<double>(false)");
//TestCross<double>(rand.Frand<double>(-5, 5), rand.Frand<double>(-5, 5), rand.Frand<double>(-5, 5));
//TestCross<double>(rand.Frand<double>(-5, 5), rand.Frand<double>(-5, 5), rand.Frand<double>(-5, 5));
//TestCross<double>(rand.Frand<double>(-5, 5), rand.Frand<double>(-5, 5), rand.Frand<double>(-5, 5));
//TestCross<double>(rand.Frand<double>(-5, 5), rand.Frand<double>(-5, 5), rand.Frand<double>(-5, 5));
//TestCross<double>(rand.Frand<double>(-5, 5), rand.Frand<double>(-5, 5), rand.Frand<double>(-5, 5));
2014-07-08 03:11:14 -04:00
//std::complex<double> cd, cd2;
//cd2 = sin(cd);
--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.
2015-11-22 17:15:07 -05:00
t . Tic ( ) ;
2015-03-22 15:46:10 -04:00
TestCasting ( ) ;
t . Toc ( " TestCasting() " ) ;
2015-03-30 20:46:52 -04:00
t . Tic ( ) ;
2016-04-13 23:59:57 -04:00
auto vlf ( VariationList < float > : : Instance ( ) ) ;
2014-07-08 03:11:14 -04:00
t . Toc ( " Creating VariationList<float> " ) ;
2016-04-13 23:59:57 -04:00
cout < < " There are " < < vlf - > Size ( ) < < " variations present. " < < endl ;
2014-07-08 03:11:14 -04:00
# ifdef DO_DOUBLE
t . Tic ( ) ;
2016-04-13 23:59:57 -04:00
auto vld ( VariationList < double > : : Instance ( ) ) ;
2014-07-08 03:11:14 -04:00
t . Toc ( " Creating VariationList<double> " ) ;
# endif
t . Tic ( ) ;
TestVarCounts ( ) ;
t . Toc ( " TestVarCounts() " ) ;
t . Tic ( ) ;
TestVarUnique < float > ( ) ;
t . Toc ( " TestVarUnique<float>() " ) ;
# ifdef DO_DOUBLE
t . Tic ( ) ;
TestVarUnique < double > ( ) ;
t . Toc ( " TestVarUnique<double>() " ) ;
# endif
t . Tic ( ) ;
TestVarCopy < float , float > ( ) ;
t . Toc ( " TestVarCopy<float, float>() " ) ;
# ifdef DO_DOUBLE
t . Tic ( ) ;
TestVarCopy < double , double > ( ) ;
t . Toc ( " TestVarCopy<double, double>() " ) ;
t . Tic ( ) ;
TestVarCopy < float , double > ( ) ;
t . Toc ( " TestVarCopy<float, double>() " ) ;
t . Tic ( ) ;
TestVarCopy < double , float > ( ) ;
t . Toc ( " TestVarCopy<double, float>() " ) ;
# endif
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
t . Tic ( ) ;
TestVarRegPrePost ( ) ;
t . Toc ( " TestVarRegPrePost() " ) ;
t . Tic ( ) ;
TestParVars ( ) ;
t . Toc ( " TestParVars() " ) ;
t . Tic ( ) ;
TestVarPrePostNames ( ) ;
t . Toc ( " TestVarPrePostNames() " ) ;
t . Tic ( ) ;
TestVarPrecalcUsedCL ( ) ;
t . Toc ( " TestVarPrecalcUsedCL() " ) ;
t . Tic ( ) ;
TestVarAssignTypes ( ) ;
t . Toc ( " TestVarAssignTypes() " ) ;
t . Tic ( ) ;
TestVarAssignVals ( ) ;
t . Toc ( " TestVarAssignVals() " ) ;
2014-08-03 19:16:10 -04:00
t . Tic ( ) ;
TestZepsFloor ( ) ;
t . Toc ( " TestZepsFloor() " ) ;
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
t . Tic ( ) ;
TestConstants ( ) ;
t . Toc ( " TestConstants() " ) ;
t . Tic ( ) ;
--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.
2015-11-22 17:15:07 -05:00
TestGlobalFuncs ( ) ;
t . Toc ( " TestGlobalFuncs() " ) ;
2015-12-31 16:41:59 -05:00
/* t.Tic();
TestXformsInOutPoints ( ) ;
t . Toc ( " TestXformsInOutPoints() " ) ;
--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.
2015-11-22 17:15:07 -05:00
2015-12-31 16:41:59 -05:00
t . Tic ( ) ;
TestVarTime < float > ( ) ;
t . Toc ( " TestVarTime() " ) ;
*/
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
t . Tic ( ) ;
TestOperations < float > ( ) ;
t . Toc ( " TestOperations() " ) ;
2014-07-08 03:11:14 -04:00
//t.Tic();
//TestVarsSimilar<float>();
//t.Toc("TestVarsSimilar()");
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
# ifdef TEST_CL
//t.Tic();
//TestCpuGpuResults<float>();
//t.Toc("TestCpuGpuResults<float>()");
2018-09-22 01:42:18 -04:00
//t.Tic();
//b = TestAllVarsCLBuild<float>(0, 0, true);
//t.Toc("TestAllVarsCLBuild<float>()");
--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.
2015-11-22 17:15:07 -05:00
if ( b )
{
2016-01-17 19:10:06 -05:00
# ifdef DO_NVIDIA
--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.
2015-11-22 17:15:07 -05:00
t . Tic ( ) ;
b = TestAllVarsCLBuild < float > ( 1 , 0 , true ) ;
t . Toc ( " TestAllVarsCLBuild<float>() " ) ;
2016-01-17 19:10:06 -05:00
# endif
--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.
2015-11-22 17:15:07 -05:00
}
2015-03-22 15:46:10 -04:00
2017-06-11 18:02:44 -04:00
# ifdef DO_DOUBLE
//t.Tic();
//TestCpuGpuResults<double>();
//t.Toc("TestCpuGpuResults<double>()");
if ( b )
{
2018-09-22 01:42:18 -04:00
//t.Tic();
//b = TestAllVarsCLBuild<double>(0, 0, true);
//t.Toc("TestAllVarsCLBuild<double>()");
2017-06-11 18:02:44 -04:00
if ( b )
{
# ifdef DO_NVIDIA
t . Tic ( ) ;
TestAllVarsCLBuild < double > ( 1 , 0 , true ) ;
t . Toc ( " TestAllVarsCLBuild<double>() " ) ;
# endif
}
}
# endif
2014-07-08 03:11:14 -04:00
# endif
//PrintAllVars();
//_CrtDumpMemoryLeaks();
return 0 ;
}