2014-07-08 03:11:14 -04:00
# include "EmberCommonPch.h"
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
2014-07-08 03:11:14 -04:00
# include "EmberGenome.h"
# include "JpegUtils.h"
2016-06-11 20:47:03 -04:00
using namespace EmberCommon ;
2014-07-08 03:11:14 -04:00
/// <summary>
/// Set various default test values on the passed in ember.
/// </summary>
/// <param name="ember">The ember to test</param>
template < typename T >
void SetDefaultTestValues ( Ember < T > & ember )
{
2015-12-31 16:41:59 -05:00
ember . m_Time = 0.0 ;
2015-12-31 19:00:36 -05:00
ember . m_Interp = eInterp : : EMBER_INTERP_LINEAR ;
ember . m_PaletteInterp = ePaletteInterp : : INTERP_HSV ;
2015-12-31 16:41:59 -05:00
ember . m_Background [ 0 ] = 0 ;
ember . m_Background [ 1 ] = 0 ;
ember . m_Background [ 2 ] = 0 ;
ember . m_Background [ 3 ] = 255 ;
ember . m_CenterX = 0 ;
ember . m_CenterY = 0 ;
ember . m_Rotate = 0 ;
ember . m_PixelsPerUnit = 64 ;
ember . m_FinalRasW = 128 ;
ember . m_FinalRasH = 128 ;
ember . m_Supersample = 1 ;
ember . m_SpatialFilterRadius = T ( 0.5 ) ;
2015-12-31 19:00:36 -05:00
ember . m_SpatialFilterType = eSpatialFilterType : : GAUSSIAN_SPATIAL_FILTER ;
2015-12-31 16:41:59 -05:00
ember . m_Zoom = 0 ;
ember . m_Quality = 1 ;
ember . m_TemporalSamples = 1 ;
ember . m_MaxRadDE = 0 ;
ember . m_MinRadDE = 0 ;
ember . m_CurveDE = T ( 0.6 ) ;
2014-07-08 03:11:14 -04:00
}
/// <summary>
/// The core of the EmberGenome.exe program.
/// Template argument expected to be float or double.
/// </summary>
/// <param name="opt">A populated EmberOptions object which specifies all program options to be used</param>
/// <returns>True if success, else false.</returns>
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
template < typename T >
2014-07-08 03:11:14 -04:00
bool EmberGenome ( EmberOptions & opt )
{
2015-12-31 16:41:59 -05:00
auto info = OpenCLInfo : : Instance ( ) ;
2014-07-08 03:11:14 -04:00
std : : cout . imbue ( std : : locale ( " " ) ) ;
if ( opt . DumpArgs ( ) )
2016-02-12 00:38:21 -05:00
cerr < < opt . GetValues ( eOptionUse : : OPT_USE_GENOME ) < < " \n " ;
2014-12-05 21:30:46 -05:00
2014-07-08 03:11:14 -04:00
if ( opt . OpenCLInfo ( ) )
{
2016-02-12 00:38:21 -05:00
cerr < < " \n OpenCL Info: \n " ;
2015-12-31 16:41:59 -05:00
cerr < < info - > DumpInfo ( ) ;
2014-07-08 03:11:14 -04:00
return true ;
}
2016-04-13 23:59:57 -04:00
auto varList = VariationList < T > : : Instance ( ) ;
2016-02-18 21:58:24 -05:00
2016-05-15 02:33:08 -04:00
if ( opt . AllVars ( ) | | opt . SumVars ( ) | | opt . AssignVars ( ) | | opt . PpSumVars ( ) | | opt . PpAssignVars ( ) | |
2016-05-18 19:48:40 -04:00
opt . DcVars ( ) | | opt . StateVars ( ) | | opt . ParVars ( ) | | opt . NonParVars ( ) | |
2016-05-15 02:33:08 -04:00
opt . RegVars ( ) | | opt . PreVars ( ) | | opt . PostVars ( ) )
2016-02-15 15:02:37 -05:00
{
2016-05-18 19:48:40 -04:00
vector < string > assign { " outPoint->m_X = " , " outPoint->m_Y = " , " outPoint->m_Z = " ,
" outPoint->m_X= " , " outPoint->m_Y= " , " outPoint->m_Z= " } ;
2016-02-15 15:02:37 -05:00
if ( opt . AllVars ( ) )
{
2016-04-13 23:59:57 -04:00
auto & vars = varList - > AllVars ( ) ;
2016-02-15 15:02:37 -05:00
for ( auto & v : vars )
cout < < v - > Name ( ) < < " \n " ;
}
2016-05-15 02:33:08 -04:00
else if ( opt . SumVars ( ) )
{
auto & reg = varList - > RegVars ( ) ;
2016-05-18 19:48:40 -04:00
auto matches = FindVarsWithout < T > ( varList - > RegVars ( ) , assign ) ;
2016-05-15 02:33:08 -04:00
for ( auto & v : matches )
cout < < v - > Name ( ) < < " \n " ;
}
else if ( opt . AssignVars ( ) )
{
2016-05-18 19:48:40 -04:00
auto matches = FindVarsWith < T > ( varList - > RegVars ( ) , assign ) ;
2016-05-15 02:33:08 -04:00
for ( auto & v : matches )
cout < < v - > Name ( ) < < " \n " ;
}
else if ( opt . PpSumVars ( ) )
{
auto & pre = varList - > PreVars ( ) ;
auto & post = varList - > PostVars ( ) ;
for ( auto & v : pre )
if ( v - > AssignType ( ) = = eVariationAssignType : : ASSIGNTYPE_SUM )
cout < < v - > Name ( ) < < " \n " ;
for ( auto & v : post )
if ( v - > AssignType ( ) = = eVariationAssignType : : ASSIGNTYPE_SUM )
cout < < v - > Name ( ) < < " \n " ;
}
else if ( opt . PpAssignVars ( ) )
{
auto & pre = varList - > PreVars ( ) ;
auto & post = varList - > PostVars ( ) ;
for ( auto & v : pre )
if ( v - > AssignType ( ) = = eVariationAssignType : : ASSIGNTYPE_SET )
cout < < v - > Name ( ) < < " \n " ;
for ( auto & v : post )
if ( v - > AssignType ( ) = = eVariationAssignType : : ASSIGNTYPE_SET )
cout < < v - > Name ( ) < < " \n " ;
}
else if ( opt . DcVars ( ) )
{
auto & all = varList - > AllVars ( ) ;
auto matches = FindVarsWith < T > ( all , vector < string > { " m_ColorX " } ) ;
for ( auto & v : matches )
cout < < v - > Name ( ) < < " \n " ;
}
2016-05-18 19:48:40 -04:00
else if ( opt . StateVars ( ) )
{
auto & all = varList - > AllVars ( ) ;
for ( auto & v : all )
if ( ! v - > StateOpenCLString ( ) . empty ( ) )
cout < < v - > Name ( ) < < " \n " ;
}
2016-05-15 02:33:08 -04:00
else if ( opt . ParVars ( ) )
{
2016-05-18 19:48:40 -04:00
auto & parVars = varList - > ParametricVariations ( ) ;
2016-05-15 02:33:08 -04:00
2016-05-18 19:48:40 -04:00
for ( auto & v : parVars )
2016-05-15 02:33:08 -04:00
cout < < v - > Name ( ) < < " \n " ;
}
else if ( opt . NonParVars ( ) )
{
2016-05-18 19:48:40 -04:00
auto & vars = varList - > NonParametricVariations ( ) ;
2016-05-15 02:33:08 -04:00
2016-05-18 19:48:40 -04:00
for ( auto & v : vars )
2016-05-15 02:33:08 -04:00
cout < < v - > Name ( ) < < " \n " ;
}
2016-02-15 15:02:37 -05:00
else
{
2016-05-15 02:33:08 -04:00
vector < const Variation < T > * > vars ;
2016-02-15 15:02:37 -05:00
if ( opt . RegVars ( ) )
2016-04-13 23:59:57 -04:00
vars . insert ( vars . end ( ) , varList - > RegVars ( ) . begin ( ) , varList - > RegVars ( ) . end ( ) ) ;
2016-02-15 15:02:37 -05:00
if ( opt . PreVars ( ) )
2016-04-13 23:59:57 -04:00
vars . insert ( vars . end ( ) , varList - > PreVars ( ) . begin ( ) , varList - > PreVars ( ) . end ( ) ) ;
2016-02-15 15:02:37 -05:00
if ( opt . PostVars ( ) )
2016-04-13 23:59:57 -04:00
vars . insert ( vars . end ( ) , varList - > PostVars ( ) . begin ( ) , varList - > PostVars ( ) . end ( ) ) ;
2016-02-15 15:02:37 -05:00
for ( auto & v : vars )
cout < < v - > Name ( ) < < " \n " ;
}
return true ;
}
2016-04-14 22:32:42 -04:00
VerbosePrint ( " Using " < < ( sizeof ( T ) = = sizeof ( float ) ? " single " : " double " ) < < " precision. " ) ;
2014-07-08 03:11:14 -04:00
//Regular variables.
Timing t ;
2016-05-02 19:54:56 -04:00
bool exactTimeMatch , randomMode , didColor , seqFlag , random = false ;
size_t i , i0 , i1 , rep , val , frame , frameCount , count = 0 ;
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
size_t ftime , firstFrame , lastFrame ;
2017-07-22 16:43:35 -04:00
double tot ;
size_t n , totb , totw ;
double avgPix ;
T fractionBlack , fractionWhite , blend , spread , mix0 , mix1 ;
2014-07-08 03:11:14 -04:00
string token , filename ;
ostringstream os , os2 ;
vector < Ember < T > > embers , embers2 , templateEmbers ;
vector < eVariationId > vars , noVars ;
2017-07-22 16:43:35 -04:00
vector < v4F > finalImage ;
2014-07-08 03:11:14 -04:00
eCrossMode crossMeth ;
eMutateMode mutMeth ;
Ember < T > orig , save , selp0 , selp1 , parent0 , parent1 ;
2014-12-05 21:30:46 -05:00
Ember < T > * aselp0 , * aselp1 , * pTemplate = nullptr ;
2014-07-08 03:11:14 -04:00
XmlToEmber < T > parser ;
EmberToXml < T > emberToXml ;
2016-04-23 12:02:09 -04:00
Interpolater < T > interpolater ;
2014-07-08 03:11:14 -04:00
EmberReport emberReport , emberReport2 ;
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
const vector < pair < size_t , size_t > > devices = Devices ( opt . Devices ( ) ) ;
2016-04-03 21:55:12 -04:00
auto progress = make_unique < RenderProgress < T > > ( ) ;
2016-01-04 19:50:15 -05:00
unique_ptr < Renderer < T , float > > renderer ( CreateRenderer < T > ( opt . EmberCL ( ) ? eRendererType : : OPENCL_RENDERER : eRendererType : : CPU_RENDERER , devices , false , 0 , emberReport ) ) ;
2014-07-08 03:11:14 -04:00
QTIsaac < ISAAC_SIZE , ISAAC_INT > rand ( ISAAC_INT ( t . Tic ( ) ) , ISAAC_INT ( t . Tic ( ) * 2 ) , ISAAC_INT ( t . Tic ( ) * 3 ) ) ;
vector < string > errorReport = emberReport . ErrorReport ( ) ;
os . imbue ( std : : locale ( " " ) ) ;
os2 . imbue ( std : : locale ( " " ) ) ;
if ( ! errorReport . empty ( ) )
2015-01-23 21:26:18 -05:00
cerr < < emberReport . ErrorReportString ( ) ;
2014-07-08 03:11:14 -04:00
if ( ! renderer . get ( ) )
{
2016-02-12 00:38:21 -05:00
cerr < < " Renderer creation failed, exiting. \n " ;
2014-07-08 03:11:14 -04:00
return false ;
}
2017-02-26 12:34:43 -05:00
if ( ! InitPaletteList < float > ( opt . PalettePath ( ) ) )
2014-07-08 03:11:14 -04:00
return false ;
if ( ! opt . EmberCL ( ) )
{
if ( opt . ThreadCount ( ) ! = 0 )
2014-12-05 21:30:46 -05:00
renderer - > ThreadCount ( opt . ThreadCount ( ) , opt . IsaacSeed ( ) ! = " " ? opt . IsaacSeed ( ) . c_str ( ) : nullptr ) ;
2014-07-08 03:11:14 -04:00
}
else
{
2016-02-12 00:38:21 -05:00
cerr < < " Using OpenCL to render. \n " ;
2014-12-05 21:30:46 -05:00
2014-07-08 03:11:14 -04:00
if ( opt . Verbose ( ) )
{
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
for ( auto & device : devices )
{
2016-02-12 00:38:21 -05:00
cerr < < " Platform: " < < info - > PlatformName ( device . first ) < < " \n " ;
cerr < < " Device: " < < info - > DeviceName ( device . first , device . second ) < < " \n " ;
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
}
2014-07-08 03:11:14 -04:00
}
}
//SheepTools will own the created renderer and will take care of cleaning it up.
2016-01-04 19:50:15 -05:00
SheepTools < T , float > tools ( opt . PalettePath ( ) , CreateRenderer < T > ( opt . EmberCL ( ) ? eRendererType : : OPENCL_RENDERER : eRendererType : : CPU_RENDERER , devices , false , 0 , emberReport2 ) ) ;
2014-07-08 03:11:14 -04:00
tools . SetSpinParams ( ! opt . UnsmoothEdge ( ) ,
T ( opt . Stagger ( ) ) ,
T ( opt . OffsetX ( ) ) ,
T ( opt . OffsetY ( ) ) ,
opt . Nick ( ) ,
opt . Url ( ) ,
opt . Id ( ) ,
opt . Comment ( ) ,
opt . SheepGen ( ) ,
opt . SheepId ( ) ) ;
if ( opt . UseVars ( ) ! = " " & & opt . DontUseVars ( ) ! = " " )
{
2016-02-12 00:38:21 -05:00
cerr < < " use_vars and dont_use_vars cannot both be specified. Returning without executing. \n " ;
2014-07-08 03:11:14 -04:00
return false ;
}
//Specify reasonable defaults if nothing is specified.
if ( opt . UseVars ( ) = = " " & & opt . DontUseVars ( ) = = " " )
{
2016-01-04 19:50:15 -05:00
noVars . push_back ( eVariationId : : VAR_NOISE ) ;
noVars . push_back ( eVariationId : : VAR_BLUR ) ;
noVars . push_back ( eVariationId : : VAR_GAUSSIAN_BLUR ) ;
noVars . push_back ( eVariationId : : VAR_RADIAL_BLUR ) ;
noVars . push_back ( eVariationId : : VAR_NGON ) ;
noVars . push_back ( eVariationId : : VAR_SQUARE ) ;
noVars . push_back ( eVariationId : : VAR_RAYS ) ;
noVars . push_back ( eVariationId : : VAR_CROSS ) ;
noVars . push_back ( eVariationId : : VAR_PRE_BLUR ) ;
noVars . push_back ( eVariationId : : VAR_SEPARATION ) ;
noVars . push_back ( eVariationId : : VAR_SPLIT ) ;
noVars . push_back ( eVariationId : : VAR_SPLITS ) ;
2014-12-05 21:30:46 -05:00
2016-05-02 19:54:56 -04:00
//Set ivars to the complement of novars.
2016-04-13 23:59:57 -04:00
for ( i = 0 ; i < varList - > Size ( ) ; i + + )
2016-05-02 19:54:56 -04:00
if ( ! Contains ( noVars , varList - > GetVariation ( i ) - > VariationId ( ) ) )
2016-04-13 23:59:57 -04:00
vars . push_back ( varList - > GetVariation ( i ) - > VariationId ( ) ) ;
2014-07-08 03:11:14 -04:00
}
else
{
if ( opt . UseVars ( ) ! = " " ) //Parse comma-separated list of variations to use.
{
istringstream iss ( opt . UseVars ( ) ) ;
while ( std : : getline ( iss , token , ' , ' ) )
{
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
if ( parser . Aton ( token . c_str ( ) , val ) )
2014-07-08 03:11:14 -04:00
{
2016-04-13 23:59:57 -04:00
if ( val < varList - > Size ( ) )
2014-12-07 02:51:44 -05:00
vars . push_back ( static_cast < eVariationId > ( val ) ) ;
2014-07-08 03:11:14 -04:00
}
}
}
else if ( opt . DontUseVars ( ) ! = " " )
{
istringstream iss ( opt . DontUseVars ( ) ) ;
while ( std : : getline ( iss , token , ' , ' ) )
{
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
if ( parser . Aton ( token . c_str ( ) , val ) )
2014-07-08 03:11:14 -04:00
{
2016-04-13 23:59:57 -04:00
if ( val < varList - > Size ( ) )
2014-12-07 02:51:44 -05:00
noVars . push_back ( static_cast < eVariationId > ( val ) ) ;
2014-07-08 03:11:14 -04:00
}
}
2016-05-02 19:54:56 -04:00
//Set ivars to the complement of novars.
2016-04-13 23:59:57 -04:00
for ( i = 0 ; i < varList - > Size ( ) ; i + + )
2016-05-02 19:54:56 -04:00
if ( ! Contains ( noVars , varList - > GetVariation ( i ) - > VariationId ( ) ) )
2016-04-13 23:59:57 -04:00
vars . push_back ( varList - > GetVariation ( i ) - > VariationId ( ) ) ;
2014-07-08 03:11:14 -04:00
}
}
bool doMutate = opt . Mutate ( ) ! = " " ;
bool doInter = opt . Inter ( ) ! = " " ;
bool doRotate = opt . Rotate ( ) ! = " " ;
bool doClone = opt . Clone ( ) ! = " " ;
bool doCross0 = opt . Cross0 ( ) ! = " " ;
bool doCross1 = opt . Cross1 ( ) ! = " " ;
count + = ( doMutate ? 1 : 0 ) ;
count + = ( doInter ? 1 : 0 ) ;
count + = ( doRotate ? 1 : 0 ) ;
count + = ( doClone ? 1 : 0 ) ;
count + = ( ( doCross0 | | doCross1 ) ? 1 : 0 ) ;
if ( count > 1 )
{
2016-05-02 19:54:56 -04:00
cerr < < " Can only specify one of mutate, clone, cross, rotate, or inter. Returning without executing. \n " ;
2014-07-08 03:11:14 -04:00
return false ;
}
2015-01-23 21:26:18 -05:00
if ( doCross0 ! = doCross1 ) //Must both be either true or false.
2014-07-08 03:11:14 -04:00
{
2016-02-12 00:38:21 -05:00
cerr < < " Must specify both crossover arguments. Returning without executing. \n " ;
2014-07-08 03:11:14 -04:00
return false ;
}
if ( opt . Method ( ) ! = " " & & ( ! doCross0 & & ! doMutate ) )
{
2016-02-12 00:38:21 -05:00
cerr < < " Cannot specify method unless doing crossover or mutate. Returning without executing. \n " ;
2014-07-08 03:11:14 -04:00
return false ;
}
if ( opt . TemplateFile ( ) ! = " " )
{
2015-07-06 23:04:38 -04:00
if ( ! ParseEmberFile ( parser , opt . TemplateFile ( ) , templateEmbers , false ) ) //Do not use defaults here to ensure only present fields get used when applying the template.
2014-07-08 03:11:14 -04:00
return false ;
2014-12-05 21:30:46 -05:00
2014-07-08 03:11:14 -04:00
if ( templateEmbers . size ( ) > 1 )
2016-02-12 00:38:21 -05:00
cerr < < " More than one control point in template, ignoring all but first. \n " ;
2014-07-08 03:11:14 -04:00
pTemplate = & templateEmbers [ 0 ] ;
}
//Methods for genetic manipulation begin here.
if ( doMutate ) filename = opt . Mutate ( ) ;
else if ( doInter ) filename = opt . Inter ( ) ;
else if ( doRotate ) filename = opt . Rotate ( ) ;
else if ( doClone ) filename = opt . Clone ( ) ;
else if ( doCross0 ) filename = opt . Cross0 ( ) ;
else if ( opt . CloneAll ( ) ! = " " ) filename = opt . CloneAll ( ) ;
else if ( opt . Animate ( ) ! = " " ) filename = opt . Animate ( ) ;
else if ( opt . Sequence ( ) ! = " " ) filename = opt . Sequence ( ) ;
else if ( opt . Inter ( ) ! = " " ) filename = opt . Inter ( ) ;
else if ( opt . Rotate ( ) ! = " " ) filename = opt . Rotate ( ) ;
else if ( opt . Clone ( ) ! = " " ) filename = opt . Clone ( ) ;
else if ( opt . Mutate ( ) ! = " " ) filename = opt . Mutate ( ) ;
2016-05-02 19:54:56 -04:00
else random = true ;
2014-07-08 03:11:14 -04:00
2016-05-02 19:54:56 -04:00
if ( ! random )
2014-11-28 04:37:51 -05:00
{
2016-05-02 19:54:56 -04:00
if ( ! ParseEmberFile ( parser , filename , embers ) )
2015-01-21 05:51:26 -05:00
return false ;
2016-05-02 19:54:56 -04:00
if ( doCross1 )
{
if ( ! ParseEmberFile ( parser , opt . Cross1 ( ) , embers2 ) )
return false ;
}
2014-11-28 04:37:51 -05:00
}
2014-07-08 03:11:14 -04:00
if ( opt . CloneAll ( ) ! = " " )
{
2016-02-12 00:38:21 -05:00
cout < < " <clone_all version= \" Ember- " < < EmberVersion ( ) < < " \" > \n " ;
2014-07-08 03:11:14 -04:00
for ( i = 0 ; i < embers . size ( ) ; i + + )
{
if ( pTemplate )
tools . ApplyTemplate ( embers [ i ] , * pTemplate ) ;
2014-12-05 21:30:46 -05:00
2014-12-07 02:51:44 -05:00
tools . Offset ( embers [ i ] , T ( opt . OffsetX ( ) ) , T ( opt . OffsetY ( ) ) ) ;
2016-04-03 21:55:12 -04:00
cout < < emberToXml . ToString ( embers [ i ] , opt . Extras ( ) , opt . PrintEditDepth ( ) , ! opt . NoEdits ( ) , opt . HexPalette ( ) ) ;
2014-07-08 03:11:14 -04:00
}
2016-02-12 00:38:21 -05:00
cout < < " </clone_all> \n " ;
2014-07-08 03:11:14 -04:00
return true ;
}
if ( opt . Animate ( ) ! = " " )
{
2016-05-02 19:54:56 -04:00
Ember < T > interpolated ;
2014-07-08 03:11:14 -04:00
for ( i = 0 ; i < embers . size ( ) ; i + + )
{
if ( i > 0 & & embers [ i ] . m_Time < = embers [ i - 1 ] . m_Time )
{
2016-04-21 18:33:00 -04:00
cerr < < " Error: control points must be sorted by time, but time " < < embers [ i ] . m_Time < < " <= " < < embers [ i - 1 ] . m_Time < < " , index " < < i < < " . \n " ;
2014-07-08 03:11:14 -04:00
return false ;
}
embers [ i ] . DeleteMotionElements ( ) ;
}
--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
firstFrame = size_t ( opt . FirstFrame ( ) = = UINT_MAX ? embers [ 0 ] . m_Time : opt . FirstFrame ( ) ) ;
lastFrame = size_t ( opt . LastFrame ( ) = = UINT_MAX ? embers . back ( ) . m_Time : opt . LastFrame ( ) ) ;
2014-07-08 03:11:14 -04:00
if ( lastFrame < firstFrame )
lastFrame = firstFrame ;
2016-02-12 00:38:21 -05:00
cout < < " <animate version= \" EMBER- " < < EmberVersion ( ) < < " \" > \n " ;
2014-07-08 03:11:14 -04:00
for ( ftime = firstFrame ; ftime < = lastFrame ; ftime + + )
{
exactTimeMatch = false ;
for ( i = 0 ; i < embers . size ( ) ; i + + )
{
--User changes
-Add new variations: bubbleT3D, crob, hexaplay3D, hexcrop, hexes, hexnix3D, loonie2, loonie3, nBlur, octapol and synth.
-Allow for pre/post versions of dc_bubble, dc_cylinder and dc_linear whereas before they were omitted.
-When saving a file with multiple embers in it, detect if time values are all the same and if so, start them at zero and increment by 1 for each ember.
-Allow for numerous quality increases to be coalesced into one. It will pick up at the end of the current render.
-Show selection highlight on variations tree in response to mouse hover. This makes it easier to see for which variation or param the current mouse wheel action will apply.
-Make default temporal samples be 100, whereas before it was 1000 which was overkill.
-Require the shift key to be held with delete for deleting an ember to prevent it from triggering when the user enters delete in the edit box.
-This wasn't otherwise fixable without writing a lot more code.
--Bug fixes
-EmberGenome was crashing when generating a sequence from a source file with more than 2 embers in it.
-EmberGenome was improperly handling the first frame of a merge after the last frame of the loop.
-These bugs were due to a previous commit. Revert parts of that commit.
-Prevent a zoom value of less than 0 when reading from xml.
-Slight optimization of the crescents, and mask variations, if the compiler wasn't doing it already.
-Unique file naming was broken because it was looking for _# and the default names ended with -#.
-Disallow renaming of an ember in the library tree to an empty string.
-Severe bug that prevented some variations from being read correctly from params generated outside this program.
-Severe OpenCL randomization bug. The first x coordinates of the first points in the first kernel call of the first ember of a render since the OpenCL renderer object was created were not random and were mostly -1.
-Severe bug when populating xform selection distributions that could sometimes cause a crash due to roundoff error. Fix by using double.
-Limit the max number of variations in a random ember to MAX_CL_VARS, which is 8. This ensures they'll look the same on CPU and GPU.
-Prevent user from saving stylesheet to default.qss, it's a special reserved filename.
--Code changes
-Generalize using the running sum output point inside of a variation for all cases: pre, reg and post.
-Allow for array variables in variations where the address of each element is stored in m_Params.
-Qualify all math functions with std::
-No longer use our own Clamp() in OpenCL, instead use the standard clamp().
-Redesign how functions are used in the variations OpenCL code.
-Add tests to EmberTester to verify some of the new functionality.
-Place more const and override qualifiers on functions where appropriate.
-Add a global rand with a lock to be used very sparingly.
-Use a map instead of a vector for bad param names in Xml parsing.
-Prefix affine interpolation mode defines with "AFFINE_" to make their purpose more clear.
-Allow for variations that change state during iteration by sending a separate copy of the ember to each rendering thread.
-Implement this same functionality with a local struct in OpenCL. It's members are the total of all variables that need to change state within an ember.
-Add Contains() function to Utils.h.
-EmberRender: print names of kernels being printed with --dump_kernel option.
-Clean up EmberTester to handle some of the recent changes.
-Fix various casts.
-Replace % 2 with & 1, even though the compiler was likely doing this already.
-Add new file Variations06.h to accommodate new variations.
-General cleanup.
2015-11-22 17:15:07 -05:00
if ( ftime = = size_t ( embers [ i ] . m_Time ) )
2014-07-08 03:11:14 -04:00
{
interpolated = embers [ i ] ;
exactTimeMatch = true ;
break ;
}
}
if ( ! exactTimeMatch )
{
2016-04-23 12:02:09 -04:00
interpolater . Interpolate ( embers , T ( ftime ) , T ( opt . Stagger ( ) ) , interpolated ) ;
2014-12-05 21:30:46 -05:00
2014-07-08 03:11:14 -04:00
for ( i = 0 ; i < embers . size ( ) ; i + + )
{
--User changes
-Add new variations: bubbleT3D, crob, hexaplay3D, hexcrop, hexes, hexnix3D, loonie2, loonie3, nBlur, octapol and synth.
-Allow for pre/post versions of dc_bubble, dc_cylinder and dc_linear whereas before they were omitted.
-When saving a file with multiple embers in it, detect if time values are all the same and if so, start them at zero and increment by 1 for each ember.
-Allow for numerous quality increases to be coalesced into one. It will pick up at the end of the current render.
-Show selection highlight on variations tree in response to mouse hover. This makes it easier to see for which variation or param the current mouse wheel action will apply.
-Make default temporal samples be 100, whereas before it was 1000 which was overkill.
-Require the shift key to be held with delete for deleting an ember to prevent it from triggering when the user enters delete in the edit box.
-This wasn't otherwise fixable without writing a lot more code.
--Bug fixes
-EmberGenome was crashing when generating a sequence from a source file with more than 2 embers in it.
-EmberGenome was improperly handling the first frame of a merge after the last frame of the loop.
-These bugs were due to a previous commit. Revert parts of that commit.
-Prevent a zoom value of less than 0 when reading from xml.
-Slight optimization of the crescents, and mask variations, if the compiler wasn't doing it already.
-Unique file naming was broken because it was looking for _# and the default names ended with -#.
-Disallow renaming of an ember in the library tree to an empty string.
-Severe bug that prevented some variations from being read correctly from params generated outside this program.
-Severe OpenCL randomization bug. The first x coordinates of the first points in the first kernel call of the first ember of a render since the OpenCL renderer object was created were not random and were mostly -1.
-Severe bug when populating xform selection distributions that could sometimes cause a crash due to roundoff error. Fix by using double.
-Limit the max number of variations in a random ember to MAX_CL_VARS, which is 8. This ensures they'll look the same on CPU and GPU.
-Prevent user from saving stylesheet to default.qss, it's a special reserved filename.
--Code changes
-Generalize using the running sum output point inside of a variation for all cases: pre, reg and post.
-Allow for array variables in variations where the address of each element is stored in m_Params.
-Qualify all math functions with std::
-No longer use our own Clamp() in OpenCL, instead use the standard clamp().
-Redesign how functions are used in the variations OpenCL code.
-Add tests to EmberTester to verify some of the new functionality.
-Place more const and override qualifiers on functions where appropriate.
-Add a global rand with a lock to be used very sparingly.
-Use a map instead of a vector for bad param names in Xml parsing.
-Prefix affine interpolation mode defines with "AFFINE_" to make their purpose more clear.
-Allow for variations that change state during iteration by sending a separate copy of the ember to each rendering thread.
-Implement this same functionality with a local struct in OpenCL. It's members are the total of all variables that need to change state within an ember.
-Add Contains() function to Utils.h.
-EmberRender: print names of kernels being printed with --dump_kernel option.
-Clean up EmberTester to handle some of the recent changes.
-Fix various casts.
-Replace % 2 with & 1, even though the compiler was likely doing this already.
-Add new file Variations06.h to accommodate new variations.
-General cleanup.
2015-11-22 17:15:07 -05:00
if ( ftime = = size_t ( embers [ i ] . m_Time - 1 ) )
2014-07-08 03:11:14 -04:00
{
exactTimeMatch = true ;
break ;
}
}
if ( ! exactTimeMatch )
2015-12-31 19:00:36 -05:00
interpolated . m_AffineInterp = eAffineInterp : : AFFINE_INTERP_LINEAR ;
2014-07-08 03:11:14 -04:00
}
2014-12-05 21:30:46 -05:00
2014-07-08 03:11:14 -04:00
if ( pTemplate )
tools . ApplyTemplate ( interpolated , * pTemplate ) ;
2016-04-03 21:55:12 -04:00
cout < < emberToXml . ToString ( interpolated , opt . Extras ( ) , opt . PrintEditDepth ( ) , ! opt . NoEdits ( ) , opt . HexPalette ( ) ) ;
2014-07-08 03:11:14 -04:00
}
2016-02-12 00:38:21 -05:00
cout < < " </animate> \n " ;
2014-07-08 03:11:14 -04:00
return true ;
}
if ( opt . Sequence ( ) ! = " " )
{
2016-05-02 19:54:56 -04:00
Ember < T > result ;
2016-12-05 22:04:33 -05:00
if ( ! opt . LoopFrames ( ) & & ! opt . InterpFrames ( ) )
2014-07-08 03:11:14 -04:00
{
2016-12-05 22:04:33 -05:00
cerr < < " loop frames or interp frames must be positive and non-zero, not " < < opt . LoopFrames ( ) < < " , " < < opt . InterpFrames ( ) < < " . \n " ;
return false ;
}
if ( opt . LoopFrames ( ) > 0 & & ! opt . Loops ( ) )
{
cerr < < " loop frames cannot be positive while loops is zero: " < < opt . LoopFrames ( ) < < " , " < < opt . Loops ( ) < < " . \n " ;
return false ;
}
if ( opt . Loops ( ) > 0 & & ! opt . LoopFrames ( ) )
{
cerr < < " loops cannot be positive while loopframes is zero: " < < opt . Loops ( ) < < " , " < < opt . LoopFrames ( ) < < " . \n " ;
2014-07-08 03:11:14 -04:00
return false ;
}
if ( opt . Enclosed ( ) )
2016-02-12 00:38:21 -05:00
cout < < " <sequence version= \" EMBER- " < < EmberVersion ( ) < < " \" > \n " ;
2014-07-08 03:11:14 -04:00
frameCount = 0 ;
--User changes
-Allow for pausing the renderer in the main window. This makes is more efficient when entering many parameters, such as when following a tutorial.
-Add support for new variations: erf, gamma, jac_cn, jac_dn, jac_sn, logDB, pressure_wave, pRose3D, splits3D, w, waves2b, x, xerf, y, z.
-Inform user of the start and stop of file parsing in EmberAnimate because the files could potentially be very large.
-Move the follwing fields to a new table called Animation: Interpolation, Affine Interpolation, Temporal Samples, Temporal Filter Width, Temporal Filter Type.
-These currently have no effect on the interactive renderer and instead are used when running flames through EmberGenome to generate sequences, and then animating them in Fractorium or EmberAnimate.
-Add new parameter overrides for EmberRender and EmberAnimate which directly assign values to all flames being rendered, rather than scale:
--quality
--demin
--demax
--Bug fixes
-Left pad instead of right pad names of sequence outputs from EmberGenome.
-Unique file naming was broken for files which already had an underscore in them.
-Properly report that png is the default format of EmberRender and EmberAnimate output instead of erroneously claiming it was jpg.
-Make command line programs search these folders in this order for the palette file:
./
~/.fractorium
~/.config/fractorium
/usr/share/fractorium
/usr/local/share/fractorium
-Fix possible bad values in hexes.
-Better assignment of Z variables.
-Fix boarders due to use of poorly implemented rint() function from flam3. Use std::rint() now.
-wedge_sph was completely wrong due to having accidentally swapped the mapping of two parameters.
-Make juliascope juliascope_power parameter be of type REAL_NONZERO since it's used as a denominator.
-Make Z assignment compatible with the originals in:
-arch, bcircle, bCollide, bent, bent2, bisplit, blob, blur_linear, blur_square, bMod, boarders, boarders2, bSwirl, bTransform, butterfly, cardioid, cell, circleblur, circlize, circlize2, circus, collideoscope, cos, cosine, cosh, coth, cpow, cpow2, crescents, cropn, csc, csch, curl, curve, dc_gridout, deltaa, diamond, disc2, eclipse, eCollide, edisc, eJulia, elliptic, eMod, eMotion, ennepers, epispiral, ePush, eRotate, eScale, eSwirl, ex, exp, expo, exponential, fan, fdisc, fibonacci, fibonacci2, fisheye, flipcircle, flipy, flower, flux, funnel, glynnia, GlynnSim1, GlynnSim2, GlynnSim3, gridout, handkerchief, heart, hole, idisc, julia, julian2, juliaNab, kaleidoscope, lazyTravis, Lissajous, mask, MobiusN, mobius_strip, modulus, murl, murl2, npolar, ortho, oscilloscope, parabola, perspective, petal, phoenix_julia, pie (was also inconsistent between cpu and gpu), poincare, popcorn, popcorn2, power, pow_block, rational3, rays, rblur, rings, rippled, roundspher, sec, secant2, sigmoid, sin, sineblur, sinh, sinusgrid, sphericaln, spiralwing, spirograph, split, squarize, squirrel, squish, sschecks, starblur, stripes, stwin, super_shape, tan, tancos, tangent, tanh, TwinTrian, twoface, unpolar, waves, wavesn, wedge_julia, whorl, xheart, zblur, zscale.
--Code changes
-Generalize Variation::PrecalcHelper() and rename to PrePostPrecalcHelper().
--Do the same for the OpenCL version and rename it PrePostPrecalcOpenCLString().
-Rename Variation::m_AssignType to m_PrePostAssignType since it's only relevant to pre/post variations.
2016-01-29 20:02:15 -05:00
os . str ( " " ) ;
2016-06-11 20:47:03 -04:00
os < < setfill ( ' 0 ' ) < < setprecision ( 0 ) < < fixed ;
2016-12-05 22:04:33 -05:00
auto padding = opt . Padding ( ) ? streamsize ( opt . Padding ( ) ) : ( streamsize ( std : : log10 ( opt . StartCount ( ) + ( ( ( opt . LoopFrames ( ) * opt . Loops ( ) ) + opt . InterpFrames ( ) ) * embers . size ( ) ) ) ) + 1 ) ;
2016-04-23 12:02:09 -04:00
t . Tic ( ) ;
2014-07-08 03:11:14 -04:00
for ( i = 0 ; i < embers . size ( ) ; i + + )
{
2015-07-06 07:06:20 -04:00
if ( opt . Loops ( ) > 0 )
2014-07-08 03:11:14 -04:00
{
2016-12-05 22:04:33 -05:00
size_t roundFrames = size_t ( std : : round ( opt . LoopFrames ( ) * opt . Loops ( ) ) ) ;
2016-06-11 20:47:03 -04:00
for ( frame = 0 ; frame < roundFrames ; frame + + )
2014-07-08 03:11:14 -04:00
{
2016-12-05 22:04:33 -05:00
blend = T ( frame ) / T ( opt . LoopFrames ( ) ) ;
tools . Spin ( embers [ i ] , pTemplate , result , opt . StartCount ( ) + frameCount + + , blend , opt . CwLoops ( ) ) ; //Result is cleared and reassigned each time inside of Spin().
--User changes
-Allow for pausing the renderer in the main window. This makes is more efficient when entering many parameters, such as when following a tutorial.
-Add support for new variations: erf, gamma, jac_cn, jac_dn, jac_sn, logDB, pressure_wave, pRose3D, splits3D, w, waves2b, x, xerf, y, z.
-Inform user of the start and stop of file parsing in EmberAnimate because the files could potentially be very large.
-Move the follwing fields to a new table called Animation: Interpolation, Affine Interpolation, Temporal Samples, Temporal Filter Width, Temporal Filter Type.
-These currently have no effect on the interactive renderer and instead are used when running flames through EmberGenome to generate sequences, and then animating them in Fractorium or EmberAnimate.
-Add new parameter overrides for EmberRender and EmberAnimate which directly assign values to all flames being rendered, rather than scale:
--quality
--demin
--demax
--Bug fixes
-Left pad instead of right pad names of sequence outputs from EmberGenome.
-Unique file naming was broken for files which already had an underscore in them.
-Properly report that png is the default format of EmberRender and EmberAnimate output instead of erroneously claiming it was jpg.
-Make command line programs search these folders in this order for the palette file:
./
~/.fractorium
~/.config/fractorium
/usr/share/fractorium
/usr/local/share/fractorium
-Fix possible bad values in hexes.
-Better assignment of Z variables.
-Fix boarders due to use of poorly implemented rint() function from flam3. Use std::rint() now.
-wedge_sph was completely wrong due to having accidentally swapped the mapping of two parameters.
-Make juliascope juliascope_power parameter be of type REAL_NONZERO since it's used as a denominator.
-Make Z assignment compatible with the originals in:
-arch, bcircle, bCollide, bent, bent2, bisplit, blob, blur_linear, blur_square, bMod, boarders, boarders2, bSwirl, bTransform, butterfly, cardioid, cell, circleblur, circlize, circlize2, circus, collideoscope, cos, cosine, cosh, coth, cpow, cpow2, crescents, cropn, csc, csch, curl, curve, dc_gridout, deltaa, diamond, disc2, eclipse, eCollide, edisc, eJulia, elliptic, eMod, eMotion, ennepers, epispiral, ePush, eRotate, eScale, eSwirl, ex, exp, expo, exponential, fan, fdisc, fibonacci, fibonacci2, fisheye, flipcircle, flipy, flower, flux, funnel, glynnia, GlynnSim1, GlynnSim2, GlynnSim3, gridout, handkerchief, heart, hole, idisc, julia, julian2, juliaNab, kaleidoscope, lazyTravis, Lissajous, mask, MobiusN, mobius_strip, modulus, murl, murl2, npolar, ortho, oscilloscope, parabola, perspective, petal, phoenix_julia, pie (was also inconsistent between cpu and gpu), poincare, popcorn, popcorn2, power, pow_block, rational3, rays, rblur, rings, rippled, roundspher, sec, secant2, sigmoid, sin, sineblur, sinh, sinusgrid, sphericaln, spiralwing, spirograph, split, squarize, squirrel, squish, sschecks, starblur, stripes, stwin, super_shape, tan, tancos, tangent, tanh, TwinTrian, twoface, unpolar, waves, wavesn, wedge_julia, whorl, xheart, zblur, zscale.
--Code changes
-Generalize Variation::PrecalcHelper() and rename to PrePostPrecalcHelper().
--Do the same for the OpenCL version and rename it PrePostPrecalcOpenCLString().
-Rename Variation::m_AssignType to m_PrePostAssignType since it's only relevant to pre/post variations.
2016-01-29 20:02:15 -05:00
FormatName ( result , os , padding ) ;
2016-04-03 21:55:12 -04:00
cout < < emberToXml . ToString ( result , opt . Extras ( ) , opt . PrintEditDepth ( ) , ! opt . NoEdits ( ) , opt . HexPalette ( ) ) ;
2014-07-08 03:11:14 -04:00
}
2016-01-16 17:23:22 -05:00
//The loop above will have rotated just shy of a complete rotation.
//Rotate the next step and save in result, but do not print.
//result will be the starting point for the interp phase below.
2016-06-11 20:47:03 -04:00
frame = roundFrames ;
2016-12-05 22:04:33 -05:00
blend = T ( frame ) / T ( opt . LoopFrames ( ) ) ;
tools . Spin ( embers [ i ] , pTemplate , result , opt . StartCount ( ) + frameCount , blend , opt . CwLoops ( ) ) ; //Do not increment frameCount here.
--User changes
-Allow for pausing the renderer in the main window. This makes is more efficient when entering many parameters, such as when following a tutorial.
-Add support for new variations: erf, gamma, jac_cn, jac_dn, jac_sn, logDB, pressure_wave, pRose3D, splits3D, w, waves2b, x, xerf, y, z.
-Inform user of the start and stop of file parsing in EmberAnimate because the files could potentially be very large.
-Move the follwing fields to a new table called Animation: Interpolation, Affine Interpolation, Temporal Samples, Temporal Filter Width, Temporal Filter Type.
-These currently have no effect on the interactive renderer and instead are used when running flames through EmberGenome to generate sequences, and then animating them in Fractorium or EmberAnimate.
-Add new parameter overrides for EmberRender and EmberAnimate which directly assign values to all flames being rendered, rather than scale:
--quality
--demin
--demax
--Bug fixes
-Left pad instead of right pad names of sequence outputs from EmberGenome.
-Unique file naming was broken for files which already had an underscore in them.
-Properly report that png is the default format of EmberRender and EmberAnimate output instead of erroneously claiming it was jpg.
-Make command line programs search these folders in this order for the palette file:
./
~/.fractorium
~/.config/fractorium
/usr/share/fractorium
/usr/local/share/fractorium
-Fix possible bad values in hexes.
-Better assignment of Z variables.
-Fix boarders due to use of poorly implemented rint() function from flam3. Use std::rint() now.
-wedge_sph was completely wrong due to having accidentally swapped the mapping of two parameters.
-Make juliascope juliascope_power parameter be of type REAL_NONZERO since it's used as a denominator.
-Make Z assignment compatible with the originals in:
-arch, bcircle, bCollide, bent, bent2, bisplit, blob, blur_linear, blur_square, bMod, boarders, boarders2, bSwirl, bTransform, butterfly, cardioid, cell, circleblur, circlize, circlize2, circus, collideoscope, cos, cosine, cosh, coth, cpow, cpow2, crescents, cropn, csc, csch, curl, curve, dc_gridout, deltaa, diamond, disc2, eclipse, eCollide, edisc, eJulia, elliptic, eMod, eMotion, ennepers, epispiral, ePush, eRotate, eScale, eSwirl, ex, exp, expo, exponential, fan, fdisc, fibonacci, fibonacci2, fisheye, flipcircle, flipy, flower, flux, funnel, glynnia, GlynnSim1, GlynnSim2, GlynnSim3, gridout, handkerchief, heart, hole, idisc, julia, julian2, juliaNab, kaleidoscope, lazyTravis, Lissajous, mask, MobiusN, mobius_strip, modulus, murl, murl2, npolar, ortho, oscilloscope, parabola, perspective, petal, phoenix_julia, pie (was also inconsistent between cpu and gpu), poincare, popcorn, popcorn2, power, pow_block, rational3, rays, rblur, rings, rippled, roundspher, sec, secant2, sigmoid, sin, sineblur, sinh, sinusgrid, sphericaln, spiralwing, spirograph, split, squarize, squirrel, squish, sschecks, starblur, stripes, stwin, super_shape, tan, tancos, tangent, tanh, TwinTrian, twoface, unpolar, waves, wavesn, wedge_julia, whorl, xheart, zblur, zscale.
--Code changes
-Generalize Variation::PrecalcHelper() and rename to PrePostPrecalcHelper().
--Do the same for the OpenCL version and rename it PrePostPrecalcOpenCLString().
-Rename Variation::m_AssignType to m_PrePostAssignType since it's only relevant to pre/post variations.
2016-01-29 20:02:15 -05:00
FormatName ( result , os , padding ) ;
2014-07-08 03:11:14 -04:00
}
if ( i < embers . size ( ) - 1 )
{
2016-01-16 17:23:22 -05:00
if ( opt . Loops ( ) > 0 ) //Store the last result as the flame to interpolate from. This applies for whole or fractional values of opt.Loops().
embers [ i ] = result ;
2016-12-05 22:04:33 -05:00
for ( frame = 0 ; frame < opt . InterpFrames ( ) ; frame + + )
2014-07-08 03:11:14 -04:00
{
2016-12-05 22:04:33 -05:00
seqFlag = frame = = 0 | | ( frame = = opt . InterpFrames ( ) - 1 ) ;
blend = frame / T ( opt . InterpFrames ( ) ) ;
2014-07-08 03:11:14 -04:00
result . Clear ( ) ;
2016-12-05 22:04:33 -05:00
tools . SpinInter ( & embers [ i ] , pTemplate , result , opt . StartCount ( ) + frameCount + + , seqFlag , blend , opt . InterpLoops ( ) , opt . CwInterpLoops ( ) ) ;
--User changes
-Allow for pausing the renderer in the main window. This makes is more efficient when entering many parameters, such as when following a tutorial.
-Add support for new variations: erf, gamma, jac_cn, jac_dn, jac_sn, logDB, pressure_wave, pRose3D, splits3D, w, waves2b, x, xerf, y, z.
-Inform user of the start and stop of file parsing in EmberAnimate because the files could potentially be very large.
-Move the follwing fields to a new table called Animation: Interpolation, Affine Interpolation, Temporal Samples, Temporal Filter Width, Temporal Filter Type.
-These currently have no effect on the interactive renderer and instead are used when running flames through EmberGenome to generate sequences, and then animating them in Fractorium or EmberAnimate.
-Add new parameter overrides for EmberRender and EmberAnimate which directly assign values to all flames being rendered, rather than scale:
--quality
--demin
--demax
--Bug fixes
-Left pad instead of right pad names of sequence outputs from EmberGenome.
-Unique file naming was broken for files which already had an underscore in them.
-Properly report that png is the default format of EmberRender and EmberAnimate output instead of erroneously claiming it was jpg.
-Make command line programs search these folders in this order for the palette file:
./
~/.fractorium
~/.config/fractorium
/usr/share/fractorium
/usr/local/share/fractorium
-Fix possible bad values in hexes.
-Better assignment of Z variables.
-Fix boarders due to use of poorly implemented rint() function from flam3. Use std::rint() now.
-wedge_sph was completely wrong due to having accidentally swapped the mapping of two parameters.
-Make juliascope juliascope_power parameter be of type REAL_NONZERO since it's used as a denominator.
-Make Z assignment compatible with the originals in:
-arch, bcircle, bCollide, bent, bent2, bisplit, blob, blur_linear, blur_square, bMod, boarders, boarders2, bSwirl, bTransform, butterfly, cardioid, cell, circleblur, circlize, circlize2, circus, collideoscope, cos, cosine, cosh, coth, cpow, cpow2, crescents, cropn, csc, csch, curl, curve, dc_gridout, deltaa, diamond, disc2, eclipse, eCollide, edisc, eJulia, elliptic, eMod, eMotion, ennepers, epispiral, ePush, eRotate, eScale, eSwirl, ex, exp, expo, exponential, fan, fdisc, fibonacci, fibonacci2, fisheye, flipcircle, flipy, flower, flux, funnel, glynnia, GlynnSim1, GlynnSim2, GlynnSim3, gridout, handkerchief, heart, hole, idisc, julia, julian2, juliaNab, kaleidoscope, lazyTravis, Lissajous, mask, MobiusN, mobius_strip, modulus, murl, murl2, npolar, ortho, oscilloscope, parabola, perspective, petal, phoenix_julia, pie (was also inconsistent between cpu and gpu), poincare, popcorn, popcorn2, power, pow_block, rational3, rays, rblur, rings, rippled, roundspher, sec, secant2, sigmoid, sin, sineblur, sinh, sinusgrid, sphericaln, spiralwing, spirograph, split, squarize, squirrel, squish, sschecks, starblur, stripes, stwin, super_shape, tan, tancos, tangent, tanh, TwinTrian, twoface, unpolar, waves, wavesn, wedge_julia, whorl, xheart, zblur, zscale.
--Code changes
-Generalize Variation::PrecalcHelper() and rename to PrePostPrecalcHelper().
--Do the same for the OpenCL version and rename it PrePostPrecalcOpenCLString().
-Rename Variation::m_AssignType to m_PrePostAssignType since it's only relevant to pre/post variations.
2016-01-29 20:02:15 -05:00
FormatName ( result , os , padding ) ;
2016-04-03 21:55:12 -04:00
cout < < emberToXml . ToString ( result , opt . Extras ( ) , opt . PrintEditDepth ( ) , ! opt . NoEdits ( ) , opt . HexPalette ( ) ) ;
2014-07-08 03:11:14 -04:00
}
}
}
2016-12-05 22:04:33 -05:00
tools . Spin ( embers . back ( ) , pTemplate , result , opt . StartCount ( ) + frameCount , 0 , opt . CwInterpLoops ( ) ) ;
--User changes
-Allow for pausing the renderer in the main window. This makes is more efficient when entering many parameters, such as when following a tutorial.
-Add support for new variations: erf, gamma, jac_cn, jac_dn, jac_sn, logDB, pressure_wave, pRose3D, splits3D, w, waves2b, x, xerf, y, z.
-Inform user of the start and stop of file parsing in EmberAnimate because the files could potentially be very large.
-Move the follwing fields to a new table called Animation: Interpolation, Affine Interpolation, Temporal Samples, Temporal Filter Width, Temporal Filter Type.
-These currently have no effect on the interactive renderer and instead are used when running flames through EmberGenome to generate sequences, and then animating them in Fractorium or EmberAnimate.
-Add new parameter overrides for EmberRender and EmberAnimate which directly assign values to all flames being rendered, rather than scale:
--quality
--demin
--demax
--Bug fixes
-Left pad instead of right pad names of sequence outputs from EmberGenome.
-Unique file naming was broken for files which already had an underscore in them.
-Properly report that png is the default format of EmberRender and EmberAnimate output instead of erroneously claiming it was jpg.
-Make command line programs search these folders in this order for the palette file:
./
~/.fractorium
~/.config/fractorium
/usr/share/fractorium
/usr/local/share/fractorium
-Fix possible bad values in hexes.
-Better assignment of Z variables.
-Fix boarders due to use of poorly implemented rint() function from flam3. Use std::rint() now.
-wedge_sph was completely wrong due to having accidentally swapped the mapping of two parameters.
-Make juliascope juliascope_power parameter be of type REAL_NONZERO since it's used as a denominator.
-Make Z assignment compatible with the originals in:
-arch, bcircle, bCollide, bent, bent2, bisplit, blob, blur_linear, blur_square, bMod, boarders, boarders2, bSwirl, bTransform, butterfly, cardioid, cell, circleblur, circlize, circlize2, circus, collideoscope, cos, cosine, cosh, coth, cpow, cpow2, crescents, cropn, csc, csch, curl, curve, dc_gridout, deltaa, diamond, disc2, eclipse, eCollide, edisc, eJulia, elliptic, eMod, eMotion, ennepers, epispiral, ePush, eRotate, eScale, eSwirl, ex, exp, expo, exponential, fan, fdisc, fibonacci, fibonacci2, fisheye, flipcircle, flipy, flower, flux, funnel, glynnia, GlynnSim1, GlynnSim2, GlynnSim3, gridout, handkerchief, heart, hole, idisc, julia, julian2, juliaNab, kaleidoscope, lazyTravis, Lissajous, mask, MobiusN, mobius_strip, modulus, murl, murl2, npolar, ortho, oscilloscope, parabola, perspective, petal, phoenix_julia, pie (was also inconsistent between cpu and gpu), poincare, popcorn, popcorn2, power, pow_block, rational3, rays, rblur, rings, rippled, roundspher, sec, secant2, sigmoid, sin, sineblur, sinh, sinusgrid, sphericaln, spiralwing, spirograph, split, squarize, squirrel, squish, sschecks, starblur, stripes, stwin, super_shape, tan, tancos, tangent, tanh, TwinTrian, twoface, unpolar, waves, wavesn, wedge_julia, whorl, xheart, zblur, zscale.
--Code changes
-Generalize Variation::PrecalcHelper() and rename to PrePostPrecalcHelper().
--Do the same for the OpenCL version and rename it PrePostPrecalcOpenCLString().
-Rename Variation::m_AssignType to m_PrePostAssignType since it's only relevant to pre/post variations.
2016-01-29 20:02:15 -05:00
FormatName ( result , os , padding ) ;
2016-04-03 21:55:12 -04:00
cout < < emberToXml . ToString ( result , opt . Extras ( ) , opt . PrintEditDepth ( ) , ! opt . NoEdits ( ) , opt . HexPalette ( ) ) ;
2016-04-23 12:02:09 -04:00
t . Toc ( " Sequencing " ) ;
2014-12-05 21:30:46 -05:00
2014-07-08 03:11:14 -04:00
if ( opt . Enclosed ( ) )
2016-02-12 00:38:21 -05:00
cout < < " </sequence> \n " ;
2014-07-08 03:11:14 -04:00
return true ;
}
if ( doInter | | doRotate )
{
2016-05-02 19:54:56 -04:00
Ember < T > result , result1 , result2 , result3 ;
2014-12-05 21:30:46 -05:00
2016-12-05 22:04:33 -05:00
if ( ! opt . LoopFrames ( ) & & ! opt . InterpFrames ( ) )
2014-07-08 03:11:14 -04:00
{
2016-12-05 22:04:33 -05:00
cerr < < " loop frames or interp frames must be positive and non-zero, not " < < opt . LoopFrames ( ) < < " , " < < opt . InterpFrames ( ) < < " . \n " ;
2014-07-08 03:11:14 -04:00
return false ;
}
2016-05-02 19:54:56 -04:00
frame = opt . Frame ( ) ;
2016-12-05 22:04:33 -05:00
blend = frame / T ( opt . InterpFrames ( ) ) ; //Percentage between first and second flame to treat as the center flame.
spread = 1 / T ( opt . InterpFrames ( ) ) ; //Amount to move backward and forward from the center flame.
2014-07-08 03:11:14 -04:00
if ( opt . Enclosed ( ) )
2016-02-12 00:38:21 -05:00
cout < < " <pick version= \" EMBER- " < < EmberVersion ( ) < < " \" > \n " ;
2014-07-08 03:11:14 -04:00
if ( doRotate )
{
if ( embers . size ( ) ! = 1 )
{
2016-02-12 00:38:21 -05:00
cerr < < " rotation requires one control point, not " < < embers . size ( ) < < " . \n " ;
2014-07-08 03:11:14 -04:00
return false ;
}
2016-05-02 19:54:56 -04:00
if ( frame ) //Cannot spin backward below frame zero.
{
2016-12-05 22:04:33 -05:00
tools . Spin ( embers [ 0 ] , pTemplate , result1 , frame - 1 , blend - spread , opt . CwLoops ( ) ) ;
2016-05-02 19:54:56 -04:00
cout < < emberToXml . ToString ( result1 , opt . Extras ( ) , opt . PrintEditDepth ( ) , ! opt . NoEdits ( ) , opt . HexPalette ( ) ) ;
}
2017-02-26 12:34:43 -05:00
tools . Spin ( embers [ 0 ] , pTemplate , result2 , frame , blend , opt . CwLoops ( ) ) ;
2016-12-05 22:04:33 -05:00
tools . Spin ( embers [ 0 ] , pTemplate , result3 , frame + 1 , blend + spread , opt . CwLoops ( ) ) ;
2016-04-03 21:55:12 -04:00
cout < < emberToXml . ToString ( result2 , opt . Extras ( ) , opt . PrintEditDepth ( ) , ! opt . NoEdits ( ) , opt . HexPalette ( ) ) ;
cout < < emberToXml . ToString ( result3 , opt . Extras ( ) , opt . PrintEditDepth ( ) , ! opt . NoEdits ( ) , opt . HexPalette ( ) ) ;
2014-07-08 03:11:14 -04:00
}
else
{
if ( embers . size ( ) ! = 2 )
{
2016-02-12 00:38:21 -05:00
cerr < < " interpolation requires two control points, not " < < embers . size ( ) < < " . \n " ;
2014-07-08 03:11:14 -04:00
return false ;
}
2016-05-02 19:54:56 -04:00
if ( frame ) //Cannot interpolate backward below frame zero.
{
2016-12-05 22:04:33 -05:00
tools . SpinInter ( embers . data ( ) , pTemplate , result1 , frame - 1 , false , blend - spread , opt . InterpLoops ( ) , opt . CwInterpLoops ( ) ) ;
2016-05-02 19:54:56 -04:00
cout < < emberToXml . ToString ( result1 , opt . Extras ( ) , opt . PrintEditDepth ( ) , ! opt . NoEdits ( ) , opt . HexPalette ( ) ) ;
}
2017-02-26 12:34:43 -05:00
tools . SpinInter ( embers . data ( ) , pTemplate , result2 , frame , false , blend , opt . InterpLoops ( ) , opt . CwInterpLoops ( ) ) ;
2016-12-05 22:04:33 -05:00
tools . SpinInter ( embers . data ( ) , pTemplate , result3 , frame + 1 , false , blend + spread , opt . InterpLoops ( ) , opt . CwInterpLoops ( ) ) ;
2016-04-03 21:55:12 -04:00
cout < < emberToXml . ToString ( result2 , opt . Extras ( ) , opt . PrintEditDepth ( ) , ! opt . NoEdits ( ) , opt . HexPalette ( ) ) ;
cout < < emberToXml . ToString ( result3 , opt . Extras ( ) , opt . PrintEditDepth ( ) , ! opt . NoEdits ( ) , opt . HexPalette ( ) ) ;
2014-07-08 03:11:14 -04:00
}
if ( opt . Enclosed ( ) )
2016-02-12 00:38:21 -05:00
cout < < " </pick> \n " ;
2014-12-05 21:30:46 -05:00
2014-07-08 03:11:14 -04:00
return true ;
}
//Repeat.
renderer - > EarlyClip ( opt . EarlyClip ( ) ) ;
2014-08-06 00:50:52 -04:00
renderer - > YAxisUp ( opt . YAxisUp ( ) ) ;
renderer - > LockAccum ( opt . LockAccum ( ) ) ;
2014-07-08 03:11:14 -04:00
renderer - > PixelAspectRatio ( T ( opt . AspectRatio ( ) ) ) ;
if ( opt . Repeat ( ) = = 0 )
{
2016-02-12 00:38:21 -05:00
cerr < < " Repeat must be positive, not " < < opt . Repeat ( ) < < " \n " ;
2014-07-08 03:11:14 -04:00
return false ;
}
if ( opt . Enclosed ( ) )
2016-02-12 00:38:21 -05:00
cout < < " <pick version= \" EMBER- " < < EmberVersion ( ) < < " \" > \n " ;
2014-07-08 03:11:14 -04:00
for ( rep = 0 ; rep < opt . Repeat ( ) ; rep + + )
{
count = 0 ;
os . str ( " " ) ;
save . Clear ( ) ;
2016-05-02 19:54:56 -04:00
VerbosePrint ( " Flame = " < < rep + 1 < < " / " < < opt . Repeat ( ) < < " ... " ) ;
2014-07-08 03:11:14 -04:00
if ( opt . Clone ( ) ! = " " )
{
os < < " clone " ; //Action is 'clone' with trunc vars concat.
if ( opt . CloneAction ( ) ! = " " )
os < < " " < < opt . CloneAction ( ) ;
selp0 = embers [ rand . Rand ( ) % embers . size ( ) ] ;
save = selp0 ;
aselp0 = & selp0 ;
2014-12-05 21:30:46 -05:00
aselp1 = nullptr ;
2014-07-08 03:11:14 -04:00
os < < tools . TruncateVariations ( save , 5 ) ;
save . m_Edits = emberToXml . CreateNewEditdoc ( aselp0 , aselp1 , os . str ( ) , opt . Nick ( ) , opt . Url ( ) , opt . Id ( ) , opt . Comment ( ) , opt . SheepGen ( ) , opt . SheepId ( ) ) ;
}
else
{
do
{
randomMode = false ;
didColor = false ;
os . str ( " " ) ;
VerbosePrint ( " . " ) ;
if ( doMutate )
{
selp0 = embers [ rand . Rand ( ) % embers . size ( ) ] ;
orig = selp0 ;
aselp0 = & selp0 ;
2014-12-05 21:30:46 -05:00
aselp1 = nullptr ;
2014-07-08 03:11:14 -04:00
if ( opt . Method ( ) = = " " )
2016-01-04 19:50:15 -05:00
mutMeth = eMutateMode : : MUTATE_NOT_SPECIFIED ;
2014-07-08 03:11:14 -04:00
else if ( opt . Method ( ) = = " all_vars " )
2016-01-04 19:50:15 -05:00
mutMeth = eMutateMode : : MUTATE_ALL_VARIATIONS ;
2014-07-08 03:11:14 -04:00
else if ( opt . Method ( ) = = " one_xform " )
2016-01-04 19:50:15 -05:00
mutMeth = eMutateMode : : MUTATE_ONE_XFORM_COEFS ;
2014-07-08 03:11:14 -04:00
else if ( opt . Method ( ) = = " add_symmetry " )
2016-01-04 19:50:15 -05:00
mutMeth = eMutateMode : : MUTATE_ADD_SYMMETRY ;
2014-07-08 03:11:14 -04:00
else if ( opt . Method ( ) = = " post_xforms " )
2016-01-04 19:50:15 -05:00
mutMeth = eMutateMode : : MUTATE_POST_XFORMS ;
2014-07-08 03:11:14 -04:00
else if ( opt . Method ( ) = = " color_palette " )
2016-01-04 19:50:15 -05:00
mutMeth = eMutateMode : : MUTATE_COLOR_PALETTE ;
2014-07-08 03:11:14 -04:00
else if ( opt . Method ( ) = = " delete_xform " )
2016-01-04 19:50:15 -05:00
mutMeth = eMutateMode : : MUTATE_DELETE_XFORM ;
2014-07-08 03:11:14 -04:00
else if ( opt . Method ( ) = = " all_coefs " )
2016-01-04 19:50:15 -05:00
mutMeth = eMutateMode : : MUTATE_ALL_COEFS ;
2014-07-08 03:11:14 -04:00
else
{
2016-02-12 00:38:21 -05:00
cerr < < " method " < < opt . Method ( ) < < " not defined for mutate. Defaulting to random. \n " ;
2016-01-04 19:50:15 -05:00
mutMeth = eMutateMode : : MUTATE_NOT_SPECIFIED ;
2014-07-08 03:11:14 -04:00
}
--User changes
-Support 4k monitors, and in general, properly scale any monitor that is not HD.
-Allow for a spatial filter of radius zero, which means do not use a spatial filter.
-Add new variations: concentric, cpow3, helicoid, helix, rand_cubes, sphereblur.
-Use a new method for computing elliptic which is more precise. Developed by Discord user Claude.
-Remove the 8 variation per xform limitation on the GPU.
-Allow for loading the last flame file on startup, rather than randoms.
-Use two different default quality values in the interactive renderer, one each for CPU and GPU.
-Creating linked xforms was using non-standard behavior. Make it match Apo and also support creating multiple linked xforms at once.
--Bug fixes
-No variations in an xform used to have the same behavior as a single linear variation with weight 1. While sensible, this breaks backward compatibility. No variations now sets the output point to zeroes.
-Prevent crashing the program when adjusting a value on the main window while a final render is in progress.
-The xaos table was inverted.
--Code changes
-Convert projects to Visual Studio 2017.
-Change bad vals from +- 1e10 to +-1e20.
-Reintroduce the symmetry tag in xforms for legacy support in programs that do not use color_speed.
-Compiler will not let us use default values in templated member functions anymore.
2017-11-26 20:27:00 -05:00
os < < tools . Mutate ( orig , mutMeth , vars , opt . Symmetry ( ) , T ( opt . Speed ( ) ) , 8 ) ;
2014-07-08 03:11:14 -04:00
//Scan string returned for 'mutate color'.
if ( strstr ( os . str ( ) . c_str ( ) , " mutate color " ) )
didColor = true ;
2014-12-05 21:30:46 -05:00
2014-07-08 03:11:14 -04:00
if ( orig . m_Name ! = " " )
{
os2 . str ( " " ) ;
os2 < < " mutation " < < rep < < " of " < < orig . m_Name ;
orig . m_Name = os2 . str ( ) ;
}
}
else if ( doCross0 )
{
i0 = rand . Rand ( ) % embers . size ( ) ;
i1 = rand . Rand ( ) % embers2 . size ( ) ;
selp0 = embers [ i0 ] ;
selp1 = embers2 [ i1 ] ;
aselp0 = & selp0 ;
aselp1 = & selp1 ;
if ( opt . Method ( ) = = " " )
2016-01-04 19:50:15 -05:00
crossMeth = eCrossMode : : CROSS_NOT_SPECIFIED ;
2014-07-08 03:11:14 -04:00
else if ( opt . Method ( ) = = " union " )
2016-01-04 19:50:15 -05:00
crossMeth = eCrossMode : : CROSS_UNION ;
2014-07-08 03:11:14 -04:00
else if ( opt . Method ( ) = = " interpolate " )
2016-01-04 19:50:15 -05:00
crossMeth = eCrossMode : : CROSS_INTERPOLATE ;
2014-07-08 03:11:14 -04:00
else if ( opt . Method ( ) = = " alternate " )
2016-01-04 19:50:15 -05:00
crossMeth = eCrossMode : : CROSS_ALTERNATE ;
2014-07-08 03:11:14 -04:00
else
{
2016-02-12 00:38:21 -05:00
cerr < < " method ' " < < opt . Method ( ) < < " ' not defined for cross. Defaulting to random. \n " ;
2016-01-04 19:50:15 -05:00
crossMeth = eCrossMode : : CROSS_NOT_SPECIFIED ;
2014-07-08 03:11:14 -04:00
}
2016-05-02 19:54:56 -04:00
os < < tools . Cross ( embers [ i0 ] , embers2 [ i1 ] , orig , crossMeth ) ;
2014-07-08 03:11:14 -04:00
if ( embers [ i0 ] . m_Name ! = " " | | embers2 [ i1 ] . m_Name ! = " " )
{
os2 . str ( " " ) ;
os2 < < rep < < " of " < < embers [ i0 ] . m_Name < < " x " < < embers2 [ i1 ] . m_Name ;
orig . m_Name = os2 . str ( ) ;
}
}
else
{
os < < " random " ;
randomMode = true ;
--User changes
-Support 4k monitors, and in general, properly scale any monitor that is not HD.
-Allow for a spatial filter of radius zero, which means do not use a spatial filter.
-Add new variations: concentric, cpow3, helicoid, helix, rand_cubes, sphereblur.
-Use a new method for computing elliptic which is more precise. Developed by Discord user Claude.
-Remove the 8 variation per xform limitation on the GPU.
-Allow for loading the last flame file on startup, rather than randoms.
-Use two different default quality values in the interactive renderer, one each for CPU and GPU.
-Creating linked xforms was using non-standard behavior. Make it match Apo and also support creating multiple linked xforms at once.
--Bug fixes
-No variations in an xform used to have the same behavior as a single linear variation with weight 1. While sensible, this breaks backward compatibility. No variations now sets the output point to zeroes.
-Prevent crashing the program when adjusting a value on the main window while a final render is in progress.
-The xaos table was inverted.
--Code changes
-Convert projects to Visual Studio 2017.
-Change bad vals from +- 1e10 to +-1e20.
-Reintroduce the symmetry tag in xforms for legacy support in programs that do not use color_speed.
-Compiler will not let us use default values in templated member functions anymore.
2017-11-26 20:27:00 -05:00
tools . Random ( orig , vars , opt . Symmetry ( ) , 0 , 8 ) ;
2016-05-02 19:54:56 -04:00
orig . m_FinalRasW = 1920 ;
orig . m_FinalRasH = 1080 ;
2014-12-05 21:30:46 -05:00
aselp0 = nullptr ;
aselp1 = nullptr ;
2014-07-08 03:11:14 -04:00
}
//Adjust bounding box half the time.
if ( rand . RandBit ( ) | | randomMode )
{
T bmin [ 2 ] , bmax [ 2 ] ;
tools . EstimateBoundingBox ( orig , T ( 0.01 ) , 100000 , bmin , bmax ) ;
if ( rand . Frand01 < T > ( ) < T ( 0.3 ) )
{
orig . m_CenterX = ( bmin [ 0 ] + bmax [ 0 ] ) / 2 ;
orig . m_CenterY = ( bmin [ 1 ] + bmax [ 1 ] ) / 2 ;
os < < " recentered " ;
}
else
{
if ( rand . RandBit ( ) )
{
mix0 = rand . GoldenBit < T > ( ) + rand . Frand11 < T > ( ) / 5 ;
mix1 = rand . GoldenBit < T > ( ) ;
os < < " reframed0 " ;
}
else if ( rand . RandBit ( ) )
{
mix0 = rand . GoldenBit < T > ( ) ;
mix1 = rand . GoldenBit < T > ( ) + rand . Frand11 < T > ( ) / 5 ;
os < < " reframed1 " ;
}
else
{
mix0 = rand . GoldenBit < T > ( ) + rand . Frand11 < T > ( ) / 5 ;
mix1 = rand . GoldenBit < T > ( ) + rand . Frand11 < T > ( ) / 5 ;
os < < " reframed2 " ;
}
orig . m_CenterX = mix0 * bmin [ 0 ] + ( 1 - mix0 ) * bmax [ 0 ] ;
orig . m_CenterY = mix1 * bmin [ 1 ] + ( 1 - mix1 ) * bmax [ 1 ] ;
}
orig . m_PixelsPerUnit = orig . m_FinalRasW / ( bmax [ 0 ] - bmin [ 0 ] ) ;
}
os < < tools . TruncateVariations ( orig , 5 ) ;
if ( ! didColor & & rand . RandBit ( ) )
{
if ( opt . Debug ( ) )
2016-02-12 00:38:21 -05:00
cerr < < " improving colors... \n " ;
2014-07-08 03:11:14 -04:00
tools . ImproveColors ( orig , 100 , false , 10 ) ;
os < < " improved colors " ;
}
orig . m_Edits = emberToXml . CreateNewEditdoc ( aselp0 , aselp1 , os . str ( ) , opt . Nick ( ) , opt . Url ( ) , opt . Id ( ) , opt . Comment ( ) , opt . SheepGen ( ) , opt . SheepId ( ) ) ;
save = orig ;
SetDefaultTestValues ( orig ) ;
renderer - > SetEmber ( orig ) ;
2015-12-31 19:00:36 -05:00
if ( renderer - > Run ( finalImage ) ! = eRenderStatus : : RENDER_OK )
2014-07-08 03:11:14 -04:00
{
2016-02-12 00:38:21 -05:00
cerr < < " Error: test image rendering failed, aborting. \n " ;
2014-07-08 03:11:14 -04:00
return false ;
}
2017-07-22 16:43:35 -04:00
tot = 0 ;
totb = totw = 0 ;
2014-07-08 03:11:14 -04:00
n = orig . m_FinalRasW * orig . m_FinalRasH ;
2017-07-22 16:43:35 -04:00
for ( i = 0 ; i < n ; i + + )
2014-07-08 03:11:14 -04:00
{
2017-07-22 16:43:35 -04:00
tot + = ( finalImage [ i ] . r + finalImage [ i ] . g + finalImage [ i ] . b ) ;
2014-07-08 03:11:14 -04:00
2017-07-22 16:43:35 -04:00
if ( 0 = = finalImage [ i ] . r & & 0 = = finalImage [ i ] . g & & 0 = = finalImage [ i ] . b ) totb + + ;
2015-12-31 16:41:59 -05:00
2017-07-22 16:43:35 -04:00
if ( 1 = = finalImage [ i ] . r & & 1 = = finalImage [ i ] . g & & 1 = = finalImage [ i ] . g ) totw + + ;
2014-07-08 03:11:14 -04:00
}
2017-07-22 16:43:35 -04:00
avgPix = ( tot / ( 3 * n ) ) ;
2014-07-08 03:11:14 -04:00
fractionBlack = totb / T ( n ) ;
fractionWhite = totw / T ( n ) ;
if ( opt . Debug ( ) )
2016-02-12 00:38:21 -05:00
cerr < < " avgPix = " < < avgPix < < " fractionBlack = " < < fractionBlack < < " fractionWhite = " < < fractionWhite < < " n = " < < n < < " \n " ;
2014-12-05 21:30:46 -05:00
2014-07-08 03:11:14 -04:00
orig . Clear ( ) ;
count + + ;
2015-12-31 16:41:59 -05:00
}
while ( ( avgPix < opt . AvgThresh ( ) | |
fractionBlack < opt . BlackThresh ( ) | |
fractionWhite > opt . WhiteLimit ( ) ) & &
count < opt . Tries ( ) ) ;
2014-07-08 03:11:14 -04:00
if ( count = = opt . Tries ( ) )
2016-02-12 00:38:21 -05:00
cerr < < " Warning: reached maximum attempts, giving up. \n " ;
2014-07-08 03:11:14 -04:00
}
if ( pTemplate )
tools . ApplyTemplate ( save , * pTemplate ) ;
save . m_Time = T ( rep ) ;
2014-12-05 21:30:46 -05:00
2014-07-08 03:11:14 -04:00
if ( opt . MaxXforms ( ) ! = UINT_MAX )
{
save . m_Symmetry = 0 ;
while ( save . TotalXformCount ( ) > opt . MaxXforms ( ) )
save . DeleteTotalXform ( save . TotalXformCount ( ) - 1 ) ;
}
2016-04-03 21:55:12 -04:00
cout < < emberToXml . ToString ( save , opt . Extras ( ) , opt . PrintEditDepth ( ) , ! opt . NoEdits ( ) , opt . HexPalette ( ) ) ;
2014-07-08 03:11:14 -04:00
VerbosePrint ( " \n Done. Action = " < < os . str ( ) < < " \n " ) ;
cout . flush ( ) ;
save . Clear ( ) ;
}
if ( opt . Enclosed ( ) )
cout < < " </pick> \n " ;
return true ;
}
/// <summary>
/// Main program entry point for EmberGenome.exe.
/// </summary>
/// <param name="argc">The number of command line arguments passed</param>
/// <param name="argv">The command line arguments passed</param>
/// <returns>0 if successful, else 1.</returns>
int _tmain ( int argc , _TCHAR * argv [ ] )
{
2014-12-05 21:30:46 -05:00
bool b = false ;
2014-07-08 03:11:14 -04:00
EmberOptions opt ;
//Required for large allocs, else GPU memory usage will be severely limited to small sizes.
//This must be done in the application and not in the EmberCL DLL.
2016-03-01 20:26:45 -05:00
# ifdef _WIN32
2014-07-08 03:11:14 -04:00
_putenv_s ( " GPU_MAX_ALLOC_PERCENT " , " 100 " ) ;
2014-12-05 21:30:46 -05:00
# else
2014-12-07 02:51:44 -05:00
putenv ( const_cast < char * > ( " GPU_MAX_ALLOC_PERCENT=100 " ) ) ;
2014-12-05 21:30:46 -05:00
# endif
06/04/2017
--User changes
-Make all fonts be MS Shell Dlg 2. This will require reloading dark.qss if users are already using it.
-Limit size of the left side of the palette editor.
-Disable create from image buttons in the palette editor when working on a fixed palette.
--Bug fixes
-The following variations were wrong: coshq, cothq.
-During iteration, the color index could become nan if all xform color speeds were negative. This could lead to bad results on the GPU. Fix to check for nan. Minimal speed difference.
--Code changes
-Make the following variations safer by using Zeps(): sinq, sinhq, secq, sechq, tanq, tanhq, cosq, coshq, cotq, cothq, cscq, cschq, estiq.
-Always pass -cl-no-signed-zeros -cl-denorms-are-zero to kernel compiles for both single and double.
-Flush all denormals to zero for all executable programs. This will likely lead to a speedup for badly behaving programs.
2017-06-04 20:37:29 -04:00
_MM_SET_FLUSH_ZERO_MODE ( _MM_FLUSH_ZERO_ON ) ;
_MM_SET_DENORMALS_ZERO_MODE ( _MM_DENORMALS_ZERO_ON ) ;
2014-07-08 03:11:14 -04:00
2016-01-04 19:50:15 -05:00
if ( ! opt . Populate ( argc , argv , eOptionUse : : OPT_USE_GENOME ) )
2014-12-05 21:30:46 -05:00
{
2017-02-26 12:34:43 -05:00
auto palf = PaletteList < float > : : Instance ( ) ;
2014-07-08 03:11:14 -04:00
# ifdef DO_DOUBLE
2015-12-31 16:41:59 -05:00
2016-04-11 21:15:14 -04:00
if ( ! opt . Sp ( ) )
--User changes
-Add support for multiple GPU devices.
--These options are present in the command line and in Fractorium.
-Change scheme of specifying devices from platform,device to just total device index.
--Single number on the command line.
--Change from combo boxes for device selection to a table of all devices in Fractorium.
-Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Bug fixes
-EmberAnimate, EmberRender, FractoriumSettings, FinalRenderDialog: Fix wrong order of arguments to Clamp() when assigning thread priority.
-VariationsDC.h: Fix NVidia OpenCL compilation error in DCTriangleVariation.
-FractoriumXformsColor.cpp: Checking for null pixmap pointer is not enough, must also check if the underlying buffer is null via call to QPixmap::isNull().
--Code changes
-Ember.h: Add case for FLAME_MOTION_NONE and default in ApplyFlameMotion().
-EmberMotion.h: Call base constructor.
-EmberPch.h: #pragma once only on Windows.
-EmberToXml.h:
--Handle different types of exceptions.
--Add default cases to ToString().
-Isaac.h: Remove unused variable in constructor.
-Point.h: Call base constructor in Color().
-Renderer.h/cpp:
--Add bool to Alloc() to only allocate memory for the histogram. Needed for multi-GPU.
--Make CoordMap() return a const ref, not a pointer.
-SheepTools.h:
--Use 64-bit types like the rest of the code already does.
--Fix some comment misspellings.
-Timing.h: Make BeginTime(), EndTime(), ElapsedTime() and Format() be const functions.
-Utils.h:
--Add new functions Equal() and Split().
--Handle more exception types in ReadFile().
--Get rid of most legacy blending of C and C++ argument parsing.
-XmlToEmber.h:
--Get rid of most legacy blending of C and C++ code from flam3.
--Remove some unused variables.
-EmberAnimate:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--If a render fails, exit since there is no point in continuing an animation with a missing frame.
--Pass variables to threaded save better, which most likely fixes a very subtle bug that existed before.
--Remove some unused variables.
-EmberGenome, EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
-EmberRender:
--Support multi-GPU processing that alternates full frames between devices.
--Use OpenCLInfo instead of OpenCLWrapper for --openclinfo option.
--Remove bucketT template parameter, and hard code float in its place.
--Only print values when not rendering with OpenCL, since they're always 0 in that case.
-EmberCLPch.h:
--#pragma once only on Windows.
--#include <atomic>.
-IterOpenCLKernelCreator.h: Add new kernel for summing two histograms. This is needed for multi-GPU.
-OpenCLWrapper.h:
--Move all OpenCL info related code into its own class OpenCLInfo.
--Add members to cache the values of global memory size and max allocation size.
-RendererCL.h/cpp:
--Redesign to accomodate multi-GPU.
--Constructor now takes a vector of devices.
--Remove DumpErrorReport() function, it's handled in the base.
--ClearBuffer(), ReadPoints(), WritePoints(), ReadHist() and WriteHist() now optionally take a device index as a parameter.
--MakeDmap() override and m_DmapCL member removed because it no longer applies since the histogram is always float since the last commit.
--Add new function SumDeviceHist() to sum histograms from two devices by first copying to a temporary on the host, then a temporary on the device, then summing.
--m_Calls member removed, as it's now per-device.
--OpenCLWrapper removed.
--m_Seeds member is now a vector of vector of seeds, to accomodate a separate and different array of seeds for each device.
--Added member m_Devices, a vector of unique_ptr of RendererCLDevice.
-EmberCommon.h
--Added Devices() function to convert from a vector of device indices to a vector of platform,device indices.
--Changed CreateRenderer() to accept a vector of devices to create a single RendererCL which will split work across multiple devices.
--Added CreateRenderers() function to accept a vector of devices to create multiple RendererCL, each which will render on a single device.
--Add more comments to some existing functions.
-EmberCommonPch.h: #pragma once only on Windows.
-EmberOptions.h:
--Remove --platform option, it's just sequential device number now with the --device option.
--Make --out be OPT_USE_RENDER instead of OPT_RENDER_ANIM since it's an error condition when animating. It makes no sense to write all frames to a single image.
--Add Devices() function to parse comma separated --device option string and return a vector of device indices.
--Make int and uint types be 64-bit, so intmax_t and size_t.
--Make better use of macros.
-JpegUtils.h: Make string parameters to WriteJpeg() and WritePng() be const ref.
-All project files: Turn off buffer security check option in Visual Studio (/Gs-)
-deployment.pri: Remove the line OTHER_FILES +=, it's pointless and was causing problems.
-Ember.pro, EmberCL.pro: Add CONFIG += plugin, otherwise it wouldn't link.
-EmberCL.pro: Add new files for multi-GPU support.
-build_all.sh: use -j4 and QMAKE=${QMAKE:/usr/bin/qmake}
-shared_settings.pri:
-Add version string.
-Remove old DESTDIR definitions.
-Add the following lines or else nothing would build:
CONFIG(release, debug|release) {
CONFIG += warn_off
DESTDIR = ../../../Bin/release
}
CONFIG(debug, debug|release) {
DESTDIR = ../../../Bin/debug
}
QMAKE_POST_LINK += $$quote(cp --update ../../../Data/flam3-palettes.xml $${DESTDIR}$$escape_expand(\n\t))
LIBS += -L/usr/lib -lpthread
-AboutDialog.ui: Another futile attempt to make it look correct on Linux.
-FinalRenderDialog.h/cpp:
--Add support for multi-GPU.
--Change from combo boxes for device selection to a table of all devices.
--Ensure device selection makes sense.
--Remove "FinalRender" prefix of various function names, it's implied given the context.
-FinalRenderEmberController.h/cpp:
--Add support for multi-GPU.
--Change m_FinishedImageCount to be atomic.
--Move CancelRender() from the base to FinalRenderEmberController<T>.
--Refactor RenderComplete() to omit any progress related functionality or image saving since it can be potentially ran in a thread.
--Consolidate setting various renderer fields into SyncGuiToRenderer().
-Fractorium.cpp: Allow for resizing of the options dialog to show the entire device table.
-FractoriumCommon.h: Add various functions to handle a table showing the available OpenCL devices on the system.
-FractoriumEmberController.h/cpp: Remove m_FinalImageIndex, it's no longer needed.
-FractoriumRender.cpp: Scale the interactive sub batch count and quality by the number of devices used.
-FractoriumSettings.h/cpp:
--Temporal samples defaults to 100 instead of 1000 which was needless overkill.
--Add multi-GPU support, remove old device,platform pair.
-FractoriumToolbar.cpp: Disable OpenCL toolbar button if there are no devices present on the system.
-FractoriumOptionsDialog.h/cpp:
--Add support for multi-GPU.
--Consolidate more assignments in DataToGui().
--Enable/disable CPU/OpenCL items in response to OpenCL checkbox event.
-Misc: Convert almost everything to size_t for unsigned, intmax_t for signed.
2015-09-12 21:33:45 -04:00
b = EmberGenome < double > ( opt ) ;
2014-12-05 21:30:46 -05:00
else
# endif
2016-04-11 21:15:14 -04:00
b = EmberGenome < float > ( opt ) ;
2014-07-08 03:11:14 -04:00
}
return b ? 0 : 1 ;
2014-12-05 21:30:46 -05:00
}