2014-07-08 03:11:14 -04:00
# pragma once
# include "Variation.h"
namespace EmberNs
{
/// <summary>
/// Linear:
/// nx = tx;
/// ny = ty;
/// p[0] += weight * nx;
/// p[1] += weight * ny;
/// </summary>
template < typename T >
class EMBER_API LinearVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
LinearVariation ( T weight = 1.0 ) : Variation < T > ( " linear " , eVariationId : : VAR_LINEAR , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( LinearVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
helper . Out . x = m_Weight * helper . In . x ;
helper . Out . y = m_Weight * helper . In . y ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
2016-01-04 19:50:15 -05:00
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.x; \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.y; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
2014-07-08 03:11:14 -04:00
return ss . str ( ) ;
}
} ;
/// <summary>
/// Sinusoidal:
/// nx = sin(tx);
/// ny = sin(ty);
/// p[0] += weight * nx;
/// p[1] += weight * ny;
/// </summary>
template < typename T >
class EMBER_API SinusoidalVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
SinusoidalVariation ( T weight = 1.0 ) : Variation < T > ( " sinusoidal " , eVariationId : : VAR_SINUSOIDAL , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( SinusoidalVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
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
helper . Out . x = m_Weight * std : : sin ( helper . In . x ) ;
helper . Out . y = m_Weight * std : : sin ( helper . In . 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
helper . Out . z = m_Weight * helper . In . z ;
2014-07-08 03:11:14 -04:00
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * sin(vIn.x); \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * sin(vIn.y); \n "
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 \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
2014-07-08 03:11:14 -04:00
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Spherical:
/// T r2 = tx * tx + ty * ty + 1e-6;
/// nx = tx / r2;
/// ny = ty / r2;
/// p[0] += weight * nx;
/// p[1] += weight * ny;
/// </summary>
template < class T >
class EMBER_API SphericalVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
SphericalVariation ( T weight = 1.0 ) : Variation < T > ( " spherical " , eVariationId : : VAR_SPHERICAL , weight , true ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( SphericalVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04: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
T r2 = m_Weight / Zeps ( helper . m_PrecalcSumSquares ) ;
2014-07-08 03:11:14 -04:00
helper . Out . x = r2 * helper . In . x ;
helper . Out . y = r2 * helper . In . 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
helper . Out . z = m_Weight * helper . In . z ;
2014-07-08 03:11:14 -04:00
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
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 \t real_t r2 = xform->m_VariationWeights[ " < < varIndex < < " ] / Zeps(precalcSumSquares); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = r2 * vIn.x; \n "
< < " \t \t vOut.y = r2 * vIn.y; \n "
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 \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
2014-07-08 03:11:14 -04:00
< < " \t } \n " ;
return ss . str ( ) ;
}
--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
virtual vector < string > OpenCLGlobalFuncNames ( ) const override
{
return vector < string > { " Zeps " } ;
}
2014-07-08 03:11:14 -04:00
} ;
/// <summary>
/// Swirl:
/// double r2 = tx * tx + ty * ty;
/// double c1 = sin(r2);
/// double c2 = cos(r2);
/// nx = c1 * tx - c2 * ty;
/// ny = c2 * tx + c1 * ty;
/// p[0] += weight * nx;
/// p[1] += weight * ny;
/// </summary>
template < typename T >
class EMBER_API SwirlVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
SwirlVariation ( T weight = 1.0 ) : Variation < T > ( " swirl " , eVariationId : : VAR_SWIRL , weight , true ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( SwirlVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T c1 , c2 ;
sincos ( helper . m_PrecalcSumSquares , & c1 , & c2 ) ;
helper . Out . x = m_Weight * ( c1 * helper . In . x - c2 * helper . In . y ) ;
helper . Out . y = m_Weight * ( c2 * helper . In . x + c1 * helper . In . y ) ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t c1 = sin(precalcSumSquares); \n "
< < " \t \t real_t c2 = cos(precalcSumSquares); \n "
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * (c1 * vIn.x - c2 * vIn.y); \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * (c2 * vIn.x + c1 * vIn.y); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Horseshoe:
/// a = atan2(tx, ty);
/// c1 = sin(a);
/// c2 = cos(a);
/// nx = c1 * tx - c2 * ty;
/// ny = c2 * tx + c1 * ty;
/// p[0] += weight * nx;
/// p[1] += weight * ny;
/// </summary>
template < typename T >
class EMBER_API HorseshoeVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
HorseshoeVariation ( T weight = 1.0 ) : Variation < T > ( " horseshoe " , eVariationId : : VAR_HORSESHOE , weight , true , true ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( HorseshoeVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04: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
T r = m_Weight / Zeps ( helper . m_PrecalcSqrtSumSquares ) ;
2014-07-08 03:11:14 -04:00
helper . Out . x = ( helper . In . x - helper . In . y ) * ( helper . In . x + helper . In . y ) * r ;
helper . Out . y = 2 * helper . In . x * helper . In . y * r ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
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 \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] / Zeps(precalcSqrtSumSquares); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = (vIn.x - vIn.y) * (vIn.x + vIn.y) * r; \n "
2015-02-26 16:18:55 -05:00
< < " \t \t vOut.y = (real_t)(2.0) * vIn.x * vIn.y * r; \n "
2014-07-08 03:11:14 -04:00
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
--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
virtual vector < string > OpenCLGlobalFuncNames ( ) const override
{
return vector < string > { " Zeps " } ;
}
2014-07-08 03:11:14 -04:00
} ;
/// <summary>
/// Polar:
/// nx = atan2(tx, ty) / M_PI;
2015-04-13 07:32:58 -04:00
/// ny = std::sqrt(tx * tx + ty * ty) - 1.0;
2014-07-08 03:11:14 -04:00
/// p[0] += weight * nx;
/// p[1] += weight * ny;
/// </summary>
template < typename T >
class EMBER_API PolarVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
PolarVariation ( T weight = 1.0 ) : Variation < T > ( " polar " , eVariationId : : VAR_POLAR , weight , true , true , false , true , false ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( PolarVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04: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
helper . Out . x = m_Weight * ( helper . m_PrecalcAtanxy * T ( M_1_PI ) ) ;
helper . Out . y = m_Weight * ( helper . m_PrecalcSqrtSumSquares - 1 ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
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 \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * (precalcAtanxy * M_1_PI); \n "
2015-02-26 16:18:55 -05:00
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * (precalcSqrtSumSquares - (real_t)(1.0)); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Handkerchief:
/// a = atan2(tx, ty);
2015-04-13 07:32:58 -04:00
/// r = std::sqrt(tx * tx + ty * ty);
2014-07-08 03:11:14 -04:00
/// p[0] += weight * sin(a + r) * r;
/// p[1] += weight * cos(a - r) * r;
/// </summary>
template < typename T >
class EMBER_API HandkerchiefVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
HandkerchiefVariation ( T weight = 1.0 ) : Variation < T > ( " handkerchief " , eVariationId : : VAR_HANDKERCHIEF , weight , true , true , false , true ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( HandkerchiefVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
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
helper . Out . x = m_Weight * helper . m_PrecalcSqrtSumSquares * std : : sin ( helper . m_PrecalcAtanxy + helper . m_PrecalcSqrtSumSquares ) ;
helper . Out . y = m_Weight * helper . m_PrecalcSqrtSumSquares * std : : cos ( helper . m_PrecalcAtanxy - helper . m_PrecalcSqrtSumSquares ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * precalcSqrtSumSquares * sin(precalcAtanxy + precalcSqrtSumSquares); \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * precalcSqrtSumSquares * cos(precalcAtanxy - precalcSqrtSumSquares); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Heart:
/// a = atan2(tx, ty);
2015-04-13 07:32:58 -04:00
/// r = std::sqrt(tx * tx + ty * ty);
2014-07-08 03:11:14 -04:00
/// a *= r;
/// p[0] += weight * sin(a) * r;
/// p[1] += weight * cos(a) * -r;
/// </summary>
template < typename T >
class EMBER_API HeartVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
HeartVariation ( T weight = 1.0 ) : Variation < T > ( " heart " , eVariationId : : VAR_HEART , weight , true , true , false , true ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( HeartVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T a = helper . m_PrecalcSqrtSumSquares * helper . m_PrecalcAtanxy ;
T r = m_Weight * helper . m_PrecalcSqrtSumSquares ;
--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
helper . Out . x = r * std : : sin ( a ) ;
helper . Out . y = ( - r ) * std : : cos ( a ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t a = precalcSqrtSumSquares * precalcAtanxy; \n "
< < " \t \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] * precalcSqrtSumSquares; \n "
< < " \n "
< < " \t \t vOut.x = r * sin(a); \n "
< < " \t \t vOut.y = (-r) * cos(a); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Disc:
/// nx = tx * M_PI;
/// ny = ty * M_PI;
/// a = atan2(nx, ny);
2015-04-13 07:32:58 -04:00
/// r = std::sqrt(nx * nx + ny * ny);
2014-07-08 03:11:14 -04:00
/// p[0] += weight * sin(r) * a / M_PI;
/// p[1] += weight * cos(r) * a / M_PI;
/// </summary>
template < typename T >
class EMBER_API DiscVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
DiscVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " disc " , eVariationId : : VAR_DISC , weight , true , true , false , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( DiscVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T val = T ( M_PI ) * helper . m_PrecalcSqrtSumSquares ;
T r = m_WeightByPI * helper . m_PrecalcAtanxy ;
--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
helper . Out . x = std : : sin ( val ) * r ;
helper . Out . y = std : : cos ( val ) * r ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string weightByPI = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ; //Precalcs only, no params.
ss < < " \t { \n "
< < " \t \t real_t val = M_PI * precalcSqrtSumSquares; \n "
< < " \t \t real_t r = " < < weightByPI < < " * precalcAtanxy; \n "
< < " \n "
< < " \t \t vOut.x = sin(val) * r; \n "
< < " \t \t vOut.y = cos(val) * r; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04:00
{
m_WeightByPI = m_Weight * T ( M_1_PI ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_WeightByPI , prefix + " disc_weight_by_pi " ) ) ; //Precalcs only, no params.
}
private :
T m_WeightByPI ; //Precalcs only, no params.
} ;
/// <summary>
/// Spiral:
/// a = atan2(tx, ty);
2015-04-13 07:32:58 -04:00
/// r = std::sqrt(tx * tx + ty * ty) + 1e-6;
2014-07-08 03:11:14 -04:00
/// p[0] += weight * (cos(a) + sin(r)) / r;
/// p[1] += weight * (sin(a) - cos(r)) / r;
/// </summary>
template < typename T >
class EMBER_API SpiralVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
SpiralVariation ( T weight = 1.0 ) : Variation < T > ( " spiral " , eVariationId : : VAR_SPIRAL , weight , true , true , true ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( SpiralVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04: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
T r = Zeps ( helper . m_PrecalcSqrtSumSquares ) ;
2014-07-08 03:11:14 -04:00
T r1 = m_Weight / r ;
--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
helper . Out . x = r1 * ( helper . m_PrecalcCosa + std : : sin ( r ) ) ;
helper . Out . y = r1 * ( helper . m_PrecalcSina - std : : cos ( r ) ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
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 \t real_t r = Zeps(precalcSqrtSumSquares); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t real_t r1 = xform->m_VariationWeights[ " < < varIndex < < " ] / r; \n "
< < " \n "
< < " \t \t vOut.x = r1 * (precalcCosa + sin(r)); \n "
< < " \t \t vOut.y = r1 * (precalcSina - cos(r)); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
--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
virtual vector < string > OpenCLGlobalFuncNames ( ) const override
{
return vector < string > { " Zeps " } ;
}
2014-07-08 03:11:14 -04:00
} ;
/// <summary>
/// Hyperbolic:
/// a = atan2(tx, ty);
2015-04-13 07:32:58 -04:00
/// r = std::sqrt(tx * tx + ty * ty) + 1e-6;
2014-07-08 03:11:14 -04:00
/// p[0] += weight * sin(a) / r;
/// p[1] += weight * cos(a) * r;
/// </summary>
template < typename T >
class EMBER_API HyperbolicVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
HyperbolicVariation ( T weight = 1.0 ) : Variation < T > ( " hyperbolic " , eVariationId : : VAR_HYPERBOLIC , weight , true , true , true ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( HyperbolicVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04: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
T r = Zeps ( helper . m_PrecalcSqrtSumSquares ) ;
2014-07-08 03:11:14 -04:00
helper . Out . x = m_Weight * helper . m_PrecalcSina / r ;
helper . Out . y = m_Weight * helper . m_PrecalcCosa * r ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
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 \t real_t r = Zeps(precalcSqrtSumSquares); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * precalcSina / r; \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * precalcCosa * r; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
--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
virtual vector < string > OpenCLGlobalFuncNames ( ) const override
{
return vector < string > { " Zeps " } ;
}
2014-07-08 03:11:14 -04:00
} ;
/// <summary>
/// Diamond:
/// a = atan2(tx, ty);
2015-04-13 07:32:58 -04:00
/// r = std::sqrt(tx * tx + ty * ty);
2014-07-08 03:11:14 -04:00
/// p[0] += weight * sin(a) * cos(r);
/// p[1] += weight * cos(a) * sin(r);
/// </summary>
template < typename T >
class EMBER_API DiamondVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
DiamondVariation ( T weight = 1.0 ) : Variation < T > ( " diamond " , eVariationId : : VAR_DIAMOND , weight , true , true , true ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( DiamondVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
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
helper . Out . x = m_Weight * helper . m_PrecalcSina * std : : cos ( helper . m_PrecalcSqrtSumSquares ) ;
helper . Out . y = m_Weight * helper . m_PrecalcCosa * std : : sin ( helper . m_PrecalcSqrtSumSquares ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * precalcSina * cos(precalcSqrtSumSquares); \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * precalcCosa * sin(precalcSqrtSumSquares); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Ex:
/// a = atan2(tx, ty);
2015-04-13 07:32:58 -04:00
/// r = std::sqrt(tx * tx + ty * ty);
2014-07-08 03:11:14 -04:00
/// n0 = sin(a + r);
/// n1 = cos(a - r);
/// m0 = n0 * n0 * n0 * r;
/// m1 = n1 * n1 * n1 * r;
/// p[0] += weight * (m0 + m1);
/// p[1] += weight * (m0 - m1);
/// </summary>
template < typename T >
class EMBER_API ExVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
ExVariation ( T weight = 1.0 ) : Variation < T > ( " ex " , eVariationId : : VAR_EX , weight , true , true , false , true ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( ExVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T a = helper . m_PrecalcAtanxy ;
T r = helper . m_PrecalcSqrtSumSquares ;
--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 n0 = std : : sin ( a + r ) ;
T n1 = std : : cos ( a - r ) ;
2014-07-08 03:11:14 -04:00
T m0 = n0 * n0 * n0 * r ;
T m1 = n1 * n1 * n1 * r ;
helper . Out . x = m_Weight * ( m0 + m1 ) ;
helper . Out . y = m_Weight * ( m0 - m1 ) ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t a = precalcAtanxy; \n "
< < " \t \t real_t r = precalcSqrtSumSquares; \n "
< < " \t \t real_t n0 = sin(a + r); \n "
< < " \t \t real_t n1 = cos(a - r); \n "
< < " \t \t real_t m0 = n0 * n0 * n0 * r; \n "
< < " \t \t real_t m1 = n1 * n1 * n1 * r; \n "
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * (m0 + m1); \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * (m0 - m1); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Julia:
/// a = atan2(tx, ty)/2.0;
/// if (random bit()) a += M_PI;
/// r = pow(tx*tx + ty*ty, 0.25);
/// nx = r * cos(a);
/// ny = r * sin(a);
/// p[0] += v * nx;
/// p[1] += v * ny;
/// </summary>
template < typename T >
class EMBER_API JuliaVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
JuliaVariation ( T weight = 1.0 ) : Variation < T > ( " julia " , eVariationId : : VAR_JULIA , weight , true , true , false , true ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( JuliaVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
2015-04-13 07:32:58 -04:00
T r = m_Weight * std : : sqrt ( helper . m_PrecalcSqrtSumSquares ) ;
2014-07-08 03:11:14 -04:00
T a = T ( 0.5 ) * helper . m_PrecalcAtanxy ;
if ( rand . RandBit ( ) )
a + = T ( M_PI ) ;
--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
helper . Out . x = r * std : : cos ( a ) ;
helper . Out . y = r * std : : sin ( a ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] * sqrt(precalcSqrtSumSquares); \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t a = (real_t)(0.5) * precalcAtanxy; \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t if (MwcNext(mwc) & 1) \n "
< < " \t \t a += M_PI; \n "
< < " \n "
< < " \t \t vOut.x = r * cos(a); \n "
< < " \t \t vOut.y = r * sin(a); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Bent:
/// nx = tx;
/// ny = ty;
/// if (nx < 0.0) nx = nx * 2.0;
/// if (ny < 0.0) ny = ny / 2.0;
/// p[0] += weight * nx;
/// p[1] += weight * ny;
/// </summary>
template < typename T >
class EMBER_API BentVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
BentVariation ( T weight = 1.0 ) : Variation < T > ( " bent " , eVariationId : : VAR_BENT , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( BentVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T nx = helper . In . x < T ( 0.0 ) ? helper . In . x * 2 : helper . In . x ;
T ny = helper . In . y < T ( 0.0 ) ? helper . In . y / 2 : helper . In . y ;
helper . Out . x = m_Weight * nx ;
helper . Out . y = m_Weight * ny ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t nx = vIn.x < (real_t)(0.0) ? (vIn.x * (real_t)(2.0)) : vIn.x; \n "
< < " \t \t real_t ny = vIn.y < (real_t)(0.0) ? (vIn.y / (real_t)(2.0)) : vIn.y; \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * nx; \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * ny; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Waves:
/// dx = coef[2][0];
/// dy = coef[2][1];
/// nx = tx + coef[1][0] * sin(ty / ((dx * dx) + EPS));
/// ny = ty + coef[1][1] * sin(tx / ((dy * dy) + EPS));
/// p[0] += weight * nx;
/// p[1] += weight * ny;
/// Special case here, use parametric for precalcs, but no regular params.
/// </summary>
template < typename T >
class EMBER_API WavesVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
WavesVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " waves " , eVariationId : : VAR_WAVES , weight )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( WavesVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T c10 = m_Xform - > m_Affine . B ( ) ;
T c11 = m_Xform - > m_Affine . E ( ) ;
--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 nx = helper . In . x + c10 * std : : sin ( helper . In . y * m_Dx2 ) ;
T ny = helper . In . y + c11 * std : : sin ( helper . In . x * m_Dy2 ) ;
2014-07-08 03:11:14 -04:00
helper . Out . x = m_Weight * nx ;
helper . Out . y = m_Weight * ny ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string dx2 = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ; //Precalcs only, no params.
string dy2 = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t real_t c10 = xform->m_B; \n "
< < " \t \t real_t c11 = xform->m_E; \n "
< < " \t \t real_t nx = vIn.x + c10 * sin(vIn.y * " < < dx2 < < " ); \n "
< < " \t \t real_t ny = vIn.y + c11 * sin(vIn.x * " < < dy2 < < " ); \n "
< < " \n "
< < " \t \t vOut.x = (xform->m_VariationWeights[ " < < varIndex < < " ] * nx); \n "
< < " \t \t vOut.y = (xform->m_VariationWeights[ " < < varIndex < < " ] * ny); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04:00
{
2014-09-10 01:41:26 -04:00
if ( m_Xform ) //If this variation exists by itself and hasn't been added to an xform yet, m_Xform will be nullptr.
2014-07-08 03:11:14 -04:00
{
T dx = m_Xform - > m_Affine . C ( ) ;
T dy = m_Xform - > m_Affine . F ( ) ;
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
m_Dx2 = 1 / Zeps ( dx * dx ) ;
m_Dy2 = 1 / Zeps ( dy * dy ) ;
2014-07-08 03:11:14 -04:00
}
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_Dx2 , prefix + " waves_dx2 " ) ) ; //Precalcs only, no params.
m_Params . push_back ( ParamWithName < T > ( true , & m_Dy2 , prefix + " waves_dy2 " ) ) ;
}
private :
T m_Dx2 ; //Precalcs only, no params.
T m_Dy2 ;
} ;
/// <summary>
/// Fisheye:
/// a = atan2(tx, ty);
2015-04-13 07:32:58 -04:00
/// r = std::sqrt(tx * tx + ty * ty);
2014-07-08 03:11:14 -04:00
/// r = 2 * r / (r + 1);
/// nx = r * cos(a);
/// ny = r * sin(a);
/// p[0] += weight * nx;
2014-09-01 00:25:15 -04:00
/// p[1] += weight * ny;
2014-07-08 03:11:14 -04:00
/// </summary>
template < typename T >
class EMBER_API FisheyeVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
FisheyeVariation ( T weight = 1.0 ) : Variation < T > ( " fisheye " , eVariationId : : VAR_FISHEYE , weight , true , true ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( FisheyeVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T r = 2 * m_Weight / ( helper . m_PrecalcSqrtSumSquares + 1 ) ;
helper . Out . x = r * helper . In . y ;
helper . Out . y = r * helper . In . x ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t r = 2 * xform->m_VariationWeights[ " < < varIndex < < " ] / (precalcSqrtSumSquares + 1); \n "
< < " \n "
< < " \t \t vOut.x = r * vIn.y; \n "
< < " \t \t vOut.y = r * vIn.x; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Popcorn:
/// dx = tan(3 * ty);
/// dy = tan(3 * tx);
/// nx = tx + coef[2][0] * sin(dx);
/// ny = ty + coef[2][1] * sin(dy);
/// p[0] += weight * nx;
/// p[1] += weight * ny;
/// </summary>
template < typename T >
class EMBER_API PopcornVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
PopcornVariation ( T weight = 1.0 ) : Variation < T > ( " popcorn " , eVariationId : : VAR_POPCORN , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( PopcornVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
2014-09-08 00:05:27 -04:00
T dx = SafeTan < T > ( 3 * helper . In . y ) ;
T dy = SafeTan < T > ( 3 * helper . In . x ) ;
--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 nx = helper . In . x + m_Xform - > m_Affine . C ( ) * std : : sin ( dx ) ;
T ny = helper . In . y + m_Xform - > m_Affine . F ( ) * std : : sin ( dy ) ;
2014-07-08 03:11:14 -04:00
helper . Out . x = m_Weight * nx ;
helper . Out . y = m_Weight * ny ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t dx = tan(3 * vIn.y); \n "
< < " \t \t real_t dy = tan(3 * vIn.x); \n "
< < " \t \t real_t nx = vIn.x + xform->m_C * sin(dx); \n "
< < " \t \t real_t ny = vIn.y + xform->m_F * sin(dy); \n "
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * nx; \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * ny; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Exponential:
/// dx = exp(tx - 1.0);
/// dy = M_PI * ty;
/// nx = cos(dy) * dx;
/// ny = sin(dy) * dx;
/// p[0] += weight * nx;
/// p[1] += weight * ny;
/// </summary>
template < typename T >
class EMBER_API ExponentialVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
ExponentialVariation ( T weight = 1.0 ) : Variation < T > ( " exponential " , eVariationId : : VAR_EXPONENTIAL , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( ExponentialVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
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
T dx = m_Weight * std : : exp ( helper . In . x - 1 ) ;
2014-07-08 03:11:14 -04:00
T dy = T ( M_PI ) * helper . In . y ;
--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
helper . Out . x = dx * std : : cos ( dy ) ;
helper . Out . y = dx * std : : sin ( dy ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t dx = xform->m_VariationWeights[ " < < varIndex < < " ] * exp(vIn.x - (real_t)(1.0)); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t real_t dy = M_PI * vIn.y; \n "
< < " \n "
< < " \t \t vOut.x = dx * cos(dy); \n "
< < " \t \t vOut.y = dx * sin(dy); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Power:
/// a = atan2(tx, ty);
/// sa = sin(a);
2015-04-13 07:32:58 -04:00
/// r = std::sqrt(tx * tx + ty * ty);
2014-07-08 03:11:14 -04:00
/// r = pow(r, sa);
/// nx = r * precalc_cosa;
/// ny = r * sa;
/// p[0] += weight * nx;
/// p[1] += weight * ny;
/// </summary>
template < typename T >
class EMBER_API PowerVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
PowerVariation ( T weight = 1.0 ) : Variation < T > ( " power " , eVariationId : : VAR_POWER , weight , true , true , true ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( PowerVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
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
T r = m_Weight * std : : pow ( helper . m_PrecalcSqrtSumSquares , helper . m_PrecalcSina ) ;
2014-07-08 03:11:14 -04:00
helper . Out . x = r * helper . m_PrecalcCosa ;
helper . Out . y = r * helper . m_PrecalcSina ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] * pow(precalcSqrtSumSquares, precalcSina); \n "
< < " \n "
< < " \t \t vOut.x = r * precalcCosa; \n "
< < " \t \t vOut.y = r * precalcSina; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Cosine:
/// nx = cos(tx * M_PI) * cosh(ty);
/// ny = -sin(tx * M_PI) * sinh(ty);
/// p[0] += weight * nx;
/// p[1] += weight * ny;
/// </summary>
template < typename T >
class EMBER_API CosineVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
CosineVariation ( T weight = 1.0 ) : Variation < T > ( " cosine " , eVariationId : : VAR_COSINE , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( CosineVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T a = helper . In . x * T ( M_PI ) ;
--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 nx = std : : cos ( a ) * std : : cosh ( helper . In . y ) ;
T ny = - std : : sin ( a ) * std : : sinh ( helper . In . y ) ;
2014-07-08 03:11:14 -04:00
helper . Out . x = m_Weight * nx ;
helper . Out . y = m_Weight * ny ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t a = vIn.x * M_PI; \n "
< < " \t \t real_t nx = cos(a) * cosh(vIn.y); \n "
< < " \t \t real_t ny = -sin(a) * sinh(vIn.y); \n "
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * nx; \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * ny; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Rings:
/// dx = coef[2][0];
/// dx = dx * dx + EPS;
2015-04-13 07:32:58 -04:00
/// r = std::sqrt(tx * tx + ty * ty);
2014-07-08 03:11:14 -04:00
/// r = fmod(r + dx, 2 * dx) - dx + r * (1 - dx);
/// a = atan2(tx, ty);
/// nx = cos(a) * r;
/// ny = sin(a) * r;
/// p[0] += weight * nx;
/// p[1] += weight * ny;
/// </summary>
template < typename T >
class EMBER_API RingsVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
RingsVariation ( T weight = 1.0 ) : Variation < T > ( " rings " , eVariationId : : VAR_RINGS , weight , true , true , true ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( RingsVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04: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
T dx = Zeps ( m_Xform - > m_Affine . C ( ) * m_Xform - > m_Affine . C ( ) ) ;
2014-07-08 03:11:14 -04:00
T r = helper . m_PrecalcSqrtSumSquares ;
r = m_Weight * ( fmod ( r + dx , 2 * dx ) - dx + r * ( 1 - dx ) ) ;
helper . Out . x = r * helper . m_PrecalcCosa ;
helper . Out . y = r * helper . m_PrecalcSina ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
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 \t real_t dx = Zeps(xform->m_C * xform->m_C); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t real_t r = precalcSqrtSumSquares; \n "
< < " \n "
< < " \t \t r = xform->m_VariationWeights[ " < < varIndex < < " ] * (fmod(r + dx, 2 * dx) - dx + r * (1 - dx)); \n "
< < " \t \t vOut.x = r * precalcCosa; \n "
< < " \t \t vOut.y = r * precalcSina; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
--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
virtual vector < string > OpenCLGlobalFuncNames ( ) const override
{
return vector < string > { " Zeps " } ;
}
2014-07-08 03:11:14 -04:00
} ;
/// <summary>
/// Fan:
/// dx = coef[2][0];
/// dy = coef[2][1];
/// dx = M_PI * (dx * dx + EPS);
/// dx2 = dx / 2;
/// a = atan(tx, ty);
2015-04-13 07:32:58 -04:00
/// r = std::sqrt(tx * tx + ty * ty);
2014-07-08 03:11:14 -04:00
/// a += (fmod(a + dy, dx) > dx2) ? -dx2 : dx2;
/// nx = cos(a) * r;
/// ny = sin(a) * r;
/// p[0] += weight * nx;
2014-09-01 00:25:15 -04:00
/// p[1] += weight * ny;
2014-07-08 03:11:14 -04:00
/// </summary>
template < typename T >
class EMBER_API FanVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
FanVariation ( T weight = 1.0 ) : Variation < T > ( " fan " , eVariationId : : VAR_FAN , weight , true , true , false , true ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( FanVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04: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
T dx = T ( M_PI ) * Zeps ( m_Xform - > m_Affine . C ( ) * m_Xform - > m_Affine . C ( ) ) ;
2014-07-08 03:11:14 -04:00
T dy = m_Xform - > m_Affine . F ( ) ;
T dx2 = T ( 0.5 ) * dx ;
T a = helper . m_PrecalcAtanxy ;
T r = m_Weight * helper . m_PrecalcSqrtSumSquares ;
a + = ( fmod ( a + dy , dx ) > dx2 ) ? - dx2 : dx2 ;
--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
helper . Out . x = r * std : : cos ( a ) ;
helper . Out . y = r * std : : sin ( a ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
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 \t real_t dx = M_PI * Zeps(xform->m_C * xform->m_C); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t real_t dy = xform->m_F; \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t dx2 = (real_t)(0.5) * dx; \n "
2014-07-08 03:11:14 -04:00
< < " \t \t real_t a = precalcAtanxy + ((fmod(precalcAtanxy + dy, dx) > dx2) ? -dx2 : dx2); \n "
< < " \t \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] * precalcSqrtSumSquares; \n "
< < " \n "
< < " \t \t vOut.x = r * cos(a); \n "
< < " \t \t vOut.y = r * sin(a); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
--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
virtual vector < string > OpenCLGlobalFuncNames ( ) const override
{
return vector < string > { " Zeps " } ;
}
2014-07-08 03:11:14 -04:00
} ;
/// <summary>
/// Blob:
/// a = atan2(tx, ty);
2015-04-13 07:32:58 -04:00
/// r = std::sqrt(tx * tx + ty * ty);
2014-07-08 03:11:14 -04:00
/// r = r * (bloblow + (blobhigh - bloblow) * (0.5 + 0.5 * sin(blobwaves * a)));
/// nx = sin(a) * r;
/// ny = cos(a) * r;
2014-09-01 00:25:15 -04:00
///
2014-07-08 03:11:14 -04:00
/// p[0] += weight * nx;
/// p[1] += weight * ny;
/// </summary>
template < typename T >
class EMBER_API BlobVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
BlobVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " blob " , eVariationId : : VAR_BLOB , weight , true , true , true , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( BlobVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
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
T r = helper . m_PrecalcSqrtSumSquares * ( m_BlobLow + m_BlobDiff * ( T ( 0.5 ) + T ( 0.5 ) * std : : sin ( m_BlobWaves * helper . m_PrecalcAtanxy ) ) ) ;
2014-07-08 03:11:14 -04:00
helper . Out . x = m_Weight * helper . m_PrecalcSina * r ;
helper . Out . y = m_Weight * helper . m_PrecalcCosa * r ;
2016-01-04 19:50:15 -05:00
helper . Out . z = ( m_VarType = = eVariationType : : VARTYPE_REG ) ? 0 : helper . In . z ;
2014-07-08 03:11:14 -04:00
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string blobLow = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string blobHigh = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string blobWaves = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string blobDiff = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t r = precalcSqrtSumSquares * ( " < < blobLow < < " + " < < blobDiff < < " * ((real_t)(0.5) + (real_t)(0.5) * sin( " < < blobWaves < < " * precalcAtanxy))); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = (xform->m_VariationWeights[ " < < varIndex < < " ] * precalcSina * r); \n "
< < " \t \t vOut.y = (xform->m_VariationWeights[ " < < varIndex < < " ] * precalcCosa * r); \n "
2016-01-04 19:50:15 -05:00
< < " \t \t vOut.z = " < < ( ( m_VarType = = eVariationType : : VARTYPE_REG ) ? " 0 " : " vIn.z " ) < < " ; \n "
2014-07-08 03:11:14 -04:00
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04:00
{
m_BlobDiff = m_BlobHigh - m_BlobLow ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_BlobLow = T ( 0.2 ) + T ( 0.5 ) * rand . Frand01 < T > ( ) ;
m_BlobHigh = T ( 0.8 ) + T ( 0.4 ) * rand . Frand01 < T > ( ) ;
2014-12-07 02:51:44 -05:00
m_BlobWaves = T ( int ( 2 + 5 * rand . Frand01 < T > ( ) ) ) ;
2014-07-08 03:11:14 -04:00
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_BlobLow , prefix + " blob_low " ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_BlobHigh , prefix + " blob_high " , 1 ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_BlobWaves , prefix + " blob_waves " , 1 ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_BlobDiff , prefix + " blob_diff " ) ) ; //Precalc.
}
private :
T m_BlobLow ;
T m_BlobHigh ;
T m_BlobWaves ;
T m_BlobDiff ; //Precalc.
} ;
/// <summary>
/// Pdj:
/// nx1 = cos(pdjb * tx);
/// nx2 = sin(pdjc * tx);
/// ny1 = sin(pdja * ty);
/// ny2 = cos(pdjd * ty);
2014-09-01 00:25:15 -04:00
///
2014-07-08 03:11:14 -04:00
/// p[0] += weight * (ny1 - nx1);
/// p[1] += weight * (nx2 - ny2);
/// </summary>
template < typename T >
class EMBER_API PdjVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
PdjVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " pdj " , eVariationId : : VAR_PDJ , weight )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( PdjVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
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
T nx1 = std : : cos ( m_PdjB * helper . In . x ) ;
T nx2 = std : : sin ( m_PdjC * helper . In . x ) ;
T ny1 = std : : sin ( m_PdjA * helper . In . y ) ;
T ny2 = std : : cos ( m_PdjD * helper . In . y ) ;
2014-07-08 03:11:14 -04:00
helper . Out . x = m_Weight * ( ny1 - nx1 ) ;
helper . Out . y = m_Weight * ( nx2 - ny2 ) ;
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string pdjA = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string pdjB = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string pdjC = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string pdjD = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t real_t nx1 = cos( " < < pdjB < < " * vIn.x) " < < " ; \n "
< < " \t \t real_t nx2 = sin( " < < pdjC < < " * vIn.x) " < < " ; \n "
< < " \t \t real_t ny1 = sin( " < < pdjA < < " * vIn.y) " < < " ; \n "
< < " \t \t real_t ny2 = cos( " < < pdjD < < " * vIn.y) " < < " ; \n "
< < " \n "
< < " \t \t vOut.x = (xform->m_VariationWeights[ " < < varIndex < < " ] * (ny1 - nx1)); \n "
< < " \t \t vOut.y = (xform->m_VariationWeights[ " < < varIndex < < " ] * (nx2 - ny2)); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_PdjA = 3 * rand . Frand11 < T > ( ) ;
m_PdjB = 3 * rand . Frand11 < T > ( ) ;
m_PdjC = 3 * rand . Frand11 < T > ( ) ;
m_PdjD = 3 * rand . Frand11 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_PdjA , prefix + " pdj_a " ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_PdjB , prefix + " pdj_b " ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_PdjC , prefix + " pdj_c " ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_PdjD , prefix + " pdj_d " ) ) ;
}
private :
T m_PdjA ;
T m_PdjB ;
T m_PdjC ;
T m_PdjD ;
} ;
/// <summary>
/// Fan2:
/// a = precalc_atan;
/// r = precalc_sqrt;
2014-09-01 00:25:15 -04:00
///
2014-07-08 03:11:14 -04:00
/// dy = fan2y;
/// dx = M_PI * (fan2x * fan2x + EPS);
/// dx2 = dx / 2.0;
2014-09-01 00:25:15 -04:00
///
2014-07-08 03:11:14 -04:00
/// t = a + dy - dx * (int)((a + dy) / dx);
2014-09-01 00:25:15 -04:00
///
2014-07-08 03:11:14 -04:00
/// if (t > dx2)
/// a = a - dx2;
/// else
/// a = a + dx2;
2014-09-01 00:25:15 -04:00
///
2014-07-08 03:11:14 -04:00
/// nx = sin(a) * r;
/// ny = cos(a) * r;
2014-09-01 00:25:15 -04:00
///
2014-07-08 03:11:14 -04:00
/// p[0] += weight * nx;
/// p[1] += weight * ny;
/// </summary>
template < typename T >
class EMBER_API Fan2Variation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
Fan2Variation ( T weight = 1.0 ) : ParametricVariation < T > ( " fan2 " , eVariationId : : VAR_FAN2 , weight , true , true , false , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( Fan2Variation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T a = helper . m_PrecalcAtanxy ;
T r = m_Weight * helper . m_PrecalcSqrtSumSquares ;
2014-12-07 02:51:44 -05:00
T t = a + m_Fan2Y - m_Fan2Dx * int ( ( a + m_Fan2Y ) / m_Fan2Dx ) ;
2014-07-08 03:11:14 -04:00
if ( t > m_Fan2Dx2 )
a = a - m_Fan2Dx2 ;
else
a = a + m_Fan2Dx2 ;
--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
helper . Out . x = r * std : : sin ( a ) ;
helper . Out . y = r * std : : cos ( a ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string fan2X = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string fan2Y = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string dx = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string dx2 = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t real_t a = precalcAtanxy; \n "
< < " \t \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] * precalcSqrtSumSquares; \n "
< < " \t \t real_t t = a + " < < fan2Y < < " - " < < dx < < " * (int)((a + " < < fan2Y < < " ) / " < < dx < < " ); \n "
< < " \n "
< < " \t \t if (t > " < < dx2 < < " ) \n "
< < " \t \t a = a - " < < dx2 < < " ; \n "
< < " \t \t else \n "
< < " \t \t a = a + " < < dx2 < < " ; \n "
< < " \n "
< < " \t \t vOut.x = r * sin(a); \n "
< < " \t \t vOut.y = r * cos(a); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04: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
m_Fan2Dx = T ( M_PI ) * Zeps ( SQR ( m_Fan2X ) ) ;
2014-07-08 03:11:14 -04:00
m_Fan2Dx2 = T ( 0.5 ) * m_Fan2Dx ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_Fan2X = rand . Frand11 < T > ( ) ;
m_Fan2Y = rand . Frand11 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Fan2X , prefix + " fan2_x " ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Fan2Y , prefix + " fan2_y " ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_Fan2Dx , prefix + " fan2_dx " ) ) ; //Precalc.
m_Params . push_back ( ParamWithName < T > ( true , & m_Fan2Dx2 , prefix + " fan2_dx2 " ) ) ;
}
private :
T m_Fan2X ;
T m_Fan2Y ;
T m_Fan2Dx ; //Precalc.
T m_Fan2Dx2 ;
} ;
/// <summary>
/// Rings2:
/// r = precalc_sqrt;
/// dx = rings2val * rings2val + EPS;
/// r += dx - 2.0 * dx * (int)((r + dx)/(2.0 * dx)) - dx + r * (1.0 - dx);
/// nx = precalc_sina * r;
/// ny = precalc_cosa * r;
/// p[0] += weight * nx;
/// p[1] += weight * ny;
/// </summary>
template < typename T >
class EMBER_API Rings2Variation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
Rings2Variation ( T weight = 1.0 ) : ParametricVariation < T > ( " rings2 " , eVariationId : : VAR_RINGS2 , weight , true , true , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( Rings2Variation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T r = helper . m_PrecalcSqrtSumSquares ;
2014-12-07 02:51:44 -05:00
r + = - 2 * m_Rings2Val2 * int ( ( r + m_Rings2Val2 ) / ( 2 * m_Rings2Val2 ) ) + r * ( 1 - m_Rings2Val2 ) ;
2014-07-08 03:11:14 -04:00
helper . Out . x = m_Weight * helper . m_PrecalcSina * r ;
helper . Out . y = m_Weight * helper . m_PrecalcCosa * r ;
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string rings2Val = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string rings2Val2 = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t real_t r = precalcSqrtSumSquares; \n "
< < " \n "
2015-02-26 16:18:55 -05:00
< < " \t \t r += -(real_t)(2.0) * " < < rings2Val2 < < " * (int)((r + " < < rings2Val2 < < " ) / ((real_t)(2.0) * " < < rings2Val2 < < " )) + r * ((real_t)(1.0) - " < < rings2Val2 < < " ); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t vOut.x = (xform->m_VariationWeights[ " < < varIndex < < " ] * precalcSina * r); \n "
< < " \t \t vOut.y = (xform->m_VariationWeights[ " < < varIndex < < " ] * precalcCosa * r); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04: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
m_Rings2Val2 = Zeps ( SQR ( m_Rings2Val ) ) ;
2014-07-08 03:11:14 -04:00
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_Rings2Val = 2 * rand . Frand01 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Rings2Val , prefix + " rings2_val " , 1 ) ) ; //This differs from the original which used zero. Use 1 instead to avoid getting too close to dividing by zero.
m_Params . push_back ( ParamWithName < T > ( true , & m_Rings2Val2 , prefix + " rings2_val2 " ) ) ; //Precalc.
}
private :
T m_Rings2Val ;
T m_Rings2Val2 ; //Precalc.
} ;
/// <summary>
/// Eyefish:
/// r = 2.0 * weight / (precalc_sqrt + 1.0);
/// p[0] += r * tx;
/// p[1] += r * ty;
/// </summary>
template < typename T >
class EMBER_API EyefishVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
EyefishVariation ( T weight = 1.0 ) : Variation < T > ( " eyefish " , eVariationId : : VAR_EYEFISH , weight , true , true ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( EyefishVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T r = 2 * m_Weight / ( helper . m_PrecalcSqrtSumSquares + 1 ) ;
helper . Out . x = r * helper . In . x ;
helper . Out . y = r * helper . In . y ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t r = (xform->m_VariationWeights[ " < < varIndex < < " ] * (real_t)(2.0)) / (precalcSqrtSumSquares + (real_t)(1.0)); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = r * vIn.x; \n "
< < " \t \t vOut.y = r * vIn.y; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Bubble.
/// </summary>
template < typename T >
class EMBER_API BubbleVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
BubbleVariation ( T weight = 1.0 ) : Variation < T > ( " bubble " , eVariationId : : VAR_BUBBLE , weight , true ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( BubbleVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04: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
T denom = T ( 0.25 ) * helper . m_PrecalcSumSquares + 1 ;
T r = m_Weight / denom ;
2014-07-08 03:11:14 -04:00
helper . Out . x = r * helper . In . x ;
helper . Out . y = r * helper . In . 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
helper . Out . z = m_Weight * ( 2 / denom - 1 ) ;
2014-07-08 03:11:14 -04:00
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t denom = (real_t)(0.25) * precalcSumSquares + 1; \n "
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 \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] / denom; \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = r * vIn.x; \n "
< < " \t \t vOut.y = r * vIn.y; \n "
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 \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * (2 / denom - 1); \n "
2014-07-08 03:11:14 -04:00
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Cylinder.
/// </summary>
template < typename T >
class EMBER_API CylinderVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
CylinderVariation ( T weight = 1.0 ) : Variation < T > ( " cylinder " , eVariationId : : VAR_CYLINDER , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( CylinderVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
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
helper . Out . x = m_Weight * std : : sin ( helper . In . x ) ;
2014-07-08 03:11:14 -04:00
helper . Out . y = m_Weight * helper . In . y ;
--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
helper . Out . z = m_Weight * std : : cos ( helper . In . x ) ;
2014-07-08 03:11:14 -04:00
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * sin(vIn.x); \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.y; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * cos(vIn.x); \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Perspective.
/// </summary>
template < typename T >
class EMBER_API PerspectiveVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
PerspectiveVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " perspective " , eVariationId : : VAR_PERSPECTIVE , weight )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( PerspectiveVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04: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
T d = Zeps ( m_Dist - helper . In . y * m_Vsin ) ;
2014-07-08 03:11:14 -04:00
T t = 1 / d ;
helper . Out . x = m_Weight * m_Dist * helper . In . x * t ;
helper . Out . y = m_Weight * m_VfCos * helper . In . y * t ;
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string angle = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ; //Params.
string dist = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string vSin = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ; //Precalc.
string vfCos = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
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 \t real_t d = Zeps( " < < dist < < " - vIn.y * " < < vSin < < " ); \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t t = (real_t)(1.0) / d; \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = (xform->m_VariationWeights[ " < < varIndex < < " ] * " < < dist < < " * vIn.x * t); \n "
< < " \t \t vOut.y = (xform->m_VariationWeights[ " < < varIndex < < " ] * " < < vfCos < < " * vIn.y * t); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
--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
virtual vector < string > OpenCLGlobalFuncNames ( ) const override
{
return vector < string > { " Zeps " } ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04:00
{
T angle = m_Angle * T ( M_PI ) / 2 ;
--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_Vsin = std : : sin ( angle ) ;
m_VfCos = m_Dist * std : : cos ( angle ) ;
2014-07-08 03:11:14 -04:00
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_Angle = rand . Frand01 < T > ( ) ;
m_Dist = 2 * rand . Frand01 < T > ( ) + 1 ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Angle , prefix + " perspective_angle " ) ) ; //Params.
m_Params . push_back ( ParamWithName < T > ( & m_Dist , prefix + " perspective_dist " ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_Vsin , prefix + " perspective_vsin " ) ) ; //Precalc.
m_Params . push_back ( ParamWithName < T > ( true , & m_VfCos , prefix + " perspective_vfcos " ) ) ;
}
private :
T m_Angle ; //Params.
T m_Dist ;
T m_Vsin ; //Precalc.
T m_VfCos ;
} ;
/// <summary>
/// Noise.
/// </summary>
template < typename T >
class EMBER_API NoiseVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
NoiseVariation ( T weight = 1.0 ) : Variation < T > ( " noise " , eVariationId : : VAR_NOISE , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( NoiseVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T tempr = rand . Frand01 < T > ( ) * M_2PI ;
T r = m_Weight * rand . Frand01 < 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
helper . Out . x = helper . In . x * r * std : : cos ( tempr ) ;
helper . Out . y = helper . In . y * r * std : : sin ( tempr ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t tempr = MwcNext01(mwc) * M_2PI; \n "
< < " \t \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] * MwcNext01(mwc); \n "
< < " \n "
< < " \t \t vOut.x = vIn.x * r * cos(tempr); \n "
< < " \t \t vOut.y = vIn.y * r * sin(tempr); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// JuliaN.
/// </summary>
template < typename T >
class EMBER_API JuliaNGenericVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
JuliaNGenericVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " julian " , eVariationId : : VAR_JULIAN , weight , true , false , false , false , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( JuliaNGenericVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
2014-12-07 02:51:44 -05:00
T tempr = ( helper . m_PrecalcAtanyx + M_2PI * rand . Rand ( ISAAC_INT ( m_Rn ) ) ) / m_Power ;
--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 r = m_Weight * std : : pow ( helper . m_PrecalcSumSquares , m_Cn ) ;
helper . Out . x = r * std : : cos ( tempr ) ;
helper . Out . y = r * std : : sin ( tempr ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string dist = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ; //Params.
string power = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string rn = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ; //Precalc.
string cn = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t int tRnd = (int)( " < < rn < < " * MwcNext01(mwc)); \n "
< < " \t \t real_t tempr = (precalcAtanyx + M_2PI * tRnd) / " < < power < < " ; \n "
< < " \t \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] * pow(precalcSumSquares, " < < cn < < " ); \n "
< < " \n "
< < " \t \t vOut.x = r * cos(tempr); \n "
< < " \t \t vOut.y = r * sin(tempr); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04: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
m_Power = Zeps ( m_Power ) ;
2016-01-12 23:42:12 -05:00
m_Rn = std : : abs ( m_Power ) ;
2014-07-08 03:11:14 -04:00
m_Cn = m_Dist / m_Power / 2 ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_Dist = 1 ;
2014-12-07 02:51:44 -05:00
m_Power = T ( int ( 5 * rand . Frand01 < T > ( ) + 2 ) ) ;
2014-07-08 03:11:14 -04:00
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Dist , prefix + " julian_dist " , 1 ) ) ; //Params.
2016-01-04 19:50:15 -05:00
m_Params . push_back ( ParamWithName < T > ( & m_Power , prefix + " julian_power " , 1 , eParamType : : INTEGER_NONZERO ) ) ;
2014-07-08 03:11:14 -04:00
m_Params . push_back ( ParamWithName < T > ( true , & m_Rn , prefix + " julian_rn " ) ) ; //Precalc.
m_Params . push_back ( ParamWithName < T > ( true , & m_Cn , prefix + " julian_cn " ) ) ;
}
private :
T m_Dist ; //Params.
T m_Power ;
T m_Rn ; //Precalc.
T m_Cn ;
} ;
/// <summary>
/// JuliaScope.
/// </summary>
template < typename T >
class EMBER_API JuliaScopeVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
JuliaScopeVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " juliascope " , eVariationId : : VAR_JULIASCOPE , weight , true , false , false , false , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( JuliaScopeVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
2014-12-07 02:51:44 -05:00
int rnd = int ( m_Rn * rand . Frand01 < 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
T tempr , r = m_Weight * std : : pow ( helper . m_PrecalcSumSquares , m_Cn ) ;
2014-07-08 03:11:14 -04:00
if ( ( rnd & 1 ) = = 0 )
tempr = ( M_2PI * rnd + helper . m_PrecalcAtanyx ) / m_Power ;
else
tempr = ( M_2PI * rnd - helper . m_PrecalcAtanyx ) / m_Power ;
--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
helper . Out . x = r * std : : cos ( tempr ) ;
helper . Out . y = r * std : : sin ( tempr ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
//int rnd = (int)(m_Rn * rand.Frand01<T>());
//T tempr, r;
//if ((rnd & 1) == 0)
// tempr = (2 * T(M_PI) * (int)(m_Rn * rand.Frand01<T>()) + helper.m_PrecalcAtanyx) / m_Power;//Fixed to get new random rather than use rnd from above.//SMOULDER
//else
// tempr = (2 * T(M_PI) * (int)(m_Rn * rand.Frand01<T>()) - helper.m_PrecalcAtanyx) / m_Power;
//r = m_Weight * pow(helper.m_PrecalcSumSquares, m_Cn);
//helper.Out.x = r * cos(tempr);
//helper.Out.y = r * sin(tempr);
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string dist = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ; //Params.
string power = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string rn = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ; //Precalc.
string cn = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
2016-01-04 19:50:15 -05:00
< < " \t \t int rnd = (int)( " < < rn < < " * MwcNext01(mwc)); \n "
< < " \t \t real_t tempr, r; \n "
< < " \n "
< < " \t \t if ((rnd & 1) == 0) \n "
< < " \t \t tempr = (M_2PI * rnd + precalcAtanyx) / " < < power < < " ; \n "
< < " \t \t else \n "
< < " \t \t tempr = (M_2PI * rnd - precalcAtanyx) / " < < power < < " ; \n "
< < " \n "
< < " \t \t r = xform->m_VariationWeights[ " < < varIndex < < " ] * pow(precalcSumSquares, " < < cn < < " ); \n "
< < " \n "
< < " \t \t vOut.x = r * cos(tempr); \n "
< < " \t \t vOut.y = r * sin(tempr); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
2014-07-08 03:11:14 -04:00
//ss << "\t{\n"
// << "\t\tint rnd = (int)(" << rn << " * MwcNext01(mwc));\n"
// << "\t\treal_t tempr, r;\n"
// << "\n"
// << "\t\tif ((rnd & 1) == 0)\n"
// << "\t\t tempr = (2 * M_PI * (int)(" << rn << " * MwcNext01(mwc)) + precalcAtanyx) / " << power << ";\n"//Fixed to get new random rather than use rnd from above.//SMOULDER
// << "\t\telse\n"
// << "\t\t tempr = (2 * M_PI * (int)(" << rn << " * MwcNext01(mwc)) - precalcAtanyx) / " << power << ";\n"
// << "\n"
// << "\t\tr = xform->m_VariationWeights[" << varIndex << "] * pow(precalcSumSquares, " << cn << ");\n"
// << "\n"
// << "\t\tvOut.x = r * cos(tempr);\n"
// << "\t\tvOut.y = r * sin(tempr);\n"
// << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
// << "\t}\n";
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04:00
{
2016-01-12 23:42:12 -05:00
m_Rn = std : : abs ( m_Power ) ;
2014-07-08 03:11:14 -04:00
m_Cn = m_Dist / m_Power / 2 ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_Dist = 1 ;
2014-12-07 02:51:44 -05:00
m_Power = T ( int ( 5 * rand . Frand01 < T > ( ) + 2 ) ) ;
2014-07-08 03:11:14 -04:00
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Dist , prefix + " juliascope_dist " , 1 ) ) ; //Params.
m_Params . push_back ( ParamWithName < T > ( & m_Power , prefix + " juliascope_power " , 1 ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_Rn , prefix + " juliascope_rn " ) ) ; //Precalc.
m_Params . push_back ( ParamWithName < T > ( true , & m_Cn , prefix + " juliascope_cn " ) ) ;
}
private :
T m_Dist ; //Params.
T m_Power ;
T m_Rn ; //Precalc.
T m_Cn ;
} ;
/// <summary>
/// Blur.
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
/// This is somewhat different than the original functionality in that blur used
/// the code below, but pre_blur used gaussian_blur.
/// If the original pre_blur functionality is needed, use pre_gaussian_blur.
2014-07-08 03:11:14 -04:00
/// </summary>
template < typename T >
class EMBER_API BlurVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
BlurVariation ( T weight = 1.0 ) : Variation < T > ( " blur " , eVariationId : : VAR_BLUR , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( BlurVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T tempr = rand . Frand01 < T > ( ) * M_2PI ;
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 r = m_Weight * rand . Frand01 < 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
helper . Out . x = r * std : : cos ( tempr ) ;
helper . Out . y = r * std : : sin ( tempr ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t tmpr = MwcNext01(mwc) * M_2PI; \n "
< < " \t \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] * MwcNext01(mwc); \n "
< < " \n "
< < " \t \t vOut.x = r * cos(tmpr); \n "
< < " \t \t vOut.y = r * sin(tmpr); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Gaussian blur.
/// </summary>
template < typename T >
class EMBER_API GaussianBlurVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
GaussianBlurVariation ( T weight = 1.0 ) : Variation < T > ( " gaussian_blur " , eVariationId : : VAR_GAUSSIAN_BLUR , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( GaussianBlurVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T angle = rand . Frand01 < T > ( ) * M_2PI ;
T r = m_Weight * ( rand . Frand01 < T > ( ) + rand . Frand01 < T > ( ) + rand . Frand01 < T > ( ) + rand . Frand01 < T > ( ) - 2 ) ;
--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
helper . Out . x = r * std : : cos ( angle ) ;
helper . Out . y = r * std : : sin ( angle ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t angle = MwcNext01(mwc) * M_2PI; \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - (real_t)(2.0)); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = r * cos(angle); \n "
< < " \t \t vOut.y = r * sin(angle); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Radial blur.
/// </summary>
template < typename T >
class EMBER_API RadialBlurVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
RadialBlurVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " radial_blur " , eVariationId : : VAR_RADIAL_BLUR , weight , true , true , false , false , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( RadialBlurVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
//Get pseudo-gaussian.
T rndG = m_Weight * ( rand . Frand01 < T > ( ) + rand . Frand01 < T > ( )
2016-01-04 19:50:15 -05:00
+ rand . Frand01 < T > ( ) + rand . Frand01 < T > ( ) - 2 ) ;
2014-07-08 03:11:14 -04:00
//Calculate angle & zoom.
T ra = helper . m_PrecalcSqrtSumSquares ;
T tempa = helper . m_PrecalcAtanyx + m_Spin * rndG ;
T rz = m_Zoom * rndG - 1 ;
--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
helper . Out . x = ra * std : : cos ( tempa ) + rz * helper . In . x ;
helper . Out . y = ra * std : : sin ( tempa ) + rz * helper . In . y ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string angle = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ; //Params.
string spin = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ; //Precalc.
string zoom = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t rndG = xform->m_VariationWeights[ " < < varIndex < < " ] * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - (real_t)(2.0)); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t real_t ra = precalcSqrtSumSquares; \n "
2016-01-04 19:50:15 -05:00
< < " \t \t real_t tempa = precalcAtanyx + " < < spin < < " * rndG; \n "
2014-07-08 03:11:14 -04:00
< < " \t \t real_t rz = " < < zoom < < " * rndG - 1; \n "
< < " \n "
< < " \t \t vOut.x = ra * cos(tempa) + rz * vIn.x; \n "
< < " \t \t vOut.y = ra * sin(tempa) + rz * vIn.y; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04:00
{
sincos ( m_Angle * T ( M_PI ) / 2 , & m_Spin , & m_Zoom ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_Angle = ( 2 * rand . Frand01 < T > ( ) - 1 ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Angle , prefix + " radial_blur_angle " ) ) ; //Params.
m_Params . push_back ( ParamWithName < T > ( true , & m_Spin , prefix + " radial_blur_spin " ) ) ; //Precalc.
m_Params . push_back ( ParamWithName < T > ( true , & m_Zoom , prefix + " radial_blur_zoom " ) ) ;
}
private :
T m_Angle ; //Params.
T m_Spin ; //Precalc.
T m_Zoom ;
} ;
/// <summary>
/// Pie.
/// </summary>
template < typename T >
class EMBER_API PieVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
PieVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " pie " , eVariationId : : VAR_PIE , weight )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( PieVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
2014-12-07 02:51:44 -05:00
int sl = int ( rand . Frand01 < T > ( ) * m_Slices + T ( 0.5 ) ) ;
2014-07-08 03:11:14 -04:00
T a = m_Rotation + M_2PI * ( sl + rand . Frand01 < T > ( ) * m_Thickness ) / m_Slices ;
T r = m_Weight * rand . Frand01 < 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
helper . Out . x = r * std : : cos ( a ) ;
helper . Out . y = r * std : : sin ( a ) ;
2014-07-08 03:11:14 -04:00
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string slices = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string rotation = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string thickness = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t int sl = (int)(MwcNext01(mwc) * " < < slices < < " + (real_t)(0.5)); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t real_t a = " < < rotation < < " + M_2PI * (sl + MwcNext01(mwc) * " < < thickness < < " ) / " < < slices < < " ; \n "
< < " \t \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] * MwcNext01(mwc); \n "
< < " \n "
< < " \t \t vOut.x = r * cos(a); \n "
< < " \t \t vOut.y = r * sin(a); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_Params [ 0 ] . Set ( 10 * rand . Frand01 < T > ( ) ) ; //Slices.
m_Params [ 1 ] . Set ( M_2PI * rand . Frand11 < T > ( ) ) ; //Rotation.
m_Thickness = rand . Frand01 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
2016-01-04 19:50:15 -05:00
m_Params . push_back ( ParamWithName < T > ( & m_Slices , prefix + " pie_slices " , 6 , eParamType : : INTEGER_NONZERO , 1 ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Rotation , prefix + " pie_rotation " , T ( 0.5 ) , eParamType : : REAL_CYCLIC , 0 , M_2PI ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Thickness , prefix + " pie_thickness " , T ( 0.5 ) , eParamType : : REAL , 0 , 1 ) ) ;
2014-07-08 03:11:14 -04:00
}
private :
T m_Slices ;
T m_Rotation ;
T m_Thickness ;
} ;
/// <summary>
/// Ngon.
/// </summary>
template < typename T >
class EMBER_API NgonVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
NgonVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " ngon " , eVariationId : : VAR_NGON , weight , true , false , false , false , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( NgonVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04: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
T rFactor ;
2014-07-08 03:11:14 -04: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 ( ( helper . In . x = = 0 ) & & ( helper . In . y = = 0 ) )
rFactor = 0 ;
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
rFactor = std : : pow ( helper . m_PrecalcSumSquares , m_CPower ) ;
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 phi = helper . m_PrecalcAtanyx - m_CSides * Floor < T > ( helper . m_PrecalcAtanyx * m_CSidesInv ) ;
2014-09-01 00:25:15 -04: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 ( phi > T ( 0.5 ) * m_CSides )
phi - = m_CSides ;
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
T amp = ( m_Corners * ( 1 / std : : cos ( phi ) - 1 ) + m_Circle ) * m_Weight * rFactor ;
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
helper . Out . x = amp * helper . In . x ;
helper . Out . y = amp * helper . In . y ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
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
string sides = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string power = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string circle = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string corners = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string csides = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string csidesinv = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string cpower = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
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 \t real_t rFactor; \n "
< < " \n "
2015-02-26 16:18:55 -05:00
< < " \t \t if ((vIn.x == (real_t)(0.0)) && (vIn.y == (real_t)(0.0))) \n "
< < " \t \t rFactor = (real_t)(0.0); \n "
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 \t else \n "
< < " \t \t rFactor = pow(precalcSumSquares, " < < cpower < < " ); \n "
< < " \n "
< < " \t \t real_t phi = precalcAtanyx - " < < csides < < " * floor(precalcAtanyx * " < < csidesinv < < " ); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
2015-02-26 16:18:55 -05:00
< < " \t \t if (phi > (real_t)(0.5) * " < < csides < < " ) \n "
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 \t phi -= " < < csides < < " ; \n "
2014-07-08 03:11:14 -04:00
< < " \n "
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 \t real_t amp = ( " < < corners < < " * (1 / cos(phi) - 1) + " < < circle < < " ) * xform->m_VariationWeights[ " < < varIndex < < " ] * rFactor; \n "
< < " \n "
< < " \t \t vOut.x = amp * vIn.x; \n "
< < " \t \t vOut.y = amp * vIn.y; \n "
2014-07-08 03:11:14 -04:00
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
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
{
m_CPower = - T ( 0.5 ) * m_Power ;
m_CSides = 2 * T ( M_PI ) / m_Sides ;
m_CSidesInv = 1 / m_CSides ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
2014-12-07 02:51:44 -05:00
m_Sides = T ( int ( rand . Frand01 < T > ( ) * 10 + 3 ) ) ;
2014-07-08 03:11:14 -04:00
m_Power = 3 * rand . Frand01 < T > ( ) + 1 ;
m_Circle = 3 * rand . Frand01 < T > ( ) ;
m_Corners = 2 * rand . Frand01 < T > ( ) * m_Circle ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
2016-01-04 19:50:15 -05:00
m_Params . push_back ( ParamWithName < T > ( & m_Sides , prefix + " ngon_sides " , 5 , eParamType : : INTEGER_NONZERO ) ) ;
2014-07-08 03:11:14 -04:00
m_Params . push_back ( ParamWithName < T > ( & m_Power , prefix + " ngon_power " , 3 ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Circle , prefix + " ngon_circle " , 1 ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Corners , prefix + " ngon_corners " , 2 ) ) ;
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
m_Params . push_back ( ParamWithName < T > ( true , & m_CSides , prefix + " ngon_csides " ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_CSidesInv , prefix + " ngon_csides_inv " ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_CPower , prefix + " ngon_cpower " ) ) ;
2014-07-08 03:11:14 -04:00
}
private :
T m_Sides ;
T m_Power ;
T m_Circle ;
T m_Corners ;
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 m_CSides ;
T m_CSidesInv ;
T m_CPower ;
2014-07-08 03:11:14 -04:00
} ;
/// <summary>
/// Curl.
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
/// Note that in Apophysis, curl and post_curl differed slightly.
/// Using what post_curl did here gave bad results, so sticking with the original
/// curl code.
2014-07-08 03:11:14 -04:00
/// </summary>
template < typename T >
class EMBER_API CurlVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
CurlVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " curl " , eVariationId : : VAR_CURL , weight )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( CurlVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04: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
T re = 1 + m_C1 * helper . In . x + m_C2 * ( SQR ( helper . In . x ) - SQR ( helper . In . y ) ) ;
T im = m_C1 * helper . In . y + m_C22 * helper . In . x * helper . In . y ;
T r = m_Weight / Zeps ( SQR ( re ) + SQR ( im ) ) ;
helper . Out . x = ( helper . In . x * re + helper . In . y * im ) * r ;
helper . Out . y = ( helper . In . y * re - helper . In . x * im ) * r ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string c1 = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string c2 = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string c22 = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t re = (real_t)(1.0) + " < < c1 < < " * vIn.x + " < < c2 < < " * (SQR(vIn.x) - SQR(vIn.y)); \n "
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 \t real_t im = " < < c1 < < " * vIn.y + " < < c22 < < " * vIn.x * vIn.y; \n "
< < " \t \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] / Zeps(SQR(re) + SQR(im)); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
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 \t vOut.x = (vIn.x * re + vIn.y * im) * r; \n "
< < " \t \t vOut.y = (vIn.y * re - vIn.x * im) * r; \n "
2014-07-08 03:11:14 -04:00
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -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
virtual vector < string > OpenCLGlobalFuncNames ( ) const override
{
return vector < string > { " Zeps " } ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04: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
m_C22 = 2 * m_C2 ;
2014-07-08 03:11:14 -04:00
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_C1 = rand . Frand01 < T > ( ) ;
m_C2 = rand . Frand01 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_C1 , prefix + " curl_c1 " , 1 ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_C2 , prefix + " curl_c2 " ) ) ;
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
m_Params . push_back ( ParamWithName < T > ( true , & m_C22 , prefix + " curl_c22 " ) ) ; //Precalc.
2014-07-08 03:11:14 -04:00
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_C1 ;
T m_C2 ;
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 m_C22 ; //Precalc.
2014-07-08 03:11:14 -04:00
} ;
/// <summary>
/// Rectangles.
/// </summary>
template < typename T >
class EMBER_API RectanglesVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
RectanglesVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " rectangles " , eVariationId : : VAR_RECTANGLES , weight )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( RectanglesVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
if ( m_X = = 0 )
helper . Out . x = m_Weight * helper . In . x ;
else
helper . Out . x = m_Weight * ( ( 2 * Floor < T > ( helper . In . x / m_X ) + 1 ) * m_X - helper . In . x ) ;
if ( m_Y = = 0 )
helper . Out . y = m_Weight * helper . In . y ;
else
helper . Out . y = m_Weight * ( ( 2 * Floor < T > ( helper . In . y / m_Y ) + 1 ) * m_Y - helper . In . y ) ;
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string x = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string y = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t if ( " < < x < < " == 0) \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.x; \n "
< < " \t \t else \n "
< < " \t \t vOut.x = (xform->m_VariationWeights[ " < < varIndex < < " ] * ((2 * floor(vIn.x / " < < x < < " ) + 1) * " < < x < < " - vIn.x)); \n "
< < " \n "
< < " \t \t if ( " < < y < < " == 0) \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.y; \n "
< < " \t \t else \n "
< < " \t \t vOut.y = (xform->m_VariationWeights[ " < < varIndex < < " ] * ((2 * floor(vIn.y / " < < y < < " ) + 1) * " < < y < < " - vIn.y)); \n "
< < " \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_X = rand . Frand01 < T > ( ) ;
m_Y = rand . Frand01 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_X , prefix + " rectangles_x " , 1 ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Y , prefix + " rectangles_y " , 1 ) ) ;
}
private :
T m_X ;
T m_Y ;
} ;
/// <summary>
/// Arch.
/// </summary>
template < typename T >
class EMBER_API ArchVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
ArchVariation ( T weight = 1.0 ) : Variation < T > ( " arch " , eVariationId : : VAR_ARCH , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( ArchVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T angle = rand . Frand01 < T > ( ) * m_Weight * T ( M_PI ) ;
T sinr , cosr ;
sincos ( angle , & sinr , & cosr ) ;
helper . Out . x = m_Weight * sinr ;
helper . Out . y = m_Weight * ( sinr * sinr ) / cosr ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t angle = MwcNext01(mwc) * xform->m_VariationWeights[ " < < varIndex < < " ] * M_PI; \n "
< < " \t \t real_t sinr = sin(angle); \n "
< < " \t \t real_t cosr = cos(angle); \n "
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * sinr; \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * (sinr * sinr) / cosr; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Tangent.
/// </summary>
template < typename T >
class EMBER_API TangentVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
TangentVariation ( T weight = 1.0 ) : Variation < T > ( " tangent " , eVariationId : : VAR_TANGENT , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( TangentVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
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
helper . Out . x = m_Weight * std : : sin ( helper . In . x ) / std : : cos ( helper . In . y ) ;
2014-09-08 00:05:27 -04:00
helper . Out . y = m_Weight * SafeTan < T > ( helper . In . y ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * sin(vIn.x) / cos(vIn.y); \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * tan(vIn.y); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Square.
/// </summary>
template < typename T >
class EMBER_API SquareVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
SquareVariation ( T weight = 1.0 ) : Variation < T > ( " square " , eVariationId : : VAR_SQUARE , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( SquareVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
helper . Out . x = m_Weight * ( rand . Frand01 < T > ( ) - T ( 0.5 ) ) ;
helper . Out . y = m_Weight * ( rand . Frand01 < T > ( ) - T ( 0.5 ) ) ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * (MwcNext01(mwc) - (real_t)(0.5)); \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * (MwcNext01(mwc) - (real_t)(0.5)); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Rays.
/// </summary>
template < typename T >
class EMBER_API RaysVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
RaysVariation ( T weight = 1.0 ) : Variation < T > ( " rays " , eVariationId : : VAR_RAYS , weight , true ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( RaysVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T ang = m_Weight * rand . Frand01 < T > ( ) * T ( M_PI ) ;
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 r = m_Weight / Zeps ( helper . m_PrecalcSumSquares ) ;
2014-09-08 00:05:27 -04:00
T tanr = m_Weight * SafeTan < T > ( ang ) * r ;
--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
helper . Out . x = tanr * std : : cos ( helper . In . x ) ;
helper . Out . y = tanr * std : : sin ( helper . In . y ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t ang = xform->m_VariationWeights[ " < < varIndex < < " ] * MwcNext01(mwc) * M_PI; \n "
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 \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] / Zeps(precalcSumSquares); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t real_t tanr = xform->m_VariationWeights[ " < < varIndex < < " ] * tan(ang) * r; \n "
< < " \n "
< < " \t \t vOut.x = tanr * cos(vIn.x); \n "
< < " \t \t vOut.y = tanr * sin(vIn.y); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
--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
virtual vector < string > OpenCLGlobalFuncNames ( ) const override
{
return vector < string > { " Zeps " } ;
}
2014-07-08 03:11:14 -04:00
} ;
/// <summary>
/// Blade.
/// </summary>
template < typename T >
class EMBER_API BladeVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
BladeVariation ( T weight = 1.0 ) : Variation < T > ( " blade " , eVariationId : : VAR_BLADE , weight , true , true ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( BladeVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T r = rand . Frand01 < T > ( ) * m_Weight * helper . m_PrecalcSqrtSumSquares ;
T sinr , cosr ;
sincos ( r , & sinr , & cosr ) ;
helper . Out . x = m_Weight * helper . In . x * ( cosr + sinr ) ;
helper . Out . y = m_Weight * helper . In . x * ( cosr - sinr ) ;
2016-01-04 19:50:15 -05:00
helper . Out . z = ( m_VarType = = eVariationType : : VARTYPE_REG ) ? 0 : helper . In . z ;
2014-07-08 03:11:14 -04:00
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t r = MwcNext01(mwc) * xform->m_VariationWeights[ " < < varIndex < < " ] * precalcSqrtSumSquares; \n "
< < " \t \t real_t sinr = sin(r); \n "
< < " \t \t real_t cosr = cos(r); \n "
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.x * (cosr + sinr); \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.x * (cosr - sinr); \n "
2016-01-04 19:50:15 -05:00
< < " \t \t vOut.z = " < < ( ( m_VarType = = eVariationType : : VARTYPE_REG ) ? " 0 " : " vIn.z " ) < < " ; \n "
2014-07-08 03:11:14 -04:00
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Secant2.
/// </summary>
template < typename T >
class EMBER_API Secant2Variation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
Secant2Variation ( T weight = 1.0 ) : Variation < T > ( " secant2 " , eVariationId : : VAR_SECANT2 , weight , true , true ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( Secant2Variation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T r = m_Weight * helper . m_PrecalcSqrtSumSquares ;
--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 cr = std : : cos ( r ) ;
2014-07-08 03:11:14 -04:00
T icr = 1 / cr ;
helper . Out . x = m_Weight * helper . In . x ;
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
if ( cr < 0 )
helper . Out . y = m_Weight * ( icr + 1 ) ;
else
helper . Out . y = m_Weight * ( icr - 1 ) ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] * precalcSqrtSumSquares; \n "
< < " \t \t real_t cr = cos(r); \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t icr = (real_t)(1.0) / cr; \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.x; \n "
< < " \n "
2015-02-26 16:18:55 -05:00
< < " \t \t if (cr < (real_t)(0.0)) \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * (icr + (real_t)(1.0)); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t else \n "
2015-02-26 16:18:55 -05:00
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * (icr - (real_t)(1.0)); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// TwinTrian.
/// </summary>
template < typename T >
class EMBER_API TwinTrianVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
TwinTrianVariation ( T weight = 1.0 ) : Variation < T > ( " TwinTrian " , eVariationId : : VAR_TWINTRIAN , weight , true , true ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( TwinTrianVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T r = rand . Frand01 < T > ( ) * m_Weight * helper . m_PrecalcSqrtSumSquares ;
T sinr , cosr , diff ;
sincos ( r , & sinr , & cosr ) ;
--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
diff = std : : log10 ( sinr * sinr ) + cosr ;
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
if ( BadVal ( diff ) )
diff = - 30.0 ;
helper . Out . x = m_Weight * helper . In . x * diff ;
helper . Out . y = m_Weight * helper . In . x * ( diff - sinr * T ( M_PI ) ) ;
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t r = MwcNext01(mwc) * xform->m_VariationWeights[ " < < varIndex < < " ] * precalcSqrtSumSquares; \n "
< < " \t \t real_t sinr = sin(r); \n "
< < " \t \t real_t cosr = cos(r); \n "
< < " \t \t real_t diff = log10(sinr * sinr) + cosr; \n "
< < " \n "
< < " \t \t if (BadVal(diff)) \n "
2015-02-26 16:18:55 -05:00
< < " \t \t diff = -(real_t)(30.0); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.x * diff; \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.x * (diff - sinr * M_PI); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Cross.
/// </summary>
template < typename T >
class EMBER_API CrossVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
CrossVariation ( T weight = 1.0 ) : Variation < T > ( " cross " , eVariationId : : VAR_CROSS , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( CrossVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
2016-01-12 23:42:12 -05:00
T r = m_Weight / Zeps ( std : : abs ( ( helper . In . x - helper . In . y ) * ( helper . In . x + helper . In . y ) ) ) ;
2014-07-08 03:11:14 -04:00
helper . Out . x = helper . In . x * r ;
helper . Out . y = helper . In . y * r ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
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 \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] /Zeps(fabs((vIn.x - vIn.y) * (vIn.x + vIn.y))); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = vIn.x * r; \n "
< < " \t \t vOut.y = vIn.y * r; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
--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
virtual vector < string > OpenCLGlobalFuncNames ( ) const override
{
return vector < string > { " Zeps " } ;
}
2014-07-08 03:11:14 -04:00
} ;
/// <summary>
/// Disc2.
/// </summary>
template < typename T >
class EMBER_API Disc2Variation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
Disc2Variation ( T weight = 1.0 ) : ParametricVariation < T > ( " disc2 " , eVariationId : : VAR_DISC2 , weight , false , false , false , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( Disc2Variation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T r , t , sinr , cosr ;
t = m_RotTimesPi * ( helper . In . x + helper . In . y ) ;
sincos ( t , & sinr , & cosr ) ;
r = m_Weight * helper . m_PrecalcAtanxy / T ( M_PI ) ;
helper . Out . x = ( sinr + m_CosAdd ) * r ;
helper . Out . y = ( cosr + m_SinAdd ) * r ;
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string rot = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ; //Params.
string twist = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string sinAdd = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ; //Precalc.
string cosAdd = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string rotTimesPi = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t real_t t = " < < rotTimesPi < < " * (vIn.x + vIn.y); \n "
< < " \t \t real_t sinr = sin(t); \n "
< < " \t \t real_t cosr = cos(t); \n "
< < " \t \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] * precalcAtanxy / M_PI; \n "
< < " \n "
< < " \t \t vOut.x = (sinr + " < < cosAdd < < " ) * r; \n "
< < " \t \t vOut.y = (cosr + " < < sinAdd < < " ) * r; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04:00
{
T k , add = m_Twist ;
m_RotTimesPi = m_Rot * T ( M_PI ) ;
sincos ( add , & m_SinAdd , & m_CosAdd ) ;
m_CosAdd - = 1 ;
if ( add > 2 * M_PI )
{
k = ( 1 + add - 2 * T ( M_PI ) ) ;
m_CosAdd * = k ;
m_SinAdd * = k ;
}
if ( add < - 2 * M_PI )
{
k = ( 1 + add + 2 * T ( M_PI ) ) ;
m_CosAdd * = k ;
m_SinAdd * = k ;
}
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_Rot = T ( 0.5 ) * rand . Frand01 < T > ( ) ;
m_Twist = T ( 0.5 ) * rand . Frand01 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Rot , prefix + " disc2_rot " ) ) ; //Params.
m_Params . push_back ( ParamWithName < T > ( & m_Twist , prefix + " disc2_twist " ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_SinAdd , prefix + " disc2_sin_add " ) ) ; //Precalc.
m_Params . push_back ( ParamWithName < T > ( true , & m_CosAdd , prefix + " disc2_cos_add " ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_RotTimesPi , prefix + " disc2_rot_times_pi " ) ) ;
}
private :
T m_Rot ; //Params.
T m_Twist ;
T m_SinAdd ; //Precalc.
T m_CosAdd ;
T m_RotTimesPi ;
} ;
/// <summary>
/// SuperShape.
/// </summary>
template < typename T >
class EMBER_API SuperShapeVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
SuperShapeVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " super_shape " , eVariationId : : VAR_SUPER_SHAPE , weight , true , true , false , false , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( SuperShapeVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T theta = m_Pm4 * helper . m_PrecalcAtanyx + T ( M_PI_4 ) ;
2016-01-12 23:42:12 -05:00
T t1 = std : : abs ( std : : cos ( theta ) ) ;
--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
t1 = std : : pow ( t1 , m_N2 ) ;
2016-01-12 23:42:12 -05:00
T t2 = std : : abs ( std : : sin ( theta ) ) ;
--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
t2 = std : : pow ( t2 , m_N3 ) ;
2014-09-01 00:25:15 -04:00
T r = m_Weight * ( ( m_Rnd * rand . Frand01 < T > ( ) + ( 1 - m_Rnd ) * helper . m_PrecalcSqrtSumSquares ) - m_Holes )
2016-01-04 19:50:15 -05:00
* std : : pow ( t1 + t2 , m_PNeg1N1 ) / helper . m_PrecalcSqrtSumSquares ;
2014-07-08 03:11:14 -04:00
helper . Out . x = r * helper . In . x ;
helper . Out . y = r * helper . In . y ;
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string m = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ; //Params.
string n1 = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string n2 = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string n3 = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string rnd = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string holes = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string pm4 = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ; //Precalc.
string pNeg1N1 = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t real_t theta = " < < pm4 < < " * precalcAtanyx + M_PI_4; \n "
< < " \t \t real_t t1 = fabs(cos(theta)); \n "
< < " \t \t t1 = pow(t1, " < < n2 < < " ); \n "
< < " \t \t real_t t2 = fabs(sin(theta)); \n "
< < " \t \t t2 = pow(t2, " < < n3 < < " ); \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] * (( " < < rnd < < " * MwcNext01(mwc) + ((real_t)(1.0) - " < < rnd < < " ) * precalcSqrtSumSquares) - " < < holes < < " ) * pow(t1 + t2, " < < pNeg1N1 < < " ) / precalcSqrtSumSquares; \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = r * vIn.x; \n "
< < " \t \t vOut.y = r * vIn.y; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04:00
{
m_Pm4 = m_M / T ( 4.0 ) ;
m_PNeg1N1 = T ( - 1.0 ) / m_N1 ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_Rnd = rand . Frand01 < T > ( ) ;
2014-12-07 02:51:44 -05:00
m_M = T ( int ( rand . Frand01 < T > ( ) * 6 ) ) ;
2014-07-08 03:11:14 -04:00
m_N1 = rand . Frand01 < T > ( ) * 40 ;
m_N2 = rand . Frand01 < T > ( ) * 20 ;
m_N3 = m_N2 ;
m_Holes = 0.0 ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_M , prefix + " super_shape_m " ) ) ; //Params.
m_Params . push_back ( ParamWithName < T > ( & m_N1 , prefix + " super_shape_n1 " , 1 ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_N2 , prefix + " super_shape_n2 " , 1 ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_N3 , prefix + " super_shape_n3 " , 1 ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Rnd , prefix + " super_shape_rnd " ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Holes , prefix + " super_shape_holes " ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_Pm4 , prefix + " super_shape_pm4 " ) ) ; //Precalc.
m_Params . push_back ( ParamWithName < T > ( true , & m_PNeg1N1 , prefix + " super_shape_pneg1n1 " ) ) ;
}
private :
T m_M ; //Params.
T m_N1 ;
T m_N2 ;
T m_N3 ;
T m_Rnd ;
T m_Holes ;
T m_Pm4 ; //Precalc.
T m_PNeg1N1 ;
} ;
/// <summary>
/// Flower.
/// </summary>
template < typename T >
class EMBER_API FlowerVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
FlowerVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " flower " , eVariationId : : VAR_FLOWER , weight , true , true , false , false , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( FlowerVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T theta = helper . m_PrecalcAtanyx ;
--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 r = m_Weight * ( rand . Frand01 < T > ( ) - m_Holes ) * std : : cos ( m_Petals * theta ) / helper . m_PrecalcSqrtSumSquares ;
2014-07-08 03:11:14 -04:00
helper . Out . x = r * helper . In . x ;
helper . Out . y = r * helper . In . y ;
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string petals = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string holes = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t real_t theta = precalcAtanyx; \n "
< < " \t \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] * (MwcNext01(mwc) - " < < holes < < " ) * cos( " < < petals < < " * theta) / precalcSqrtSumSquares; \n "
< < " \n "
< < " \t \t vOut.x = r * vIn.x; \n "
< < " \t \t vOut.y = r * vIn.y; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_Petals = 4 * rand . Frand01 < T > ( ) ;
m_Holes = rand . Frand01 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Petals , prefix + " flower_petals " ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Holes , prefix + " flower_holes " ) ) ;
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_Petals ;
T m_Holes ;
} ;
/// <summary>
/// Conic.
/// </summary>
template < typename T >
class EMBER_API ConicVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
ConicVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " conic " , eVariationId : : VAR_CONIC , weight , true , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( ConicVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T ct = helper . In . x / helper . m_PrecalcSqrtSumSquares ;
2014-09-01 00:25:15 -04:00
T r = m_Weight * ( rand . Frand01 < T > ( ) - m_Holes ) *
2016-01-04 19:50:15 -05:00
m_Eccentricity / ( 1 + m_Eccentricity * ct ) / helper . m_PrecalcSqrtSumSquares ;
2014-07-08 03:11:14 -04:00
helper . Out . x = r * helper . In . x ;
helper . Out . y = r * helper . In . y ;
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string eccentricity = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string holes = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t real_t ct = vIn.x / precalcSqrtSumSquares; \n "
< < " \t \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] * (MwcNext01(mwc) - " < < holes < < " ) * " < < eccentricity < < " / (1 + " < < eccentricity < < " * ct) / precalcSqrtSumSquares; \n "
< < " \n "
< < " \t \t vOut.x = r * vIn.x; \n "
< < " \t \t vOut.y = r * vIn.y; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_Eccentricity = rand . Frand01 < T > ( ) ;
m_Holes = rand . Frand01 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Eccentricity , prefix + " conic_eccentricity " , 1 ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Holes , prefix + " conic_holes " ) ) ;
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_Eccentricity ;
T m_Holes ;
} ;
/// <summary>
/// Parabola.
/// </summary>
template < typename T >
class EMBER_API ParabolaVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
ParabolaVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " parabola " , eVariationId : : VAR_PARABOLA , weight , true , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( ParabolaVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T sr , cr ;
sincos ( helper . m_PrecalcSqrtSumSquares , & sr , & cr ) ;
helper . Out . x = m_Height * m_Weight * sr * sr * rand . Frand01 < T > ( ) ;
helper . Out . y = m_Width * m_Weight * cr * rand . Frand01 < T > ( ) ;
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string height = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string width = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t real_t sr = sin(precalcSqrtSumSquares); \n "
< < " \t \t real_t cr = cos(precalcSqrtSumSquares); \n "
< < " \n "
< < " \t \t vOut.x = " < < height < < " * (xform->m_VariationWeights[ " < < varIndex < < " ] * sr * sr * MwcNext01(mwc)); \n "
< < " \t \t vOut.y = " < < width < < " * (xform->m_VariationWeights[ " < < varIndex < < " ] * cr * MwcNext01(mwc)); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_Height = T ( 0.5 ) * rand . Frand01 < T > ( ) ;
m_Width = T ( 0.5 ) * rand . Frand01 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Height , prefix + " parabola_height " ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Width , prefix + " parabola_width " ) ) ;
}
private :
T m_Height ;
T m_Width ;
} ;
/// <summary>
/// Bent2.
/// </summary>
template < typename T >
class EMBER_API Bent2Variation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
Bent2Variation ( T weight = 1.0 ) : ParametricVariation < T > ( " bent2 " , eVariationId : : VAR_BENT2 , weight )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( Bent2Variation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
if ( helper . In . x > = 0 )
helper . Out . x = m_Weight * helper . In . x ;
else
helper . Out . x = m_Vx * helper . In . x ;
if ( helper . In . y > = 0 )
helper . Out . y = m_Weight * helper . In . y ;
else
helper . Out . y = m_Vy * helper . In . y ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string x = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string y = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string vx = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string vy = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t if (vIn.x >= 0) \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.x; \n "
< < " \t \t else \n "
< < " \t \t vOut.x = " < < vx < < " * vIn.x; \n "
< < " \n "
< < " \t \t if (vIn.y >= 0) \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.y; \n "
< < " \t \t else \n "
< < " \t \t vOut.y = " < < vy < < " * vIn.y; \n "
< < " \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04:00
{
m_Vx = m_X * m_Weight ;
m_Vy = m_Y * m_Weight ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_X = 3 * ( T ( - 0.5 ) + rand . Frand01 < T > ( ) ) ;
m_Y = 3 * ( T ( - 0.5 ) + rand . Frand01 < T > ( ) ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_X , prefix + " bent2_x " , 1 ) ) ; //Params.
m_Params . push_back ( ParamWithName < T > ( & m_Y , prefix + " bent2_y " , 1 ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_Vx , prefix + " bent2_vx " ) ) ; //Precalc.
m_Params . push_back ( ParamWithName < T > ( true , & m_Vy , prefix + " bent2_vy " ) ) ;
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_X ; //Params.
T m_Y ;
T m_Vx ; //Precalc.
T m_Vy ;
} ;
/// <summary>
/// Bipolar.
/// </summary>
template < typename T >
class EMBER_API BipolarVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
BipolarVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " bipolar " , eVariationId : : VAR_BIPOLAR , weight , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( BipolarVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04: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
const T x2y2 = helper . m_PrecalcSumSquares ;
const T t = x2y2 + 1 ;
const T x2 = 2 * helper . In . x ;
2014-07-08 03:11:14 -04:00
T y = T ( 0.5 ) * atan2 ( 2 * helper . In . y , x2y2 - 1 ) + m_S ;
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
if ( y > T ( M_PI_2 ) )
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
y = - T ( M_PI_2 ) + fmod ( y + T ( M_PI_2 ) , T ( M_PI ) ) ;
else if ( y < - T ( M_PI_2 ) )
2014-07-08 03:11:14 -04:00
y = T ( M_PI_2 ) - fmod ( T ( M_PI_2 ) - y , T ( M_PI ) ) ;
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
const T f = t + x2 ;
const T g = t - x2 ;
2014-07-08 03:11:14 -04:00
if ( ( g = = 0 ) | | ( f / g < = 0 ) )
{
2016-01-04 19:50:15 -05:00
if ( m_VarType = = eVariationType : : VARTYPE_REG )
2014-07-08 03:11:14 -04:00
{
helper . Out . x = 0 ;
helper . Out . y = 0 ;
helper . Out . z = 0 ;
}
else
{
helper . Out . x = helper . In . x ;
helper . Out . y = helper . In . y ;
helper . Out . z = helper . In . z ;
}
}
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
helper . Out . x = m_V4 * std : : log ( ( t + x2 ) / ( t - x2 ) ) ;
2014-07-08 03:11:14 -04:00
helper . Out . y = m_V * y ;
helper . Out . z = m_Weight * helper . In . z ;
}
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string shift = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string s = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string v = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string v4 = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t real_t x2y2 = precalcSumSquares; \n "
< < " \t \t real_t t = x2y2 + 1; \n "
< < " \t \t real_t x2 = 2 * vIn.x; \n "
< < " \t \t real_t ps = " < < s < < " ; \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t y = (real_t)(0.5) * atan2((real_t)(2.0) * vIn.y, x2y2 - (real_t)(1.0)) + ps; \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t if (y > M_PI_2) \n "
< < " \t \t y = -M_PI_2 + fmod(y + M_PI_2, M_PI); \n "
< < " \t \t else if (y < -M_PI_2) \n "
< < " \t \t y = M_PI_2 - fmod(M_PI_2 - y, M_PI); \n "
< < " \n "
< < " \t \t real_t f = t + x2; \n "
< < " \t \t real_t g = t - x2; \n "
< < " \n " ;
2016-01-04 19:50:15 -05:00
if ( m_VarType = = eVariationType : : VARTYPE_REG )
2014-07-08 03:11:14 -04:00
{
ss < < " \t \t if ((g == 0) || (f / g <= 0)) \n "
< < " \t \t { \n "
< < " \t \t vOut.x = 0; \n "
< < " \t \t vOut.y = 0; \n "
< < " \t \t vOut.z = 0; \n "
< < " \t \t } \n " ;
}
else
{
ss < < " \t \t if ((g == 0) || (f / g <= 0)) \n "
< < " \t \t { \n "
< < " \t \t vOut.x = vIn.x; \n "
< < " \t \t vOut.y = vIn.y; \n "
< < " \t \t vOut.z = vIn.z; \n "
< < " \t \t } \n " ;
}
ss < < " \t \t else \n "
< < " \t \t { \n "
< < " \t \t vOut.x = ( " < < v4 < < " * log((t + x2) / (t - x2))); \n "
< < " \t \t vOut.y = ( " < < v < < " * y); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t \t } \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04: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
m_S = - T ( M_PI_2 ) * m_Shift ; ;
2014-07-08 03:11:14 -04:00
m_V = m_Weight * T ( M_2_PI ) ;
m_V4 = m_Weight * T ( 0.25 ) * T ( M_2_PI ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_Shift = 2 * rand . Frand01 < T > ( ) - 1 ;
}
2014-09-01 00:25:15 -04:00
virtual bool SetParamVal ( const char * name , T val ) override
2014-07-08 03:11:14 -04: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 ( ! _stricmp ( name , " bipolar_shift " ) )
2014-07-08 03:11:14 -04:00
{
T temp = Fabsmod ( T ( 0.5 ) * ( val + 1 ) ) ;
m_Shift = 2 * temp - 1 ;
Precalc ( ) ;
return true ;
}
return ParametricVariation < T > : : SetParamVal ( name , val ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Shift , prefix + " bipolar_shift " ) ) ; //Params.
m_Params . push_back ( ParamWithName < T > ( true , & m_S , prefix + " bipolar_s " ) ) ; //Precalc.
m_Params . push_back ( ParamWithName < T > ( true , & m_V , prefix + " bipolar_v " ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_V4 , prefix + " bipolar_v4 " ) ) ;
}
private :
T m_Shift ; //Params.
T m_S ; //Precalc.
T m_V ;
T m_V4 ;
} ;
/// <summary>
/// Boarders.
/// </summary>
template < typename T >
class EMBER_API BoardersVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
BoardersVariation ( T weight = 1.0 ) : Variation < T > ( " boarders " , eVariationId : : VAR_BOARDERS , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( BoardersVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T roundX = Rint ( helper . In . x ) ;
T roundY = Rint ( helper . In . y ) ;
T offsetX = helper . In . x - roundX ;
T offsetY = helper . In . y - roundY ;
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
if ( rand . Frand01 < T > ( ) > = 0.75 )
{
helper . Out . x = m_Weight * ( offsetX * T ( 0.5 ) + roundX ) ;
helper . Out . y = m_Weight * ( offsetY * T ( 0.5 ) + roundY ) ;
}
else
{
2016-01-12 23:42:12 -05:00
if ( std : : abs ( offsetX ) > = std : : abs ( offsetY ) )
2014-07-08 03:11:14 -04:00
{
if ( offsetX > = 0.0 )
{
helper . Out . x = m_Weight * ( offsetX * T ( 0.5 ) + roundX + T ( 0.25 ) ) ;
helper . Out . y = m_Weight * ( offsetY * T ( 0.5 ) + roundY + T ( 0.25 ) * offsetY / offsetX ) ;
}
else
{
helper . Out . x = m_Weight * ( offsetX * T ( 0.5 ) + roundX - T ( 0.25 ) ) ;
2014-09-01 00:25:15 -04:00
helper . Out . y = m_Weight * ( offsetY * T ( 0.5 ) + roundY - T ( 0.25 ) * offsetY / offsetX ) ;
2014-07-08 03:11:14 -04:00
}
}
else
{
if ( offsetY > = 0.0 )
{
helper . Out . y = m_Weight * ( offsetY * T ( 0.5 ) + roundY + T ( 0.25 ) ) ;
helper . Out . x = m_Weight * ( offsetX * T ( 0.5 ) + roundX + offsetX / offsetY * T ( 0.25 ) ) ;
}
else
{
helper . Out . y = m_Weight * ( offsetY * T ( 0.5 ) + roundY - T ( 0.25 ) ) ;
helper . Out . x = m_Weight * ( offsetX * T ( 0.5 ) + roundX - offsetX / offsetY * T ( 0.25 ) ) ;
}
}
}
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t roundX = Rint(vIn.x); \n "
< < " \t \t real_t roundY = Rint(vIn.y); \n "
< < " \t \t real_t offsetX = vIn.x - roundX; \n "
< < " \t \t real_t offsetY = vIn.y - roundY; \n "
< < " \n "
2015-02-26 16:18:55 -05:00
< < " \t \t if (MwcNext01(mwc) >= (real_t)(0.75)) \n "
2014-07-08 03:11:14 -04:00
< < " \t \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * (offsetX * (real_t)(0.5) + roundX); \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * (offsetY * (real_t)(0.5) + roundY); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t } \n "
< < " \t \t else \n "
< < " \t \t { \n "
< < " \t \t if (fabs(offsetX) >= fabs(offsetY)) \n "
< < " \t \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t if (offsetX >= (real_t)(0.0)) \n "
2014-07-08 03:11:14 -04:00
< < " \t \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * (offsetX * (real_t)(0.5) + roundX + (real_t)(0.25)); \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * (offsetY * (real_t)(0.5) + roundY + (real_t)(0.25) * offsetY / offsetX); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t } \n "
< < " \t \t else \n "
< < " \t \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * (offsetX * (real_t)(0.5) + roundX - (real_t)(0.25)); \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * (offsetY * (real_t)(0.5) + roundY - (real_t)(0.25) * offsetY / offsetX); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t } \n "
< < " \t \t } \n "
< < " \t \t else \n "
< < " \t \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t if (offsetY >= (real_t)(0.0)) \n "
2014-07-08 03:11:14 -04:00
< < " \t \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * (offsetY * (real_t)(0.5) + roundY + (real_t)(0.25)); \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * (offsetX * (real_t)(0.5) + roundX + offsetX / offsetY * (real_t)(0.25)); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t } \n "
< < " \t \t else \n "
< < " \t \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * (offsetY * (real_t)(0.5) + roundY - (real_t)(0.25)); \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * (offsetX * (real_t)(0.5) + roundX - offsetX / offsetY * (real_t)(0.25)); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t } \n "
< < " \t \t } \n "
< < " \t \t } \n "
< < " \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Butterfly.
/// </summary>
template < typename T >
class EMBER_API ButterflyVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
ButterflyVariation ( T weight = 1.0 ) : Variation < T > ( " butterfly " , eVariationId : : VAR_BUTTERFLY , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( ButterflyVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T wx = m_Weight * T ( 1.3029400317411197908970256609023 ) ; //This precision came from the original.
T y2 = helper . In . y * 2 ;
2016-01-12 23:42:12 -05:00
T r = wx * std : : sqrt ( std : : abs ( helper . In . y * helper . In . x ) / Zeps ( SQR ( helper . In . x ) + SQR ( y2 ) ) ) ;
2014-07-08 03:11:14 -04:00
helper . Out . x = r * helper . In . x ;
helper . Out . y = r * y2 ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t wx = xform->m_VariationWeights[ " < < varIndex < < " ] * (real_t)(1.3029400317411197908970256609023); \n "
< < " \t \t real_t y2 = vIn.y * (real_t)(2.0); \n "
2014-07-28 01:25:38 -04:00
< < " \t \t real_t r = wx * sqrt(fabs(vIn.y * vIn.x) / Zeps(SQR(vIn.x) + SQR(y2))); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = r * vIn.x; \n "
< < " \t \t vOut.y = r * y2; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
--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
virtual vector < string > OpenCLGlobalFuncNames ( ) const override
{
return vector < string > { " Zeps " } ;
}
2014-07-08 03:11:14 -04:00
} ;
/// <summary>
/// Cell.
/// </summary>
template < typename T >
class EMBER_API CellVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
CellVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " cell " , eVariationId : : VAR_CELL , weight )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( CellVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T invCellSize = 1 / m_Size ;
T x = floor ( helper . In . x * invCellSize ) ; //Calculate input cell. Note that int cast is omitted here. See below.
T y = floor ( helper . In . y * invCellSize ) ;
T dx = helper . In . x - x * m_Size ; //Offset from cell origin.
T dy = helper . In . y - y * m_Size ;
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
//Interleave cells.
if ( y > = 0 )
{
if ( x > = 0 )
{
y * = 2 ;
x * = 2 ;
}
else
{
y * = 2 ;
x = - ( 2 * x + 1 ) ;
}
}
else
{
if ( x > = 0 )
{
y = - ( 2 * y + 1 ) ;
x * = 2 ;
}
else
{
y = - ( 2 * y + 1 ) ;
x = - ( 2 * x + 1 ) ;
}
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
helper . Out . x = m_Weight * ( dx + x * m_Size ) ;
helper . Out . y = - ( m_Weight * ( dy + y * m_Size ) ) ;
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
/// <summary>
/// Cell is very strange and will not run using integers.
/// When using floats, it at least gives some output, however
/// that output is slightly different than the CPU. But not by enough
/// to change the shape of the final image.
/// </summary>
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string size = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t invCellSize = (real_t)(1.0) / " < < size < < " ; \n "
2014-07-08 03:11:14 -04:00
//Float to int, orig.
//<< "\t\tint x = (int)floor(vIn.x * invCellSize);\n"
//<< "\t\tint y = (int)floor(vIn.y * invCellSize);\n"
//For some reason, OpenCL renders nothing if these are ints, so use floats.
//Note that Cuburn also omits the usage of ints.
< < " \t \t real_t x = floor(vIn.x * invCellSize); \n "
< < " \t \t real_t y = floor(vIn.y * invCellSize); \n "
< < " \t \t real_t dx = vIn.x - x * " < < size < < " ; \n "
< < " \t \t real_t dy = vIn.y - y * " < < size < < " ; \n "
< < " \n "
< < " \t \t if (y >= 0) \n "
< < " \t \t { \n "
< < " \t \t if (x >= 0) \n "
< < " \t \t { \n "
< < " \t \t y *= 2; \n "
< < " \t \t x *= 2; \n "
< < " \t \t } \n "
< < " \t \t else \n "
< < " \t \t { \n "
< < " \t \t y *= 2; \n "
< < " \t \t x = -(2 * x + 1); \n "
< < " \t \t } \n "
< < " \t \t } \n "
< < " \t \t else \n "
< < " \t \t { \n "
< < " \t \t if (x >= 0) \n "
< < " \t \t { \n "
< < " \t \t y = -(2 * y + 1); \n "
< < " \t \t x *= 2; \n "
< < " \t \t } \n "
< < " \t \t else \n "
< < " \t \t { \n "
< < " \t \t y = -(2 * y + 1); \n "
< < " \t \t x = -(2 * x + 1); \n "
< < " \t \t } \n "
< < " \t \t } \n "
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * (dx + x * " < < size < < " ); \n "
< < " \t \t vOut.y = -(xform->m_VariationWeights[ " < < varIndex < < " ] * (dy + y * " < < size < < " )); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_Size = 2 * rand . Frand01 < T > ( ) + T ( 0.5 ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Size , prefix + " cell_size " , 1 ) ) ;
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_Size ;
} ;
/// <summary>
/// Cpow.
/// </summary>
template < typename T >
class EMBER_API CpowVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
CpowVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " cpow " , eVariationId : : VAR_CPOW , weight , true , false , false , false , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( CpowVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T a = helper . m_PrecalcAtanyx ;
--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 lnr = T ( 0.5 ) * std : : log ( helper . m_PrecalcSumSquares ) ;
2014-07-08 03:11:14 -04:00
T angle = m_C * a + m_D * lnr + m_Ang * Floor < T > ( m_Power * rand . Frand01 < 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
T m = m_Weight * std : : exp ( m_C * lnr - m_D * a ) ;
helper . Out . x = m * std : : cos ( angle ) ;
helper . Out . y = m * std : : sin ( angle ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string powerR = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string powerI = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string power = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string c = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string d = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string ang = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t real_t a = precalcAtanyx; \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t lnr = (real_t)(0.5) * log(precalcSumSquares); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t real_t angle = " < < c < < " * a + " < < d < < " * lnr + " < < ang < < " * floor( " < < power < < " * MwcNext01(mwc)); \n "
< < " \t \t real_t m = xform->m_VariationWeights[ " < < varIndex < < " ] * exp( " < < c < < " * lnr - " < < d < < " * a); \n "
< < " \n "
< < " \t \t vOut.x = m * cos(angle); \n "
< < " \t \t vOut.y = m * sin(angle); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04:00
{
m_C = m_PowerR / m_Power ;
m_D = m_PowerI / m_Power ;
m_Ang = 2 * T ( M_PI ) / m_Power ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_PowerR = 3 * rand . Frand01 < T > ( ) ;
m_PowerI = rand . Frand01 < T > ( ) - T ( 0.5 ) ;
m_Params [ 2 ] . Set ( 5 * rand . Frand01 < T > ( ) ) ; //Power.
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_PowerR , prefix + " cpow_r " , 1 ) ) ; //Params.
m_Params . push_back ( ParamWithName < T > ( & m_PowerI , prefix + " cpow_i " ) ) ;
2016-01-04 19:50:15 -05:00
m_Params . push_back ( ParamWithName < T > ( & m_Power , prefix + " cpow_power " , 1 , eParamType : : INTEGER_NONZERO ) ) ;
2014-07-08 03:11:14 -04:00
m_Params . push_back ( ParamWithName < T > ( true , & m_C , prefix + " cpow_c " ) ) ; //Precalc.
m_Params . push_back ( ParamWithName < T > ( true , & m_D , prefix + " cpow_d " ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_Ang , prefix + " cpow_ang " ) ) ;
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_PowerR ; //Params.
T m_PowerI ;
T m_Power ;
T m_C ; //Precalc.
T m_D ;
T m_Ang ;
} ;
/// <summary>
/// Curve.
/// </summary>
template < typename T >
class EMBER_API CurveVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
CurveVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " curve " , eVariationId : : VAR_CURVE , weight )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( CurveVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
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
helper . Out . x = m_Weight * helper . In . x + m_XAmpV * std : : exp ( - helper . In . y * helper . In . y * m_XLengthV ) ;
helper . Out . y = m_Weight * helper . In . y + m_YAmpV * std : : exp ( - helper . In . x * helper . In . x * m_YLengthV ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string xAmp = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string yAmp = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string xLength = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string yLength = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string xAmpV = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string yAmpV = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string xLengthV = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string yLengthV = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.x + " < < xAmpV < < " * exp(-vIn.y * vIn.y * " < < xLengthV < < " ); \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.y + " < < yAmpV < < " * exp(-vIn.x * vIn.x * " < < yLengthV < < " ); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04:00
{
m_XAmpV = m_Weight * m_XAmp ;
m_YAmpV = m_Weight * m_YAmp ;
2015-03-21 18:27:37 -04:00
m_XLengthV = 1 / std : : max ( SQR ( m_XLength ) , T ( 1e-20 ) ) ;
m_YLengthV = 1 / std : : max ( SQR ( m_YLength ) , T ( 1e-20 ) ) ;
2014-07-08 03:11:14 -04:00
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_XAmp = 5 * ( rand . Frand01 < T > ( ) - T ( 0.5 ) ) ;
m_YAmp = 4 * ( rand . Frand01 < T > ( ) - T ( 0.5 ) ) ;
m_XLength = 2 * ( rand . Frand01 < T > ( ) + T ( 0.5 ) ) ;
m_YLength = 2 * ( rand . Frand01 < T > ( ) + T ( 0.5 ) ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_XAmp , prefix + " curve_xamp " ) ) ; //Params.
m_Params . push_back ( ParamWithName < T > ( & m_YAmp , prefix + " curve_yamp " ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_XLength , prefix + " curve_xlength " , 1 ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_YLength , prefix + " curve_ylength " , 1 ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_XAmpV , prefix + " curve_xampv " ) ) ; //Precalc.
m_Params . push_back ( ParamWithName < T > ( true , & m_YAmpV , prefix + " curve_yampv " ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_XLengthV , prefix + " curve_xlenv " ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_YLengthV , prefix + " curve_ylenv " ) ) ;
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_XAmp ; //Params.
T m_YAmp ;
T m_XLength ;
T m_YLength ;
T m_XAmpV ; //Precalc.
T m_YAmpV ;
T m_XLengthV ;
T m_YLengthV ;
} ;
/// <summary>
/// Edisc.
/// </summary>
template < typename T >
class EMBER_API EdiscVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
EdiscVariation ( T weight = 1.0 ) : Variation < T > ( " edisc " , eVariationId : : VAR_EDISC , weight , true ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( EdiscVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T tmp = helper . m_PrecalcSumSquares + 1 ;
T tmp2 = 2 * helper . In . x ;
2015-04-13 07:32:58 -04:00
T r1 = std : : sqrt ( tmp + tmp2 ) ;
T r2 = std : : sqrt ( tmp - tmp2 ) ;
2014-07-08 03:11:14 -04:00
T xmax = ( r1 + r2 ) * T ( 0.5 ) ;
--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 a1 = std : : log ( xmax + std : : sqrt ( xmax - 1 ) ) ;
T a2 = - std : : acos ( Clamp < T > ( helper . In . x / xmax , - 1 , 1 ) ) ;
2014-07-08 03:11:14 -04:00
T w = m_Weight / T ( 11.57034632 ) ; //This is an interesting magic number.
T snv , csv , snhu , cshu ;
sincos ( a1 , & snv , & csv ) ;
snhu = sinh ( a2 ) ;
cshu = cosh ( a2 ) ;
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
if ( helper . In . y > 0.0 )
snv = - snv ;
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
helper . Out . x = w * cshu * csv ;
helper . Out . y = w * snhu * snv ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t tmp = precalcSumSquares + (real_t)(1.0); \n "
< < " \t \t real_t tmp2 = (real_t)(2.0) * vIn.x; \n "
2014-07-08 03:11:14 -04:00
< < " \t \t real_t r1 = sqrt(tmp + tmp2); \n "
< < " \t \t real_t r2 = sqrt(tmp - tmp2); \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t xmax = (r1 + r2) * (real_t)(0.5); \n "
< < " \t \t real_t a1 = log(xmax + sqrt(xmax - (real_t)(1.0))); \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
< < " \t \t real_t a2 = -acos(clamp(vIn.x / xmax, -(real_t)(1.0), (real_t)(1.0))); \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t w = xform->m_VariationWeights[ " < < varIndex < < " ] / (real_t)(11.57034632); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t real_t snv = sin(a1); \n "
< < " \t \t real_t csv = cos(a1); \n "
< < " \t \t real_t snhu = sinh(a2); \n "
< < " \t \t real_t cshu = cosh(a2); \n "
< < " \t \t if (vIn.y > 0) \n "
< < " \t \t snv = -snv; \n "
< < " \t \t vOut.x = w * cshu * csv; \n "
< < " \t \t vOut.y = w * snhu * snv; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Elliptic.
/// </summary>
template < typename 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
class EMBER_API EllipticVariation : public ParametricVariation < T >
2014-07-08 03:11:14 -04:00
{
public :
2016-01-04 19:50:15 -05:00
EllipticVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " elliptic " , eVariationId : : VAR_ELLIPTIC , weight , 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
{
Init ( ) ;
}
2014-07-08 03:11:14 -04: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
PARVARCOPY ( EllipticVariation )
2014-07-08 03:11:14 -04:00
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T tmp = helper . m_PrecalcSumSquares + 1 ;
T x2 = 2 * helper . In . x ;
2015-04-13 07:32:58 -04:00
T xmax = T ( 0.5 ) * ( std : : sqrt ( tmp + x2 ) + std : : sqrt ( tmp - x2 ) ) ;
2014-07-08 03:11:14 -04:00
T a = helper . In . x / xmax ;
T b = 1 - a * a ;
T ssx = xmax - 1 ;
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
const T w = m_WeightDivPiDiv2 ;
2014-07-08 03:11:14 -04:00
if ( b < 0 )
b = 0 ;
else
2015-04-13 07:32:58 -04:00
b = std : : sqrt ( b ) ;
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
if ( ssx < 0 )
ssx = 0 ;
else
2015-04-13 07:32:58 -04:00
ssx = std : : sqrt ( ssx ) ;
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
helper . Out . x = w * atan2 ( a , b ) ;
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
if ( helper . In . y > 0 )
--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
helper . Out . y = w * std : : log ( xmax + ssx ) ;
2014-07-08 03:11:14 -04:00
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
helper . Out . y = - ( w * std : : log ( xmax + ssx ) ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04: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
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
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
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string weightDivPiDiv2 = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t tmp = precalcSumSquares + (real_t)(1.0); \n "
< < " \t \t real_t x2 = (real_t)(2.0) * vIn.x; \n "
< < " \t \t real_t xmax = (real_t)(0.5) * (sqrt(tmp + x2) + sqrt(tmp - x2)); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t real_t a = vIn.x / xmax; \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t b = (real_t)(1.0) - a * a; \n "
< < " \t \t real_t ssx = xmax - (real_t)(1.0); \n "
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 \t const real_t w = " < < weightDivPiDiv2 < < " ; \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t if (b < 0) \n "
< < " \t \t b = 0; \n "
< < " \t \t else \n "
< < " \t \t b = sqrt(b); \n "
< < " \n "
< < " \t \t if (ssx < 0) \n "
< < " \t \t ssx = 0; \n "
< < " \t \t else \n "
< < " \t \t ssx = sqrt(ssx); \n "
< < " \n "
< < " \t \t vOut.x = w * atan2(a, b); \n "
< < " \n "
< < " \t \t if (vIn.y > 0) \n "
< < " \t \t vOut.y = w * log(xmax + ssx); \n "
< < " \t \t else \n "
< < " \t \t vOut.y = -(w * log(xmax + ssx)); \n "
< < " \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
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
{
m_WeightDivPiDiv2 = m_Weight / T ( M_PI_2 ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_WeightDivPiDiv2 , prefix + " elliptic_weight_div_pi_div_2 " ) ) ; //Precalc.
}
2014-09-01 00:25:15 -04: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
private :
T m_WeightDivPiDiv2 ; //Precalc.
2014-07-08 03:11:14 -04:00
} ;
/// <summary>
/// Escher.
/// </summary>
template < typename T >
class EMBER_API EscherVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
EscherVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " escher " , eVariationId : : VAR_ESCHER , weight , true , false , false , false , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( EscherVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T a = helper . m_PrecalcAtanyx ;
--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 lnr = T ( 0.5 ) * std : : log ( helper . m_PrecalcSumSquares ) ;
T m = m_Weight * std : : exp ( m_C * lnr - m_D * a ) ;
2014-07-08 03:11:14 -04:00
T n = m_C * a + m_D * lnr ;
--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
helper . Out . x = m * std : : cos ( n ) ;
helper . Out . y = m * std : : sin ( n ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string beta = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string c = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string d = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t real_t a = precalcAtanyx; \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t lnr = (real_t)(0.5) * log(precalcSumSquares); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t real_t m = xform->m_VariationWeights[ " < < varIndex < < " ] * exp( " < < c < < " * lnr - " < < d < < " * a); \n "
< < " \t \t real_t n = " < < c < < " * a + " < < d < < " * lnr; \n "
< < " \n "
< < " \t \t vOut.x = m * cos(n); \n "
< < " \t \t vOut.y = m * sin(n); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04:00
{
sincos ( m_Beta , & m_D , & m_C ) ;
m_C = T ( 0.5 ) * ( 1 + m_C ) ;
m_D = T ( 0.5 ) * m_D ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
SetParamVal ( " escher_beta " , T ( M_PI ) * rand . Frand01 < T > ( ) ) ;
}
2014-09-01 00:25:15 -04:00
virtual bool SetParamVal ( const char * name , T val ) override
2014-07-08 03:11:14 -04: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 ( ! _stricmp ( name , " escher_beta " ) )
2014-07-08 03:11:14 -04:00
{
m_Beta = Fabsmod ( ( val + T ( M_PI ) ) / ( 2 * T ( M_PI ) ) ) * 2 * T ( M_PI ) - T ( M_PI ) ;
Precalc ( ) ;
return true ;
}
return ParametricVariation < T > : : SetParamVal ( name , val ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Beta , prefix + " escher_beta " ) ) ; //Params.
m_Params . push_back ( ParamWithName < T > ( true , & m_C , prefix + " escher_beta_c " ) ) ; //Precalc.
m_Params . push_back ( ParamWithName < T > ( true , & m_D , prefix + " escher_beta_d " ) ) ;
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_Beta ; //Params.
T m_C ; //Precalc.
T m_D ;
} ;
/// <summary>
/// Foci.
/// </summary>
template < typename T >
class EMBER_API FociVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
FociVariation ( T weight = 1.0 ) : Variation < T > ( " foci " , eVariationId : : VAR_FOCI , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( FociVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
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
T expx = std : : exp ( helper . In . x ) * T ( 0.5 ) ;
2014-07-08 03:11:14 -04:00
T expnx = T ( 0.25 ) / expx ;
T sn , cn , tmp ;
sincos ( helper . In . y , & sn , & cn ) ;
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
tmp = m_Weight / Zeps ( expx + expnx - cn ) ;
2014-07-08 03:11:14 -04:00
helper . Out . x = tmp * ( expx - expnx ) ;
helper . Out . y = tmp * sn ;
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
helper . Out . z = m_Weight * helper . In . z ;
2014-07-08 03:11:14 -04:00
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t expx = exp(vIn.x) * (real_t)(0.5); \n "
< < " \t \t real_t expnx = (real_t)(0.25) / expx; \n "
2014-07-08 03:11:14 -04:00
< < " \t \t real_t sn = sin(vIn.y); \n "
< < " \t \t real_t cn = cos(vIn.y); \n "
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 \t real_t tmp = Zeps(expx + expnx - cn); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t tmp = xform->m_VariationWeights[ " < < varIndex < < " ] / tmp; \n "
< < " \n "
< < " \t \t vOut.x = tmp * (expx - expnx); \n "
< < " \t \t vOut.y = tmp * sn; \n "
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 \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
2014-07-08 03:11:14 -04:00
< < " \t } \n " ;
return ss . str ( ) ;
}
--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
virtual vector < string > OpenCLGlobalFuncNames ( ) const override
{
return vector < string > { " Zeps " } ;
}
2014-07-08 03:11:14 -04:00
} ;
/// <summary>
/// LazySusan.
/// </summary>
template < typename T >
class EMBER_API LazySusanVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
LazySusanVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " lazysusan " , eVariationId : : VAR_LAZYSUSAN , weight )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( LazySusanVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T x = helper . In . x - m_X ;
T y = helper . In . y + m_Y ;
2015-04-13 07:32:58 -04:00
T r = std : : sqrt ( x * x + y * y ) ;
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
if ( r < m_Weight )
{
T a = atan2 ( y , x ) + m_Spin + m_Twist * ( m_Weight - r ) ;
--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
helper . Out . x = m_Weight * ( r * std : : cos ( a ) + m_X ) ; //Fix to make it colapse to 0 when weight is 0.//SMOULDER
helper . Out . y = m_Weight * ( r * std : : sin ( a ) - m_Y ) ;
2014-07-08 03:11:14 -04:00
}
else
{
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
r = 1 + m_Space / Zeps ( r ) ;
2014-07-08 03:11:14 -04:00
helper . Out . x = m_Weight * ( r * x + m_X ) ; //Fix to make it colapse to 0 when weight is 0.//SMOULDER
helper . Out . y = m_Weight * ( r * y - m_Y ) ;
}
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string spin = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string space = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string twist = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string x = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string y = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t real_t x = vIn.x - " < < x < < " ; \n "
< < " \t \t real_t y = vIn.y + " < < y < < " ; \n "
< < " \t \t real_t r = sqrt(x * x + y * y); \n "
< < " \n "
< < " \t \t if (r < xform->m_VariationWeights[ " < < varIndex < < " ]) \n "
< < " \t \t { \n "
< < " \t \t real_t a = atan2(y, x) + " < < spin < < " + " < < twist < < " * (xform->m_VariationWeights[ " < < varIndex < < " ] - r); \n "
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * (r * cos(a) + " < < x < < " ); \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * (r * sin(a) - " < < y < < " ); \n "
< < " \t \t } \n "
< < " \t \t else \n "
< < " \t \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t r = (real_t)(1.0) + " < < space < < " / Zeps(r); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * (r * x + " < < x < < " ); \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * (r * y - " < < y < < " ); \n "
< < " \t \t } \n "
< < " \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -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
virtual vector < string > OpenCLGlobalFuncNames ( ) const override
{
return vector < string > { " Zeps " } ;
}
2014-09-01 00:25:15 -04:00
virtual bool SetParamVal ( const char * name , T val ) override
2014-07-08 03:11:14 -04: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 ( ! _stricmp ( name , " lazysusan_spin " ) )
2014-07-08 03:11:14 -04:00
{
m_Spin = Fabsmod ( val / T ( M_2PI ) ) * T ( M_2PI ) ;
2014-09-01 00:25:15 -04:00
this - > Precalc ( ) ;
2014-07-08 03:11:14 -04:00
return true ;
}
return ParametricVariation < T > : : SetParamVal ( name , val ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_X = 2 * rand . Frand11 < T > ( ) ;
m_Y = 2 * rand . Frand11 < T > ( ) ;
m_Spin = T ( M_PI ) * rand . Frand11 < T > ( ) ;
m_Space = 2 * rand . Frand11 < T > ( ) ;
m_Twist = 2 * rand . Frand11 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Spin , prefix + " lazysusan_spin " , T ( M_PI ) ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Space , prefix + " lazysusan_space " ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Twist , prefix + " lazysusan_twist " ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_X , prefix + " lazysusan_x " ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Y , prefix + " lazysusan_y " ) ) ;
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_Spin ;
T m_Space ;
T m_Twist ;
T m_X ;
T m_Y ;
} ;
/// <summary>
/// Loonie.
/// </summary>
template < typename T >
class EMBER_API LoonieVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
LoonieVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " loonie " , eVariationId : : VAR_LOONIE , weight , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( LoonieVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04: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 ( helper . m_PrecalcSumSquares < m_W2 & & helper . m_PrecalcSumSquares ! = 0 )
2014-07-08 03:11:14 -04:00
{
2015-04-13 07:32:58 -04:00
T r = m_Weight * std : : sqrt ( ( m_W2 / helper . m_PrecalcSumSquares ) - 1 ) ;
2014-07-08 03:11:14 -04:00
helper . Out . x = r * helper . In . x ;
helper . Out . y = r * helper . In . y ;
}
else
{
helper . Out . x = m_Weight * helper . In . x ;
helper . Out . y = m_Weight * helper . In . y ;
}
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string w2 = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
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 \t if (precalcSumSquares < " < < w2 < < " && precalcSumSquares != 0) \n "
2014-07-08 03:11:14 -04:00
< < " \t \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] * sqrt(( " < < w2 < < " / precalcSumSquares) - (real_t)(1.0)); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t vOut.x = r * vIn.x; \n "
< < " \t \t vOut.y = r * vIn.y; \n "
< < " \t \t } \n "
< < " \t \t else \n "
< < " \t \t { \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.x; \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.y; \n "
< < " \t \t } \n "
< < " \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04:00
{
m_W2 = SQR ( m_Weight ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_W2 , prefix + " loonie_w2 " ) ) ; //Precalc.
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_W2 ; //Precalc.
} ;
/// <summary>
/// Modulus.
/// </summary>
template < typename T >
class EMBER_API ModulusVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
ModulusVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " modulus " , eVariationId : : VAR_MODULUS , weight )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( ModulusVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
if ( helper . In . x > m_X )
helper . Out . x = m_Weight * ( - m_X + fmod ( helper . In . x + m_X , m_XRange ) ) ;
else if ( helper . In . x < - m_X )
helper . Out . x = m_Weight * ( m_X - fmod ( m_X - helper . In . x , m_XRange ) ) ;
else
helper . Out . x = m_Weight * helper . In . x ;
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
if ( helper . In . y > m_Y )
helper . Out . y = m_Weight * ( - m_Y + fmod ( helper . In . y + m_Y , m_YRange ) ) ;
else if ( helper . In . y < - m_Y )
helper . Out . y = m_Weight * ( m_Y - fmod ( m_Y - helper . In . y , m_YRange ) ) ;
else
helper . Out . y = m_Weight * helper . In . y ;
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string x = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string y = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string xr = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string yr = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t if (vIn.x > " < < x < < " ) \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * (- " < < x < < " + fmod(vIn.x + " < < x < < " , " < < xr < < " )); \n "
< < " \t \t else if (vIn.x < - " < < x < < " ) \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * ( " < < x < < " - fmod( " < < x < < " - vIn.x, " < < xr < < " )); \n "
< < " \t \t else \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.x; \n "
2014-09-01 00:25:15 -04:00
< < " \n "
2014-07-08 03:11:14 -04:00
< < " \t \t if (vIn.y > " < < y < < " ) \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * (- " < < y < < " + fmod(vIn.y + " < < y < < " , " < < yr < < " )); \n "
< < " \t \t else if (vIn.y < - " < < y < < " ) \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * ( " < < y < < " - fmod( " < < y < < " - vIn.y, " < < yr < < " )); \n "
< < " \t \t else \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.y; \n "
< < " \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04:00
{
m_XRange = 2 * m_X ;
m_YRange = 2 * m_Y ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_X = rand . Frand11 < T > ( ) ;
m_Y = rand . Frand11 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_X , prefix + " modulus_x " , 1 ) ) ; //Params.
m_Params . push_back ( ParamWithName < T > ( & m_Y , prefix + " modulus_y " , 1 ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_XRange , prefix + " modulus_xrange " ) ) ; //Precalc.
m_Params . push_back ( ParamWithName < T > ( true , & m_YRange , prefix + " modulus_yrange " ) ) ;
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_X ; //Params.
T m_Y ;
T m_XRange ; //Precalc.
T m_YRange ;
} ;
/// <summary>
/// Oscilloscope.
/// </summary>
template < typename T >
class EMBER_API OscilloscopeVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
OscilloscopeVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " oscilloscope " , eVariationId : : VAR_OSCILLOSCOPE , weight )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( OscilloscopeVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T t ;
if ( m_Damping = = 0.0 )
--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 = m_Amplitude * std : : cos ( m_2PiFreq * helper . In . x ) + m_Separation ;
2014-07-08 03:11:14 -04:00
else
2016-01-12 23:42:12 -05:00
t = m_Amplitude * std : : exp ( - std : : abs ( helper . In . x ) * m_Damping ) * std : : cos ( m_2PiFreq * helper . In . x ) + m_Separation ;
2014-09-01 00:25:15 -04:00
2016-01-12 23:42:12 -05:00
if ( std : : abs ( helper . In . y ) < = t )
2014-07-08 03:11:14 -04:00
{
helper . Out . x = m_Weight * helper . In . x ;
helper . Out . y = - ( m_Weight * helper . In . y ) ;
}
else
{
helper . Out . x = m_Weight * helper . In . x ;
helper . Out . y = m_Weight * helper . In . y ;
}
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string separation = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string frequency = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string amplitude = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string damping = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string tpf = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t real_t t; \n "
< < " \n "
2015-02-26 16:18:55 -05:00
< < " \t \t if ( " < < damping < < " == (real_t)(0.0)) \n "
2014-07-08 03:11:14 -04:00
< < " \t \t t = " < < amplitude < < " * cos( " < < tpf < < " * vIn.x) + " < < separation < < " ; \n "
< < " \t \t else \n "
< < " \t \t t = " < < amplitude < < " * exp(-fabs(vIn.x) * " < < damping < < " ) * cos( " < < tpf < < " * vIn.x) + " < < separation < < " ; \n "
< < " \n "
< < " \t \t if (fabs(vIn.y) <= t) \n "
< < " \t \t { \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.x; \n "
< < " \t \t vOut.y = -(xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.y); \n "
< < " \t \t } \n "
< < " \t \t else \n "
< < " \t \t { \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.x; \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.y; \n "
< < " \t \t } \n "
< < " \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04:00
{
m_2PiFreq = m_Frequency * T ( M_2PI ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_Separation = 1 + rand . Frand11 < T > ( ) ;
m_Frequency = T ( M_PI ) * rand . Frand11 < T > ( ) ;
m_Amplitude = 1 + 2 * rand . Frand01 < T > ( ) ;
m_Damping = rand . Frand01 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Separation , prefix + " oscilloscope_separation " , 1 ) ) ; //Params.
m_Params . push_back ( ParamWithName < T > ( & m_Frequency , prefix + " oscilloscope_frequency " , T ( M_PI ) ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Amplitude , prefix + " oscilloscope_amplitude " , 1 ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Damping , prefix + " oscilloscope_damping " ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_2PiFreq , prefix + " oscilloscope_2pifreq " ) ) ; //Precalc.
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_Separation ; //Params.
T m_Frequency ;
T m_Amplitude ;
T m_Damping ;
T m_2PiFreq ; //Precalc.
} ;
/// <summary>
/// Polar2.
/// </summary>
template < typename T >
class EMBER_API Polar2Variation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
Polar2Variation ( T weight = 1.0 ) : ParametricVariation < T > ( " polar2 " , eVariationId : : VAR_POLAR2 , weight , true , false , false , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( Polar2Variation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
helper . Out . x = m_Vvar * helper . m_PrecalcAtanxy ;
--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
helper . Out . y = m_Vvar2 * std : : log ( helper . m_PrecalcSumSquares ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string vvar = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string vvar2 = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t vOut.x = " < < vvar < < " * precalcAtanxy; \n "
< < " \t \t vOut.y = " < < vvar2 < < " * log(precalcSumSquares); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04:00
{
m_Vvar = m_Weight / T ( M_PI ) ;
m_Vvar2 = m_Vvar * T ( 0.5 ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_Vvar , prefix + " polar2_vvar " ) ) ; //Precalc.
m_Params . push_back ( ParamWithName < T > ( true , & m_Vvar2 , prefix + " polar2_vvar2 " ) ) ;
}
private :
T m_Vvar ;
T m_Vvar2 ;
} ;
/// <summary>
/// Popcorn2.
/// </summary>
template < typename T >
class EMBER_API Popcorn2Variation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
Popcorn2Variation ( T weight = 1.0 ) : ParametricVariation < T > ( " popcorn2 " , eVariationId : : VAR_POPCORN2 , weight )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( Popcorn2Variation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
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
helper . Out . x = m_Weight * ( helper . In . x + m_X * std : : sin ( SafeTan < T > ( helper . In . y * m_C ) ) ) ;
helper . Out . y = m_Weight * ( helper . In . y + m_Y * std : : sin ( SafeTan < T > ( helper . In . x * m_C ) ) ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string x = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string y = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string c = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * (vIn.x + " < < x < < " * sin(tan(vIn.y * " < < c < < " ))); \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * (vIn.y + " < < y < < " * sin(tan(vIn.x * " < < c < < " ))); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_X = T ( 0.2 ) + rand . Frand01 < T > ( ) ;
m_Y = T ( 0.2 ) * rand . Frand01 < T > ( ) ;
m_C = 5 * rand . Frand01 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_X , prefix + " popcorn2_x " , T ( 0.1 ) ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Y , prefix + " popcorn2_y " , T ( 0.1 ) ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_C , prefix + " popcorn2_c " , 3 ) ) ;
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_X ;
T m_Y ;
T m_C ;
} ;
/// <summary>
/// Scry.
/// Note that scry does not multiply by weight, but as the
/// values still approach 0 as the weight approaches 0, it
/// should be ok.
/// </summary>
template < typename T >
class EMBER_API ScryVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
ScryVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " scry " , eVariationId : : VAR_SCRY , weight , true , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( ScryVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T t = helper . m_PrecalcSumSquares ;
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 r = 1 / Zeps ( helper . m_PrecalcSqrtSumSquares * ( t + m_InvWeight ) ) ;
2014-07-08 03:11:14 -04:00
helper . Out . x = helper . In . x * r ;
helper . Out . y = helper . In . y * r ;
2016-01-04 19:50:15 -05:00
helper . Out . z = ( m_VarType = = eVariationType : : VARTYPE_REG ) ? 0 : helper . In . z ;
2014-07-08 03:11:14 -04:00
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-09-10 01:41:26 -04:00
int i = 0 ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string invWeight = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t real_t t = precalcSumSquares; \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t r = (real_t)(1.0) / Zeps(precalcSqrtSumSquares * (t + " < < invWeight < < " )); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = vIn.x * r; \n "
< < " \t \t vOut.y = vIn.y * r; \n "
2016-01-04 19:50:15 -05:00
< < " \t \t vOut.z = " < < ( ( m_VarType = = eVariationType : : VARTYPE_REG ) ? " 0 " : " vIn.z " ) < < " ; \n "
2014-07-08 03:11:14 -04:00
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -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
virtual vector < string > OpenCLGlobalFuncNames ( ) const override
{
return vector < string > { " Zeps " } ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04: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
m_InvWeight = 1 / Zeps ( m_Weight ) ;
2014-07-08 03:11:14 -04:00
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_InvWeight , prefix + " scry_inv_weight " ) ) ; //Precalcs only, no params.
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_InvWeight ; //Precalcs only, no params.
} ;
/// <summary>
/// Separation.
/// </summary>
template < typename T >
class EMBER_API SeparationVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
SeparationVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " separation " , eVariationId : : VAR_SEPARATION , weight )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( SeparationVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
if ( helper . In . x > 0.0 )
2015-04-13 07:32:58 -04:00
helper . Out . x = m_Weight * ( std : : sqrt ( SQR ( helper . In . x ) + m_XX ) - helper . In . x * m_XInside ) ;
2014-07-08 03:11:14 -04:00
else
2015-04-13 07:32:58 -04:00
helper . Out . x = - ( m_Weight * ( std : : sqrt ( SQR ( helper . In . x ) + m_XX ) + helper . In . x * m_XInside ) ) ;
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
if ( helper . In . y > 0.0 )
2015-04-13 07:32:58 -04:00
helper . Out . y = m_Weight * ( std : : sqrt ( SQR ( helper . In . y ) + m_YY ) - helper . In . y * m_YInside ) ;
2014-07-08 03:11:14 -04:00
else
2015-04-13 07:32:58 -04:00
helper . Out . y = - ( m_Weight * ( std : : sqrt ( SQR ( helper . In . y ) + m_YY ) + helper . In . y * m_YInside ) ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string x = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string xInside = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string y = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string yInside = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string xx = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string yy = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t if (vIn.x > (real_t)(0.0)) \n "
2014-09-01 00:25:15 -04:00
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * (sqrt(vIn.x * vIn.x + " < < xx < < " ) - vIn.x * " < < xInside < < " ); \n "
< < " \t \t else \n "
< < " \t \t vOut.x = -(xform->m_VariationWeights[ " < < varIndex < < " ] * (sqrt(vIn.x * vIn.x + " < < xx < < " ) + vIn.x * " < < xInside < < " )); \n "
< < " \n "
2015-02-26 16:18:55 -05:00
< < " \t \t if (vIn.y > (real_t)(0.0)) \n "
2014-09-01 00:25:15 -04:00
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * (sqrt(vIn.y * vIn.y + " < < yy < < " ) - vIn.y * " < < yInside < < " ); \n "
< < " \t \t else \n "
< < " \t \t vOut.y = -(xform->m_VariationWeights[ " < < varIndex < < " ] * (sqrt(vIn.y * vIn.y + " < < yy < < " ) + vIn.y * " < < yInside < < " )); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04:00
{
m_XX = SQR ( m_X ) ;
m_YY = SQR ( m_Y ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_X = 1 + rand . Frand11 < T > ( ) ;
m_XInside = 1 + rand . Frand11 < T > ( ) ;
m_Y = rand . Frand11 < T > ( ) ;
m_YInside = rand . Frand11 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_X , prefix + " separation_x " , 1 ) ) ; //Params.
m_Params . push_back ( ParamWithName < T > ( & m_XInside , prefix + " separation_xinside " ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Y , prefix + " separation_y " , 1 ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_YInside , prefix + " separation_yinside " ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_XX , prefix + " separation_xx " ) ) ; //Precalc.
m_Params . push_back ( ParamWithName < T > ( true , & m_YY , prefix + " separation_yy " ) ) ;
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_X ; //Params.
T m_XInside ;
T m_Y ;
T m_YInside ;
T m_XX ; //Precalc.
T m_YY ;
} ;
/// <summary>
/// Split.
/// </summary>
template < typename T >
class EMBER_API SplitVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
SplitVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " split " , eVariationId : : VAR_SPLIT , weight )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( SplitVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
if ( cos ( helper . In . y * m_YAng ) > = 0 )
helper . Out . x = m_Weight * helper . In . x ;
else
helper . Out . x = - ( m_Weight * helper . In . x ) ;
if ( cos ( helper . In . x * m_XAng ) > = 0 )
helper . Out . y = m_Weight * helper . In . y ;
else
helper . Out . y = - ( m_Weight * helper . In . y ) ;
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string xSize = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string ySize = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string xAng = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string yAng = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t if (cos(vIn.y * " < < yAng < < " ) >= 0) \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.x; \n "
< < " \t \t else \n "
< < " \t \t vOut.x = -(xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.x); \n "
< < " \n "
< < " \t \t if (cos(vIn.x * " < < xAng < < " ) >= 0) \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.y; \n "
< < " \t \t else \n "
< < " \t \t vOut.y = -(xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.y); \n "
< < " \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04:00
{
m_XAng = T ( M_PI ) * m_XSize ;
m_YAng = T ( M_PI ) * m_YSize ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_XSize = rand . Frand11 < T > ( ) ;
m_YSize = rand . Frand11 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_XSize , prefix + " split_xsize " , T ( 0.5 ) ) ) ; //Params.
m_Params . push_back ( ParamWithName < T > ( & m_YSize , prefix + " split_ysize " , T ( 0.5 ) ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_XAng , prefix + " split_xang " ) ) ; //Precalc.
m_Params . push_back ( ParamWithName < T > ( true , & m_YAng , prefix + " split_yang " ) ) ;
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_XSize ; //Params.
T m_YSize ;
T m_XAng ; //Precalc.
T m_YAng ;
} ;
/// <summary>
/// Splits.
/// </summary>
template < typename T >
class EMBER_API SplitsVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
SplitsVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " splits " , eVariationId : : VAR_SPLITS , weight )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( SplitsVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
if ( helper . In . x > = 0 )
helper . Out . x = m_Weight * ( helper . In . x + m_X ) ;
else
helper . Out . x = m_Weight * ( helper . In . x - m_X ) ;
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
if ( helper . In . y > = 0 )
helper . Out . y = m_Weight * ( helper . In . y + m_Y ) ;
else
helper . Out . y = m_Weight * ( helper . In . y - m_Y ) ;
2016-01-16 17:23:22 -05:00
helper . Out . z = m_Weight * helper . In . z ; //Original does *not* have this. search through all for this and sync.//TODO!
2014-07-08 03:11:14 -04:00
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string x = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string y = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t if (vIn.x >= 0) \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * (vIn.x + " < < x < < " ); \n "
< < " \t \t else \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * (vIn.x - " < < x < < " ); \n "
< < " \n "
< < " \t \t if (vIn.y >= 0) \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * (vIn.y + " < < y < < " ); \n "
< < " \t \t else \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * (vIn.y - " < < y < < " ); \n "
< < " \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_X = rand . Frand11 < T > ( ) ;
m_Y = rand . Frand11 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_X , prefix + " splits_x " ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Y , prefix + " splits_y " ) ) ;
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_X ;
T m_Y ;
} ;
/// <summary>
/// Stripes.
/// </summary>
template < typename T >
class EMBER_API StripesVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
StripesVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " stripes " , eVariationId : : VAR_STRIPES , weight )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( StripesVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
2014-12-07 02:51:44 -05:00
T roundx = T ( int ( helper . In . x > = 0 ? ( helper . In . x + T ( 0.5 ) ) : ( helper . In . x - T ( 0.5 ) ) ) ) ;
2014-07-08 03:11:14 -04:00
T offsetx = helper . In . x - roundx ;
helper . Out . x = m_Weight * ( offsetx * ( 1 - m_Space ) + roundx ) ;
helper . Out . y = m_Weight * ( helper . In . y + offsetx * offsetx * m_Warp ) ;
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string space = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string warp = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t roundx = (real_t)(int)(vIn.x >= 0 ? (vIn.x + (real_t)(0.5)) : (vIn.x - (real_t)(0.5))); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t real_t offsetx = vIn.x - roundx; \n "
< < " \n "
2015-02-26 16:18:55 -05:00
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * (offsetx * ((real_t)(1.0) - " < < space < < " ) + roundx); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * (vIn.y + offsetx * offsetx * " < < warp < < " ); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_Params [ 0 ] . Set ( rand . Frand01 < T > ( ) ) ; //Space.
m_Params [ 1 ] . Set ( 5 * rand . Frand01 < T > ( ) ) ; //Warp.
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
2016-01-04 19:50:15 -05:00
m_Params . push_back ( ParamWithName < T > ( & m_Space , prefix + " stripes_space " , T ( 0.5 ) , eParamType : : REAL , T ( 0.5 ) , 5 ) ) ;
2014-07-08 03:11:14 -04:00
m_Params . push_back ( ParamWithName < T > ( & m_Warp , prefix + " stripes_warp " ) ) ;
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_Space ;
T m_Warp ;
} ;
/// <summary>
/// Wedge.
/// </summary>
template < typename T >
class EMBER_API WedgeVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
WedgeVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " wedge " , eVariationId : : VAR_WEDGE , weight , true , true , false , false , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( WedgeVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T r = helper . m_PrecalcSqrtSumSquares ;
T a = helper . m_PrecalcAtanyx + m_Swirl * r ;
2014-12-07 02:51:44 -05:00
T c = T ( Floor < T > ( ( m_Count * a + T ( M_PI ) ) * T ( M_1_PI ) * T ( 0.5 ) ) ) ;
2014-07-08 03:11:14 -04:00
a = a * m_CompFac + c * m_Angle ;
r = m_Weight * ( r + m_Hole ) ;
--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
helper . Out . x = r * std : : cos ( a ) ;
helper . Out . y = r * std : : sin ( a ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string angle = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string hole = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string count = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string swirl = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string compFac = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t real_t r = precalcSqrtSumSquares; \n "
< < " \t \t real_t a = precalcAtanyx + " < < swirl < < " * r; \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t c = floor(( " < < count < < " * a + M_PI) * M_1_PI * (real_t)(0.5)); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t a = a * " < < compFac < < " + c * " < < angle < < " ; \n "
< < " \t \t r = xform->m_VariationWeights[ " < < varIndex < < " ] * (r + " < < hole < < " ); \n "
< < " \t \t vOut.x = r * cos(a); \n "
< < " \t \t vOut.y = r * sin(a); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04:00
{
m_CompFac = 1 - m_Angle * m_Count * T ( M_1_PI ) * T ( 0.5 ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_Angle = T ( M_PI ) * rand . Frand01 < T > ( ) ;
m_Hole = T ( 0.5 ) * rand . Frand11 < T > ( ) ;
2014-12-07 02:51:44 -05:00
m_Count = T ( Floor < T > ( 5 * rand . Frand01 < T > ( ) ) ) + 1 ;
2014-07-08 03:11:14 -04:00
m_Swirl = rand . Frand01 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Angle , prefix + " wedge_angle " , T ( M_PI_2 ) ) ) ; //Params.
m_Params . push_back ( ParamWithName < T > ( & m_Hole , prefix + " wedge_hole " ) ) ;
2016-01-04 19:50:15 -05:00
m_Params . push_back ( ParamWithName < T > ( & m_Count , prefix + " wedge_count " , 2 , eParamType : : INTEGER , 1 ) ) ;
2014-07-08 03:11:14 -04:00
m_Params . push_back ( ParamWithName < T > ( & m_Swirl , prefix + " wedge_swirl " ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_CompFac , prefix + " wedge_compfac " ) ) ; //Precalc.
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_Angle ; //Params.
T m_Hole ;
T m_Count ;
T m_Swirl ;
T m_CompFac ; //Precalc.
} ;
/// <summary>
/// Wedge julia.
/// </summary>
template < typename T >
class EMBER_API WedgeJuliaVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
WedgeJuliaVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " wedge_julia " , eVariationId : : VAR_WEDGE_JULIA , weight , true , false , false , false , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( WedgeJuliaVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
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
T r = m_Weight * std : : pow ( helper . m_PrecalcSumSquares , m_Cn ) ;
2014-12-07 02:51:44 -05:00
int tRand = int ( m_Rn * rand . Frand01 < T > ( ) ) ;
2014-07-08 03:11:14 -04:00
T a = ( helper . m_PrecalcAtanyx + M_2PI * tRand ) / m_Power ;
2014-12-07 02:51:44 -05:00
T c = T ( Floor < T > ( ( m_Count * a + T ( M_PI ) ) * T ( M_1_PI ) * T ( 0.5 ) ) ) ;
2014-07-08 03:11:14 -04:00
a = a * m_Cf + c * m_Angle ;
--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
helper . Out . x = r * std : : cos ( a ) ;
helper . Out . y = r * std : : sin ( a ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string angle = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ; //Params.
string count = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string power = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string dist = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string rn = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ; //Precalc.
string cn = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string cf = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t real_t r = xform->m_VariationWeights[ " < < varIndex < < " ] * pow(precalcSumSquares, " < < cn < < " ); \n "
< < " \t \t int tRand = (int)( " < < rn < < " * MwcNext01(mwc)); \n "
< < " \t \t real_t a = (precalcAtanyx + M_2PI * tRand) / " < < power < < " ; \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t c = floor(( " < < count < < " * a + M_PI) * M_1_PI * (real_t)(0.5)); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t a = a * " < < cf < < " + c * " < < angle < < " ; \n "
< < " \t \t vOut.x = r * cos(a); \n "
< < " \t \t vOut.y = r * sin(a); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04:00
{
m_Cf = 1 - m_Angle * m_Count * T ( M_1_PI ) * T ( 0.5 ) ;
2016-01-12 23:42:12 -05:00
m_Rn = std : : abs ( m_Power ) ;
2014-07-08 03:11:14 -04:00
m_Cn = m_Dist / m_Power / 2 ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
2014-12-07 02:51:44 -05:00
m_Power = T ( int ( 5 * rand . Frand01 < T > ( ) + 2 ) ) ;
2014-07-08 03:11:14 -04:00
m_Dist = 1 ;
2014-12-07 02:51:44 -05:00
m_Count = T ( int ( 3 * rand . Frand01 < T > ( ) + 1 ) ) ;
2014-07-08 03:11:14 -04:00
m_Angle = T ( M_PI ) * rand . Frand01 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Angle , prefix + " wedge_julia_angle " ) ) ; //Params.
m_Params . push_back ( ParamWithName < T > ( & m_Count , prefix + " wedge_julia_count " , 1 ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Power , prefix + " wedge_julia_power " , 1 ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Dist , prefix + " wedge_julia_dist " ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_Rn , prefix + " wedge_julia_rn " ) ) ; //Precalc.
m_Params . push_back ( ParamWithName < T > ( true , & m_Cn , prefix + " wedge_julia_cn " ) ) ;
m_Params . push_back ( ParamWithName < T > ( true , & m_Cf , prefix + " wedge_julia_cf " ) ) ;
}
private :
T m_Angle ; //Params.
T m_Count ;
T m_Power ;
T m_Dist ;
T m_Rn ; //Precalc.
T m_Cn ;
T m_Cf ;
} ;
/// <summary>
/// Wedge sph.
/// </summary>
template < typename T >
class EMBER_API WedgeSphVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
WedgeSphVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " wedge_sph " , eVariationId : : VAR_WEDGE_SPH , weight , true , true , false , false , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( WedgeSphVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04: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
T r = 1 / Zeps ( helper . m_PrecalcSqrtSumSquares ) ;
2014-07-08 03:11:14 -04:00
T a = helper . m_PrecalcAtanyx + m_Swirl * r ;
2014-12-07 02:51:44 -05:00
T c = T ( Floor < T > ( ( m_Count * a + T ( M_PI ) ) * T ( M_1_PI ) * T ( 0.5 ) ) ) ;
2014-07-08 03:11:14 -04:00
T compFac = 1 - m_Angle * m_Count * T ( M_1_PI ) * T ( 0.5 ) ;
a = a * compFac + c * m_Angle ;
r = m_Weight * ( r + m_Hole ) ;
--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
helper . Out . x = r * std : : cos ( a ) ;
helper . Out . y = r * std : : sin ( a ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string angle = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string count = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string hole = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string swirl = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t r = (real_t)(1.0) / Zeps(precalcSqrtSumSquares); \n "
2014-07-08 03:11:14 -04:00
< < " \t \t real_t a = precalcAtanyx + " < < swirl < < " * r; \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t c = floor(( " < < count < < " * a + M_PI) * M_1_PI * (real_t)(0.5)); \n "
< < " \t \t real_t compFac = 1 - " < < angle < < " * " < < count < < " * M_1_PI * (real_t)(0.5); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t a = a * compFac + c * " < < angle < < " ; \n "
< < " \t \t r = xform->m_VariationWeights[ " < < varIndex < < " ] * (r + " < < hole < < " ); \n "
< < " \t \t vOut.x = r * cos(a); \n "
< < " \t \t vOut.y = r * sin(a); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
--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
virtual vector < string > OpenCLGlobalFuncNames ( ) const override
{
return vector < string > { " Zeps " } ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_Angle = T ( M_PI ) * rand . Frand01 < T > ( ) ;
2014-12-07 02:51:44 -05:00
m_Count = T ( Floor < T > ( 5 * rand . Frand01 < T > ( ) ) ) + 1 ;
2014-07-08 03:11:14 -04:00
m_Hole = T ( 0.5 ) * rand . Frand11 < T > ( ) ;
m_Swirl = rand . Frand01 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Angle , prefix + " wedge_sph_angle " ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Count , prefix + " wedge_sph_hole " , 1 ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Hole , prefix + " wedge_sph_count " ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Swirl , prefix + " wedge_sph_swirl " ) ) ;
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_Angle ;
T m_Count ;
T m_Hole ;
T m_Swirl ;
} ;
/// <summary>
/// Whorl.
/// </summary>
template < typename T >
class EMBER_API WhorlVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
WhorlVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " whorl " , eVariationId : : VAR_WHORL , weight , true , true , false , false , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( WhorlVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T a , r = helper . m_PrecalcSqrtSumSquares ;
if ( r < m_Weight )
a = helper . m_PrecalcAtanyx + m_Inside / ( m_Weight - r ) ;
else
a = helper . m_PrecalcAtanyx + m_Outside / ( m_Weight - r ) ;
--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
helper . Out . x = m_Weight * r * std : : cos ( a ) ;
helper . Out . y = m_Weight * r * std : : sin ( a ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string inside = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string outside = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t real_t a; \n "
< < " \t \t real_t r = precalcSqrtSumSquares; \n "
< < " \n "
< < " \t \t if (r < xform->m_VariationWeights[ " < < varIndex < < " ]) \n "
< < " \t \t a = precalcAtanyx + " < < inside < < " / (xform->m_VariationWeights[ " < < varIndex < < " ] - r); \n "
< < " \t \t else \n "
< < " \t \t a = precalcAtanyx + " < < outside < < " / (xform->m_VariationWeights[ " < < varIndex < < " ] - r); \n "
< < " \n "
< < " \t \t vOut.x = (xform->m_VariationWeights[ " < < varIndex < < " ] * r * cos(a)); \n "
< < " \t \t vOut.y = (xform->m_VariationWeights[ " < < varIndex < < " ] * r * sin(a)); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
m_Inside = rand . Frand01 < T > ( ) ;
m_Outside = rand . Frand01 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Inside , prefix + " whorl_inside " , 1 ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Outside , prefix + " whorl_outside " , 1 ) ) ;
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_Inside ;
T m_Outside ;
} ;
/// <summary>
/// Waves.
/// </summary>
template < typename T >
class EMBER_API Waves2Variation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
Waves2Variation ( T weight = 1.0 ) : ParametricVariation < T > ( " waves2 " , eVariationId : : VAR_WAVES2 , weight , true , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( Waves2Variation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
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
helper . Out . x = m_Weight * ( helper . In . x + m_ScaleX * std : : sin ( helper . In . y * m_FreqX ) ) ;
helper . Out . y = m_Weight * ( helper . In . y + m_ScaleY * std : : sin ( helper . In . x * m_FreqY ) ) ;
helper . Out . z = m_Weight * ( helper . In . z + m_ScaleZ * std : : sin ( helper . m_PrecalcSqrtSumSquares * m_FreqZ ) ) ;
2014-07-08 03:11:14 -04:00
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string freqX = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string scaleX = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string freqY = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string scaleY = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string freqZ = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string scaleZ = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * (vIn.x + " < < scaleX < < " * sin(vIn.y * " < < freqX < < " )); \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * (vIn.y + " < < scaleY < < " * sin(vIn.x * " < < freqY < < " )); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * (vIn.z + " < < scaleZ < < " * sin(precalcSqrtSumSquares * " < < freqZ < < " )); \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
{
2014-07-08 03:11:14 -04:00
m_FreqX = 4 * rand . Frand01 < T > ( ) ;
m_ScaleX = T ( 0.5 ) + rand . Frand01 < T > ( ) ;
m_FreqY = 4 * rand . Frand01 < T > ( ) ;
m_ScaleY = T ( 0.5 ) + rand . Frand01 < T > ( ) ;
m_FreqZ = 0 ;
m_ScaleZ = 0 ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_FreqX , prefix + " waves2_freqx " , 2 ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_ScaleX , prefix + " waves2_scalex " ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_FreqY , prefix + " waves2_freqy " , 2 ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_ScaleY , prefix + " waves2_scaley " ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_FreqZ , prefix + " waves2_freqz " ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_ScaleZ , prefix + " waves2_scalez " ) ) ;
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_FreqX ;
T m_ScaleX ;
T m_FreqY ;
T m_ScaleY ;
T m_FreqZ ;
T m_ScaleZ ;
} ;
/// <summary>
/// Exp.
/// </summary>
template < typename T >
class EMBER_API ExpVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
ExpVariation ( T weight = 1.0 ) : Variation < T > ( " exp " , eVariationId : : VAR_EXP , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( ExpVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
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
T expe = m_Weight * std : : exp ( helper . In . x ) ;
helper . Out . x = expe * std : : cos ( helper . In . y ) ;
helper . Out . y = expe * std : : sin ( helper . In . y ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t expe = xform->m_VariationWeights[ " < < varIndex < < " ] * exp(vIn.x); \n "
< < " \n "
< < " \t \t vOut.x = expe * cos(vIn.y); \n "
< < " \t \t vOut.y = expe * sin(vIn.y); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Log.
/// </summary>
template < typename T >
class EMBER_API LogVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
LogVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " log " , eVariationId : : VAR_LOG , weight , true , false , false , false , true )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( LogVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
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
helper . Out . x = m_Weight * std : : log ( helper . m_PrecalcSumSquares ) * m_Denom ;
2014-07-08 03:11:14 -04:00
helper . Out . y = m_Weight * helper . m_PrecalcAtanyx ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string base = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string denom = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * log(precalcSumSquares) * " < < denom < < " ; \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * precalcAtanyx; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
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
m_Denom = T ( 0.5 ) / std : : log ( m_Base ) ;
2014-07-08 03:11:14 -04:00
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
2016-01-04 19:50:15 -05:00
m_Params . push_back ( ParamWithName < T > ( & m_Base , prefix + " log_base " , T ( M_E ) , eParamType : : REAL , EPS , TMAX ) ) ;
2014-07-08 03:11:14 -04:00
m_Params . push_back ( ParamWithName < T > ( true , & m_Denom , prefix + " log_denom " ) ) ; //Precalc.
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_Base ;
T m_Denom ; //Precalc.
} ;
/// <summary>
/// Sine.
/// </summary>
template < typename T >
class EMBER_API SinVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
SinVariation ( T weight = 1.0 ) : Variation < T > ( " sin " , eVariationId : : VAR_SIN , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( SinVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
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
helper . Out . x = m_Weight * std : : sin ( helper . In . x ) * cosh ( helper . In . y ) ;
helper . Out . y = m_Weight * std : : cos ( helper . In . x ) * sinh ( helper . In . y ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * sin(vIn.x) * cosh(vIn.y); \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * cos(vIn.x) * sinh(vIn.y); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Cosine.
/// </summary>
template < typename T >
class EMBER_API CosVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
CosVariation ( T weight = 1.0 ) : Variation < T > ( " cos " , eVariationId : : VAR_COS , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( CosVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
//clamp fabs x and y to 7.104760e+002 for cosh, and |x| 7.104760e+002 for sinh
--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
helper . Out . x = m_Weight * std : : cos ( helper . In . x ) * cosh ( helper . In . y ) ;
helper . Out . y = - ( m_Weight * std : : sin ( helper . In . x ) * sinh ( helper . In . y ) ) ;
2014-07-08 03:11:14 -04:00
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * cos(vIn.x) * cosh(vIn.y); \n "
< < " \t \t vOut.y = -(xform->m_VariationWeights[ " < < varIndex < < " ] * sin(vIn.x) * sinh(vIn.y)); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Tangent.
/// </summary>
template < typename T >
class EMBER_API TanVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
TanVariation ( T weight = 1.0 ) : Variation < T > ( " tan " , eVariationId : : VAR_TAN , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( TanVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T tansin , tancos , tansinh , tancosh , tanden ;
sincos ( 2 * helper . In . x , & tansin , & tancos ) ;
tansinh = sinh ( 2 * helper . In . y ) ;
tancosh = cosh ( 2 * helper . In . y ) ;
tanden = 1 / ( tancos + tancosh ) ;
helper . Out . x = m_Weight * tanden * tansin ;
helper . Out . y = m_Weight * tanden * tansinh ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t tansin = sin((real_t)(2.0) * vIn.x); \n "
< < " \t \t real_t tancos = cos((real_t)(2.0) * vIn.x); \n "
< < " \t \t real_t tansinh = sinh((real_t)(2.0) * vIn.y); \n "
< < " \t \t real_t tancosh = cosh((real_t)(2.0) * vIn.y); \n "
< < " \t \t real_t tanden = (real_t)(1.0) / (tancos + tancosh); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * tanden * tansin; \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * tanden * tansinh; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Sec.
/// </summary>
template < typename T >
class EMBER_API SecVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
SecVariation ( T weight = 1.0 ) : Variation < T > ( " sec " , eVariationId : : VAR_SEC , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( SecVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T secsin , seccos , secsinh , seccosh , secden ;
sincos ( helper . In . x , & secsin , & seccos ) ;
secsinh = sinh ( helper . In . y ) ;
seccosh = cosh ( helper . In . y ) ;
secden = 2 / ( cos ( 2 * helper . In . x ) + cosh ( 2 * helper . In . y ) ) ;
helper . Out . x = m_Weight * secden * seccos * seccosh ;
helper . Out . y = m_Weight * secden * secsin * secsinh ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t secsin = sin(vIn.x); \n "
< < " \t \t real_t seccos = cos(vIn.x); \n "
< < " \t \t real_t secsinh = sinh(vIn.y); \n "
< < " \t \t real_t seccosh = cosh(vIn.y); \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t secden = (real_t)(2.0) / (cos((real_t)(2.0) * vIn.x) + cosh((real_t)(2.0) * vIn.y)); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * secden * seccos * seccosh; \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * secden * secsin * secsinh; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Cosecant.
/// </summary>
template < typename T >
class EMBER_API CscVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
CscVariation ( T weight = 1.0 ) : Variation < T > ( " csc " , eVariationId : : VAR_CSC , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( CscVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T cscsin , csccos , cscsinh , csccosh , cscden ;
sincos ( helper . In . x , & cscsin , & csccos ) ;
--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
cscsinh = std : : sinh ( helper . In . y ) ;
csccosh = std : : cosh ( helper . In . y ) ;
cscden = 2 / ( std : : cosh ( 2 * helper . In . y ) - std : : cos ( 2 * helper . In . x ) ) ;
2014-07-08 03:11:14 -04:00
helper . Out . x = m_Weight * cscden * cscsin * csccosh ;
helper . Out . y = - ( m_Weight * cscden * csccos * cscsinh ) ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t cscsin = sin(vIn.x); \n "
< < " \t \t real_t csccos = cos(vIn.x); \n "
< < " \t \t real_t cscsinh = sinh(vIn.y); \n "
< < " \t \t real_t csccosh = cosh(vIn.y); \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t cscden = (real_t)(2.0) / (cosh((real_t)(2.0) * vIn.y) - cos((real_t)(2.0) * vIn.x)); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * cscden * cscsin * csccosh; \n "
< < " \t \t vOut.y = -(xform->m_VariationWeights[ " < < varIndex < < " ] * cscden * csccos * cscsinh); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Cotangent.
/// </summary>
template < typename T >
class EMBER_API CotVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
CotVariation ( T weight = 1.0 ) : Variation < T > ( " cot " , eVariationId : : VAR_COT , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( CotVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T cotsin , cotcos , cotsinh , cotcosh , cotden ;
sincos ( 2 * helper . In . x , & cotsin , & cotcos ) ;
cotsinh = sinh ( 2 * helper . In . y ) ;
cotcosh = cosh ( 2 * helper . In . y ) ;
cotden = 1 / ( cotcosh - cotcos ) ;
helper . Out . x = m_Weight * cotden * cotsin ;
helper . Out . y = m_Weight * cotden * - 1 * cotsinh ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t cotsin = sin((real_t)(2.0) * vIn.x); \n "
< < " \t \t real_t cotcos = cos((real_t)(2.0) * vIn.x); \n "
< < " \t \t real_t cotsinh = sinh((real_t)(2.0) * vIn.y); \n "
< < " \t \t real_t cotcosh = cosh((real_t)(2.0) * vIn.y); \n "
< < " \t \t real_t cotden = (real_t)(1.0) / (cotcosh - cotcos); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * cotden * cotsin; \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * cotden * -1 * cotsinh; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Sinh.
/// </summary>
template < typename T >
class EMBER_API SinhVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
SinhVariation ( T weight = 1.0 ) : Variation < T > ( " sinh " , eVariationId : : VAR_SINH , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( SinhVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T sinhsin , sinhcos , sinhsinh , sinhcosh ;
sincos ( helper . In . y , & sinhsin , & sinhcos ) ;
sinhsinh = sinh ( helper . In . x ) ;
sinhcosh = cosh ( helper . In . x ) ;
helper . Out . x = m_Weight * sinhsinh * sinhcos ;
helper . Out . y = m_Weight * sinhcosh * sinhsin ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t sinhsin = sin(vIn.y); \n "
< < " \t \t real_t sinhcos = cos(vIn.y); \n "
< < " \t \t real_t sinhsinh = sinh(vIn.x); \n "
< < " \t \t real_t sinhcosh = cosh(vIn.x); \n "
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * sinhsinh * sinhcos; \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * sinhcosh * sinhsin; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Cosh.
/// </summary>
template < typename T >
class EMBER_API CoshVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
CoshVariation ( T weight = 1.0 ) : Variation < T > ( " cosh " , eVariationId : : VAR_COSH , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( CoshVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
2016-01-04 19:50:15 -05:00
T coshsin , coshcos , coshsinh , coshcosh ;
2014-07-08 03:11:14 -04:00
sincos ( helper . In . y , & coshsin , & coshcos ) ;
coshsinh = sinh ( helper . In . x ) ;
coshcosh = cosh ( helper . In . x ) ;
helper . Out . x = m_Weight * coshcosh * coshcos ;
helper . Out . y = m_Weight * coshsinh * coshsin ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t coshsin = sin(vIn.y); \n "
< < " \t \t real_t coshcos = cos(vIn.y); \n "
< < " \t \t real_t coshsinh = sinh(vIn.x); \n "
< < " \t \t real_t coshcosh = cosh(vIn.x); \n "
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * coshcosh * coshcos; \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * coshsinh * coshsin; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Tanh.
/// </summary>
template < typename T >
class EMBER_API TanhVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
TanhVariation ( T weight = 1.0 ) : Variation < T > ( " tanh " , eVariationId : : VAR_TANH , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( TanhVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T tanhsin , tanhcos , tanhsinh , tanhcosh , tanhden ;
sincos ( 2 * helper . In . y , & tanhsin , & tanhcos ) ;
tanhsinh = sinh ( 2 * helper . In . x ) ;
tanhcosh = cosh ( 2 * helper . In . x ) ;
tanhden = 1 / ( tanhcos + tanhcosh ) ;
helper . Out . x = m_Weight * tanhden * tanhsinh ;
helper . Out . y = m_Weight * tanhden * tanhsin ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t tanhsin = sin((real_t)(2.0) * vIn.y); \n "
< < " \t \t real_t tanhcos = cos((real_t)(2.0) * vIn.y); \n "
< < " \t \t real_t tanhsinh = sinh((real_t)(2.0) * vIn.x); \n "
< < " \t \t real_t tanhcosh = cosh((real_t)(2.0) * vIn.x); \n "
< < " \t \t real_t tanhden = (real_t)(1.0) / (tanhcos + tanhcosh); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * tanhden * tanhsinh; \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * tanhden * tanhsin; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Sech
/// </summary>
template < typename T >
class EMBER_API SechVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
SechVariation ( T weight = 1.0 ) : Variation < T > ( " sech " , eVariationId : : VAR_SECH , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( SechVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T sechsin , sechcos , sechsinh , sechcosh , sechden ;
sincos ( helper . In . y , & sechsin , & sechcos ) ;
sechsinh = sinh ( helper . In . x ) ;
sechcosh = cosh ( helper . In . x ) ;
sechden = 2 / ( cos ( 2 * helper . In . y ) + cosh ( 2 * helper . In . x ) ) ;
helper . Out . x = m_Weight * sechden * sechcos * sechcosh ;
helper . Out . y = - ( m_Weight * sechden * sechsin * sechsinh ) ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t sechsin = sin(vIn.y); \n "
< < " \t \t real_t sechcos = cos(vIn.y); \n "
< < " \t \t real_t sechsinh = sinh(vIn.x); \n "
< < " \t \t real_t sechcosh = cosh(vIn.x); \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t sechden = (real_t)(2.0) / (cos((real_t)(2.0) * vIn.y) + cosh((real_t)(2.0) * vIn.x)); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * sechden * sechcos * sechcosh; \n "
< < " \t \t vOut.y = -(xform->m_VariationWeights[ " < < varIndex < < " ] * sechden * sechsin * sechsinh); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Csch.
/// </summary>
template < typename T >
class EMBER_API CschVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
CschVariation ( T weight = 1.0 ) : Variation < T > ( " csch " , eVariationId : : VAR_CSCH , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( CschVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T cschsin , cschcos , cschsinh , cschcosh , cschden ;
sincos ( helper . In . y , & cschsin , & cschcos ) ;
--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
cschsinh = std : : sinh ( helper . In . x ) ;
cschcosh = std : : cosh ( helper . In . x ) ;
cschden = 2 / ( std : : cosh ( 2 * helper . In . x ) - std : : cos ( 2 * helper . In . y ) ) ;
2014-07-08 03:11:14 -04:00
helper . Out . x = m_Weight * cschden * cschsinh * cschcos ;
helper . Out . y = - ( m_Weight * cschden * cschcosh * cschsin ) ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
< < " \t \t real_t cschsin = sin(vIn.y); \n "
< < " \t \t real_t cschcos = cos(vIn.y); \n "
< < " \t \t real_t cschsinh = sinh(vIn.x); \n "
< < " \t \t real_t cschcosh = cosh(vIn.x); \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t cschden = (real_t)(2.0) / (cosh((real_t)(2.0) * vIn.x) - cos((real_t)(2.0) * vIn.y)); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * cschden * cschsinh * cschcos; \n "
< < " \t \t vOut.y = -(xform->m_VariationWeights[ " < < varIndex < < " ] * cschden * cschcosh * cschsin); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Coth.
/// </summary>
template < typename T >
class EMBER_API CothVariation : public Variation < T >
{
public :
2016-01-04 19:50:15 -05:00
CothVariation ( T weight = 1.0 ) : Variation < T > ( " coth " , eVariationId : : VAR_COTH , weight ) { }
2014-07-08 03:11:14 -04:00
VARCOPY ( CothVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T cothsin , cothcos , cothsinh , cothcosh , cothden ;
sincos ( 2 * helper . In . y , & cothsin , & cothcos ) ;
cothsinh = sinh ( 2 * helper . In . x ) ;
cothcosh = cosh ( 2 * helper . In . x ) ;
cothden = 1 / ( cothcosh - cothcos ) ;
helper . Out . x = m_Weight * cothden * cothsinh ;
helper . Out . y = m_Weight * cothden * cothsin ;
helper . Out . z = m_Weight * helper . In . z ;
}
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss ;
2014-10-14 11:53:15 -04:00
intmax_t varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss < < " \t { \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t cothsin = sin((real_t)(2.0) * vIn.y); \n "
< < " \t \t real_t cothcos = cos((real_t)(2.0) * vIn.y); \n "
< < " \t \t real_t cothsinh = sinh((real_t)(2.0) * vIn.x); \n "
< < " \t \t real_t cothcosh = cosh((real_t)(2.0) * vIn.x); \n "
< < " \t \t real_t cothden = (real_t)(1.0) / (cothcosh - cothcos); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * cothden * cothsinh; \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * cothden * cothsin; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
} ;
/// <summary>
/// Auger.
/// </summary>
template < typename T >
class EMBER_API AugerVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
AugerVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " auger " , eVariationId : : VAR_AUGER , weight )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( AugerVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
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
T s = std : : sin ( m_Freq * helper . In . x ) ;
T t = std : : sin ( m_Freq * helper . In . y ) ;
2016-01-12 23:42:12 -05:00
T dy = helper . In . y + m_AugerWeight * ( m_Scale * s / 2 + std : : abs ( helper . In . y ) * s ) ;
T dx = helper . In . x + m_AugerWeight * ( m_Scale * t / 2 + std : : abs ( helper . In . x ) * t ) ;
2014-07-08 03:11:14 -04:00
helper . Out . x = m_Weight * ( helper . In . x + m_Symmetry * ( dx - helper . In . x ) ) ;
helper . Out . y = m_Weight * dy ;
helper . Out . z = m_Weight * helper . In . z ;
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string symmetry = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string augerWeight = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string freq = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string scale = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t real_t s = sin( " < < freq < < " * vIn.x); \n "
< < " \t \t real_t t = sin( " < < freq < < " * vIn.y); \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t dy = vIn.y + " < < augerWeight < < " * ( " < < scale < < " * s / (real_t)(2.0) + fabs(vIn.y) * s); \n "
< < " \t \t real_t dx = vIn.x + " < < augerWeight < < " * ( " < < scale < < " * t / (real_t)(2.0) + fabs(vIn.x) * t); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = xform->m_VariationWeights[ " < < varIndex < < " ] * (vIn.x + " < < symmetry < < " * (dx - vIn.x)); \n "
< < " \t \t vOut.y = xform->m_VariationWeights[ " < < varIndex < < " ] * dy; \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
{
2014-07-08 03:11:14 -04:00
m_Symmetry = 0 ;
m_AugerWeight = T ( 0.5 ) + rand . Frand01 < T > ( ) / 2 ;
2014-12-07 02:51:44 -05:00
m_Freq = T ( Floor < T > ( 5 * rand . Frand01 < T > ( ) ) ) + 1 ;
2014-07-08 03:11:14 -04:00
m_Scale = rand . Frand01 < T > ( ) ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Symmetry , prefix + " auger_sym " ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_AugerWeight , prefix + " auger_weight " , T ( 0.5 ) ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Freq , prefix + " auger_freq " , 5 ) ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Scale , prefix + " auger_scale " , T ( 0.1 ) ) ) ;
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_Symmetry ;
T m_AugerWeight ;
T m_Freq ;
T m_Scale ;
} ;
/// <summary>
/// Flux.
/// </summary>
template < typename T >
class EMBER_API FluxVariation : public ParametricVariation < T >
{
public :
2016-01-04 19:50:15 -05:00
FluxVariation ( T weight = 1.0 ) : ParametricVariation < T > ( " flux " , eVariationId : : VAR_FLUX , weight )
2014-07-08 03:11:14 -04:00
{
Init ( ) ;
}
PARVARCOPY ( FluxVariation )
2014-09-01 00:25:15 -04:00
virtual void Func ( IteratorHelper < T > & helper , Point < T > & outPoint , QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
2014-07-08 03:11:14 -04:00
{
T xpw = helper . In . x + m_Weight ;
T xmw = helper . In . x - m_Weight ;
T yy = SQR ( helper . In . y ) ;
2015-04-13 07:32:58 -04:00
T frac = std : : sqrt ( yy + SQR ( xmw ) ) ;
2014-07-08 03:11:14 -04:00
if ( frac = = 0 )
frac = 1 ;
2015-04-13 07:32:58 -04:00
T avgr = m_Weight * ( m_Spr * std : : sqrt ( std : : sqrt ( yy + SQR ( xpw ) ) / frac ) ) ;
2014-07-08 03:11:14 -04:00
T avga = ( atan2 ( helper . In . y , xmw ) - atan2 ( helper . In . y , xpw ) ) * T ( 0.5 ) ;
--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
helper . Out . x = avgr * std : : cos ( avga ) ;
helper . Out . y = avgr * std : : sin ( avga ) ;
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
helper . Out . z = helper . In . z ;
2014-07-08 03:11:14 -04:00
}
2014-09-01 00:25:15 -04:00
2015-06-29 23:13:53 -04:00
virtual string OpenCLString ( ) const override
2014-07-08 03:11:14 -04:00
{
ostringstream ss , ss2 ;
2014-10-14 11:53:15 -04:00
intmax_t i = 0 , varIndex = IndexInXform ( ) ;
2014-07-08 03:11:14 -04:00
ss2 < < " _ " < < XformIndexInEmber ( ) < < " ] " ;
string index = ss2 . str ( ) ;
string spread = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
string spr = " parVars[ " + ToUpper ( m_Params [ i + + ] . Name ( ) ) + index ;
ss < < " \t { \n "
< < " \t \t real_t xpw = vIn.x + xform->m_VariationWeights[ " < < varIndex < < " ]; \n "
< < " \t \t real_t xmw = vIn.x - xform->m_VariationWeights[ " < < varIndex < < " ]; \n "
< < " \t \t real_t yy = SQR(vIn.y); \n "
< < " \t \t real_t frac = sqrt(yy + SQR(xmw)); \n "
< < " \n "
2015-02-26 16:18:55 -05:00
< < " \t \t if (frac == (real_t)(0.0)) \n "
< < " \t \t frac = (real_t)(1.0); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t real_t avgr = xform->m_VariationWeights[ " < < varIndex < < " ] * ( " < < spr < < " * sqrt(sqrt(yy + SQR(xpw)) / frac)); \n "
2015-02-26 16:18:55 -05:00
< < " \t \t real_t avga = (atan2(vIn.y, xmw) - atan2(vIn.y, xpw)) * (real_t)(0.5); \n "
2014-07-08 03:11:14 -04:00
< < " \n "
< < " \t \t vOut.x = avgr * cos(avga); \n "
< < " \t \t vOut.y = avgr * sin(avga); \n "
< < " \t \t vOut.z = xform->m_VariationWeights[ " < < varIndex < < " ] * vIn.z; \n "
< < " \t } \n " ;
return ss . str ( ) ;
}
2014-09-01 00:25:15 -04:00
virtual void Precalc ( ) override
2014-07-08 03:11:14 -04:00
{
m_Spr = 2 + m_Spread ;
}
2014-09-01 00:25:15 -04:00
virtual void Random ( QTIsaac < ISAAC_SIZE , ISAAC_INT > & rand ) override
{
2014-07-08 03:11:14 -04:00
m_Spread = T ( 0.5 ) + rand . Frand01 < T > ( ) / 2 ;
}
protected :
void Init ( )
{
string prefix = Prefix ( ) ;
m_Params . clear ( ) ;
m_Params . push_back ( ParamWithName < T > ( & m_Spread , prefix + " flux_spread " ) ) ; //Params.
m_Params . push_back ( ParamWithName < T > ( true , & m_Spr , prefix + " flux_spr " ) ) ; //Precalc.
}
2014-09-01 00:25:15 -04:00
2014-07-08 03:11:14 -04:00
private :
T m_Spread ; //Params.
T m_Spr ; //Precalc.
} ;
MAKEPREPOSTVAR ( Linear , linear , LINEAR )
MAKEPREPOSTVAR ( Sinusoidal , sinusoidal , SINUSOIDAL )
MAKEPREPOSTVAR ( Spherical , spherical , SPHERICAL )
MAKEPREPOSTVAR ( Swirl , swirl , SWIRL )
MAKEPREPOSTVAR ( Horseshoe , horseshoe , HORSESHOE )
MAKEPREPOSTVAR ( Polar , polar , POLAR )
MAKEPREPOSTVAR ( Handkerchief , handkerchief , HANDKERCHIEF )
MAKEPREPOSTVAR ( Heart , heart , HEART )
MAKEPREPOSTPARVAR ( Disc , disc , DISC )
MAKEPREPOSTVAR ( Spiral , spiral , SPIRAL )
MAKEPREPOSTVAR ( Hyperbolic , hyperbolic , HYPERBOLIC )
MAKEPREPOSTVAR ( Diamond , diamond , DIAMOND )
MAKEPREPOSTVAR ( Ex , ex , EX )
MAKEPREPOSTVAR ( Julia , julia , JULIA )
MAKEPREPOSTVAR ( Bent , bent , BENT )
MAKEPREPOSTPARVAR ( Waves , waves , WAVES )
MAKEPREPOSTVAR ( Fisheye , fisheye , FISHEYE )
MAKEPREPOSTVAR ( Popcorn , popcorn , POPCORN )
MAKEPREPOSTVAR ( Exponential , exponential , EXPONENTIAL )
MAKEPREPOSTVAR ( Power , power , POWER )
MAKEPREPOSTVAR ( Cosine , cosine , COSINE )
MAKEPREPOSTVAR ( Rings , rings , RINGS )
MAKEPREPOSTVAR ( Fan , fan , FAN )
MAKEPREPOSTPARVAR ( Blob , blob , BLOB )
MAKEPREPOSTPARVAR ( Pdj , pdj , PDJ )
MAKEPREPOSTPARVAR ( Fan2 , fan2 , FAN2 )
MAKEPREPOSTPARVAR ( Rings2 , rings2 , RINGS2 )
MAKEPREPOSTVAR ( Eyefish , eyefish , EYEFISH )
MAKEPREPOSTVAR ( Bubble , bubble , BUBBLE )
MAKEPREPOSTVAR ( Cylinder , cylinder , CYLINDER )
MAKEPREPOSTPARVAR ( Perspective , perspective , PERSPECTIVE )
MAKEPREPOSTVAR ( Noise , noise , NOISE )
MAKEPREPOSTPARVAR ( JuliaNGeneric , julian , JULIAN )
MAKEPREPOSTPARVAR ( JuliaScope , juliascope , JULIASCOPE )
2016-01-04 19:50:15 -05:00
MAKEPREPOSTVARASSIGN ( Blur , blur , BLUR , eVariationAssignType : : ASSIGNTYPE_SUM )
MAKEPREPOSTVARASSIGN ( GaussianBlur , gaussian_blur , GAUSSIAN_BLUR , eVariationAssignType : : ASSIGNTYPE_SUM )
2014-07-08 03:11:14 -04:00
MAKEPREPOSTPARVAR ( RadialBlur , radial_blur , RADIAL_BLUR )
2016-01-04 19:50:15 -05:00
MAKEPREPOSTPARVARASSIGN ( Pie , pie , PIE , eVariationAssignType : : ASSIGNTYPE_SUM )
2014-07-08 03:11:14 -04:00
MAKEPREPOSTPARVAR ( Ngon , ngon , NGON )
MAKEPREPOSTPARVAR ( Curl , curl , CURL )
MAKEPREPOSTPARVAR ( Rectangles , rectangles , RECTANGLES )
2016-01-04 19:50:15 -05:00
MAKEPREPOSTVARASSIGN ( Arch , arch , ARCH , eVariationAssignType : : ASSIGNTYPE_SUM )
2014-07-08 03:11:14 -04:00
MAKEPREPOSTVAR ( Tangent , tangent , TANGENT )
2016-01-04 19:50:15 -05:00
MAKEPREPOSTVARASSIGN ( Square , square , SQUARE , eVariationAssignType : : ASSIGNTYPE_SUM )
2014-07-08 03:11:14 -04:00
MAKEPREPOSTVAR ( Rays , rays , RAYS )
MAKEPREPOSTVAR ( Blade , blade , BLADE )
MAKEPREPOSTVAR ( Secant2 , secant2 , SECANT2 )
MAKEPREPOSTVAR ( TwinTrian , TwinTrian , TWINTRIAN )
MAKEPREPOSTVAR ( Cross , cross , CROSS )
MAKEPREPOSTPARVAR ( Disc2 , disc2 , DISC2 )
MAKEPREPOSTPARVAR ( SuperShape , super_shape , SUPER_SHAPE )
MAKEPREPOSTPARVAR ( Flower , flower , FLOWER )
MAKEPREPOSTPARVAR ( Conic , conic , CONIC )
MAKEPREPOSTPARVAR ( Parabola , parabola , PARABOLA )
MAKEPREPOSTPARVAR ( Bent2 , bent2 , BENT2 )
MAKEPREPOSTPARVAR ( Bipolar , bipolar , BIPOLAR )
MAKEPREPOSTVAR ( Boarders , boarders , BOARDERS )
MAKEPREPOSTVAR ( Butterfly , butterfly , BUTTERFLY )
MAKEPREPOSTPARVAR ( Cell , cell , CELL )
MAKEPREPOSTPARVAR ( Cpow , cpow , CPOW )
MAKEPREPOSTPARVAR ( Curve , curve , CURVE )
MAKEPREPOSTVAR ( Edisc , edisc , EDISC )
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
MAKEPREPOSTPARVAR ( Elliptic , elliptic , ELLIPTIC )
2014-07-08 03:11:14 -04:00
MAKEPREPOSTPARVAR ( Escher , escher , ESCHER )
MAKEPREPOSTVAR ( Foci , foci , FOCI )
MAKEPREPOSTPARVAR ( LazySusan , lazysusan , LAZYSUSAN )
MAKEPREPOSTPARVAR ( Loonie , loonie , LOONIE )
MAKEPREPOSTPARVAR ( Modulus , modulus , MODULUS )
MAKEPREPOSTPARVAR ( Oscilloscope , oscilloscope , OSCILLOSCOPE )
MAKEPREPOSTPARVAR ( Polar2 , polar2 , POLAR2 )
MAKEPREPOSTPARVAR ( Popcorn2 , popcorn2 , POPCORN2 )
MAKEPREPOSTPARVAR ( Scry , scry , SCRY )
MAKEPREPOSTPARVAR ( Separation , separation , SEPARATION )
MAKEPREPOSTPARVAR ( Split , split , SPLIT )
MAKEPREPOSTPARVAR ( Splits , splits , SPLITS )
MAKEPREPOSTPARVAR ( Stripes , stripes , STRIPES )
MAKEPREPOSTPARVAR ( Wedge , wedge , WEDGE )
MAKEPREPOSTPARVAR ( WedgeJulia , wedge_julia , WEDGE_JULIA )
MAKEPREPOSTPARVAR ( WedgeSph , wedge_sph , WEDGE_SPH )
MAKEPREPOSTPARVAR ( Whorl , whorl , WHORL )
MAKEPREPOSTPARVAR ( Waves2 , waves2 , WAVES2 )
MAKEPREPOSTVAR ( Exp , exp , EXP )
MAKEPREPOSTPARVAR ( Log , log , LOG )
MAKEPREPOSTVAR ( Sin , sin , SIN )
MAKEPREPOSTVAR ( Cos , cos , COS )
MAKEPREPOSTVAR ( Tan , tan , TAN )
MAKEPREPOSTVAR ( Sec , sec , SEC )
MAKEPREPOSTVAR ( Csc , csc , CSC )
MAKEPREPOSTVAR ( Cot , cot , COT )
MAKEPREPOSTVAR ( Sinh , sinh , SINH )
MAKEPREPOSTVAR ( Cosh , cosh , COSH )
MAKEPREPOSTVAR ( Tanh , tanh , TANH )
MAKEPREPOSTVAR ( Sech , sech , SECH )
MAKEPREPOSTVAR ( Csch , csch , CSCH )
MAKEPREPOSTVAR ( Coth , coth , COTH )
MAKEPREPOSTPARVAR ( Auger , auger , AUGER )
MAKEPREPOSTPARVAR ( Flux , flux , FLUX )
2014-09-01 00:25:15 -04:00
}