diff --git a/.gitignore b/.gitignore index 4f98ea0..6342cb2 100644 --- a/.gitignore +++ b/.gitignore @@ -249,3 +249,9 @@ Builds/include/GL /Deps/include/OpenEXR/halfFunction.h /Deps/include/OpenEXR/halfExport.h /Deps/include/OpenEXR/half.h +/Builds/MSVC/VS2017/.vs/Fractorium/v15 +/Source/Fractorium/Fractorium.ui.autosave +/main.pro.user.8f4f6a2 +/Builds/MSVC/VS2017/flam3-palettes.xml +/Builds/MSVC/VS2017/UpgradeLog.htm +/Builds/MSVC/VS2017/zlib.props diff --git a/Builds/MSVC/Installer/Product.wxs b/Builds/MSVC/Installer/Product.wxs index 805140c..f39a900 100644 --- a/Builds/MSVC/Installer/Product.wxs +++ b/Builds/MSVC/Installer/Product.wxs @@ -1,6 +1,6 @@ - + @@ -13,7 +13,7 @@ - + - + - + - + - + diff --git a/Builds/MSVC/VS2017/Ember.rc b/Builds/MSVC/VS2017/Ember.rc new file mode 100644 index 0000000..0951996 Binary files /dev/null and b/Builds/MSVC/VS2017/Ember.rc differ diff --git a/Builds/MSVC/VS2017/Ember.vcxproj b/Builds/MSVC/VS2017/Ember.vcxproj new file mode 100644 index 0000000..9dbc1f7 --- /dev/null +++ b/Builds/MSVC/VS2017/Ember.vcxproj @@ -0,0 +1,173 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {2BDB7A54-BB1A-476B-A6E5-F81E90AD4E67} + Win32Proj + EmberNs + Ember + 10.0.15063.0 + + + + DynamicLibrary + true + MultiByte + false + v141 + + + DynamicLibrary + false + false + MultiByte + v141 + + + + + + + + + + + + + true + $(SolutionDir)..\..\..\Bin\$(Platform)\$(Configuration)\ + $(SolutionDir)Obj\$(TargetName)\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)..\..\..\Bin\$(Platform)\$(Configuration)\ + $(SolutionDir)Obj\$(TargetName)\$(Platform)\$(Configuration)\ + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;BUILDING_EMBER;%(PreprocessorDefinitions) + $(TargetDir)$(TargetName).pdb + + + $(ProjectDir)..\..\..\..\glm;$(ProjectDir)..\..\..\..\libxml2\include;$(ProjectDir)..\..\..\..\tbb\include + Default + EmberPch.h + Precise + /bigobj %(AdditionalOptions) + true + false + true + false + AnySuitable + true + + + Windows + DebugFull + libxml2.lib;tbb.lib;%(AdditionalDependencies) + $(ProjectDir)..\..\..\Deps;%(AdditionalLibraryDirectories) + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;BUILDING_EMBER;%(PreprocessorDefinitions) + $(TargetDir)$(TargetName).pdb + + + $(ProjectDir)..\..\..\..\glm;$(ProjectDir)..\..\..\..\libxml2\include;$(ProjectDir)..\..\..\..\tbb\include + Speed + EmberPch.h + true + /bigobj %(AdditionalOptions) + Precise + true + false + false + false + true + + + Windows + DebugFull + true + true + libxml2.lib;tbb.lib;%(AdditionalDependencies) + $(ProjectDir)..\..\..\Deps;%(AdditionalLibraryDirectories) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Builds/MSVC/VS2017/Ember.vcxproj.filters b/Builds/MSVC/VS2017/Ember.vcxproj.filters new file mode 100644 index 0000000..e19c36a --- /dev/null +++ b/Builds/MSVC/VS2017/Ember.vcxproj.filters @@ -0,0 +1,169 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {bc119dca-b280-4071-b72d-f8c377b2e192} + + + {39f9b624-d25e-4af7-9f76-3b1a36a8a0f5} + + + {1ae77918-b5ee-4186-9fec-802fed55144e} + + + {782f9ed7-c2d4-4cad-9676-f707ccde10a6} + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files\Filters + + + Header Files\Filters + + + Header Files\Filters + + + Header Files\Xml + + + Header Files\Xml + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files\Variations + + + Header Files\Variations + + + Header Files\Variations + + + Header Files\Variations + + + Header Files\Variations + + + Header Files\Variations + + + Header Files\Variations + + + Header Files\Variations + + + Header Files + + + Header Files + + + Header Files + + + Header Files\Variations + + + Header Files + + + Header Files\Variations + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Header Files\Variations + + + Header Files\Xml + + + Header Files\Xml + + + Source Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/Builds/MSVC/VS2017/EmberAnimate.rc b/Builds/MSVC/VS2017/EmberAnimate.rc new file mode 100644 index 0000000..bca788e --- /dev/null +++ b/Builds/MSVC/VS2017/EmberAnimate.rc @@ -0,0 +1,98 @@ +// Microsoft Visual C++ generated resource script. +// +#include +#include "resource.h" +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) + LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + #pragma code_page(1252) + + ///////////////////////////////////////////////////////////////////////////// + // + // Icon + // + + // Icon with lowest ID value placed first to ensure application icon + // remains consistent on all systems. + IDI_ICON1 ICON "..\\..\\..\\Source\\Fractorium\\Icons\\Fractorium.ico" + + #ifdef APSTUDIO_INVOKED + ///////////////////////////////////////////////////////////////////////////// + // + // TEXTINCLUDE + // + + 1 TEXTINCLUDE + BEGIN + "resource.h\0" + END + + 2 TEXTINCLUDE + BEGIN + "\0" + END + + 3 TEXTINCLUDE + BEGIN + "\r\n" + "\0" + END + + #endif // APSTUDIO_INVOKED + + + ///////////////////////////////////////////////////////////////////////////// + // + // Version + // + + VS_VERSION_INFO VERSIONINFO + FILEVERSION 1, 0, 0, 7 + PRODUCTVERSION 1, 0, 0, 7 + FILEFLAGSMASK 0x3fL + #ifdef _DEBUG + FILEFLAGS 0x1L + #else + FILEFLAGS 0x0L + #endif + FILEOS 0x40004L + FILETYPE 0x0L + FILESUBTYPE 0x0L + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "Open Source" + VALUE "FileDescription", "Renders fractal flames as animations with motion blur" + VALUE "FileVersion", "1.0.0.7" + VALUE "InternalName", "EmberAnimate.exe" + VALUE "LegalCopyright", "Copyright (C) Matt Feemster 2017, GPL v3" + VALUE "OriginalFilename", "EmberAnimate.exe" + VALUE "ProductName", "Ember Animate" + VALUE "ProductVersion", "1.0.0.7" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END + END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED + ///////////////////////////////////////////////////////////////////////////// + // + // Generated from the TEXTINCLUDE 3 resource. + // + + + ///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/Builds/MSVC/VS2017/EmberAnimate.vcxproj b/Builds/MSVC/VS2017/EmberAnimate.vcxproj new file mode 100644 index 0000000..16f65ae --- /dev/null +++ b/Builds/MSVC/VS2017/EmberAnimate.vcxproj @@ -0,0 +1,153 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {35285FCF-6FA8-410E-841B-70AE744D38B8} + Win32Proj + EmberAnimate + EmberAnimate + 10.0.15063.0 + + + + Application + true + MultiByte + false + v141 + + + Application + false + false + MultiByte + v141 + + + + + + + + + + + + + true + $(SolutionDir)..\..\..\Bin\$(Platform)\$(Configuration)\ + $(SolutionDir)Obj\$(TargetName)\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)..\..\..\Bin\$(Platform)\$(Configuration)\ + $(SolutionDir)Obj\$(TargetName)\$(Platform)\$(Configuration)\ + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(TargetDir)$(TargetName).pdb + $(ProjectDir)..\..\..\Source\Ember;$(ProjectDir)..\..\..\Source\EmberCommon;$(ProjectDir)..\..\..\Source\EmberCL;$(ProjectDir)..\..\..\..\glm;$(ProjectDir)..\..\..\..\tbb\include;$(ProjectDir)..\..\..\..\libjpeg;$(ProjectDir)..\..\..\..\libpng;$(ProjectDir)..\..\..\..\libxml2\include;$(ProjectDir)..\..\..\Deps\include\OpenEXR;$(AMDAPPSDKROOT)\include;$(CUDA_PATH)\include + + + EmberCommonPch.h + true + false + true + false + AnySuitable + true + + + Console + DebugFull + libjpeg.lib;libpng.lib;libxml2.lib;tbb.lib;zlib.lib;Half.lib;Iex.lib;IlmImf.lib;opencl.lib;Ws2_32.lib;%(AdditionalDependencies) + $(ProjectDir)..\..\..\Deps;$(AMDAPPSDKROOT)\lib\x86_64;$(CUDA_PATH)\lib\$(PlatformName) + + + xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Deps\*.dll" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\flam3-palettes.xml" "$(OutDir)" + + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(TargetDir)$(TargetName).pdb + $(ProjectDir)..\..\..\Source\Ember;$(ProjectDir)..\..\..\Source\EmberCommon;$(ProjectDir)..\..\..\Source\EmberCL;$(ProjectDir)..\..\..\..\glm;$(ProjectDir)..\..\..\..\tbb\include;$(ProjectDir)..\..\..\..\libjpeg;$(ProjectDir)..\..\..\..\libpng;$(ProjectDir)..\..\..\..\libxml2\include;$(ProjectDir)..\..\..\Deps\include\OpenEXR;$(AMDAPPSDKROOT)\include;$(CUDA_PATH)\include + + + EmberCommonPch.h + true + true + false + false + true + + + Console + DebugFull + true + true + libjpeg.lib;libpng.lib;libxml2.lib;tbb.lib;zlib.lib;Half.lib;Iex.lib;IlmImf.lib;opencl.lib;Ws2_32.lib;%(AdditionalDependencies) + $(ProjectDir)..\..\..\Deps;$(AMDAPPSDKROOT)\lib\x86_64;$(CUDA_PATH)\lib\$(PlatformName) + + + xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Deps\*.dll" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\flam3-palettes.xml" "$(OutDir)" + + + + + + + + + + {2bdb7a54-bb1a-476b-a6e5-f81e90ad4e67} + + + {f6a9102c-69a9-48fb-bc4b-49e49af43236} + + + + + + + + + + + + + + + + Create + Create + + + + + + + + + \ No newline at end of file diff --git a/Builds/MSVC/VS2017/EmberAnimate.vcxproj.filters b/Builds/MSVC/VS2017/EmberAnimate.vcxproj.filters new file mode 100644 index 0000000..5b0a143 --- /dev/null +++ b/Builds/MSVC/VS2017/EmberAnimate.vcxproj.filters @@ -0,0 +1,62 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + Resource Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/Builds/MSVC/VS2017/EmberCL.rc b/Builds/MSVC/VS2017/EmberCL.rc new file mode 100644 index 0000000..7a51e44 Binary files /dev/null and b/Builds/MSVC/VS2017/EmberCL.rc differ diff --git a/Builds/MSVC/VS2017/EmberCL.vcxproj b/Builds/MSVC/VS2017/EmberCL.vcxproj new file mode 100644 index 0000000..26f294f --- /dev/null +++ b/Builds/MSVC/VS2017/EmberCL.vcxproj @@ -0,0 +1,155 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {F6A9102C-69A9-48FB-BC4B-49E49AF43236} + Win32Proj + EmberCLns + EmberCL + 10.0.15063.0 + + + + DynamicLibrary + true + MultiByte + false + v141 + + + DynamicLibrary + false + false + MultiByte + v141 + + + + + + + + + + + + + true + $(SolutionDir)..\..\..\Bin\$(Platform)\$(Configuration)\ + $(SolutionDir)Obj\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)..\..\..\Bin\$(Platform)\$(Configuration)\ + $(SolutionDir)Obj\$(TargetName)\$(Platform)\$(Configuration)\ + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;BUILDING_EMBERCL;%(PreprocessorDefinitions) + $(TargetDir)$(TargetName).pdb + + + $(ProjectDir)..\..\..\Source\Ember\;$(ProjectDir)..\..\..\..\glm;$(ProjectDir)..\..\..\..\tbb\include;$(ProjectDir)..\..\..\..\libxml2\include;$(AMDAPPSDKROOT)\include;$(CUDA_PATH)\include + Default + EmberCLPch.h + true + false + true + false + AnySuitable + true + + + Windows + DebugFull + libxml2.lib;tbb.lib;opencl.lib;Opengl32.lib;%(AdditionalDependencies) + $(ProjectDir)..\..\..\Deps;$(AMDAPPSDKROOT)\lib\x86_64;$(CUDA_PATH)\lib\$(PlatformName) + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;BUILDING_EMBERCL;%(PreprocessorDefinitions) + $(TargetDir)$(TargetName).pdb + + + $(ProjectDir)..\..\..\Source\Ember\;$(ProjectDir)..\..\..\..\glm;$(ProjectDir)..\..\..\..\tbb\include;$(ProjectDir)..\..\..\..\libxml2\include;$(AMDAPPSDKROOT)\include;$(CUDA_PATH)\include + Speed + EmberCLPch.h + /bigobj %(AdditionalOptions) + Precise + true + false + true + false + true + + + Windows + DebugFull + true + true + libxml2.lib;tbb.lib;opencl.lib;Opengl32.lib;%(AdditionalDependencies) + $(ProjectDir)..\..\..\Deps;$(AMDAPPSDKROOT)\lib\x86_64;$(CUDA_PATH)\lib\$(PlatformName) + + + + + {2bdb7a54-bb1a-476b-a6e5-f81e90ad4e67} + true + true + false + true + false + + + + + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Builds/MSVC/VS2017/EmberCL.vcxproj.filters b/Builds/MSVC/VS2017/EmberCL.vcxproj.filters new file mode 100644 index 0000000..9fb2fd9 --- /dev/null +++ b/Builds/MSVC/VS2017/EmberCL.vcxproj.filters @@ -0,0 +1,89 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {d66f35ca-a4cd-470a-9c56-653b0665b598} + + + + + Source Files + + + Source Files + + + Source Files + + + Kernel Creators + + + Kernel Creators + + + Kernel Creators + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Kernel Creators + + + Kernel Creators + + + Kernel Creators + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/Builds/MSVC/VS2017/EmberGenome.rc b/Builds/MSVC/VS2017/EmberGenome.rc new file mode 100644 index 0000000..6ce3338 --- /dev/null +++ b/Builds/MSVC/VS2017/EmberGenome.rc @@ -0,0 +1,98 @@ +// Microsoft Visual C++ generated resource script. +// +#include +#include "resource.h" +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) + LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + #pragma code_page(1252) + + ///////////////////////////////////////////////////////////////////////////// + // + // Icon + // + + // Icon with lowest ID value placed first to ensure application icon + // remains consistent on all systems. + IDI_ICON1 ICON "..\\..\\..\\Source\\Fractorium\\Icons\\Fractorium.ico" + + #ifdef APSTUDIO_INVOKED + ///////////////////////////////////////////////////////////////////////////// + // + // TEXTINCLUDE + // + + 1 TEXTINCLUDE + BEGIN + "resource.h\0" + END + + 2 TEXTINCLUDE + BEGIN + "\0" + END + + 3 TEXTINCLUDE + BEGIN + "\r\n" + "\0" + END + + #endif // APSTUDIO_INVOKED + + + ///////////////////////////////////////////////////////////////////////////// + // + // Version + // + + VS_VERSION_INFO VERSIONINFO + FILEVERSION 1, 0, 0, 7 + PRODUCTVERSION 1, 0, 0, 7 + FILEFLAGSMASK 0x3fL + #ifdef _DEBUG + FILEFLAGS 0x1L + #else + FILEFLAGS 0x0L + #endif + FILEOS 0x40004L + FILETYPE 0x0L + FILESUBTYPE 0x0L + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "Open Source" + VALUE "FileDescription", "Manipulates fractal flames parameter files" + VALUE "FileVersion", "1.0.0.7" + VALUE "InternalName", "EmberGenome.exe" + VALUE "LegalCopyright", "Copyright (C) Matt Feemster 2017, GPL v3" + VALUE "OriginalFilename", "EmberGenome.exe" + VALUE "ProductName", "Ember Genome" + VALUE "ProductVersion", "1.0.0.7" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END + END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED + ///////////////////////////////////////////////////////////////////////////// + // + // Generated from the TEXTINCLUDE 3 resource. + // + + + ///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/Builds/MSVC/VS2017/EmberGenome.vcxproj b/Builds/MSVC/VS2017/EmberGenome.vcxproj new file mode 100644 index 0000000..e3a3580 --- /dev/null +++ b/Builds/MSVC/VS2017/EmberGenome.vcxproj @@ -0,0 +1,152 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {7930CAAC-9FC4-4202-B6A3-E760F73F88B7} + Win32Proj + EmberGenome + EmberGenome + 10.0.15063.0 + + + + Application + true + MultiByte + false + v141 + + + Application + false + false + MultiByte + v141 + + + + + + + + + + + + + true + $(SolutionDir)..\..\..\Bin\$(Platform)\$(Configuration)\ + $(SolutionDir)Obj\$(TargetName)\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)..\..\..\Bin\$(Platform)\$(Configuration)\ + $(SolutionDir)Obj\$(TargetName)\$(Platform)\$(Configuration)\ + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(TargetDir)$(TargetName).pdb + $(ProjectDir)..\..\..\Source\Ember;$(ProjectDir)..\..\..\Source\EmberCommon;$(ProjectDir)..\..\..\Source\EmberCL;$(ProjectDir)..\..\..\..\glm;$(ProjectDir)..\..\..\..\tbb\include;$(ProjectDir)..\..\..\..\libjpeg;$(ProjectDir)..\..\..\..\libpng;$(ProjectDir)..\..\..\..\libxml2\include;$(ProjectDir)..\..\..\Deps\include\OpenEXR;$(AMDAPPSDKROOT)\include;$(CUDA_PATH)\include + + + EmberCommonPch.h + true + false + true + false + AnySuitable + true + + + Console + DebugFull + libjpeg.lib;libpng.lib;libxml2.lib;tbb.lib;zlib.lib;Half.lib;Iex.lib;IlmImf.lib;opencl.lib;Ws2_32.lib;%(AdditionalDependencies) + $(ProjectDir)..\..\..\Deps;$(AMDAPPSDKROOT)\lib\x86_64;$(CUDA_PATH)\lib\$(PlatformName) + + + xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Deps\*.dll" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\flam3-palettes.xml" "$(OutDir)" + + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(TargetDir)$(TargetName).pdb + $(ProjectDir)..\..\..\Source\Ember;$(ProjectDir)..\..\..\Source\EmberCommon;$(ProjectDir)..\..\..\Source\EmberCL;$(ProjectDir)..\..\..\..\glm;$(ProjectDir)..\..\..\..\tbb\include;$(ProjectDir)..\..\..\..\libjpeg;$(ProjectDir)..\..\..\..\libpng;$(ProjectDir)..\..\..\..\libxml2\include;$(ProjectDir)..\..\..\Deps\include\OpenEXR;$(AMDAPPSDKROOT)\include;$(CUDA_PATH)\include + + + EmberCommonPch.h + true + true + false + false + true + + + Console + DebugFull + true + true + libjpeg.lib;libpng.lib;libxml2.lib;tbb.lib;zlib.lib;Half.lib;Iex.lib;IlmImf.lib;opencl.lib;Ws2_32.lib;%(AdditionalDependencies) + $(ProjectDir)..\..\..\Deps;$(AMDAPPSDKROOT)\lib\x86_64;$(CUDA_PATH)\lib\$(PlatformName) + + + xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Deps\*.dll" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\flam3-palettes.xml" "$(OutDir)" + + + + + + + + + {2bdb7a54-bb1a-476b-a6e5-f81e90ad4e67} + + + {f6a9102c-69a9-48fb-bc4b-49e49af43236} + + + + + + + + + + + + + + + Create + Create + + + + + + + + + + \ No newline at end of file diff --git a/Builds/MSVC/VS2017/EmberGenome.vcxproj.filters b/Builds/MSVC/VS2017/EmberGenome.vcxproj.filters new file mode 100644 index 0000000..3d1270f --- /dev/null +++ b/Builds/MSVC/VS2017/EmberGenome.vcxproj.filters @@ -0,0 +1,61 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Resource Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/Builds/MSVC/VS2017/EmberRender.rc b/Builds/MSVC/VS2017/EmberRender.rc new file mode 100644 index 0000000..ffe03b9 --- /dev/null +++ b/Builds/MSVC/VS2017/EmberRender.rc @@ -0,0 +1,98 @@ +// Microsoft Visual C++ generated resource script. +// +#include +#include "resource.h" +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) + LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + #pragma code_page(1252) + + ///////////////////////////////////////////////////////////////////////////// + // + // Icon + // + + // Icon with lowest ID value placed first to ensure application icon + // remains consistent on all systems. + IDI_ICON1 ICON "..\\..\\..\\Source\\Fractorium\\Icons\\Fractorium.ico" + + #ifdef APSTUDIO_INVOKED + ///////////////////////////////////////////////////////////////////////////// + // + // TEXTINCLUDE + // + + 1 TEXTINCLUDE + BEGIN + "resource.h\0" + END + + 2 TEXTINCLUDE + BEGIN + "\0" + END + + 3 TEXTINCLUDE + BEGIN + "\r\n" + "\0" + END + + #endif // APSTUDIO_INVOKED + + + ///////////////////////////////////////////////////////////////////////////// + // + // Version + // + + VS_VERSION_INFO VERSIONINFO + FILEVERSION 1, 0, 0, 7 + PRODUCTVERSION 1, 0, 0, 7 + FILEFLAGSMASK 0x3fL + #ifdef _DEBUG + FILEFLAGS 0x1L + #else + FILEFLAGS 0x0L + #endif + FILEOS 0x40004L + FILETYPE 0x0L + FILESUBTYPE 0x0L + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "Open Source" + VALUE "FileDescription", "Renders fractal flames as single images" + VALUE "FileVersion", "1.0.0.7" + VALUE "InternalName", "EmberRender.exe" + VALUE "LegalCopyright", "Copyright (C) Matt Feemster 2017, GPL v3" + VALUE "OriginalFilename", "EmberRender.exe" + VALUE "ProductName", "Ember Render" + VALUE "ProductVersion", "1.0.0.7" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END + END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED + ///////////////////////////////////////////////////////////////////////////// + // + // Generated from the TEXTINCLUDE 3 resource. + // + + + ///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/Builds/MSVC/VS2017/EmberRender.vcxproj b/Builds/MSVC/VS2017/EmberRender.vcxproj new file mode 100644 index 0000000..10826d4 --- /dev/null +++ b/Builds/MSVC/VS2017/EmberRender.vcxproj @@ -0,0 +1,153 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {4A191F4C-03AC-4F1B-AFFD-F5483ECEBD29} + Win32Proj + EmberRender + EmberRender + 10.0.15063.0 + + + + Application + true + MultiByte + false + v141 + + + Application + false + false + MultiByte + v141 + + + + + + + + + + + + + true + $(SolutionDir)..\..\..\Bin\$(Platform)\$(Configuration)\ + $(SolutionDir)Obj\$(TargetName)\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)..\..\..\Bin\$(Platform)\$(Configuration)\ + $(SolutionDir)Obj\$(TargetName)\$(Platform)\$(Configuration)\ + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(TargetDir)$(TargetName).pdb + $(ProjectDir)..\..\..\Source\Ember;$(ProjectDir)..\..\..\Source\EmberCommon;$(ProjectDir)..\..\..\Source\EmberCL;$(ProjectDir)..\..\..\..\glm;$(ProjectDir)..\..\..\..\tbb\include;$(ProjectDir)..\..\..\..\libjpeg;$(ProjectDir)..\..\..\..\libpng;$(ProjectDir)..\..\..\..\libxml2\include;$(ProjectDir)..\..\..\Deps\include\OpenEXR;$(AMDAPPSDKROOT)\include;$(CUDA_PATH)\include + + + EmberCommonPch.h + true + false + true + false + AnySuitable + true + + + Console + DebugFull + libjpeg.lib;libpng.lib;libxml2.lib;tbb.lib;zlib.lib;Half.lib;Iex.lib;IlmImf.lib;opencl.lib;Ws2_32.lib;%(AdditionalDependencies) + $(ProjectDir)..\..\..\Deps;$(AMDAPPSDKROOT)\lib\x86_64;$(CUDA_PATH)\lib\$(PlatformName) + + + xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Deps\*.dll" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\flam3-palettes.xml" "$(OutDir)" + + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(TargetDir)$(TargetName).pdb + $(ProjectDir)..\..\..\Source\Ember;$(ProjectDir)..\..\..\Source\EmberCommon;$(ProjectDir)..\..\..\Source\EmberCL;$(ProjectDir)..\..\..\..\glm;$(ProjectDir)..\..\..\..\tbb\include;$(ProjectDir)..\..\..\..\libjpeg;$(ProjectDir)..\..\..\..\libpng;$(ProjectDir)..\..\..\..\libxml2\include;$(ProjectDir)..\..\..\Deps\include\OpenEXR;$(AMDAPPSDKROOT)\include;$(CUDA_PATH)\include + + + EmberCommonPch.h + Precise + true + false + true + false + true + + + Console + DebugFull + true + true + libjpeg.lib;libpng.lib;libxml2.lib;tbb.lib;zlib.lib;Half.lib;Iex.lib;IlmImf.lib;opencl.lib;Ws2_32.lib;%(AdditionalDependencies) + $(ProjectDir)..\..\..\Deps;$(AMDAPPSDKROOT)\lib\x86_64;$(CUDA_PATH)\lib\$(PlatformName) + + + xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Deps\*.dll" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\flam3-palettes.xml" "$(OutDir)" + + + + + + + + + {2bdb7a54-bb1a-476b-a6e5-f81e90ad4e67} + + + {f6a9102c-69a9-48fb-bc4b-49e49af43236} + + + + + + + + + + + + + + + Create + Create + + + + + + + + + + \ No newline at end of file diff --git a/Builds/MSVC/VS2017/EmberRender.vcxproj.filters b/Builds/MSVC/VS2017/EmberRender.vcxproj.filters new file mode 100644 index 0000000..8b02474 --- /dev/null +++ b/Builds/MSVC/VS2017/EmberRender.vcxproj.filters @@ -0,0 +1,61 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Resource Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/Builds/MSVC/VS2017/EmberTester.vcxproj b/Builds/MSVC/VS2017/EmberTester.vcxproj new file mode 100644 index 0000000..af3932c --- /dev/null +++ b/Builds/MSVC/VS2017/EmberTester.vcxproj @@ -0,0 +1,145 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {320F611A-F9CE-4196-A8DC-FA24B2E8A320} + Win32Proj + EmberTester + EmberTester + 10.0.15063.0 + + + + Application + true + MultiByte + false + v141 + + + Application + false + false + MultiByte + v141 + + + + + + + + + + + + + true + $(SolutionDir)..\..\..\Bin\$(Platform)\$(Configuration)\ + $(SolutionDir)Obj\$(TargetName)\$(Platform)\$(Configuration)\ + + + false + $(SolutionDir)..\..\..\Bin\$(Platform)\$(Configuration)\ + $(SolutionDir)Obj\$(TargetName)\$(Platform)\$(Configuration)\ + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;OPENEXR_DLL;%(PreprocessorDefinitions) + $(TargetDir)$(TargetName).pdb + $(ProjectDir)..\..\..\Source\Ember;$(ProjectDir)..\..\..\Source\EmberCommon;$(ProjectDir)..\..\..\Source\EmberCL;$(ProjectDir)..\..\..\..\glm;$(ProjectDir)..\..\..\..\tbb\include;$(ProjectDir)..\..\..\..\libjpeg;$(ProjectDir)..\..\..\..\libpng;$(ProjectDir)..\..\..\..\libxml2\include;$(ProjectDir)..\..\..\Deps\include\OpenEXR;$(AMDAPPSDKROOT)\include;$(CUDA_PATH)\include + + + EmberCommonPch.h + true + false + true + false + AnySuitable + true + + + Console + DebugFull + libjpeg.lib;libpng.lib;libxml2.lib;tbb.lib;zlib.lib;Half.lib;IlmImf.lib;opencl.lib;Ws2_32.lib;%(AdditionalDependencies) + $(ProjectDir)..\..\..\Deps;$(AMDAPPSDKROOT)\lib\x86_64;$(CUDA_PATH)\lib\$(PlatformName) + + + xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Deps\*.dll" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\flam3-palettes.xml" "$(OutDir)" + + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;OPENEXR_DLL;%(PreprocessorDefinitions) + $(TargetDir)$(TargetName).pdb + $(ProjectDir)..\..\..\Source\Ember;$(ProjectDir)..\..\..\Source\EmberCommon;$(ProjectDir)..\..\..\Source\EmberCL;$(ProjectDir)..\..\..\..\glm;$(ProjectDir)..\..\..\..\tbb\include;$(ProjectDir)..\..\..\..\libjpeg;$(ProjectDir)..\..\..\..\libpng;$(ProjectDir)..\..\..\..\libxml2\include;$(ProjectDir)..\..\..\Deps\include\OpenEXR;$(AMDAPPSDKROOT)\include;$(CUDA_PATH)\include + + + EmberCommonPch.h + true + true + false + false + true + + + Console + DebugFull + true + true + libjpeg.lib;libpng.lib;libxml2.lib;tbb.lib;zlib.lib;Half.lib;IlmImf.lib;opencl.lib;Ws2_32.lib;%(AdditionalDependencies) + $(ProjectDir)..\..\..\Deps;$(AMDAPPSDKROOT)\lib\x86_64;$(CUDA_PATH)\lib\$(PlatformName) + + + xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Deps\*.dll" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\flam3-palettes.xml" "$(OutDir)" + + + + + + {2bdb7a54-bb1a-476b-a6e5-f81e90ad4e67} + + + {f6a9102c-69a9-48fb-bc4b-49e49af43236} + + + + + + + + + + + + + + Create + Create + + + + + + + \ No newline at end of file diff --git a/Builds/MSVC/VS2017/EmberTester.vcxproj.filters b/Builds/MSVC/VS2017/EmberTester.vcxproj.filters new file mode 100644 index 0000000..be5b41b --- /dev/null +++ b/Builds/MSVC/VS2017/EmberTester.vcxproj.filters @@ -0,0 +1,48 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/Builds/MSVC/VS2017/Fractorium.rc b/Builds/MSVC/VS2017/Fractorium.rc new file mode 100644 index 0000000..395dfcb Binary files /dev/null and b/Builds/MSVC/VS2017/Fractorium.rc differ diff --git a/Builds/MSVC/VS2017/Fractorium.sln b/Builds/MSVC/VS2017/Fractorium.sln new file mode 100644 index 0000000..fe074a1 --- /dev/null +++ b/Builds/MSVC/VS2017/Fractorium.sln @@ -0,0 +1,76 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Ember", "Ember.vcxproj", "{2BDB7A54-BB1A-476B-A6E5-F81E90AD4E67}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EmberTester", "EmberTester.vcxproj", "{320F611A-F9CE-4196-A8DC-FA24B2E8A320}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Fractorium", "Fractorium.vcxproj", "{6547D5FA-64CE-44BA-9D3C-B6E217456445}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EmberRender", "EmberRender.vcxproj", "{4A191F4C-03AC-4F1B-AFFD-F5483ECEBD29}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EmberAnimate", "EmberAnimate.vcxproj", "{35285FCF-6FA8-410E-841B-70AE744D38B8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EmberGenome", "EmberGenome.vcxproj", "{7930CAAC-9FC4-4202-B6A3-E760F73F88B7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EmberCL", "EmberCL.vcxproj", "{F6A9102C-69A9-48FB-BC4B-49E49AF43236}" +EndProject +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "FractoriumInstaller", "..\Installer\FractoriumInstaller.wixproj", "{C8096C47-E358-438C-A520-146D46B0637D}" + ProjectSection(ProjectDependencies) = postProject + {F6A9102C-69A9-48FB-BC4B-49E49AF43236} = {F6A9102C-69A9-48FB-BC4B-49E49AF43236} + {4A191F4C-03AC-4F1B-AFFD-F5483ECEBD29} = {4A191F4C-03AC-4F1B-AFFD-F5483ECEBD29} + {2BDB7A54-BB1A-476B-A6E5-F81E90AD4E67} = {2BDB7A54-BB1A-476B-A6E5-F81E90AD4E67} + {7930CAAC-9FC4-4202-B6A3-E760F73F88B7} = {7930CAAC-9FC4-4202-B6A3-E760F73F88B7} + {35285FCF-6FA8-410E-841B-70AE744D38B8} = {35285FCF-6FA8-410E-841B-70AE744D38B8} + {6547D5FA-64CE-44BA-9D3C-B6E217456445} = {6547D5FA-64CE-44BA-9D3C-B6E217456445} + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5CD06D80-903E-45D6-90F3-3C3EB4FFE46F}" + ProjectSection(SolutionItems) = preProject + ..\..\..\Data\Version History.txt = ..\..\..\Data\Version History.txt + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2BDB7A54-BB1A-476B-A6E5-F81E90AD4E67}.Debug|x64.ActiveCfg = Debug|x64 + {2BDB7A54-BB1A-476B-A6E5-F81E90AD4E67}.Debug|x64.Build.0 = Debug|x64 + {2BDB7A54-BB1A-476B-A6E5-F81E90AD4E67}.Release|x64.ActiveCfg = Release|x64 + {2BDB7A54-BB1A-476B-A6E5-F81E90AD4E67}.Release|x64.Build.0 = Release|x64 + {320F611A-F9CE-4196-A8DC-FA24B2E8A320}.Debug|x64.ActiveCfg = Debug|x64 + {320F611A-F9CE-4196-A8DC-FA24B2E8A320}.Debug|x64.Build.0 = Debug|x64 + {320F611A-F9CE-4196-A8DC-FA24B2E8A320}.Release|x64.ActiveCfg = Release|x64 + {320F611A-F9CE-4196-A8DC-FA24B2E8A320}.Release|x64.Build.0 = Release|x64 + {6547D5FA-64CE-44BA-9D3C-B6E217456445}.Debug|x64.ActiveCfg = Debug|x64 + {6547D5FA-64CE-44BA-9D3C-B6E217456445}.Debug|x64.Build.0 = Debug|x64 + {6547D5FA-64CE-44BA-9D3C-B6E217456445}.Release|x64.ActiveCfg = Release|x64 + {6547D5FA-64CE-44BA-9D3C-B6E217456445}.Release|x64.Build.0 = Release|x64 + {4A191F4C-03AC-4F1B-AFFD-F5483ECEBD29}.Debug|x64.ActiveCfg = Debug|x64 + {4A191F4C-03AC-4F1B-AFFD-F5483ECEBD29}.Debug|x64.Build.0 = Debug|x64 + {4A191F4C-03AC-4F1B-AFFD-F5483ECEBD29}.Release|x64.ActiveCfg = Release|x64 + {4A191F4C-03AC-4F1B-AFFD-F5483ECEBD29}.Release|x64.Build.0 = Release|x64 + {35285FCF-6FA8-410E-841B-70AE744D38B8}.Debug|x64.ActiveCfg = Debug|x64 + {35285FCF-6FA8-410E-841B-70AE744D38B8}.Debug|x64.Build.0 = Debug|x64 + {35285FCF-6FA8-410E-841B-70AE744D38B8}.Release|x64.ActiveCfg = Release|x64 + {35285FCF-6FA8-410E-841B-70AE744D38B8}.Release|x64.Build.0 = Release|x64 + {7930CAAC-9FC4-4202-B6A3-E760F73F88B7}.Debug|x64.ActiveCfg = Debug|x64 + {7930CAAC-9FC4-4202-B6A3-E760F73F88B7}.Debug|x64.Build.0 = Debug|x64 + {7930CAAC-9FC4-4202-B6A3-E760F73F88B7}.Release|x64.ActiveCfg = Release|x64 + {7930CAAC-9FC4-4202-B6A3-E760F73F88B7}.Release|x64.Build.0 = Release|x64 + {F6A9102C-69A9-48FB-BC4B-49E49AF43236}.Debug|x64.ActiveCfg = Debug|x64 + {F6A9102C-69A9-48FB-BC4B-49E49AF43236}.Debug|x64.Build.0 = Debug|x64 + {F6A9102C-69A9-48FB-BC4B-49E49AF43236}.Release|x64.ActiveCfg = Release|x64 + {F6A9102C-69A9-48FB-BC4B-49E49AF43236}.Release|x64.Build.0 = Release|x64 + {C8096C47-E358-438C-A520-146D46B0637D}.Debug|x64.ActiveCfg = Debug|x64 + {C8096C47-E358-438C-A520-146D46B0637D}.Release|x64.ActiveCfg = Release|x64 + {C8096C47-E358-438C-A520-146D46B0637D}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Builds/MSVC/VS2017/Fractorium.vcxproj b/Builds/MSVC/VS2017/Fractorium.vcxproj new file mode 100644 index 0000000..26b5ead --- /dev/null +++ b/Builds/MSVC/VS2017/Fractorium.vcxproj @@ -0,0 +1,771 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {6547D5FA-64CE-44BA-9D3C-B6E217456445} + Qt4VSv1.0 + 10.0.15063.0 + + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + AllRules.ruleset + + + AllRules.ruleset + + + $(SolutionDir)..\..\..\Bin\$(Platform)\$(Configuration)\ + $(SolutionDir)..\..\..\Bin\$(Platform)\$(Configuration)\ + $(SolutionDir)Obj\$(TargetName)\$(Platform)\$(Configuration)\ + $(SolutionDir)Obj\$(TargetName)\$(Platform)\$(Configuration)\ + + + true + + + true + + + + UNICODE;WIN32;QT_DLL;QT_CORE_LIB;QT_GUI_LIB;QT_MULTIMEDIA_LIB;QT_HELP_LIB;QT_OPENGL_LIB;QT_WIDGETS_LIB;QT_XML_LIB;%(PreprocessorDefinitions) + .;.\PaletteEditor;$(QTDIR)\include;$(ProjectDir)..\..\..\Fractorium\GeneratedFiles;$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName;$(QTDIR)\..\qtmultimedia\include\QtMultimedia;$(QTDIR)\..\qtmultimedia\include;$(QTDIR)\..\qttools\include;$(QTDIR)\..\qttools\include\QtHelp;$(QTDIR)\include\QtConcurrent;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtOpenGL;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtXml;.\GeneratedFiles;$(ProjectDir)..\..\..\Source\Ember;$(ProjectDir)..\..\..\Source\EmberCL;$(ProjectDir)..\..\..\Source\EmberCommon;$(ProjectDir)..\..\..\Source\Fractorium;$(ProjectDir)..\..\..\..\glm;$(ProjectDir)..\..\..\..\tbb\include;$(ProjectDir)..\..\..\..\libjpeg;$(ProjectDir)..\..\..\..\libpng;$(ProjectDir)..\..\..\..\libxml2\include;$(ProjectDir)..\..\..\Deps\include\OpenEXR;$(AMDAPPSDKROOT)\include;$(CUDA_PATH)\include;.\GeneratedFiles\$(ConfigurationName);%(AdditionalIncludeDirectories) + Disabled + ProgramDatabase + MultiThreadedDebugDLL + false + Use + FractoriumPch.h + $(IntDir)$(TargetName).pch + $(TargetDir)$(TargetName).pdb + + + /bigobj -Zm150 %(AdditionalOptions) + true + true + false + Level3 + AnySuitable + true + + + Windows + $(OutDir)\$(ProjectName).exe + $(ProjectDir)..\..\..\Deps;$(QTDIR)\lib;$(AMDAPPSDKROOT)\lib\x86_64;$(CUDA_PATH)\lib\$(PlatformName);%(AdditionalLibraryDirectories) + DebugFull + qtmaind.lib;Qt5Cored.lib;Qt5Guid.lib;Qt5OpenGLd.lib;opengl32.lib;glu32.lib;opencl.lib;Qt5Widgetsd.lib;Qt5Xmld.lib;Ws2_32.lib;libjpeg.lib;libpng.lib;libxml2.lib;tbb.lib;zlib.lib;Half.lib;Iex.lib;IlmImf.lib;%(AdditionalDependencies) + + + xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Deps\*.dll" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\flam3-palettes.xml" "$(OutDir)" + +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\boxtail_pack_02.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\boxtail_pack_03_triangle.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\boxtail_pack_04_mineshack.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\fardareismai_pack_01_variety_number_128.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\fardareismai_pack_02_b_sides.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\fardareismai_pack_03_old_and_new.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\fardareismai_pack_04_hoard.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\fractaldesire_pack_01.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\rce_ordinary_pack_01_colornation.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\tatasz_pack_01.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\tatasz_pack_02_colder.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\tatasz_pack_02_dark.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\tatasz_pack_02_warmer.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\tatasz_pack_03.gradient" "$(OutDir)" + +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\dark_windows.qss" "$(OutDir)" + +xcopy /F /Y /R /D "$(QTDIR)\bin\Qt5Cored.dll" "$(OutDir)" +xcopy /F /Y /R /D "$(QTDIR)\bin\Qt5Guid.dll" "$(OutDir)" +xcopy /F /Y /R /D "$(QTDIR)\bin\Qt5Widgetsd.dll" "$(OutDir)" + +xcopy /F /Y /R /D "$(QTDIR)\plugins\platforms\qwindowsd.dll" "$(OutDir)\platforms\" + + + + + + UNICODE;WIN32;QT_DLL;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_GUI_LIB;QT_MULTIMEDIA_LIB;QT_HELP_LIB;QT_OPENGL_LIB;QT_WIDGETS_LIB;QT_XML_LIB;%(PreprocessorDefinitions) + .;.\PaletteEditor;$(QTDIR)\include;$(ProjectDir)..\..\..\Fractorium\GeneratedFiles;$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName;$(QTDIR)\..\qtmultimedia\include\QtMultimedia;$(QTDIR)\..\qtmultimedia\include;$(QTDIR)\..\qttools\include;$(QTDIR)\..\qttools\include\QtHelp;$(QTDIR)\include\QtConcurrent;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtOpenGL;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtXml;.\GeneratedFiles;$(ProjectDir)..\..\..\Source\Ember;$(ProjectDir)..\..\..\Source\EmberCL;$(ProjectDir)..\..\..\Source\EmberCommon;$(ProjectDir)..\..\..\Source\Fractorium;$(ProjectDir)..\..\..\..\glm;$(ProjectDir)..\..\..\..\tbb\include;$(ProjectDir)..\..\..\..\libjpeg;$(ProjectDir)..\..\..\..\libpng;$(ProjectDir)..\..\..\..\libxml2\include;$(ProjectDir)..\..\..\Deps\include\OpenEXR;$(AMDAPPSDKROOT)\include;$(CUDA_PATH)\include;.\GeneratedFiles\$(ConfigurationName);%(AdditionalIncludeDirectories) + ProgramDatabase + MultiThreadedDLL + false + Use + FractoriumPch.h + $(IntDir)$(TargetName).pch + $(TargetDir)$(TargetName).pdb + + + true + true + false + /bigobj -Zm150 %(AdditionalOptions) + false + Level3 + true + + + Windows + $(OutDir)\$(ProjectName).exe + $(ProjectDir)..\..\..\Deps;$(QTDIR)\lib;$(AMDAPPSDKROOT)\lib\x86_64;$(CUDA_PATH)\lib\$(PlatformName);%(AdditionalLibraryDirectories) + DebugFull + qtmain.lib;Qt5Core.lib;Qt5Gui.lib;Qt5OpenGL.lib;opengl32.lib;glu32.lib;opencl.lib;Qt5Widgets.lib;Ws2_32.lib;libjpeg.lib;libpng.lib;libxml2.lib;tbb.lib;zlib.lib;Half.lib;Iex.lib;IlmImf.lib;%(AdditionalDependencies) + 0.1 + + + xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Deps\*.dll" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\flam3-palettes.xml" "$(OutDir)" + +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\boxtail_pack_02.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\boxtail_pack_03_triangle.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\boxtail_pack_04_mineshack.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\fardareismai_pack_01_variety_number_128.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\fardareismai_pack_02_b_sides.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\fardareismai_pack_03_old_and_new.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\fardareismai_pack_04_hoard.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\fractaldesire_pack_01.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\rce_ordinary_pack_01_colornation.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\tatasz_pack_01.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\tatasz_pack_02_colder.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\tatasz_pack_02_dark.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\tatasz_pack_02_warmer.gradient" "$(OutDir)" +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\tatasz_pack_03.gradient" "$(OutDir)" + +xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\dark_windows.qss" "$(OutDir)" + +xcopy /F /Y /R /D "$(QTDIR)\bin\Qt5Core.dll" "$(OutDir)" +xcopy /F /Y /R /D "$(QTDIR)\bin\Qt5Gui.dll" "$(OutDir)" +xcopy /F /Y /R /D "$(QTDIR)\bin\Qt5Widgets.dll" "$(OutDir)" + +xcopy /F /Y /R /D "$(QTDIR)\plugins\platforms\qwindows.dll" "$(OutDir)\platforms\" + + + + + Use + Use + + + + + + + Use + Use + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + + + + + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + + + Moc%27ing VariationsDialog.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/VariationsDialog.h" + Moc%27ing VariationsDialog.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/VariationsDialog.h" + $(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath) + + + Moc%27ing QssDialog.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/QssDialog.h" + Moc%27ing QssDialog.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/QssDialog.h" + $(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath) + + + Moc%27ing csshighlighter.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/csshighlighter.h" + Moc%27ing csshighlighter.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/csshighlighter.h" + $(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath) + + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing LibraryTreeWidget.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/LibraryTreeWidget.h" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing LibraryTreeWidget.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/LibraryTreeWidget.h" + + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing ColorPanel.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/PaletteEditor/ColorPanel.h" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing ColorPanel.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/PaletteEditor/ColorPanel.h" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." + + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing ColorPickerWidget.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/PaletteEditor/ColorPickerWidget.h" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing ColorPickerWidget.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/PaletteEditor/ColorPickerWidget.h" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." + + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing ColorTriangle.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/PaletteEditor/ColorTriangle.h" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing ColorTriangle.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/PaletteEditor/ColorTriangle.h" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." + + + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing GradientColorsView.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/PaletteEditor/GradientColorsView.h" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing GradientColorsView.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/PaletteEditor/GradientColorsView.h" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." + + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing PaletteEditor.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/PaletteEditor/PaletteEditor.h" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing PaletteEditor.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/PaletteEditor/PaletteEditor.h" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." + + + + + Moc%27ing QssTextEdit.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/QssTextEdit.h" + Moc%27ing QssTextEdit.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/QssTextEdit.h" + $(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath) + + + + + + Moc%27ing OptionsDialog.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/OptionsDialog.h" + Moc%27ing OptionsDialog.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/OptionsDialog.h" + $(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath) + + + Moc%27ing AboutDialog.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/AboutDialog.h" + Moc%27ing AboutDialog.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/AboutDialog.h" + $(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath) + + + Moc%27ing FinalRenderDialog.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/FinalRenderDialog.h" + Moc%27ing FinalRenderDialog.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/FinalRenderDialog.h" + $(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath) + + + %(AdditionalInputs) + + + + + + + %(AdditionalInputs) + + + + + + + + + Moc%27ing FractoriumSettings.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/FractoriumSettings.h" + Moc%27ing FractoriumSettings.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/FractoriumSettings.h" + $(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath) + + + Moc%27ing TwoButtonComboWidget.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/TwoButtonComboWidget.h" + Moc%27ing TwoButtonComboWidget.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/TwoButtonComboWidget.h" + $(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath) + + + + Moc%27ing CurvesGraphicsView.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/CurvesGraphicsView.h" + Moc%27ing CurvesGraphicsView.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/CurvesGraphicsView.h" + $(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath) + + + Moc%27ing DoubleSpinBoxTableItemDelegate.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/DoubleSpinBoxTableItemDelegate.h" + Moc%27ing DoubleSpinBoxTableItemDelegate.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/DoubleSpinBoxTableItemDelegate.h" + $(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath) + + + + + + + + + + + + Moc%27ing GLWidget.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/GLWidget.h" + Moc%27ing GLWidget.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/GLWidget.h" + $(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath) + + + + Moc%27ing DoubleSpinBox.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/DoubleSpinBox.h" + Moc%27ing DoubleSpinBox.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/DoubleSpinBox.h" + $(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath) + + + Moc%27ing SpinBox.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/SpinBox.h" + Moc%27ing SpinBox.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/SpinBox.h" + $(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath) + + + Moc%27ing StealthComboBox.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/StealthComboBox.h" + Moc%27ing StealthComboBox.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/StealthComboBox.h" + $(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath) + + + + %(AdditionalInputs) + + + + + + + %(AdditionalInputs) + + + + + + + + + Moc%27ing TableWidget.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/TableWidget.h" + Moc%27ing TableWidget.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/TableWidget.h" + $(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath) + + + + Moc%27ing Fractorium.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/Fractorium.h" + Moc%27ing Fractorium.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_HELP_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_MBCS "-I." "-I.\PaletteEditor" "-I$(QTDIR)\include" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles" "-I$(ProjectDir)..\..\..\Fractorium\GeneratedFiles\ConfigurationName" "-I$(QTDIR)\..\qtmultimedia\include\QtMultimedia" "-I$(QTDIR)\..\qtmultimedia\include" "-I$(QTDIR)\..\qttools\include" "-I$(QTDIR)\..\qttools\include\QtHelp" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtXml" "-I.\GeneratedFiles" "-I$(ProjectDir)..\..\..\Source\Ember" "-I$(ProjectDir)..\..\..\Source\EmberCL" "-I$(ProjectDir)..\..\..\Source\EmberCommon" "-I$(ProjectDir)..\..\..\Source\Fractorium" "-I$(ProjectDir)..\..\..\..\glm" "-I$(ProjectDir)..\..\..\..\tbb\include" "-I$(ProjectDir)..\..\..\..\libjpeg" "-I$(ProjectDir)..\..\..\..\libpng" "-I$(ProjectDir)..\..\..\..\libxml2\include" "-I$(AMDAPPSDKROOT)\include" "-I$(CUDA_PATH)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-fFractoriumPch.h" "-f../../../../../Source/Fractorium/Fractorium.h" + $(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath) + + + + + + Document + %(FullPath);%(AdditionalInputs) + Rcc%27ing %(Identity)... + .\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp + %(FullPath);%(AdditionalInputs) + Rcc%27ing %(Identity)... + .\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp + Designer + + + + + Document + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + Designer + + + + + {2bdb7a54-bb1a-476b-a6e5-f81e90ad4e67} + + + {f6a9102c-69a9-48fb-bc4b-49e49af43236} + + + + + Document + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + + + + + Document + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + Designer + + + + + Document + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + + + + + + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + + + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + + + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Builds/MSVC/VS2017/Fractorium.vcxproj.filters b/Builds/MSVC/VS2017/Fractorium.vcxproj.filters new file mode 100644 index 0000000..5a528cc --- /dev/null +++ b/Builds/MSVC/VS2017/Fractorium.vcxproj.filters @@ -0,0 +1,489 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;cxx;c;def + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h + + + {99349809-55BA-4b9d-BF79-8FDBB0286EB3} + ui + + + {D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E} + qrc;* + false + + + {71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11} + moc;h;cpp + False + + + {44a6e761-1e1f-46ce-820d-b80d1c0265ae} + cpp;moc + False + + + {cc25f297-1a73-4c08-9b5f-8dad7c7c7452} + cpp;moc + False + + + {d61ea4d8-e7a6-4d86-934e-992611e1c181} + + + {84e24710-0e4f-4aa3-9f74-82cd2a3b39a7} + + + {5555e39d-b8d2-4bac-bf6c-6763228b15bc} + + + {26fa32d9-268c-4021-8398-d40d46344dff} + + + {811962f9-51c1-48ba-a9da-f5ce981aea71} + + + {5ba9fccd-8922-4037-956f-d57177a43700} + + + {30bfa226-b712-471b-a4ff-cf01d10cf1f4} + + + + + Source Files + + + Generated Files + + + Source Files + + + Widgets + + + Widgets + + + Dialogs + + + Dialogs + + + Dialogs + + + MainWindows + + + MainWindows + + + MainWindows + + + MainWindows + + + MainWindows + + + MainWindows + + + MainWindows + + + MainWindows + + + MainWindows + + + MainWindows + + + MainWindows + + + MainWindows + + + Source Files + + + MainWindows + + + Controllers + + + Controllers + + + Controllers + + + Widgets + + + MainWindows + + + MainWindows + + + Dialogs + + + Dialogs\Qss + + + Dialogs\Qss + + + Dialogs\Qss + + + Dialogs\Qss + + + Dialogs\Qss + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Widgets + + + Dialogs\PaletteEditor + + + Generated Files\Debug + + + Generated Files\Release + + + Dialogs\PaletteEditor + + + Generated Files\Debug + + + Generated Files\Release + + + Dialogs\PaletteEditor + + + Generated Files\Debug + + + Generated Files\Release + + + Dialogs\PaletteEditor + + + Generated Files\Debug + + + Generated Files\Release + + + Dialogs\PaletteEditor + + + Generated Files\Debug + + + Generated Files\Release + + + + + Generated Files + + + Glm + + + Header Files + + + Header Files + + + Generated Files + + + Generated Files + + + Generated Files + + + Header Files + + + Controllers + + + Controllers + + + Controllers + + + Header Files + + + Header Files + + + Widgets + + + Generated Files + + + Generated Files + + + Dialogs\Qss + + + Dialogs\Qss + + + Dialogs\PaletteEditor + + + Generated Files + + + + + Resource Files + + + Form Files + + + Form Files + + + Form Files + + + Form Files + + + Widgets + + + Widgets + + + Widgets + + + Dialogs + + + Dialogs + + + Dialogs + + + Widgets + + + MainWindows + + + Widgets + + + Widgets + + + Header Files + + + Widgets + + + Widgets + + + Widgets + + + Form Files + + + Dialogs + + + Form Files + + + Dialogs\Qss + + + Dialogs\Qss + + + Dialogs\Qss + + + Widgets + + + Dialogs\PaletteEditor + + + Dialogs\PaletteEditor + + + Dialogs\PaletteEditor + + + Dialogs\PaletteEditor + + + Dialogs\PaletteEditor + + + Form Files + + + Header Files + + + + + + + + Resource Files + + + \ No newline at end of file diff --git a/Builds/MSVC/VS2017/resource.h b/Builds/MSVC/VS2017/resource.h new file mode 100644 index 0000000..320fe20 --- /dev/null +++ b/Builds/MSVC/VS2017/resource.h @@ -0,0 +1,14 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by EmberCL.rc + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/Builds/MSVC/VS2017/resource1.h b/Builds/MSVC/VS2017/resource1.h new file mode 100644 index 0000000..dad2fe4 --- /dev/null +++ b/Builds/MSVC/VS2017/resource1.h @@ -0,0 +1,14 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Ember.rc + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/Data/Version History.txt b/Data/Version History.txt index d521f72..422b1a1 100644 --- a/Data/Version History.txt +++ b/Data/Version History.txt @@ -1,3 +1,26 @@ +1.0.0.7 11/26/2017 +--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. + -Add a benchmarking suite. + 1.0.0.6 09/02/2017 --Bug fixes -Strips renders crashed. diff --git a/Source/Ember/Ember.h b/Source/Ember/Ember.h index e562725..85a2043 100644 --- a/Source/Ember/Ember.h +++ b/Source/Ember/Ember.h @@ -181,6 +181,19 @@ public: return *this; } + /// + /// Reserve the underlying xforms vector to contain the specified capacity. + /// This should be called at the start of scenarios where xforms are added and their pointers + /// are used in the process. That way no resizing takes place and the pointers remain valid. + /// No action is taken if i is less than the existing capacity. + /// + /// The capacity to reserve + void Reserve(size_t i) + { + if (i > m_Xforms.capacity()) + m_Xforms.reserve(i); + } + /// /// Add a copy of a new xform to the xforms vector. /// @@ -201,6 +214,7 @@ public: for (size_t i = 0; i < count; i++) { Xform xform; + xform.AddVariation(m_VariationList->GetVariationCopy(eVariationId::VAR_LINEAR)); AddXform(xform); } } diff --git a/Source/Ember/EmberDefines.h b/Source/Ember/EmberDefines.h index a57b444..f4fc906 100644 --- a/Source/Ember/EmberDefines.h +++ b/Source/Ember/EmberDefines.h @@ -37,7 +37,7 @@ static void sincos(float x, float* s, float* c) namespace EmberNs { -#define EMBER_VERSION "1.0.0.6" +#define EMBER_VERSION "1.0.0.7" #define EPS6 T(1e-6) #define EPS std::numeric_limits::epsilon()//Apoplugin.h uses -20, but it's more mathematically correct to do it this way. #define ISAAC_SIZE 4 @@ -60,7 +60,7 @@ namespace EmberNs #define XC(c) (reinterpret_cast(c)) #define CX(c) (reinterpret_cast(c)) #define CCX(c) (reinterpret_cast(c)) -#define BadVal(x) (((x) != (x)) || ((x) > 1e10) || ((x) < -1e10)) +#define BadVal(x) (((x) != (x)) || ((x) > 1e20) || ((x) < -1e20)) #define Vlen(x) (sizeof(x) / sizeof(*x)) #define SQR(x) ((x) * (x)) #define CUBE(x) ((x) * (x) * (x)) @@ -72,17 +72,17 @@ namespace EmberNs #define CURVES_LENGTH_M1 65535.0f #define ONE_OVER_CURVES_LENGTH_M1 1.525902189669e-5f #define EMPTYFIELD -9999 -typedef std::chrono::high_resolution_clock Clock; -typedef std::chrono::duration> DoubleMs; -typedef std::chrono::time_point DoubleMsTimePoint; -static inline DoubleMsTimePoint NowMsD() { return time_point_cast(Clock::now()); } -static inline size_t NowMs() { return duration_cast(Clock::now().time_since_epoch()).count(); } typedef uint et; typedef std::lock_guard rlg; /// /// Thin wrapper around getting the current time in milliseconds. /// +typedef std::chrono::high_resolution_clock Clock; +typedef std::chrono::duration> DoubleMs; +typedef std::chrono::time_point DoubleMsTimePoint; +static inline DoubleMsTimePoint NowMsD() { return time_point_cast(Clock::now()); } +static inline size_t NowMs() { return duration_cast(Clock::now().time_since_epoch()).count(); } #ifndef byte typedef unsigned char byte; diff --git a/Source/Ember/EmberToXml.cpp b/Source/Ember/EmberToXml.cpp index 7b7fcc7..bb900d7 100644 --- a/Source/Ember/EmberToXml.cpp +++ b/Source/Ember/EmberToXml.cpp @@ -500,7 +500,8 @@ string EmberToXml::ToString(Xform& xform, size_t xformCount, bool isFinal, if (!doMotion || xform.m_ColorSpeed != EMPTYFIELD) os << "color_speed=\"" << xform.m_ColorSpeed << "\" "; - //os << "symmetry=\"" << fabs(xform.m_ColorSpeed - 1) * 2 << "\" ";//Legacy support. + //Legacy support. + os << "symmetry=\"" << 1 - (xform.m_ColorSpeed * 2) << "\" "; if (!doMotion) { diff --git a/Source/Ember/EmberToXml.h b/Source/Ember/EmberToXml.h index 79425a3..7d2525a 100644 --- a/Source/Ember/EmberToXml.h +++ b/Source/Ember/EmberToXml.h @@ -29,7 +29,7 @@ public: bool Save(const string& filename, Ember& ember, size_t printEditDepth, bool doEdits, bool hexPalette, bool append = false, bool start = false, bool finish = false); template class C> - bool Save(const string& filename, C, Alloc>& embers, size_t printEditDepth, bool doEdits, bool hexPalette, bool append = false, bool start = false, bool finish = false); + bool Save(const string& filename, C, Alloc>& embers, size_t printEditDepth, bool doEdits, bool hexPalette, bool append, bool start, bool finish); string ToString(Ember& ember, const string& extraAttributes, size_t printEditDepth, bool doEdits, bool hexPalette = true); xmlDocPtr CreateNewEditdoc(Ember* parent0, Ember* parent1, const string& action, const string& nick, const string& url, const string& id, const string& comment, intmax_t sheepGen = 0, intmax_t sheepId = 0); diff --git a/Source/Ember/Renderer.cpp b/Source/Ember/Renderer.cpp index e7793dc..330928c 100644 --- a/Source/Ember/Renderer.cpp +++ b/Source/Ember/Renderer.cpp @@ -806,6 +806,12 @@ bool Renderer::Alloc(bool histOnly) } } + if (!m_StandardIterator.get()) + m_StandardIterator = make_unique>(); + + if (!m_XaosIterator.get()) + m_XaosIterator = make_unique>(); + if (lock) LeaveResize(); diff --git a/Source/Ember/SpatialFilter.h b/Source/Ember/SpatialFilter.h index 4419acc..a0fffe1 100644 --- a/Source/Ember/SpatialFilter.h +++ b/Source/Ember/SpatialFilter.h @@ -107,6 +107,14 @@ public: { do { + if (!m_FilterRadius) + { + m_Filter.resize(1); + m_Filter[0] = 1; + m_FinalFilterWidth = 1; + return; + } + T fw = T(2.0) * m_Support * m_Supersample * m_FilterRadius / m_PixelAspectRatio; T adjust, ii, jj; int fwidth = int(fw) + 1; diff --git a/Source/Ember/VarFuncs.h b/Source/Ember/VarFuncs.h index db9de8a..c2449f3 100644 --- a/Source/Ember/VarFuncs.h +++ b/Source/Ember/VarFuncs.h @@ -186,6 +186,21 @@ public: return static_cast(temp); } + /// + /// Integer hash function from http://burtleburtle.net/bob/hash/integer.html + /// + /// The value to hash + /// The hashed value + static T Hash(int a) + { + a = (a ^ 61) ^ (a >> 16); + a = a + (a << 3); + a = a ^ (a >> 4); + a = a * 0x27d4eb2d; + a = a ^ (a >> 15); + return (T)a / std::numeric_limits::max(); + } + /// /// Retrieve information about a piece of shared data by looking /// up its name. diff --git a/Source/Ember/Variation.h b/Source/Ember/Variation.h index 53ed956..b4a210b 100644 --- a/Source/Ember/Variation.h +++ b/Source/Ember/Variation.h @@ -39,12 +39,16 @@ enum class eVariationAssignType : et ASSIGNTYPE_SUM }; +#define WEIGHT_PREFIX "parVars[WEIGHT_" + /// /// Complete list of every variation class ID. /// enum class eVariationId : et { VAR_ARCH, + //VAR_ARCSINH, + //VAR_ARCTANH, VAR_AUGER , VAR_BARYCENTROID, VAR_BCIRCLE , @@ -90,6 +94,7 @@ enum class eVariationId : et VAR_CIRCLIZE2 , VAR_CIRCUS, VAR_COLLIDEOSCOPE, + VAR_CONCENTRIC , VAR_CONIC , VAR_COS , VAR_COS_WRAP , @@ -103,6 +108,7 @@ enum class eVariationId : et VAR_COTQ , VAR_CPOW , VAR_CPOW2 , + VAR_CPOW3 , VAR_CRACKLE , VAR_CRESCENTS , VAR_CROB , @@ -180,6 +186,8 @@ enum class eVariationId : et VAR_HANDKERCHIEF, VAR_HEART , VAR_HEAT, + VAR_HELICOID, + VAR_HELIX, VAR_HEMISPHERE , VAR_HEXAPLAY3D , VAR_HEXCROP , @@ -275,6 +283,7 @@ enum class eVariationId : et VAR_PSPHERE , VAR_Q_ODE, VAR_RADIAL_BLUR , + VAR_RAND_CUBES , VAR_RATIONAL3 , VAR_RAYS , VAR_RBLUR, @@ -309,6 +318,7 @@ enum class eVariationId : et VAR_SINUSOIDAL , VAR_SINUSOIDAL3D, //VAR_SMARTCROP , + VAR_SPHEREBLUR , VAR_SPHERICAL , VAR_SPHERICAL3D , VAR_SPHERICALN , @@ -376,6 +386,8 @@ enum class eVariationId : et VAR_ZTRANSLATE, VAR_PRE_ARCH, + //VAR_PRE_ARCSINH, + //VAR_PRE_ARCTANH, VAR_PRE_AUGER, VAR_PRE_BARYCENTROID, VAR_PRE_BCIRCLE, @@ -421,6 +433,7 @@ enum class eVariationId : et VAR_PRE_CIRCLIZE2, VAR_PRE_CIRCUS, VAR_PRE_COLLIDEOSCOPE, + VAR_PRE_CONCENTRIC, VAR_PRE_CONIC, VAR_PRE_COS, VAR_PRE_COS_WRAP, @@ -434,6 +447,7 @@ enum class eVariationId : et VAR_PRE_COTQ, VAR_PRE_CPOW, VAR_PRE_CPOW2, + VAR_PRE_CPOW3, VAR_PRE_CRACKLE, VAR_PRE_CRESCENTS, VAR_PRE_CROB, @@ -511,6 +525,8 @@ enum class eVariationId : et VAR_PRE_HANDKERCHIEF, VAR_PRE_HEART, VAR_PRE_HEAT, + VAR_PRE_HELICOID, + VAR_PRE_HELIX, VAR_PRE_HEMISPHERE, VAR_PRE_HEXAPLAY3D, VAR_PRE_HEXCROP, @@ -606,6 +622,7 @@ enum class eVariationId : et VAR_PRE_PSPHERE, VAR_PRE_Q_ODE, VAR_PRE_RADIAL_BLUR, + VAR_PRE_RAND_CUBES, VAR_PRE_RATIONAL3, VAR_PRE_RAYS, VAR_PRE_RBLUR, @@ -640,6 +657,7 @@ enum class eVariationId : et VAR_PRE_SINUSOIDAL, VAR_PRE_SINUSOIDAL3D, //VAR_PRE_SMARTCROP, + VAR_PRE_SPHEREBLUR, VAR_PRE_SPHERICAL, VAR_PRE_SPHERICAL3D, VAR_PRE_SPHERICALN, @@ -707,6 +725,8 @@ enum class eVariationId : et VAR_PRE_ZTRANSLATE, VAR_POST_ARCH, + //VAR_POST_ARCSINH, + //VAR_POST_ARCTANH, VAR_POST_AUGER, VAR_POST_BARYCENTROID, VAR_POST_BCIRCLE, @@ -752,6 +772,7 @@ enum class eVariationId : et VAR_POST_CIRCLIZE2, VAR_POST_CIRCUS, VAR_POST_COLLIDEOSCOPE, + VAR_POST_CONCENTRIC, VAR_POST_CONIC, VAR_POST_COS, VAR_POST_COS_WRAP, @@ -765,6 +786,7 @@ enum class eVariationId : et VAR_POST_COTQ, VAR_POST_CPOW, VAR_POST_CPOW2, + VAR_POST_CPOW3, VAR_POST_CRACKLE, VAR_POST_CRESCENTS, VAR_POST_CROB, @@ -842,6 +864,8 @@ enum class eVariationId : et VAR_POST_HANDKERCHIEF, VAR_POST_HEART, VAR_POST_HEAT, + VAR_POST_HELICOID, + VAR_POST_HELIX, VAR_POST_HEMISPHERE, VAR_POST_HEXAPLAY3D, VAR_POST_HEXCROP, @@ -937,6 +961,7 @@ enum class eVariationId : et VAR_POST_PSPHERE, VAR_POST_Q_ODE, VAR_POST_RADIAL_BLUR, + VAR_POST_RAND_CUBES, VAR_POST_RATIONAL3, VAR_POST_RAYS, VAR_POST_RBLUR, @@ -971,6 +996,7 @@ enum class eVariationId : et VAR_POST_SINUSOIDAL, VAR_POST_SINUSOIDAL3D, VAR_POST_SMARTCROP, + VAR_POST_SPHEREBLUR, VAR_POST_SPHERICAL, VAR_POST_SPHERICAL3D, VAR_POST_SPHERICALN, @@ -1472,6 +1498,11 @@ protected: return m_VarType == eVariationType::VARTYPE_REG ? "0;\n" : (m_PrePostAssignType == eVariationAssignType::ASSIGNTYPE_SET ? "vIn.z;\n" : "0;\n"); } + string WeightDefineString() const + { + return WEIGHT_PREFIX + std::to_string(XformIndexInEmber()) + "_" + std::to_string(IndexInXform()) + "]"; + } + Xform* m_Xform;//The parent Xform that this variation is a child of. eVariationId m_VariationId;//The unique ID of this variation. string m_Name;//The unique name of this variation. diff --git a/Source/Ember/VariationList.cpp b/Source/Ember/VariationList.cpp index 42af5ad..f957e1d 100644 --- a/Source/Ember/VariationList.cpp +++ b/Source/Ember/VariationList.cpp @@ -351,6 +351,11 @@ VariationList::VariationList() ADDPREPOSTREGVAR(Waves2Radial) ADDPREPOSTREGVAR(Panorama1) ADDPREPOSTREGVAR(Panorama2) + ADDPREPOSTREGVAR(Helicoid) + ADDPREPOSTREGVAR(Helix) + ADDPREPOSTREGVAR(Sphereblur) + ADDPREPOSTREGVAR(Cpow3) + ADDPREPOSTREGVAR(Concentric) //ADDPREPOSTREGVAR(LinearXZ) //ADDPREPOSTREGVAR(LinearYZ) //DC are special. @@ -363,6 +368,7 @@ VariationList::VariationList() ADDPREPOSTREGVAR(DCPerlin) ADDPREPOSTREGVAR(DCTriangle) ADDPREPOSTREGVAR(DCZTransl) + ADDPREPOSTREGVAR(RandCubes) for (auto var : m_Variations) const_cast*>(var)->Precalc();//Modify once here, then const after this. diff --git a/Source/Ember/Variations01.h b/Source/Ember/Variations01.h index 575bf92..31b5fe2 100644 --- a/Source/Ember/Variations01.h +++ b/Source/Ember/Variations01.h @@ -32,11 +32,12 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.x = " << weight << " * vIn.x;\n" + << "\t\tvOut.y = " << weight << " * vIn.y;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -67,11 +68,12 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sin(vIn.x);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sin(vIn.y);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.x = " << weight << " * sin(vIn.x);\n" + << "\t\tvOut.y = " << weight << " * sin(vIn.y);\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -104,13 +106,14 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\treal_t r2 = xform->m_VariationWeights[" << varIndex << "] / Zeps(precalcSumSquares);\n" + << "\t\treal_t r2 = " << weight << " / Zeps(precalcSumSquares);\n" << "\n" << "\t\tvOut.x = r2 * vIn.x;\n" << "\t\tvOut.y = r2 * vIn.y;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -151,14 +154,15 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t c1 = sin(precalcSumSquares);\n" << "\t\treal_t c2 = cos(precalcSumSquares);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (c1 * vIn.x - c2 * vIn.y);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (c2 * vIn.x + c1 * vIn.y);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.x = " << weight << " * (c1 * vIn.x - c2 * vIn.y);\n" + << "\t\tvOut.y = " << weight << " * (c2 * vIn.x + c1 * vIn.y);\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -193,13 +197,14 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / Zeps(precalcSqrtSumSquares);\n" + << "\t\treal_t r = " << weight << " / Zeps(precalcSqrtSumSquares);\n" << "\n" << "\t\tvOut.x = (vIn.x - vIn.y) * (vIn.x + vIn.y) * r;\n" << "\t\tvOut.y = (real_t)(2.0) * vIn.x * vIn.y * r;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -235,11 +240,12 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (precalcAtanxy * M1PI);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (precalcSqrtSumSquares - (real_t)(1.0));\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.x = " << weight << " * (precalcAtanxy * M1PI);\n" + << "\t\tvOut.y = " << weight << " * (precalcSqrtSumSquares - (real_t)(1.0));\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -270,10 +276,11 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares * sin(precalcAtanxy + precalcSqrtSumSquares);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares * cos(precalcAtanxy - precalcSqrtSumSquares);\n" + << "\t\tvOut.x = " << weight << " * precalcSqrtSumSquares * sin(precalcAtanxy + precalcSqrtSumSquares);\n" + << "\t\tvOut.y = " << weight << " * precalcSqrtSumSquares * cos(precalcAtanxy - precalcSqrtSumSquares);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -308,10 +315,11 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t a = precalcSqrtSumSquares * precalcAtanxy;\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares;\n" + << "\t\treal_t r = " << weight << " * precalcSqrtSumSquares;\n" << "\n" << "\t\tvOut.x = r * sin(a);\n" << "\t\tvOut.y = (-r) * cos(a);\n" @@ -356,6 +364,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string weightByPI = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params. ss << "\t{\n" << "\t\treal_t val = MPI * precalcSqrtSumSquares;\n" @@ -363,7 +372,7 @@ public: << "\n" << "\t\tvOut.x = sin(val) * r;\n" << "\t\tvOut.y = cos(val) * r;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -412,14 +421,15 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t r = Zeps(precalcSqrtSumSquares);\n" - << "\t\treal_t r1 = xform->m_VariationWeights[" << varIndex << "] / r;\n" + << "\t\treal_t r1 = " << weight << " / r;\n" << "\n" << "\t\tvOut.x = r1 * (precalcCosa + sin(r));\n" << "\t\tvOut.y = r1 * (precalcSina - cos(r));\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -456,13 +466,14 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t r = Zeps(precalcSqrtSumSquares);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * precalcSina / r;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * precalcCosa * r;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.x = " << weight << " * precalcSina / r;\n" + << "\t\tvOut.y = " << weight << " * precalcCosa * r;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -498,10 +509,11 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * precalcSina * cos(precalcSqrtSumSquares);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * precalcCosa * sin(precalcSqrtSumSquares);\n" + << "\t\tvOut.x = " << weight << " * precalcSina * cos(precalcSqrtSumSquares);\n" + << "\t\tvOut.y = " << weight << " * precalcCosa * sin(precalcSqrtSumSquares);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -543,6 +555,7 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t a = precalcAtanxy;\n" @@ -552,8 +565,8 @@ public: << "\t\treal_t m0 = n0 * n0 * n0 * r;\n" << "\t\treal_t m1 = n1 * n1 * n1 * r;\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (m0 + m1);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (m0 - m1);\n" + << "\t\tvOut.x = " << weight << " * (m0 + m1);\n" + << "\t\tvOut.y = " << weight << " * (m0 - m1);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -594,9 +607,10 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * sqrt(precalcSqrtSumSquares);\n" + << "\t\treal_t r = " << weight << " * sqrt(precalcSqrtSumSquares);\n" << "\t\treal_t a = (real_t)(0.5) * precalcAtanxy;\n" << "\n" << "\t\tif (MwcNext(mwc) & 1)\n" @@ -639,13 +653,14 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t nx = vIn.x < (real_t)(0.0) ? (vIn.x * (real_t)(2.0)) : vIn.x;\n" << "\t\treal_t ny = vIn.y < (real_t)(0.0) ? (vIn.y / (real_t)(2.0)) : vIn.y;\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * nx;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * ny;\n" + << "\t\tvOut.x = " << weight << " * nx;\n" + << "\t\tvOut.y = " << weight << " * ny;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -690,6 +705,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string dx2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params. string dy2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" @@ -698,8 +714,8 @@ public: << "\t\treal_t nx = vIn.x + c10 * sin(vIn.y * " << dx2 << ");\n" << "\t\treal_t ny = vIn.y + c11 * sin(vIn.x * " << dy2 << ");\n" << "\n" - << "\t\tvOut.x = (xform->m_VariationWeights[" << varIndex << "] * nx);\n" - << "\t\tvOut.y = (xform->m_VariationWeights[" << varIndex << "] * ny);\n" + << "\t\tvOut.x = (" << weight << " * nx);\n" + << "\t\tvOut.y = (" << weight << " * ny);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -759,9 +775,10 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\treal_t r = 2 * xform->m_VariationWeights[" << varIndex << "] / (precalcSqrtSumSquares + 1);\n" + << "\t\treal_t r = 2 * " << weight << " / (precalcSqrtSumSquares + 1);\n" << "\n" << "\t\tvOut.x = r * vIn.y;\n" << "\t\tvOut.y = r * vIn.x;\n" @@ -802,6 +819,7 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t dx = tan(3 * vIn.y);\n" @@ -809,8 +827,8 @@ public: << "\t\treal_t nx = vIn.x + xform->m_C * sin(dx);\n" << "\t\treal_t ny = vIn.y + xform->m_F * sin(dy);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * nx;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * ny;\n" + << "\t\tvOut.x = " << weight << " * nx;\n" + << "\t\tvOut.y = " << weight << " * ny;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -846,9 +864,10 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\treal_t dx = xform->m_VariationWeights[" << varIndex << "] * exp(vIn.x - (real_t)(1.0));\n" + << "\t\treal_t dx = " << weight << " * exp(vIn.x - (real_t)(1.0));\n" << "\t\treal_t dy = MPI * vIn.y;\n" << "\n" << "\t\tvOut.x = dx * cos(dy);\n" @@ -889,9 +908,10 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * pow(precalcSqrtSumSquares, precalcSina);\n" + << "\t\treal_t r = " << weight << " * pow(precalcSqrtSumSquares, precalcSina);\n" << "\n" << "\t\tvOut.x = r * precalcCosa;\n" << "\t\tvOut.y = r * precalcSina;\n" @@ -929,14 +949,15 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t a = vIn.x * MPI;\n" << "\t\treal_t nx = cos(a) * cosh(vIn.y);\n" << "\t\treal_t ny = -sin(a) * sinh(vIn.y);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * nx;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * ny;\n" + << "\t\tvOut.x = " << weight << " * nx;\n" + << "\t\tvOut.y = " << weight << " * ny;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -976,12 +997,13 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t dx = Zeps(xform->m_C * xform->m_C);\n" << "\t\treal_t r = precalcSqrtSumSquares;\n" << "\n" - << "\t\tr = xform->m_VariationWeights[" << varIndex << "] * (fmod(r + dx, 2 * dx) - dx + r * (1 - dx));\n" + << "\t\tr = " << weight << " * (fmod(r + dx, 2 * dx) - dx + r * (1 - dx));\n" << "\t\tvOut.x = r * precalcCosa;\n" << "\t\tvOut.y = r * precalcSina;\n" << "\t\tvOut.z = " << DefaultZCl() @@ -1033,13 +1055,14 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t dx = MPI * Zeps(xform->m_C * xform->m_C);\n" << "\t\treal_t dy = xform->m_F;\n" << "\t\treal_t dx2 = (real_t)(0.5) * dx;\n" << "\t\treal_t a = precalcAtanxy + ((fmod(precalcAtanxy + dy, dx) > dx2) ? -dx2 : dx2);\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares;\n" + << "\t\treal_t r = " << weight << " * precalcSqrtSumSquares;\n" << "\n" << "\t\tvOut.x = r * cos(a);\n" << "\t\tvOut.y = r * sin(a);\n" @@ -1090,15 +1113,16 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string blobLow = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string blobHigh = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string blobLow = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string blobHigh = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string blobWaves = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string blobDiff = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string blobDiff = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t r = precalcSqrtSumSquares * (" << blobLow << " + " << blobDiff << " * ((real_t)(0.5) + (real_t)(0.5) * sin(" << blobWaves << " * precalcAtanxy)));\n" << "\n" - << "\t\tvOut.x = (xform->m_VariationWeights[" << varIndex << "] * precalcSina * r);\n" - << "\t\tvOut.y = (xform->m_VariationWeights[" << varIndex << "] * precalcCosa * r);\n" + << "\t\tvOut.x = (" << weight << " * precalcSina * r);\n" + << "\t\tvOut.y = (" << weight << " * precalcCosa * r);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -1111,8 +1135,8 @@ public: virtual void Random(QTIsaac& rand) override { - m_BlobLow = T(0.2) + T(0.5) * rand.Frand01(); - m_BlobHigh = T(0.8) + T(0.4) * rand.Frand01(); + m_BlobLow = T(0.2) + T(0.5) * rand.Frand01(); + m_BlobHigh = T(0.8) + T(0.4) * rand.Frand01(); m_BlobWaves = T(int(2 + 5 * rand.Frand01())); } @@ -1121,8 +1145,8 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_BlobLow, prefix + "blob_low")); - m_Params.push_back(ParamWithName(&m_BlobHigh, prefix + "blob_high", 1)); + m_Params.push_back(ParamWithName(&m_BlobLow, prefix + "blob_low")); + m_Params.push_back(ParamWithName(&m_BlobHigh, prefix + "blob_high", 1)); m_Params.push_back(ParamWithName(&m_BlobWaves, prefix + "blob_waves", 1)); m_Params.push_back(ParamWithName(true, &m_BlobDiff, prefix + "blob_diff"));//Precalc. } @@ -1172,6 +1196,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string pdjA = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string pdjB = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string pdjC = "parVars[" + ToUpper(m_Params[i++].Name()) + index; @@ -1182,9 +1207,9 @@ public: << "\t\treal_t ny1 = sin(" << pdjA << " * vIn.y)" << ";\n" << "\t\treal_t ny2 = cos(" << pdjD << " * vIn.y)" << ";\n" << "\n" - << "\t\tvOut.x = (xform->m_VariationWeights[" << varIndex << "] * (ny1 - nx1));\n" - << "\t\tvOut.y = (xform->m_VariationWeights[" << varIndex << "] * (nx2 - ny2));\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.x = (" << weight << " * (ny1 - nx1));\n" + << "\t\tvOut.y = (" << weight << " * (nx2 - ny2));\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -1270,13 +1295,14 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string fan2X = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string fan2Y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string dx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string dx2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string dx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string dx2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t a = precalcAtanxy;\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares;\n" + << "\t\treal_t r = " << weight << " * precalcSqrtSumSquares;\n" << "\t\treal_t t = a + " << fan2Y << " - " << dx << " * (int)((a + " << fan2Y << ") / " << dx << ");\n" << "\n" << "\t\tif (t > " << dx2 << ")\n" @@ -1286,7 +1312,7 @@ public: << "\n" << "\t\tvOut.x = r * sin(a);\n" << "\t\tvOut.y = r * cos(a);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -1310,7 +1336,7 @@ protected: m_Params.clear(); m_Params.push_back(ParamWithName(&m_Fan2X, prefix + "fan2_x")); m_Params.push_back(ParamWithName(&m_Fan2Y, prefix + "fan2_y")); - m_Params.push_back(ParamWithName(true, &m_Fan2Dx, prefix + "fan2_dx"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_Fan2Dx, prefix + "fan2_dx"));//Precalc. m_Params.push_back(ParamWithName(true, &m_Fan2Dx2, prefix + "fan2_dx2")); } @@ -1357,15 +1383,16 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string rings2Val = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string rings2Val = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string rings2Val2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t r = precalcSqrtSumSquares;\n" << "\n" << "\t\tr += -(real_t)(2.0) * " << rings2Val2 << " * (int)((r + " << rings2Val2 << ") / ((real_t)(2.0) * " << rings2Val2 << ")) + r * ((real_t)(1.0) - " << rings2Val2 << ");\n" - << "\t\tvOut.x = (xform->m_VariationWeights[" << varIndex << "] * precalcSina * r);\n" - << "\t\tvOut.y = (xform->m_VariationWeights[" << varIndex << "] * precalcCosa * r);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.x = (" << weight << " * precalcSina * r);\n" + << "\t\tvOut.y = (" << weight << " * precalcCosa * r);\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -1419,13 +1446,14 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\treal_t r = (xform->m_VariationWeights[" << varIndex << "] * (real_t)(2.0)) / (precalcSqrtSumSquares + (real_t)(1.0));\n" + << "\t\treal_t r = (" << weight << " * (real_t)(2.0)) / (precalcSqrtSumSquares + (real_t)(1.0));\n" << "\n" << "\t\tvOut.x = r * vIn.x;\n" << "\t\tvOut.y = r * vIn.y;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -1454,14 +1482,15 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t denom = (real_t)(0.25) * precalcSumSquares + 1;\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / denom;\n" + << "\t\treal_t r = " << weight << " / denom;\n" << "\n" << "\t\tvOut.x = r * vIn.x;\n" << "\t\tvOut.y = r * vIn.y;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * (2 / Zeps(denom - 1));\n" + << "\t\tvOut.z = " << weight << " * (2 / Zeps(denom - 1));\n" << "\t}\n"; return ss.str(); } @@ -1493,11 +1522,12 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sin(vIn.x);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * cos(vIn.x);\n" + << "\t\tvOut.x = " << weight << " * sin(vIn.x);\n" + << "\t\tvOut.y = " << weight << " * vIn.y;\n" + << "\t\tvOut.z = " << weight << " * cos(vIn.x);\n" << "\t}\n"; return ss.str(); } @@ -1532,16 +1562,17 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string angle = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Params. - string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string vSin = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. + string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string vSin = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. string vfCos = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t d = Zeps(" << dist << " - vIn.y * " << vSin << ");\n" << "\t\treal_t t = (real_t)(1.0) / d;\n" << "\n" - << "\t\tvOut.x = (xform->m_VariationWeights[" << varIndex << "] * " << dist << " * vIn.x * t);\n" - << "\t\tvOut.y = (xform->m_VariationWeights[" << varIndex << "] * " << vfCos << " * vIn.y * t);\n" + << "\t\tvOut.x = (" << weight << " * " << dist << " * vIn.x * t);\n" + << "\t\tvOut.y = (" << weight << " * " << vfCos << " * vIn.y * t);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -1571,8 +1602,8 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Angle, prefix + "perspective_angle"));//Params. - m_Params.push_back(ParamWithName(&m_Dist, prefix + "perspective_dist")); - m_Params.push_back(ParamWithName(true, &m_Vsin, prefix + "perspective_vsin"));//Precalc. + m_Params.push_back(ParamWithName(&m_Dist, prefix + "perspective_dist")); + m_Params.push_back(ParamWithName(true, &m_Vsin, prefix + "perspective_vsin"));//Precalc. m_Params.push_back(ParamWithName(true, &m_VfCos, prefix + "perspective_vfcos")); } @@ -1606,14 +1637,15 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t tempr = MwcNext01(mwc) * M_2PI;\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * MwcNext01(mwc);\n" + << "\t\treal_t r = " << weight << " * MwcNext01(mwc);\n" << "\n" << "\t\tvOut.x = vIn.x * r * cos(tempr);\n" << "\t\tvOut.y = vIn.y * r * sin(tempr);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -1648,18 +1680,19 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Params. + string weight = WeightDefineString(); + string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Params. string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rn = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. - string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rn = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. + string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tint tRnd = (int)(" << rn << " * MwcNext01(mwc));\n" << "\t\treal_t tempr = (precalcAtanyx + M_2PI * tRnd) / " << power << ";\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * pow(precalcSumSquares, " << cn << ");\n" + << "\t\treal_t r = " << weight << " * pow(precalcSumSquares, " << cn << ");\n" << "\n" << "\t\tvOut.x = r * cos(tempr);\n" << "\t\tvOut.y = r * sin(tempr);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -1682,7 +1715,7 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Dist, prefix + "julian_dist", 1));//Params. + m_Params.push_back(ParamWithName(&m_Dist, prefix + "julian_dist", 1));//Params. m_Params.push_back(ParamWithName(&m_Power, prefix + "julian_power", 1, eParamType::INTEGER_NONZERO)); m_Params.push_back(ParamWithName(true, &m_Rn, prefix + "julian_rn"));//Precalc. m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "julian_cn")); @@ -1739,10 +1772,11 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Params. + string weight = WeightDefineString(); + string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Params. string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rn = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. - string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rn = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. + string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tint rnd = (int)(" << rn << " * MwcNext01(mwc));\n" << "\t\treal_t tempr, r;\n" @@ -1752,11 +1786,11 @@ public: << "\t\telse\n" << "\t\t tempr = (M_2PI * rnd - precalcAtanyx) / " << power << ";\n" << "\n" - << "\t\tr = xform->m_VariationWeights[" << varIndex << "] * pow(precalcSumSquares, " << cn << ");\n" + << "\t\tr = " << weight << " * pow(precalcSumSquares, " << cn << ");\n" << "\n" << "\t\tvOut.x = r * cos(tempr);\n" << "\t\tvOut.y = r * sin(tempr);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; //ss << "\t{\n" // << "\t\tint rnd = (int)(" << rn << " * MwcNext01(mwc));\n" @@ -1767,11 +1801,11 @@ public: // << "\t\telse\n" // << "\t\t tempr = (2 * M_PI * (int)(" << rn << " * MwcNext01(mwc)) - precalcAtanyx) / " << power << ";\n" // << "\n" - // << "\t\tr = xform->m_VariationWeights[" << varIndex << "] * pow(precalcSumSquares, " << cn << ");\n" + // << "\t\tr = " << weight << " * pow(precalcSumSquares, " << cn << ");\n" // << "\n" // << "\t\tvOut.x = r * cos(tempr);\n" // << "\t\tvOut.y = r * sin(tempr);\n" - // << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + // << "\t\tvOut.z = " << weight << " * vIn.z;\n" // << "\t}\n"; return ss.str(); } @@ -1793,7 +1827,7 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Dist, prefix + "juliascope_dist", 1));//Params. + m_Params.push_back(ParamWithName(&m_Dist, prefix + "juliascope_dist", 1));//Params. m_Params.push_back(ParamWithName(&m_Power, prefix + "juliascope_power", 1, eParamType::REAL_NONZERO)); m_Params.push_back(ParamWithName(true, &m_Rn, prefix + "juliascope_rn"));//Precalc. m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "juliascope_cn")); @@ -1832,14 +1866,15 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t tmpr = MwcNext01(mwc) * M_2PI;\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * MwcNext01(mwc);\n" + << "\t\treal_t r = " << weight << " * MwcNext01(mwc);\n" << "\n" << "\t\tvOut.x = r * cos(tmpr);\n" << "\t\tvOut.y = r * sin(tmpr);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -1868,14 +1903,15 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t angle = MwcNext01(mwc) * M_2PI;\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - (real_t)(2.0));\n" + << "\t\treal_t r = " << weight << " * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - (real_t)(2.0));\n" << "\n" << "\t\tvOut.x = r * cos(angle);\n" << "\t\tvOut.y = r * sin(angle);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -1915,18 +1951,19 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string angle = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Params. - string spin = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. - string zoom = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string spin = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. + string zoom = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\treal_t rndG = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - (real_t)(2.0));\n" + << "\t\treal_t rndG = " << weight << " * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - (real_t)(2.0));\n" << "\t\treal_t ra = precalcSqrtSumSquares;\n" << "\t\treal_t tempa = precalcAtanyx + " << spin << " * rndG;\n" << "\t\treal_t rz = " << zoom << " * rndG - 1;\n" << "\n" << "\t\tvOut.x = ra * cos(tempa) + rz * vIn.x;\n" << "\t\tvOut.y = ra * sin(tempa) + rz * vIn.y;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -1987,14 +2024,15 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string slices = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rotation = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string slices = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rotation = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string thickness = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string pi2Slices = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tint sl = (int)(MwcNext01(mwc) * " << slices << " + (real_t)(0.5));\n" << "\t\treal_t a = " << rotation << " + " << pi2Slices << " * (sl + " << thickness << " * MwcNext01(mwc));\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * MwcNext01(mwc);\n" + << "\t\treal_t r = " << weight << " * MwcNext01(mwc);\n" << "\n" << "\t\tvOut.x = r * cos(a);\n" << "\t\tvOut.y = r * sin(a);\n" @@ -2020,8 +2058,8 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Slices, prefix + "pie_slices", 6, eParamType::INTEGER_NONZERO, 1)); - m_Params.push_back(ParamWithName(&m_Rotation, prefix + "pie_rotation", T(0.5), eParamType::REAL_CYCLIC, 0, M_2PI)); + m_Params.push_back(ParamWithName(&m_Slices, prefix + "pie_slices", 6, eParamType::INTEGER_NONZERO, 1)); + m_Params.push_back(ParamWithName(&m_Rotation, prefix + "pie_rotation", T(0.5), eParamType::REAL_CYCLIC, 0, M_2PI)); m_Params.push_back(ParamWithName(&m_Thickness, prefix + "pie_thickness", T(0.5), eParamType::REAL, 0, 1)); m_Params.push_back(ParamWithName(true, &m_Pi2Slices, prefix + "pie_pi2_slices")); } @@ -2073,13 +2111,14 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string sides = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string circle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string corners = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string csides = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string sides = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string circle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string corners = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string csides = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string csidesinv = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cpower = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cpower = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t rFactor;\n" << "\n" @@ -2093,11 +2132,11 @@ public: << "\t\tif (phi > (real_t)(0.5) * " << csides << ")\n" << "\t\t phi -= " << csides << ";\n" << "\n" - << "\t\treal_t amp = (" << corners << " * (1 / cos(phi) - 1) + " << circle << ") * xform->m_VariationWeights[" << varIndex << "] * rFactor;\n" + << "\t\treal_t amp = (" << corners << " * (1 / cos(phi) - 1) + " << circle << ") * " << weight << " * rFactor;\n" << "\n" << "\t\tvOut.x = amp * vIn.x;\n" << "\t\tvOut.y = amp * vIn.y;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -2122,13 +2161,13 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Sides, prefix + "ngon_sides", 5, eParamType::INTEGER_NONZERO)); - m_Params.push_back(ParamWithName(&m_Power, prefix + "ngon_power", 3)); - m_Params.push_back(ParamWithName(&m_Circle, prefix + "ngon_circle", 1)); + m_Params.push_back(ParamWithName(&m_Sides, prefix + "ngon_sides", 5, eParamType::INTEGER_NONZERO)); + m_Params.push_back(ParamWithName(&m_Power, prefix + "ngon_power", 3)); + m_Params.push_back(ParamWithName(&m_Circle, prefix + "ngon_circle", 1)); m_Params.push_back(ParamWithName(&m_Corners, prefix + "ngon_corners", 2)); - m_Params.push_back(ParamWithName(true, &m_CSides, prefix + "ngon_csides")); + m_Params.push_back(ParamWithName(true, &m_CSides, prefix + "ngon_csides")); m_Params.push_back(ParamWithName(true, &m_CSidesInv, prefix + "ngon_csides_inv")); - m_Params.push_back(ParamWithName(true, &m_CPower, prefix + "ngon_cpower")); + m_Params.push_back(ParamWithName(true, &m_CPower, prefix + "ngon_cpower")); } private: @@ -2174,13 +2213,14 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string c1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string c1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string c22 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t re = (real_t)(1.0) + " << c1 << " * vIn.x + " << c2 << " * (SQR(vIn.x) - SQR(vIn.y));\n" << "\t\treal_t im = " << c1 << " * vIn.y + " << c22 << " * vIn.x * vIn.y;\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / Zeps(SQR(re) + SQR(im));\n" + << "\t\treal_t r = " << weight << " / Zeps(SQR(re) + SQR(im));\n" << "\n" << "\t\tvOut.x = (vIn.x * re + vIn.y * im) * r;\n" << "\t\tvOut.y = (vIn.y * re - vIn.x * im) * r;\n" @@ -2256,20 +2296,21 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tif (" << x << " == 0)\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" << "\t\telse\n" - << "\t\t vOut.x = (xform->m_VariationWeights[" << varIndex << "] * ((2 * floor(vIn.x / " << x << ") + 1) * " << x << " - vIn.x));\n" + << "\t\t vOut.x = (" << weight << " * ((2 * floor(vIn.x / " << x << ") + 1) * " << x << " - vIn.x));\n" << "\n" << "\t\tif (" << y << " == 0)\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\telse\n" - << "\t\t vOut.y = (xform->m_VariationWeights[" << varIndex << "] * ((2 * floor(vIn.y / " << y << ") + 1) * " << y << " - vIn.y));\n" + << "\t\t vOut.y = (" << weight << " * ((2 * floor(vIn.y / " << y << ") + 1) * " << y << " - vIn.y));\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -2318,14 +2359,15 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\treal_t angle = MwcNext01(mwc) * xform->m_VariationWeights[" << varIndex << "] * MPI;\n" + << "\t\treal_t angle = MwcNext01(mwc) * " << weight << " * MPI;\n" << "\t\treal_t sinr = sin(angle);\n" << "\t\treal_t cosr = cos(angle);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sinr;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (sinr * sinr) / cosr;\n" + << "\t\tvOut.x = " << weight << " * sinr;\n" + << "\t\tvOut.y = " << weight << " * (sinr * sinr) / cosr;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -2353,10 +2395,11 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sin(vIn.x) / cos(vIn.y);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * tan(vIn.y);\n" + << "\t\tvOut.x = " << weight << " * sin(vIn.x) / cos(vIn.y);\n" + << "\t\tvOut.y = " << weight << " * tan(vIn.y);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -2384,11 +2427,12 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) - (real_t)(0.5));\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) - (real_t)(0.5));\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.x = " << weight << " * (MwcNext01(mwc) - (real_t)(0.5));\n" + << "\t\tvOut.y = " << weight << " * (MwcNext01(mwc) - (real_t)(0.5));\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -2418,11 +2462,12 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\treal_t ang = xform->m_VariationWeights[" << varIndex << "] * MwcNext01(mwc) * MPI;\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / Zeps(precalcSumSquares);\n" - << "\t\treal_t tanr = xform->m_VariationWeights[" << varIndex << "] * tan(ang) * r;\n" + << "\t\treal_t ang = " << weight << " * MwcNext01(mwc) * MPI;\n" + << "\t\treal_t r = " << weight << " / Zeps(precalcSumSquares);\n" + << "\t\treal_t tanr = " << weight << " * tan(ang) * r;\n" << "\n" << "\t\tvOut.x = tanr * cos(vIn.x);\n" << "\t\tvOut.y = tanr * sin(vIn.y);\n" @@ -2461,14 +2506,15 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\treal_t r = MwcNext01(mwc) * xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares;\n" + << "\t\treal_t r = MwcNext01(mwc) * " << weight << " * precalcSqrtSumSquares;\n" << "\t\treal_t sinr = sin(r);\n" << "\t\treal_t cosr = cos(r);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x * (cosr + sinr);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.x * (cosr - sinr);\n" + << "\t\tvOut.x = " << weight << " * vIn.x * (cosr + sinr);\n" + << "\t\tvOut.y = " << weight << " * vIn.x * (cosr - sinr);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -2504,18 +2550,19 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares;\n" + << "\t\treal_t r = " << weight << " * precalcSqrtSumSquares;\n" << "\t\treal_t cr = cos(r);\n" << "\t\treal_t icr = (real_t)(1.0) / cr;\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" + << "\t\tvOut.x = " << weight << " * vIn.x;\n" << "\n" << "\t\tif (cr < (real_t)(0.0))\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (icr + (real_t)(1.0));\n" + << "\t\t vOut.y = " << weight << " * (icr + (real_t)(1.0));\n" << "\t\telse\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (icr - (real_t)(1.0));\n" + << "\t\t vOut.y = " << weight << " * (icr - (real_t)(1.0));\n" << "\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; @@ -2552,9 +2599,10 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\treal_t r = MwcNext01(mwc) * xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares;\n" + << "\t\treal_t r = MwcNext01(mwc) * " << weight << " * precalcSqrtSumSquares;\n" << "\t\treal_t sinr = sin(r);\n" << "\t\treal_t cosr = cos(r);\n" << "\t\treal_t diff = log10(sinr * sinr) + cosr;\n" @@ -2562,8 +2610,8 @@ public: << "\t\tif (BadVal(diff))\n" << "\t\t diff = -(real_t)(30.0);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x * diff;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.x * (diff - sinr * MPI);\n" + << "\t\tvOut.x = " << weight << " * vIn.x * diff;\n" + << "\t\tvOut.y = " << weight << " * vIn.x * (diff - sinr * MPI);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -2592,13 +2640,14 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] /Zeps(fabs((vIn.x - vIn.y) * (vIn.x + vIn.y)));\n" + << "\t\treal_t r = " << weight << " /Zeps(fabs((vIn.x - vIn.y) * (vIn.x + vIn.y)));\n" << "\n" << "\t\tvOut.x = vIn.x * r;\n" << "\t\tvOut.y = vIn.y * r;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -2640,16 +2689,17 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string rot = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Params. - string twist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string sinAdd = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. - string cosAdd = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string rot = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Params. + string twist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string sinAdd = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. + string cosAdd = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string rotTimesPi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t t = " << rotTimesPi << " * (vIn.x + vIn.y);\n" << "\t\treal_t sinr = sin(t);\n" << "\t\treal_t cosr = cos(t);\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * precalcAtanxy / MPI;\n" + << "\t\treal_t r = " << weight << " * precalcAtanxy / MPI;\n" << "\n" << "\t\tvOut.x = (sinr + " << cosAdd << ") * r;\n" << "\t\tvOut.y = (cosr + " << sinAdd << ") * r;\n" @@ -2682,7 +2732,7 @@ public: virtual void Random(QTIsaac& rand) override { - m_Rot = T(0.5) * rand.Frand01(); + m_Rot = T(0.5) * rand.Frand01(); m_Twist = T(0.5) * rand.Frand01(); } @@ -2691,10 +2741,10 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Rot, prefix + "disc2_rot"));//Params. + m_Params.push_back(ParamWithName(&m_Rot, prefix + "disc2_rot"));//Params. m_Params.push_back(ParamWithName(&m_Twist, prefix + "disc2_twist")); - m_Params.push_back(ParamWithName(true, &m_SinAdd, prefix + "disc2_sin_add"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_CosAdd, prefix + "disc2_cos_add")); + m_Params.push_back(ParamWithName(true, &m_SinAdd, prefix + "disc2_sin_add"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_CosAdd, prefix + "disc2_cos_add")); m_Params.push_back(ParamWithName(true, &m_RotTimesPi, prefix + "disc2_rot_times_pi")); } @@ -2740,13 +2790,14 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string m = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Params. - string n1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string n2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string n3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rnd = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string holes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string pm4 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. + string weight = WeightDefineString(); + string m = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Params. + string n1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string n2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string n3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rnd = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string holes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string pm4 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. string pNeg1N1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t theta = " << pm4 << " * precalcAtanyx + MPI4;\n" @@ -2754,7 +2805,7 @@ public: << "\t\tt1 = pow(t1, " << n2 << ");\n" << "\t\treal_t t2 = fabs(sin(theta));\n" << "\t\tt2 = pow(t2, " << n3 << ");\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * ((" << rnd << " * MwcNext01(mwc) + ((real_t)(1.0) - " << rnd << ") * precalcSqrtSumSquares) - " << holes << ") * pow(t1 + t2, " << pNeg1N1 << ") / precalcSqrtSumSquares;\n" + << "\t\treal_t r = " << weight << " * ((" << rnd << " * MwcNext01(mwc) + ((real_t)(1.0) - " << rnd << ") * precalcSqrtSumSquares) - " << holes << ") * pow(t1 + t2, " << pNeg1N1 << ") / precalcSqrtSumSquares;\n" << "\n" << "\t\tvOut.x = r * vIn.x;\n" << "\t\tvOut.y = r * vIn.y;\n" @@ -2771,11 +2822,11 @@ public: virtual void Random(QTIsaac& rand) override { - m_Rnd = rand.Frand01(); - m_M = T(int(rand.Frand01() * 6)); - m_N1 = rand.Frand01() * 40; - m_N2 = rand.Frand01() * 20; - m_N3 = m_N2; + m_Rnd = rand.Frand01(); + m_M = T(int(rand.Frand01() * 6)); + m_N1 = rand.Frand01() * 40; + m_N2 = rand.Frand01() * 20; + m_N3 = m_N2; m_Holes = 0.0; } @@ -2784,13 +2835,13 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_M, prefix + "super_shape_m"));//Params. - m_Params.push_back(ParamWithName(&m_N1, prefix + "super_shape_n1", 1)); - m_Params.push_back(ParamWithName(&m_N2, prefix + "super_shape_n2", 1)); - m_Params.push_back(ParamWithName(&m_N3, prefix + "super_shape_n3", 1)); - m_Params.push_back(ParamWithName(&m_Rnd, prefix + "super_shape_rnd")); - m_Params.push_back(ParamWithName(&m_Holes, prefix + "super_shape_holes")); - m_Params.push_back(ParamWithName(true, &m_Pm4, prefix + "super_shape_pm4"));//Precalc. + m_Params.push_back(ParamWithName(&m_M, prefix + "super_shape_m"));//Params. + m_Params.push_back(ParamWithName(&m_N1, prefix + "super_shape_n1", 1)); + m_Params.push_back(ParamWithName(&m_N2, prefix + "super_shape_n2", 1)); + m_Params.push_back(ParamWithName(&m_N3, prefix + "super_shape_n3", 1)); + m_Params.push_back(ParamWithName(&m_Rnd, prefix + "super_shape_rnd")); + m_Params.push_back(ParamWithName(&m_Holes, prefix + "super_shape_holes")); + m_Params.push_back(ParamWithName(true, &m_Pm4, prefix + "super_shape_pm4"));//Precalc. m_Params.push_back(ParamWithName(true, &m_PNeg1N1, prefix + "super_shape_pneg1n1")); } @@ -2834,11 +2885,12 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string petals = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string holes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string holes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t theta = precalcAtanyx;\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) - " << holes << ") * cos(" << petals << " * theta) / precalcSqrtSumSquares;\n" + << "\t\treal_t r = " << weight << " * (MwcNext01(mwc) - " << holes << ") * cos(" << petals << " * theta) / precalcSqrtSumSquares;\n" << "\n" << "\t\tvOut.x = r * vIn.x;\n" << "\t\tvOut.y = r * vIn.y;\n" @@ -2850,7 +2902,7 @@ public: virtual void Random(QTIsaac& rand) override { m_Petals = 4 * rand.Frand01(); - m_Holes = rand.Frand01(); + m_Holes = rand.Frand01(); } protected: @@ -2859,7 +2911,7 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Petals, prefix + "flower_petals")); - m_Params.push_back(ParamWithName(&m_Holes, prefix + "flower_holes")); + m_Params.push_back(ParamWithName(&m_Holes, prefix + "flower_holes")); } private: @@ -2898,12 +2950,13 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string eccentricity = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string holes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string holes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t z = Zeps(precalcSqrtSumSquares);\n" << "\t\treal_t ct = vIn.x / precalcSqrtSumSquares;\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) - " << holes << ") * " << eccentricity << " / (1 + " << eccentricity << " * ct) / z;\n" + << "\t\treal_t r = " << weight << " * (MwcNext01(mwc) - " << holes << ") * " << eccentricity << " / (1 + " << eccentricity << " * ct) / z;\n" << "\n" << "\t\tvOut.x = r * vIn.x;\n" << "\t\tvOut.y = r * vIn.y;\n" @@ -2920,7 +2973,7 @@ public: virtual void Random(QTIsaac& rand) override { m_Eccentricity = rand.Frand01(); - m_Holes = rand.Frand01(); + m_Holes = rand.Frand01(); } protected: @@ -2929,7 +2982,7 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Eccentricity, prefix + "conic_eccentricity", 1)); - m_Params.push_back(ParamWithName(&m_Holes, prefix + "conic_holes")); + m_Params.push_back(ParamWithName(&m_Holes, prefix + "conic_holes")); } private: @@ -2966,14 +3019,15 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string height = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string width = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string width = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t sr = sin(precalcSqrtSumSquares);\n" << "\t\treal_t cr = cos(precalcSqrtSumSquares);\n" << "\n" - << "\t\tvOut.x = " << height << " * (xform->m_VariationWeights[" << varIndex << "] * sr * sr * MwcNext01(mwc));\n" - << "\t\tvOut.y = " << width << " * (xform->m_VariationWeights[" << varIndex << "] * cr * MwcNext01(mwc));\n" + << "\t\tvOut.x = " << height << " * (" << weight << " * sr * sr * MwcNext01(mwc));\n" + << "\t\tvOut.y = " << width << " * (" << weight << " * cr * MwcNext01(mwc));\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -2982,7 +3036,7 @@ public: virtual void Random(QTIsaac& rand) override { m_Height = T(0.5) * rand.Frand01(); - m_Width = T(0.5) * rand.Frand01(); + m_Width = T(0.5) * rand.Frand01(); } protected: @@ -2991,7 +3045,7 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Height, prefix + "parabola_height")); - m_Params.push_back(ParamWithName(&m_Width, prefix + "parabola_width")); + m_Params.push_back(ParamWithName(&m_Width, prefix + "parabola_width")); } private: @@ -3034,18 +3088,19 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string vx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string vy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tif (vIn.x >= 0)\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" << "\t\telse\n" << "\t\t vOut.x = " << vx << " * vIn.x;\n" << "\n" << "\t\tif (vIn.y >= 0)\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\telse\n" << "\t\tvOut.y = " << vy << " * vIn.y;\n" << "\n" @@ -3142,10 +3197,11 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string shift = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string s = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string v = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string v4 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string s = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string v = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string v4 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t x2y2 = precalcSumSquares;\n" << "\t\treal_t t = x2y2 + 1;\n" @@ -3185,7 +3241,7 @@ public: << "\t\t{\n" << "\t\t vOut.x = (" << v4 << " * log((t + x2) / Zeps(t - x2)));\n" << "\t\t vOut.y = (" << v << " * y);\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\t vOut.z = " << weight << " * vIn.z;\n" << "\t\t}\n" << "\t}\n"; return ss.str(); @@ -3227,8 +3283,8 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Shift, prefix + "bipolar_shift"));//Params. - m_Params.push_back(ParamWithName(true, &m_S, prefix + "bipolar_s"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_V, prefix + "bipolar_v")); + m_Params.push_back(ParamWithName(true, &m_S, prefix + "bipolar_s"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_V, prefix + "bipolar_v")); m_Params.push_back(ParamWithName(true, &m_V4, prefix + "bipolar_v4")); } @@ -3298,6 +3354,7 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t roundX = rint(vIn.x);\n" @@ -3307,8 +3364,8 @@ public: << "\n" << "\t\tif (MwcNext01(mwc) >= (real_t)(0.75))\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY);\n" + << "\t\t vOut.x = " << weight << " * (offsetX * (real_t)(0.5) + roundX);\n" + << "\t\t vOut.y = " << weight << " * (offsetY * (real_t)(0.5) + roundY);\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" @@ -3316,26 +3373,26 @@ public: << "\t\t {\n" << "\t\t if (offsetX >= (real_t)(0.0))\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX + (real_t)(0.25));\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY + (real_t)(0.25) * offsetY / offsetX);\n" + << "\t\t vOut.x = " << weight << " * (offsetX * (real_t)(0.5) + roundX + (real_t)(0.25));\n" + << "\t\t vOut.y = " << weight << " * (offsetY * (real_t)(0.5) + roundY + (real_t)(0.25) * offsetY / offsetX);\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX - (real_t)(0.25));\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY - (real_t)(0.25) * offsetY / offsetX);\n" + << "\t\t vOut.x = " << weight << " * (offsetX * (real_t)(0.5) + roundX - (real_t)(0.25));\n" + << "\t\t vOut.y = " << weight << " * (offsetY * (real_t)(0.5) + roundY - (real_t)(0.25) * offsetY / offsetX);\n" << "\t\t }\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" << "\t\t if (offsetY >= (real_t)(0.0))\n" << "\t\t {\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY + (real_t)(0.25));\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX + offsetX / offsetY * (real_t)(0.25));\n" + << "\t\t vOut.y = " << weight << " * (offsetY * (real_t)(0.5) + roundY + (real_t)(0.25));\n" + << "\t\t vOut.x = " << weight << " * (offsetX * (real_t)(0.5) + roundX + offsetX / offsetY * (real_t)(0.25));\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY - (real_t)(0.25));\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX - offsetX / offsetY * (real_t)(0.25));\n" + << "\t\t vOut.y = " << weight << " * (offsetY * (real_t)(0.5) + roundY - (real_t)(0.25));\n" + << "\t\t vOut.x = " << weight << " * (offsetX * (real_t)(0.5) + roundX - offsetX / offsetY * (real_t)(0.25));\n" << "\t\t }\n" << "\t\t }\n" << "\t\t}\n" @@ -3370,9 +3427,10 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\treal_t wx = xform->m_VariationWeights[" << varIndex << "] * (real_t)(1.3029400317411197908970256609023);\n" + << "\t\treal_t wx = " << weight << " * (real_t)(1.3029400317411197908970256609023);\n" << "\t\treal_t y2 = vIn.y * (real_t)(2.0);\n" << "\t\treal_t r = wx * sqrt(fabs(vIn.y * vIn.x) / Zeps(SQR(vIn.x) + SQR(y2)));\n" << "\n" @@ -3456,6 +3514,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string size = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t invCellSize = (real_t)(1.0) / " << size << ";\n" @@ -3496,8 +3555,8 @@ public: << "\t\t }\n" << "\t\t}\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (dx + x * " << size << ");\n" - << "\t\tvOut.y = -(xform->m_VariationWeights[" << varIndex << "] * (dy + y * " << size << "));\n" + << "\t\tvOut.x = " << weight << " * (dx + x * " << size << ");\n" + << "\t\tvOut.y = -(" << weight << " * (dy + y * " << size << "));\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -3551,17 +3610,18 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string powerR = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string powerI = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string d = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ang = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string d = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ang = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t a = precalcAtanyx;\n" << "\t\treal_t lnr = (real_t)(0.5) * log(precalcSumSquares);\n" << "\t\treal_t angle = " << c << " * a + " << d << " * lnr + " << ang << " * floor(" << power << " * MwcNext01(mwc));\n" - << "\t\treal_t m = xform->m_VariationWeights[" << varIndex << "] * exp(" << c << " * lnr - " << d << " * a);\n" + << "\t\treal_t m = " << weight << " * exp(" << c << " * lnr - " << d << " * a);\n" << "\n" << "\t\tvOut.x = m * cos(angle);\n" << "\t\tvOut.y = m * sin(angle);\n" @@ -3591,9 +3651,9 @@ protected: m_Params.clear(); m_Params.push_back(ParamWithName(&m_PowerR, prefix + "cpow_r", 1));//Params. m_Params.push_back(ParamWithName(&m_PowerI, prefix + "cpow_i")); - m_Params.push_back(ParamWithName(&m_Power, prefix + "cpow_power", 1, eParamType::INTEGER_NONZERO)); - m_Params.push_back(ParamWithName(true, &m_C, prefix + "cpow_c"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_D, prefix + "cpow_d")); + m_Params.push_back(ParamWithName(&m_Power, prefix + "cpow_power", 1, eParamType::INTEGER_NONZERO)); + m_Params.push_back(ParamWithName(true, &m_C, prefix + "cpow_c"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_D, prefix + "cpow_d")); m_Params.push_back(ParamWithName(true, &m_Ang, prefix + "cpow_ang")); } @@ -3633,17 +3693,18 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string xAmp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string yAmp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string xLength = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string yLength = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string xAmpV = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string yAmpV = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string xAmp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string yAmp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string xLength = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string yLength = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string xAmpV = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string yAmpV = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string xLengthV = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string yLengthV = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x + " << xAmpV << " * exp(-vIn.y * vIn.y * " << xLengthV << ");\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y + " << yAmpV << " * exp(-vIn.x * vIn.x * " << yLengthV << ");\n" + << "\t\tvOut.x = " << weight << " * vIn.x + " << xAmpV << " * exp(-vIn.y * vIn.y * " << xLengthV << ");\n" + << "\t\tvOut.y = " << weight << " * vIn.y + " << yAmpV << " * exp(-vIn.x * vIn.x * " << yLengthV << ");\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -3659,8 +3720,8 @@ public: virtual void Random(QTIsaac& rand) override { - m_XAmp = 5 * (rand.Frand01() - T(0.5)); - m_YAmp = 4 * (rand.Frand01() - T(0.5)); + m_XAmp = 5 * (rand.Frand01() - T(0.5)); + m_YAmp = 4 * (rand.Frand01() - T(0.5)); m_XLength = 2 * (rand.Frand01() + T(0.5)); m_YLength = 2 * (rand.Frand01() + T(0.5)); } @@ -3670,12 +3731,12 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_XAmp, prefix + "curve_xamp"));//Params. - m_Params.push_back(ParamWithName(&m_YAmp, prefix + "curve_yamp")); + m_Params.push_back(ParamWithName(&m_XAmp, prefix + "curve_xamp"));//Params. + m_Params.push_back(ParamWithName(&m_YAmp, prefix + "curve_yamp")); m_Params.push_back(ParamWithName(&m_XLength, prefix + "curve_xlength", 1)); m_Params.push_back(ParamWithName(&m_YLength, prefix + "curve_ylength", 1)); - m_Params.push_back(ParamWithName(true, &m_XAmpV, prefix + "curve_xampv"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_YAmpV, prefix + "curve_yampv")); + m_Params.push_back(ParamWithName(true, &m_XAmpV, prefix + "curve_xampv"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_YAmpV, prefix + "curve_yampv")); m_Params.push_back(ParamWithName(true, &m_XLengthV, prefix + "curve_xlenv")); m_Params.push_back(ParamWithName(true, &m_YLengthV, prefix + "curve_ylenv")); } @@ -3728,6 +3789,7 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t tmp = precalcSumSquares + (real_t)(1.0);\n" @@ -3737,7 +3799,7 @@ public: << "\t\treal_t xmax = Zeps((r1 + r2) * (real_t)(0.5));\n" << "\t\treal_t a1 = log(xmax + sqrt(xmax - (real_t)(1.0)));\n" << "\t\treal_t a2 = -acos(clamp(vIn.x / xmax, -(real_t)(1.0), (real_t)(1.0)));\n" - << "\t\treal_t w = xform->m_VariationWeights[" << varIndex << "] / (real_t)(11.57034632);\n" + << "\t\treal_t w = " << weight << " / (real_t)(11.57034632);\n" << "\t\treal_t snv = sin(a1);\n" << "\t\treal_t csv = cos(a1);\n" << "\t\treal_t snhu = sinh(a2);\n" @@ -3771,32 +3833,23 @@ public: PARVARCOPY(EllipticVariation) + //An improved version which was posted in the Discord chat by user Claude which was helps with rounding errors. + //Note that for this to work, a "bad value" had to be changed from 1e10 and -1e10 to 1e50 and -1e50. + //For this to be correct, it must always use double. So there is no point in switching precisions when using this variation. virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override { - T tmp = helper.m_PrecalcSumSquares + 1; - T x2 = 2 * helper.In.x; - T xmax = T(0.5) * (std::sqrt(tmp + x2) + std::sqrt(tmp - x2)); - T a = helper.In.x / xmax; - T b = 1 - a * a; - T ssx = xmax - 1; - const T w = m_WeightDivPiDiv2; - - if (b < 0) - b = 0; - else - b = std::sqrt(b); - - if (ssx < 0) - ssx = 0; - else - ssx = std::sqrt(ssx); - - helper.Out.x = w * std::atan2(a, b); + double x2 = 2 * helper.In.x; + double u = helper.m_PrecalcSumSquares + x2; + double v = helper.m_PrecalcSumSquares - x2; + double xmaxm1 = 0.5 * (Sqrt1pm1(u) + Sqrt1pm1(v)); + double a = helper.In.x / (1 + xmaxm1); + double ssx = xmaxm1 < 0 ? 0 : std::sqrt(xmaxm1); + helper.Out.x = T(m_WeightDivPiDiv2 * std::asin(Clamp(a, -1.0, 1.0))); if (helper.In.y > 0) - helper.Out.y = w * std::log(xmax + ssx); + helper.Out.y = T(m_WeightDivPiDiv2 * std::log1p(xmaxm1 + ssx)); else - helper.Out.y = -(w * std::log(xmax + ssx)); + helper.Out.y = T(-(m_WeightDivPiDiv2 * std::log1p(xmaxm1 + ssx))); helper.Out.z = DefaultZ(helper); } @@ -3807,38 +3860,65 @@ public: intmax_t i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string weightDivPiDiv2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\treal_t tmp = precalcSumSquares + (real_t)(1.0);\n" - << "\t\treal_t x2 = (real_t)(2.0) * vIn.x;\n" - << "\t\treal_t xmax = (real_t)(0.5) * (sqrt(tmp + x2) + sqrt(tmp - x2));\n" - << "\t\treal_t a = vIn.x / xmax;\n" - << "\t\treal_t b = (real_t)(1.0) - a * a;\n" - << "\t\treal_t ssx = xmax - (real_t)(1.0);\n" - << "\t\tconst real_t w = " << weightDivPiDiv2 << ";\n" + << "double x2 = 2.0 * vIn.x;\n" + << "double u = precalcSumSquares + x2;\n" + << "double v = precalcSumSquares - x2;\n" + << "double xmaxm1 = 0.5 * (Sqrt1pm1(u) + Sqrt1pm1(v));\n" + << "double a = vIn.x / (1 + xmaxm1);\n" + << "double ssx = xmaxm1 < 0 ? 0.0 : sqrt(xmaxm1);\n" + << "vOut.x = (" << weightDivPiDiv2 << " * asin(clamp(a, (double)-1.0, (double)1.0)));\n" << "\n" - << "\t\tif (b < 0)\n" - << "\t\t b = 0;\n" - << "\t\telse\n" - << "\t\t b = sqrt(b);\n" - << "\n" - << "\t\tif (ssx < 0)\n" - << "\t\t ssx = 0;\n" - << "\t\telse\n" - << "\t\t ssx = sqrt(ssx);\n" - << "\n" - << "\t\tvOut.x = w * atan2(a, b);\n" - << "\n" - << "\t\tif (vIn.y > 0)\n" - << "\t\t vOut.y = w * log(xmax + ssx);\n" - << "\t\telse\n" - << "\t\t vOut.y = -(w * log(xmax + ssx));\n" + << "if (vIn.y > 0)\n" + << " vOut.y = " << weightDivPiDiv2 << " * log1p(xmaxm1 + ssx);\n" + << "else\n" + << " vOut.y = -(" << weightDivPiDiv2 << " * log1p(xmaxm1 + ssx));\n" << "\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } + virtual vector OpenCLGlobalFuncNames() const override + { + return vector { "Zeps" }; + } + + virtual string OpenCLFuncsString() const override + { + return + "double Sqrt1pm1(double x)\n" + "{\n" + " if (-0.0625 < x && x < 0.0625)\n" + " {\n" + " double num = 0;\n" + " double den = 0;\n" + " num += 1.0 / 32.0;\n" + " den += 1.0 / 256.0;\n" + " num *= x;\n" + " den *= x;\n" + " num += 5.0 / 16.0;\n" + " den += 5.0 / 32.0;\n" + " num *= x;\n" + " den *= x;\n" + " num += 3.0 / 4.0;\n" + " den += 15.0 / 16.0;\n" + " num *= x;\n" + " den *= x;\n" + " num += 1.0 / 2.0;\n" + " den += 7.0 / 4.0;\n" + " num *= x;\n" + " den *= x;\n" + " den += 1;\n" + " return num / den;\n" + " }\n" + "\n" + " return sqrt(1 + x) - 1;\n" + "}\n\n"; + } + virtual void Precalc() override { m_WeightDivPiDiv2 = m_Weight / T(M_PI_2); @@ -3853,6 +3933,38 @@ protected: } private: + //An improved version which was posted in the Discord chat by user Claude which was helps with rounding errors. + //Note that for this to work, a "bad value" had to be changed from 1e10 and -1e10 to 1e50 and -1e50. + //For this to be correct, it must always use double. So there is no point in switching precisions when using this variation. + double Sqrt1pm1(double x) + { + if (-0.0625 < x && x < 0.0625) + { + double num = 0; + double den = 0; + num += 1.0 / 32; + den += 1.0 / 256; + num *= x; + den *= x; + num += 5.0 / 16; + den += 5.0 / 32; + num *= x; + den *= x; + num += 3.0 / 4; + den += 15.0 / 16; + num *= x; + den *= x; + num += 1.0 / 2; + den += 7.0 / 4; + num *= x; + den *= x; + den += 1; + return num / den; + } + + return std::sqrt(1 + x) - 1; + } + T m_WeightDivPiDiv2;//Precalc. }; @@ -3887,18 +3999,19 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string beta = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string d = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string d = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t a = precalcAtanyx;\n" << "\t\treal_t lnr = (real_t)(0.5) * log(precalcSumSquares);\n" - << "\t\treal_t m = xform->m_VariationWeights[" << varIndex << "] * exp(" << c << " * lnr - " << d << " * a);\n" + << "\t\treal_t m = " << weight << " * exp(" << c << " * lnr - " << d << " * a);\n" << "\t\treal_t n = " << c << " * a + " << d << " * lnr;\n" << "\n" << "\t\tvOut.x = m * cos(n);\n" << "\t\tvOut.y = m * sin(n);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -3969,6 +4082,7 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t expx = exp(vIn.x) * (real_t)(0.5);\n" @@ -3977,11 +4091,11 @@ public: << "\t\treal_t cn = cos(vIn.y);\n" << "\t\treal_t tmp = Zeps(expx + expnx - cn);\n" << "\n" - << "\t\ttmp = xform->m_VariationWeights[" << varIndex << "] / tmp;\n" + << "\t\ttmp = " << weight << " / tmp;\n" << "\n" << "\t\tvOut.x = tmp * (expx - expnx);\n" << "\t\tvOut.y = tmp * sn;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -4034,32 +4148,33 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string spin = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string spin = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string space = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string twist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t x = vIn.x - " << x << ";\n" << "\t\treal_t y = vIn.y + " << y << ";\n" << "\t\treal_t r = sqrt(x * x + y * y);\n" << "\n" - << "\t\tif (r < xform->m_VariationWeights[" << varIndex << "])\n" + << "\t\tif (r < " << weight << ")\n" << "\t\t{\n" - << "\t\t real_t a = atan2(y, x) + " << spin << " + " << twist << " * (xform->m_VariationWeights[" << varIndex << "] - r);\n" + << "\t\t real_t a = atan2(y, x) + " << spin << " + " << twist << " * (" << weight << " - r);\n" << "\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (r * cos(a) + " << x << ");\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (r * sin(a) - " << y << ");\n" + << "\t\t vOut.x = " << weight << " * (r * cos(a) + " << x << ");\n" + << "\t\t vOut.y = " << weight << " * (r * sin(a) - " << y << ");\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" << "\t\t r = (real_t)(1.0) + " << space << " / Zeps(r);\n" << "\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (r * x + " << x << ");\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (r * y - " << y << ");\n" + << "\t\t vOut.x = " << weight << " * (r * x + " << x << ");\n" + << "\t\t vOut.y = " << weight << " * (r * y - " << y << ");\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -4083,11 +4198,11 @@ public: virtual void Random(QTIsaac& rand) override { - m_X = 2 * rand.Frand11(); - m_Y = 2 * rand.Frand11(); - m_Spin = T(M_PI) * rand.Frand11(); - m_Space = 2 * rand.Frand11(); - m_Twist = 2 * rand.Frand11(); + m_X = 2 * rand.Frand11(); + m_Y = 2 * rand.Frand11(); + m_Spin = T(M_PI) * rand.Frand11(); + m_Space = 2 * rand.Frand11(); + m_Twist = 2 * rand.Frand11(); } protected: @@ -4095,11 +4210,11 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Spin, prefix + "lazysusan_spin", T(M_PI))); + m_Params.push_back(ParamWithName(&m_Spin, prefix + "lazysusan_spin", T(M_PI))); m_Params.push_back(ParamWithName(&m_Space, prefix + "lazysusan_space")); m_Params.push_back(ParamWithName(&m_Twist, prefix + "lazysusan_twist")); - m_Params.push_back(ParamWithName(&m_X, prefix + "lazysusan_x")); - m_Params.push_back(ParamWithName(&m_Y, prefix + "lazysusan_y")); + m_Params.push_back(ParamWithName(&m_X, prefix + "lazysusan_x")); + m_Params.push_back(ParamWithName(&m_Y, prefix + "lazysusan_y")); } private: @@ -4147,21 +4262,22 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string w2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string w2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tif (precalcSumSquares < " << w2 << " && precalcSumSquares != 0)\n" << "\t\t{\n" - << "\t\t real_t r = xform->m_VariationWeights[" << varIndex << "] * sqrt((" << w2 << " / precalcSumSquares) - (real_t)(1.0));\n" + << "\t\t real_t r = " << weight << " * sqrt((" << w2 << " / precalcSumSquares) - (real_t)(1.0));\n" << "\t\t vOut.x = r * vIn.x;\n" << "\t\t vOut.y = r * vIn.y;\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -4202,14 +4318,14 @@ public: if (helper.In.x > m_X) helper.Out.x = m_Weight * (-m_X + fmod(helper.In.x + m_X, m_XRange)); else if (helper.In.x < -m_X) - helper.Out.x = m_Weight * ( m_X - fmod(m_X - helper.In.x, m_XRange)); + helper.Out.x = m_Weight * (m_X - fmod(m_X - helper.In.x, m_XRange)); else helper.Out.x = m_Weight * helper.In.x; if (helper.In.y > m_Y) helper.Out.y = m_Weight * (-m_Y + fmod(helper.In.y + m_Y, m_YRange)); else if (helper.In.y < -m_Y) - helper.Out.y = m_Weight * ( m_Y - fmod(m_Y - helper.In.y, m_YRange)); + helper.Out.y = m_Weight * (m_Y - fmod(m_Y - helper.In.y, m_YRange)); else helper.Out.y = m_Weight * helper.In.y; @@ -4222,24 +4338,25 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string xr = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string yr = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tif (vIn.x > " << x << ")\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (-" << x << " + fmod(vIn.x + " << x << ", " << xr << "));\n" + << "\t\t vOut.x = " << weight << " * (-" << x << " + fmod(vIn.x + " << x << ", " << xr << "));\n" << "\t\telse if (vIn.x < -" << x << ")\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * ( " << x << " - fmod(" << x << " - vIn.x, " << xr << "));\n" + << "\t\t vOut.x = " << weight << " * ( " << x << " - fmod(" << x << " - vIn.x, " << xr << "));\n" << "\t\telse\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" << "\n" << "\t\tif (vIn.y > " << y << ")\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (-" << y << " + fmod(vIn.y + " << y << ", " << yr << "));\n" + << "\t\t vOut.y = " << weight << " * (-" << y << " + fmod(vIn.y + " << y << ", " << yr << "));\n" << "\t\telse if (vIn.y < -" << y << ")\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * ( " << y << " - fmod(" << y << " - vIn.y, " << yr << "));\n" + << "\t\t vOut.y = " << weight << " * ( " << y << " - fmod(" << y << " - vIn.y, " << yr << "));\n" << "\t\telse\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; @@ -4319,11 +4436,12 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string separation = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string frequency = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string amplitude = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string damping = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string tpf = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string frequency = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string amplitude = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string damping = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string tpf = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t t;\n" << "\n" @@ -4334,13 +4452,13 @@ public: << "\n" << "\t\tif (fabs(vIn.y) <= t)\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = -(xform->m_VariationWeights[" << varIndex << "] * vIn.y);\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = -(" << weight << " * vIn.y);\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t}\n" << "\n" << "\t\tvOut.z = " << DefaultZCl() @@ -4356,9 +4474,9 @@ public: virtual void Random(QTIsaac& rand) override { m_Separation = 1 + rand.Frand11(); - m_Frequency = T(M_PI) * rand.Frand11(); - m_Amplitude = 1 + 2 * rand.Frand01(); - m_Damping = rand.Frand01(); + m_Frequency = T(M_PI) * rand.Frand11(); + m_Amplitude = 1 + 2 * rand.Frand01(); + m_Damping = rand.Frand01(); } protected: @@ -4367,9 +4485,9 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Separation, prefix + "oscilloscope_separation", 1));//Params. - m_Params.push_back(ParamWithName(&m_Frequency, prefix + "oscilloscope_frequency", T(M_PI))); - m_Params.push_back(ParamWithName(&m_Amplitude, prefix + "oscilloscope_amplitude", 1)); - m_Params.push_back(ParamWithName(&m_Damping, prefix + "oscilloscope_damping")); + m_Params.push_back(ParamWithName(&m_Frequency, prefix + "oscilloscope_frequency", T(M_PI))); + m_Params.push_back(ParamWithName(&m_Amplitude, prefix + "oscilloscope_amplitude", 1)); + m_Params.push_back(ParamWithName(&m_Damping, prefix + "oscilloscope_damping")); m_Params.push_back(ParamWithName(true, &m_2PiFreq, prefix + "oscilloscope_2pifreq"));//Precalc. } @@ -4408,12 +4526,13 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string vvar = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string vvar = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string vvar2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tvOut.x = " << vvar << " * precalcAtanxy;\n" << "\t\tvOut.y = " << vvar2 << " * log(precalcSumSquares);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -4465,12 +4584,13 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + " << x << " * sin(tan(vIn.y * " << c << ")));\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + " << y << " * sin(tan(vIn.x * " << c << ")));\n" + << "\t\tvOut.x = " << weight << " * (vIn.x + " << x << " * sin(tan(vIn.y * " << c << ")));\n" + << "\t\tvOut.y = " << weight << " * (vIn.y + " << y << " * sin(tan(vIn.x * " << c << ")));\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -4480,7 +4600,7 @@ public: { m_X = T(0.2) + rand.Frand01(); m_Y = T(0.2) * rand.Frand01(); - m_C = 5 * rand.Frand01(); + m_C = 5 * rand.Frand01(); } protected: @@ -4531,6 +4651,7 @@ public: int i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string invWeight = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t t = precalcSumSquares;\n" @@ -4600,24 +4721,25 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string xInside = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string yInside = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string xx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string yy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string xx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string yy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tif (vIn.x > (real_t)(0.0))\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (sqrt(vIn.x * vIn.x + " << xx << ") - vIn.x * " << xInside << ");\n" + << "\t\t vOut.x = " << weight << " * (sqrt(vIn.x * vIn.x + " << xx << ") - vIn.x * " << xInside << ");\n" << "\t\telse\n" - << "\t\t vOut.x = -(xform->m_VariationWeights[" << varIndex << "] * (sqrt(vIn.x * vIn.x + " << xx << ") + vIn.x * " << xInside << "));\n" + << "\t\t vOut.x = -(" << weight << " * (sqrt(vIn.x * vIn.x + " << xx << ") + vIn.x * " << xInside << "));\n" << "\n" << "\t\tif (vIn.y > (real_t)(0.0))\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (sqrt(vIn.y * vIn.y + " << yy << ") - vIn.y * " << yInside << ");\n" + << "\t\t vOut.y = " << weight << " * (sqrt(vIn.y * vIn.y + " << yy << ") - vIn.y * " << yInside << ");\n" << "\t\telse\n" - << "\t\t vOut.y = -(xform->m_VariationWeights[" << varIndex << "] * (sqrt(vIn.y * vIn.y + " << yy << ") + vIn.y * " << yInside << "));\n" + << "\t\t vOut.y = -(" << weight << " * (sqrt(vIn.y * vIn.y + " << yy << ") + vIn.y * " << yInside << "));\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -4630,9 +4752,9 @@ public: virtual void Random(QTIsaac& rand) override { - m_X = 1 + rand.Frand11(); + m_X = 1 + rand.Frand11(); m_XInside = 1 + rand.Frand11(); - m_Y = rand.Frand11(); + m_Y = rand.Frand11(); m_YInside = rand.Frand11(); } @@ -4641,9 +4763,9 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_X, prefix + "separation_x", 1));//Params. + m_Params.push_back(ParamWithName(&m_X, prefix + "separation_x", 1));//Params. m_Params.push_back(ParamWithName(&m_XInside, prefix + "separation_xinside")); - m_Params.push_back(ParamWithName(&m_Y, prefix + "separation_y", 1)); + m_Params.push_back(ParamWithName(&m_Y, prefix + "separation_y", 1)); m_Params.push_back(ParamWithName(&m_YInside, prefix + "separation_yinside")); m_Params.push_back(ParamWithName(true, &m_XX, prefix + "separation_xx"));//Precalc. m_Params.push_back(ParamWithName(true, &m_YY, prefix + "separation_yy")); @@ -4693,20 +4815,21 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string xSize = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string ySize = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string xAng = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string yAng = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string xAng = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string yAng = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tif (cos(vIn.y * " << yAng << ") >= 0)\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" << "\t\telse\n" - << "\t\t vOut.x = -(xform->m_VariationWeights[" << varIndex << "] * vIn.x);\n" + << "\t\t vOut.x = -(" << weight << " * vIn.x);\n" << "\n" << "\t\tif (cos(vIn.x * " << xAng << ") >= 0)\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\telse\n" - << "\t\t vOut.y = -(xform->m_VariationWeights[" << varIndex << "] * vIn.y);\n" + << "\t\t vOut.y = -(" << weight << " * vIn.y);\n" << "\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; @@ -4778,20 +4901,21 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tif (vIn.x >= 0)\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + " << x << ");\n" + << "\t\t vOut.x = " << weight << " * (vIn.x + " << x << ");\n" << "\t\telse\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x - " << x << ");\n" + << "\t\t vOut.x = " << weight << " * (vIn.x - " << x << ");\n" << "\n" << "\t\tif (vIn.y >= 0)\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + " << y << ");\n" + << "\t\t vOut.y = " << weight << " * (vIn.y + " << y << ");\n" << "\t\telse\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y - " << y << ");\n" + << "\t\t vOut.y = " << weight << " * (vIn.y - " << y << ");\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -4845,14 +4969,15 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string space = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string warp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string warp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t roundx = (real_t)(int)(vIn.x >= 0 ? (vIn.x + (real_t)(0.5)) : (vIn.x - (real_t)(0.5)));\n" << "\t\treal_t offsetx = vIn.x - roundx;\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetx * ((real_t)(1.0) - " << space << ") + roundx);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + offsetx * offsetx * " << warp << ");\n" + << "\t\tvOut.x = " << weight << " * (offsetx * ((real_t)(1.0) - " << space << ") + roundx);\n" + << "\t\tvOut.y = " << weight << " * (vIn.y + offsetx * offsetx * " << warp << ");\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -4870,7 +4995,7 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Space, prefix + "stripes_space", T(0.5), eParamType::REAL, T(0.5), 5)); - m_Params.push_back(ParamWithName(&m_Warp, prefix + "stripes_warp")); + m_Params.push_back(ParamWithName(&m_Warp, prefix + "stripes_warp")); } private: @@ -4910,10 +5035,11 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string angle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string hole = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string count = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string swirl = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string angle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hole = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string count = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string swirl = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string compFac = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t r = precalcSqrtSumSquares;\n" @@ -4921,10 +5047,10 @@ public: << "\t\treal_t c = floor((" << count << " * a + MPI) * M1PI * (real_t)(0.5));\n" << "\n" << "\t\ta = a * " << compFac << " + c * " << angle << ";\n" - << "\t\tr = xform->m_VariationWeights[" << varIndex << "] * (r + " << hole << ");\n" + << "\t\tr = " << weight << " * (r + " << hole << ");\n" << "\t\tvOut.x = r * cos(a);\n" << "\t\tvOut.y = r * sin(a);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -4937,7 +5063,7 @@ public: virtual void Random(QTIsaac& rand) override { m_Angle = T(M_PI) * rand.Frand01(); - m_Hole = T(0.5) * rand.Frand11(); + m_Hole = T(0.5) * rand.Frand11(); m_Count = T(Floor(5 * rand.Frand01())) + 1; m_Swirl = rand.Frand01(); } @@ -4948,7 +5074,7 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Angle, prefix + "wedge_angle", T(M_PI_2)));//Params. - m_Params.push_back(ParamWithName(&m_Hole, prefix + "wedge_hole")); + m_Params.push_back(ParamWithName(&m_Hole, prefix + "wedge_hole")); m_Params.push_back(ParamWithName(&m_Count, prefix + "wedge_count", 2, eParamType::INTEGER, 1)); m_Params.push_back(ParamWithName(&m_Swirl, prefix + "wedge_swirl")); m_Params.push_back(ParamWithName(true, &m_CompFac, prefix + "wedge_compfac"));//Precalc. @@ -4994,15 +5120,16 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string angle = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Params. string count = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rn = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. - string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cf = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rn = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. + string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cf = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * pow(precalcSumSquares, " << cn << ");\n" + << "\t\treal_t r = " << weight << " * pow(precalcSumSquares, " << cn << ");\n" << "\t\tint tRand = (int)(" << rn << " * MwcNext01(mwc));\n" << "\t\treal_t a = (precalcAtanyx + M_2PI * tRand) / " << power << ";\n" << "\t\treal_t c = floor((" << count << " * a + MPI) * M1PI * (real_t)(0.5));\n" @@ -5025,7 +5152,7 @@ public: virtual void Random(QTIsaac& rand) override { m_Power = T(int(5 * rand.Frand01() + 2)); - m_Dist = 1; + m_Dist = 1; m_Count = T(int(3 * rand.Frand01() + 1)); m_Angle = T(M_PI) * rand.Frand01(); } @@ -5038,7 +5165,7 @@ protected: m_Params.push_back(ParamWithName(&m_Angle, prefix + "wedge_julia_angle"));//Params. m_Params.push_back(ParamWithName(&m_Count, prefix + "wedge_julia_count", 1)); m_Params.push_back(ParamWithName(&m_Power, prefix + "wedge_julia_power", 1)); - m_Params.push_back(ParamWithName(&m_Dist, prefix + "wedge_julia_dist")); + m_Params.push_back(ParamWithName(&m_Dist, prefix + "wedge_julia_dist")); m_Params.push_back(ParamWithName(true, &m_Rn, prefix + "wedge_julia_rn"));//Precalc. m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "wedge_julia_cn")); m_Params.push_back(ParamWithName(true, &m_Cf, prefix + "wedge_julia_cf")); @@ -5086,11 +5213,12 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string angle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string count = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string hole = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string swirl = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c12pi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string angle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string count = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hole = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string swirl = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c12pi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string compfac = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t r = (real_t)(1.0) / Zeps(precalcSqrtSumSquares);\n" @@ -5098,7 +5226,7 @@ public: << "\t\treal_t c = floor((" << count << " * a + MPI) * " << c12pi << "); \n" << "\n" << "\t\ta = a * " << compfac << " + c * " << angle << ";\n" - << "\t\treal_t temp = xform->m_VariationWeights[" << varIndex << "] * (r + " << hole << ");\n" + << "\t\treal_t temp = " << weight << " * (r + " << hole << ");\n" << "\t\tvOut.x = temp * cos(a);\n" << "\t\tvOut.y = temp * sin(a);\n" << "\t\tvOut.z = " << DefaultZCl() @@ -5115,7 +5243,7 @@ public: { m_Angle = T(M_PI) * rand.Frand01(); m_Count = T(Floor(5 * rand.Frand01())) + 1; - m_Hole = T(0.5) * rand.Frand11(); + m_Hole = T(0.5) * rand.Frand11(); m_Swirl = rand.Frand01(); } @@ -5132,9 +5260,9 @@ protected: m_Params.clear(); m_Params.push_back(ParamWithName(&m_Angle, prefix + "wedge_sph_angle", T(M_PI_2))); m_Params.push_back(ParamWithName(&m_Count, prefix + "wedge_sph_count", 2, eParamType::INTEGER, 1)); - m_Params.push_back(ParamWithName(&m_Hole, prefix + "wedge_sph_hole")); + m_Params.push_back(ParamWithName(&m_Hole, prefix + "wedge_sph_hole")); m_Params.push_back(ParamWithName(&m_Swirl, prefix + "wedge_sph_swirl")); - m_Params.push_back(ParamWithName(true, &m_C12Pi, prefix + "wedge_sph_c1_2pi")); + m_Params.push_back(ParamWithName(true, &m_C12Pi, prefix + "wedge_sph_c1_2pi")); m_Params.push_back(ParamWithName(true, &m_CompFac, prefix + "wedge_sph_comp_fac")); } @@ -5181,19 +5309,20 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string inside = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string inside = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string outside = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t a;\n" << "\t\treal_t r = precalcSqrtSumSquares;\n" << "\n" - << "\t\tif (r < xform->m_VariationWeights[" << varIndex << "])\n" - << "\t\t a = precalcAtanyx + " << inside << " / (xform->m_VariationWeights[" << varIndex << "] - r);\n" + << "\t\tif (r < " << weight << ")\n" + << "\t\t a = precalcAtanyx + " << inside << " / (" << weight << " - r);\n" << "\t\telse\n" - << "\t\t a = precalcAtanyx + " << outside << " / Zeps(xform->m_VariationWeights[" << varIndex << "] - r);\n" + << "\t\t a = precalcAtanyx + " << outside << " / Zeps(" << weight << " - r);\n" << "\n" - << "\t\tvOut.x = (xform->m_VariationWeights[" << varIndex << "] * r * cos(a));\n" - << "\t\tvOut.y = (xform->m_VariationWeights[" << varIndex << "] * r * sin(a));\n" + << "\t\tvOut.x = (" << weight << " * r * cos(a));\n" + << "\t\tvOut.y = (" << weight << " * r * sin(a));\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -5215,7 +5344,7 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Inside, prefix + "whorl_inside", 1)); + m_Params.push_back(ParamWithName(&m_Inside, prefix + "whorl_inside", 1)); m_Params.push_back(ParamWithName(&m_Outside, prefix + "whorl_outside", 1)); } @@ -5251,25 +5380,26 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string freqX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string freqX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string scaleX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string freqY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string freqY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string scaleY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string freqZ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string freqZ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string scaleZ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + " << scaleX << " * sin(vIn.y * " << freqX << "));\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + " << scaleY << " * sin(vIn.x * " << freqY << "));\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * (vIn.z + " << scaleZ << " * sin(precalcSqrtSumSquares * " << freqZ << "));\n" + << "\t\tvOut.x = " << weight << " * (vIn.x + " << scaleX << " * sin(vIn.y * " << freqX << "));\n" + << "\t\tvOut.y = " << weight << " * (vIn.y + " << scaleY << " * sin(vIn.x * " << freqY << "));\n" + << "\t\tvOut.z = " << weight << " * (vIn.z + " << scaleZ << " * sin(precalcSqrtSumSquares * " << freqZ << "));\n" << "\t}\n"; return ss.str(); } virtual void Random(QTIsaac& rand) override { - m_FreqX = 4 * rand.Frand01(); + m_FreqX = 4 * rand.Frand01(); m_ScaleX = T(0.5) + rand.Frand01(); - m_FreqY = 4 * rand.Frand01(); + m_FreqY = 4 * rand.Frand01(); m_ScaleY = T(0.5) + rand.Frand01(); m_FreqZ = 0; m_ScaleZ = 0; @@ -5280,11 +5410,11 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_FreqX, prefix + "waves2_freqx", 2)); + m_Params.push_back(ParamWithName(&m_FreqX, prefix + "waves2_freqx", 2)); m_Params.push_back(ParamWithName(&m_ScaleX, prefix + "waves2_scalex")); - m_Params.push_back(ParamWithName(&m_FreqY, prefix + "waves2_freqy", 2)); + m_Params.push_back(ParamWithName(&m_FreqY, prefix + "waves2_freqy", 2)); m_Params.push_back(ParamWithName(&m_ScaleY, prefix + "waves2_scaley")); - m_Params.push_back(ParamWithName(&m_FreqZ, prefix + "waves2_freqz")); + m_Params.push_back(ParamWithName(&m_FreqZ, prefix + "waves2_freqz")); m_Params.push_back(ParamWithName(&m_ScaleZ, prefix + "waves2_scalez")); } @@ -5319,9 +5449,10 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\treal_t expe = xform->m_VariationWeights[" << varIndex << "] * exp(vIn.x);\n" + << "\t\treal_t expe = " << weight << " * exp(vIn.x);\n" << "\n" << "\t\tvOut.x = expe * cos(vIn.y);\n" << "\t\tvOut.y = expe * sin(vIn.y);\n" @@ -5358,12 +5489,13 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string base = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string base = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string denom = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * log(precalcSumSquares) * " << denom << ";\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * precalcAtanyx;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.x = " << weight << " * log(precalcSumSquares) * " << denom << ";\n" + << "\t\tvOut.y = " << weight << " * precalcAtanyx;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -5408,10 +5540,11 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sin(vIn.x) * cosh(vIn.y);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * cos(vIn.x) * sinh(vIn.y);\n" + << "\t\tvOut.x = " << weight << " * sin(vIn.x) * cosh(vIn.y);\n" + << "\t\tvOut.y = " << weight << " * cos(vIn.x) * sinh(vIn.y);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -5440,10 +5573,11 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cos(vIn.x) * cosh(vIn.y);\n" - << "\t\tvOut.y = -(xform->m_VariationWeights[" << varIndex << "] * sin(vIn.x) * sinh(vIn.y));\n" + << "\t\tvOut.x = " << weight << " * cos(vIn.x) * cosh(vIn.y);\n" + << "\t\tvOut.y = -(" << weight << " * sin(vIn.x) * sinh(vIn.y));\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -5476,6 +5610,7 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t tansin = sin((real_t)(2.0) * vIn.x);\n" @@ -5484,8 +5619,8 @@ public: << "\t\treal_t tancosh = cosh((real_t)(2.0) * vIn.y);\n" << "\t\treal_t tanden = (real_t)(1.0) / Zeps(tancos + tancosh);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * tanden * tansin;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * tanden * tansinh;\n" + << "\t\tvOut.x = " << weight << " * tanden * tansin;\n" + << "\t\tvOut.y = " << weight << " * tanden * tansinh;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -5523,6 +5658,7 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t secsin = sin(vIn.x);\n" @@ -5531,8 +5667,8 @@ public: << "\t\treal_t seccosh = cosh(vIn.y);\n" << "\t\treal_t secden = (real_t)(2.0) / Zeps(cos((real_t)(2.0) * vIn.x) + cosh((real_t)(2.0) * vIn.y));\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * secden * seccos * seccosh;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * secden * secsin * secsinh;\n" + << "\t\tvOut.x = " << weight << " * secden * seccos * seccosh;\n" + << "\t\tvOut.y = " << weight << " * secden * secsin * secsinh;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -5570,6 +5706,7 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t cscsin = sin(vIn.x);\n" @@ -5578,8 +5715,8 @@ public: << "\t\treal_t csccosh = cosh(vIn.y);\n" << "\t\treal_t cscden = (real_t)(2.0) / Zeps(cosh((real_t)(2.0) * vIn.y) - cos((real_t)(2.0) * vIn.x));\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cscden * cscsin * csccosh;\n" - << "\t\tvOut.y = -(xform->m_VariationWeights[" << varIndex << "] * cscden * csccos * cscsinh);\n" + << "\t\tvOut.x = " << weight << " * cscden * cscsin * csccosh;\n" + << "\t\tvOut.y = -(" << weight << " * cscden * csccos * cscsinh);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -5617,6 +5754,7 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t cotsin = sin((real_t)(2.0) * vIn.x);\n" @@ -5625,8 +5763,8 @@ public: << "\t\treal_t cotcosh = cosh((real_t)(2.0) * vIn.y);\n" << "\t\treal_t cotden = (real_t)(1.0) / Zeps(cotcosh - cotcos);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cotden * cotsin;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * cotden * -1 * cotsinh;\n" + << "\t\tvOut.x = " << weight << " * cotden * cotsin;\n" + << "\t\tvOut.y = " << weight << " * cotden * -1 * cotsinh;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -5663,6 +5801,7 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t sinhsin = sin(vIn.y);\n" @@ -5670,8 +5809,8 @@ public: << "\t\treal_t sinhsinh = sinh(vIn.x);\n" << "\t\treal_t sinhcosh = cosh(vIn.x);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sinhsinh * sinhcos;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sinhcosh * sinhsin;\n" + << "\t\tvOut.x = " << weight << " * sinhsinh * sinhcos;\n" + << "\t\tvOut.y = " << weight << " * sinhcosh * sinhsin;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -5703,6 +5842,7 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t coshsin = sin(vIn.y);\n" @@ -5710,8 +5850,8 @@ public: << "\t\treal_t coshsinh = sinh(vIn.x);\n" << "\t\treal_t coshcosh = cosh(vIn.x);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * coshcosh * coshcos;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * coshsinh * coshsin;\n" + << "\t\tvOut.x = " << weight << " * coshcosh * coshcos;\n" + << "\t\tvOut.y = " << weight << " * coshsinh * coshsin;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -5744,6 +5884,7 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t tanhsin = sin((real_t)(2.0) * vIn.y);\n" @@ -5752,8 +5893,8 @@ public: << "\t\treal_t tanhcosh = cosh((real_t)(2.0) * vIn.x);\n" << "\t\treal_t tanhden = (real_t)(1.0) / Zeps(tanhcos + tanhcosh);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * tanhden * tanhsinh;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * tanhden * tanhsin;\n" + << "\t\tvOut.x = " << weight << " * tanhden * tanhsinh;\n" + << "\t\tvOut.y = " << weight << " * tanhden * tanhsin;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -5791,6 +5932,7 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t sechsin = sin(vIn.y);\n" @@ -5799,8 +5941,8 @@ public: << "\t\treal_t sechcosh = cosh(vIn.x);\n" << "\t\treal_t sechden = (real_t)(2.0) / Zeps(cos((real_t)(2.0) * vIn.y) + cosh((real_t)(2.0) * vIn.x));\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sechden * sechcos * sechcosh;\n" - << "\t\tvOut.y = -(xform->m_VariationWeights[" << varIndex << "] * sechden * sechsin * sechsinh);\n" + << "\t\tvOut.x = " << weight << " * sechden * sechcos * sechcosh;\n" + << "\t\tvOut.y = -(" << weight << " * sechden * sechsin * sechsinh);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -5838,6 +5980,7 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t cschsin = sin(vIn.y);\n" @@ -5846,8 +5989,8 @@ public: << "\t\treal_t cschcosh = cosh(vIn.x);\n" << "\t\treal_t cschden = (real_t)(2.0) / Zeps(cosh((real_t)(2.0) * vIn.x) - cos((real_t)(2.0) * vIn.y));\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cschden * cschsinh * cschcos;\n" - << "\t\tvOut.y = -(xform->m_VariationWeights[" << varIndex << "] * cschden * cschcosh * cschsin);\n" + << "\t\tvOut.x = " << weight << " * cschden * cschsinh * cschcos;\n" + << "\t\tvOut.y = -(" << weight << " * cschden * cschcosh * cschsin);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -5885,6 +6028,7 @@ public: virtual string OpenCLString() const override { ostringstream ss; + string weight = WeightDefineString(); intmax_t varIndex = IndexInXform(); ss << "\t{\n" << "\t\treal_t cothsin = sin((real_t)(2.0) * vIn.y);\n" @@ -5893,8 +6037,8 @@ public: << "\t\treal_t cothcosh = cosh((real_t)(2.0) * vIn.x);\n" << "\t\treal_t cothden = (real_t)(1.0) / Zeps(cothcosh - cothcos);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cothden * cothsinh;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * cothden * cothsin;\n" + << "\t\tvOut.x = " << weight << " * cothden * cothsinh;\n" + << "\t\tvOut.y = " << weight << " * cothden * cothsin;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -5937,29 +6081,30 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string symmetry = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string symmetry = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string augerWeight = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string freq = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string freq = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t s = sin(" << freq << " * vIn.x);\n" << "\t\treal_t t = sin(" << freq << " * vIn.y);\n" << "\t\treal_t dy = vIn.y + " << augerWeight << " * (" << scale << " * s / Zeps((real_t)(2.0) + fabs(vIn.y) * s));\n" << "\t\treal_t dx = vIn.x + " << augerWeight << " * (" << scale << " * t / Zeps((real_t)(2.0) + fabs(vIn.x) * t));\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + " << symmetry << " * (dx - vIn.x));\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * dy;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.x = " << weight << " * (vIn.x + " << symmetry << " * (dx - vIn.x));\n" + << "\t\tvOut.y = " << weight << " * dy;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } virtual void Random(QTIsaac& rand) override { - m_Symmetry = 0; + m_Symmetry = 0; m_AugerWeight = T(0.5) + rand.Frand01() / 2; - m_Freq = T(Floor(5 * rand.Frand01())) + 1; - m_Scale = rand.Frand01(); + m_Freq = T(Floor(5 * rand.Frand01())) + 1; + m_Scale = rand.Frand01(); } virtual vector OpenCLGlobalFuncNames() const override @@ -5972,10 +6117,10 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Symmetry, prefix + "auger_sym")); + m_Params.push_back(ParamWithName(&m_Symmetry, prefix + "auger_sym")); m_Params.push_back(ParamWithName(&m_AugerWeight, prefix + "auger_weight", T(0.5))); - m_Params.push_back(ParamWithName(&m_Freq, prefix + "auger_freq", 5)); - m_Params.push_back(ParamWithName(&m_Scale, prefix + "auger_scale", T(0.1))); + m_Params.push_back(ParamWithName(&m_Freq, prefix + "auger_freq", 5)); + m_Params.push_back(ParamWithName(&m_Scale, prefix + "auger_scale", T(0.1))); } private: @@ -6022,18 +6167,19 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string spread = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string spr = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string spr = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\treal_t xpw = vIn.x + xform->m_VariationWeights[" << varIndex << "];\n" - << "\t\treal_t xmw = vIn.x - xform->m_VariationWeights[" << varIndex << "];\n" + << "\t\treal_t xpw = vIn.x + " << weight << ";\n" + << "\t\treal_t xmw = vIn.x - " << weight << ";\n" << "\t\treal_t yy = SQR(vIn.y);\n" << "\t\treal_t frac = sqrt(yy + SQR(xmw));\n" << "\n" << "\t\tif (frac == (real_t)(0.0))\n" << "\t\t frac = (real_t)(1.0);\n" << "\n" - << "\t\treal_t avgr = xform->m_VariationWeights[" << varIndex << "] * (" << spr << " * sqrt(sqrt(yy + SQR(xpw)) / frac));\n" + << "\t\treal_t avgr = " << weight << " * (" << spr << " * sqrt(sqrt(yy + SQR(xpw)) / frac));\n" << "\t\treal_t avga = (atan2(vIn.y, xmw) - atan2(vIn.y, xpw)) * (real_t)(0.5);\n" << "\n" << "\t\tvOut.x = avgr * cos(avga);\n" @@ -6050,7 +6196,7 @@ public: virtual void Random(QTIsaac& rand) override { - m_Spread = T(0.5) + rand.Frand01() / 2; + m_Spread = T(0.5) + rand.Frand01() / 2; } protected: diff --git a/Source/Ember/Variations02.h b/Source/Ember/Variations02.h index 9deb899..a675dba 100644 --- a/Source/Ember/Variations02.h +++ b/Source/Ember/Variations02.h @@ -27,8 +27,9 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" - << "\t\treal_t t = xform->m_VariationWeights[" << varIndex << "] / sqrt(precalcSumSquares + (real_t)(1.0));\n" + << "\t\treal_t t = " << weight << " / sqrt(precalcSumSquares + (real_t)(1.0));\n" << "\n" << "\t\tvOut.x = vIn.x * t;\n" << "\t\tvOut.y = vIn.y * t;\n" @@ -77,17 +78,18 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string thickness = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string holes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string holes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t theta = precalcAtanyx;\n" << "\t\treal_t t = (MwcNext01(mwc) * " << thickness << ") * (1 / cos(" << n << " * theta)) - " << holes << ";\n" << "\n" << "\t\tif (fabs(t) != 0)\n" << "\t\t{\n" - << "\t\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * t * cos(theta);\n" - << "\t\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * t * sin(theta);\n" + << "\t\t\tvOut.x = " << weight << " * t * cos(theta);\n" + << "\t\t\tvOut.y = " << weight << " * t * sin(theta);\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" @@ -104,9 +106,9 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_N, prefix + "epispiral_n", 6)); + m_Params.push_back(ParamWithName(&m_N, prefix + "epispiral_n", 6)); m_Params.push_back(ParamWithName(&m_Thickness, prefix + "epispiral_thickness")); - m_Params.push_back(ParamWithName(&m_Holes, prefix + "epispiral_holes", 1)); + m_Params.push_back(ParamWithName(&m_Holes, prefix + "epispiral_holes", 1)); } private: @@ -178,19 +180,20 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string bwrapsCellsize = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string bwrapsSpace = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string bwrapsGain = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string bwrapsCellsize = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string bwrapsSpace = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string bwrapsGain = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string bwrapsInnerTwist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string bwrapsOuterTwist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string g2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string r2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rfactor = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string g2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string r2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rfactor = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tif (" << bwrapsCellsize << " == 0)\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" @@ -203,8 +206,8 @@ public: << "\n" << "\t\t if ((SQR(lx) + SQR(ly)) > " << r2 << ")\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" @@ -224,12 +227,12 @@ public: << "\t\t vx = cx + c * lx + s * ly;\n" << "\t\t vy = cy - s * lx + c * ly;\n" << "\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vx;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vy;\n" + << "\t\t vOut.x = " << weight << " * vx;\n" + << "\t\t vOut.y = " << weight << " * vy;\n" << "\t\t }\n" << "\t\t}\n" << "\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -259,13 +262,13 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_BwrapsCellsize, prefix + "bwraps_cellsize", 1)); - m_Params.push_back(ParamWithName(&m_BwrapsSpace, prefix + "bwraps_space")); - m_Params.push_back(ParamWithName(&m_BwrapsGain, prefix + "bwraps_gain", 1)); + m_Params.push_back(ParamWithName(&m_BwrapsCellsize, prefix + "bwraps_cellsize", 1)); + m_Params.push_back(ParamWithName(&m_BwrapsSpace, prefix + "bwraps_space")); + m_Params.push_back(ParamWithName(&m_BwrapsGain, prefix + "bwraps_gain", 1)); m_Params.push_back(ParamWithName(&m_BwrapsInnerTwist, prefix + "bwraps_inner_twist")); m_Params.push_back(ParamWithName(&m_BwrapsOuterTwist, prefix + "bwraps_outer_twist")); - m_Params.push_back(ParamWithName(true, &m_G2, prefix + "bwraps_g2"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_R2, prefix + "bwraps_r2")); + m_Params.push_back(ParamWithName(true, &m_G2, prefix + "bwraps_g2"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_R2, prefix + "bwraps_r2")); m_Params.push_back(ParamWithName(true, &m_Rfactor, prefix + "bwraps_rfactor")); } @@ -337,6 +340,7 @@ public: { ostringstream ss, ss2; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); ss << "\t{\n" @@ -371,14 +375,14 @@ public: << "\t\t side = absy;\n" << "\t\t}\n" << "\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * side;\n" + << "\t\treal_t r = " << weight << " * side;\n" << "\t\treal_t val = MPI4 * perimeter / side - MPI4;\n" << "\t\treal_t sina = sin(val);\n" << "\t\treal_t cosa = cos(val);\n" << "\n" << "\t\tvOut.x = r * cosa;\n" << "\t\tvOut.y = r * sina;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -412,15 +416,16 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string blurZoomLength = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string blurZoomX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string blurZoomY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string blurZoomX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string blurZoomY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t z = 1 + " << blurZoomLength << " * MwcNext01(mwc);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * ((vIn.x - " << blurZoomX << ") * z + " << blurZoomX << ");\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * ((vIn.y - " << blurZoomY << ") * z - " << blurZoomY << ");\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.x = " << weight << " * ((vIn.x - " << blurZoomX << ") * z + " << blurZoomX << ");\n" + << "\t\tvOut.y = " << weight << " * ((vIn.y - " << blurZoomY << ") * z - " << blurZoomY << ");\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -431,8 +436,8 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_BlurZoomLength, prefix + "blur_zoom_length")); - m_Params.push_back(ParamWithName(&m_BlurZoomX, prefix + "blur_zoom_x")); - m_Params.push_back(ParamWithName(&m_BlurZoomY, prefix + "blur_zoom_y")); + m_Params.push_back(ParamWithName(&m_BlurZoomX, prefix + "blur_zoom_x")); + m_Params.push_back(ParamWithName(&m_BlurZoomY, prefix + "blur_zoom_y")); } private: @@ -470,17 +475,18 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string blurPixelizeSize = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string blurPixelizeSize = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string blurPixelizeScale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string v = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string invSize = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string v = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invSize = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t x = floor(vIn.x * " << invSize << ");\n" << "\t\treal_t y = floor(vIn.y * " << invSize << ");\n" << "\n" << "\t\tvOut.x = " << v << " * (x + " << blurPixelizeScale << " * (MwcNext01(mwc) - (real_t)(0.5)) + (real_t)(0.5));\n" << "\t\tvOut.y = " << v << " * (y + " << blurPixelizeScale << " * (MwcNext01(mwc) - (real_t)(0.5)) + (real_t)(0.5));\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -496,9 +502,9 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_BlurPixelizeSize, prefix + "blur_pixelize_size", T(0.1), eParamType::REAL, EPS)); + m_Params.push_back(ParamWithName(&m_BlurPixelizeSize, prefix + "blur_pixelize_size", T(0.1), eParamType::REAL, EPS)); m_Params.push_back(ParamWithName(&m_BlurPixelizeScale, prefix + "blur_pixelize_scale", 1)); - m_Params.push_back(ParamWithName(true, &m_V, prefix + "blur_pixelize_v"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_V, prefix + "blur_pixelize_v"));//Precalc. m_Params.push_back(ParamWithName(true, &m_InvSize, prefix + "blur_pixelize_inv_size")); } @@ -557,18 +563,19 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string x0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string x1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string s = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string z = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string x0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string x1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string s = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string z = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string x0_ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string y0_ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string x1_ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string y1_ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string w = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string h = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string w = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string h = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t x = vIn.x;\n" << "\t\treal_t y = vIn.y;\n" @@ -591,9 +598,9 @@ public: << "\t\t y = " << y1_ << " - MwcNext01(mwc) * " << h << ";\n" << "\t\t}\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * x;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * y;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.x = " << weight << " * x;\n" + << "\t\tvOut.y = " << weight << " * y;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -635,14 +642,14 @@ protected: m_Params.push_back(ParamWithName(&m_Y0, prefix + "crop_top", -1)); m_Params.push_back(ParamWithName(&m_X1, prefix + "crop_right", 1)); m_Params.push_back(ParamWithName(&m_Y1, prefix + "crop_bottom", 1)); - m_Params.push_back(ParamWithName(&m_S, prefix + "crop_scatter_area", 0, eParamType::REAL, -1, 1)); - m_Params.push_back(ParamWithName(&m_Z, prefix + "crop_zero", 0, eParamType::INTEGER, 0, 1)); + m_Params.push_back(ParamWithName(&m_S, prefix + "crop_scatter_area", 0, eParamType::REAL, -1, 1)); + m_Params.push_back(ParamWithName(&m_Z, prefix + "crop_zero", 0, eParamType::INTEGER, 0, 1)); m_Params.push_back(ParamWithName(true, &m_X0_, prefix + "crop_x0_"));//Precalc. m_Params.push_back(ParamWithName(true, &m_Y0_, prefix + "crop_y0_")); m_Params.push_back(ParamWithName(true, &m_X1_, prefix + "crop_x1_")); m_Params.push_back(ParamWithName(true, &m_Y1_, prefix + "crop_y1_")); - m_Params.push_back(ParamWithName(true, &m_W, prefix + "crop_w")); - m_Params.push_back(ParamWithName(true, &m_H, prefix + "crop_h")); + m_Params.push_back(ParamWithName(true, &m_W, prefix + "crop_w")); + m_Params.push_back(ParamWithName(true, &m_H, prefix + "crop_h")); } private: @@ -710,9 +717,10 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string borderWidth = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string bcbw = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string borderWidth = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string bcbw = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tif ((vIn.x == 0) && (vIn.y == 0))\n" << "\t\t return;\n" @@ -723,8 +731,8 @@ public: << "\n" << "\t\tif (r <= 1)\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * y;\n" + << "\t\t vOut.x = " << weight << " * x;\n" + << "\t\t vOut.y = " << weight << " * y;\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" @@ -735,8 +743,8 @@ public: << "\t\t real_t px = omega * cos(ang);\n" << "\t\t real_t py = omega * sin(ang);\n" << "\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * px;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * py;\n" + << "\t\t vOut.x = " << weight << " * px;\n" + << "\t\t vOut.y = " << weight << " * py;\n" << "\t\t }\n" << "\t\t}\n" << "\n" @@ -755,7 +763,7 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Scale, prefix + "bcircle_scale", 1)); + m_Params.push_back(ParamWithName(&m_Scale, prefix + "bcircle_scale", 1)); m_Params.push_back(ParamWithName(&m_BorderWidth, prefix + "bcircle_borderwidth")); m_Params.push_back(ParamWithName(true, &m_Bcbw, prefix + "bcircle_bcbw"));//Precalc. } @@ -794,15 +802,16 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string blurLinearLength = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string blurLinearAngle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string s = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string blurLinearAngle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string s = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t r = " << blurLinearLength << " * MwcNext01(mwc);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + r * " << c << ");\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + r * " << s << ");\n" + << "\t\tvOut.x = " << weight << " * (vIn.x + r * " << c << ");\n" + << "\t\tvOut.y = " << weight << " * (vIn.y + r * " << s << ");\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -819,7 +828,7 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_BlurLinearLength, prefix + "blur_linear_length")); - m_Params.push_back(ParamWithName(&m_BlurLinearAngle, prefix + "blur_linear_angle", 0, eParamType::REAL_CYCLIC, 0, T(M_2PI))); + m_Params.push_back(ParamWithName(&m_BlurLinearAngle, prefix + "blur_linear_angle", 0, eParamType::REAL_CYCLIC, 0, T(M_2PI))); m_Params.push_back(ParamWithName(true, &m_S, prefix + "blur_linear_s"));//Precalc. m_Params.push_back(ParamWithName(true, &m_C, prefix + "blur_linear_c")); } @@ -858,6 +867,7 @@ public: intmax_t i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string v = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params. ss << "\t{\n" << "\t\tvOut.x = " << v << " * (MwcNext01(mwc) - (real_t)(0.5));\n" @@ -959,9 +969,10 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\tvOut.x = vOut.y = 0;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - (real_t)(2.0));\n" + << "\t\tvOut.z = " << weight << " * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - (real_t)(2.0));\n" << "\t}\n"; return ss.str(); } @@ -989,9 +1000,10 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\tvOut.x = vOut.y = 0;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -1019,9 +1031,10 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\tvOut.x = vOut.y = 0;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "];\n" + << "\t\tvOut.z = " << weight << ";\n" << "\t}\n"; return ss.str(); } @@ -1058,6 +1071,7 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n"; if (m_VarType == eVariationType::VARTYPE_REG) @@ -1070,7 +1084,7 @@ public: << "\t\tvOut.y = vIn.y;\n"; } - ss << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares;\n" + ss << "\t\tvOut.z = " << weight << " * precalcSqrtSumSquares;\n" << "\t}\n"; return ss.str(); } @@ -1105,9 +1119,10 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t angle = MwcNext01(mwc) * M_2PI;\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - (real_t)(2.0));\n" + << "\t\treal_t r = " << weight << " * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - (real_t)(2.0));\n" << "\t\treal_t angle2 = MwcNext01(mwc) * MPI;\n" << "\t\treal_t sina = sin(angle);\n" << "\t\treal_t cosa = cos(angle);\n" @@ -1145,8 +1160,9 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" - << "\t\treal_t r2 = xform->m_VariationWeights[" << varIndex << "] / Zeps(precalcSumSquares + SQR(vIn.z));\n" + << "\t\treal_t r2 = " << weight << " / Zeps(precalcSumSquares + SQR(vIn.z));\n" << "\n" << "\t\tvOut.x = r2 * vIn.x;\n" << "\t\tvOut.y = r2 * vIn.y;\n" @@ -1190,16 +1206,17 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string cx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cz = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string cx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cz = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string c2x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string c2y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string c2z = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t r2 = precalcSumSquares + SQR(vIn.z);\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / Zeps(r2 * " << c2 << " + " << c2x << " * vIn.x - " << c2y << " * vIn.y + " << c2z << " * vIn.z + (real_t)(1.0));\n" + << "\t\treal_t r = " << weight << " / Zeps(r2 * " << c2 << " + " << c2x << " * vIn.x - " << c2y << " * vIn.y + " << c2z << " * vIn.z + (real_t)(1.0));\n" << "\n" << "\t\tvOut.x = r * (vIn.x + " << cx << " * r2);\n" << "\t\tvOut.y = r * (vIn.y - " << cy << " * r2);\n" @@ -1229,7 +1246,7 @@ protected: m_Params.push_back(ParamWithName(&m_Cx, prefix + "curl3D_cx")); m_Params.push_back(ParamWithName(&m_Cy, prefix + "curl3D_cy")); m_Params.push_back(ParamWithName(&m_Cz, prefix + "curl3D_cz")); - m_Params.push_back(ParamWithName(true, &m_C2, prefix + "curl3D_c2"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_C2, prefix + "curl3D_c2"));//Precalc. m_Params.push_back(ParamWithName(true, &m_C2x, prefix + "curl3D_c2x")); m_Params.push_back(ParamWithName(true, &m_C2y, prefix + "curl3D_c2y")); m_Params.push_back(ParamWithName(true, &m_C2z, prefix + "curl3D_c2z")); @@ -1277,13 +1294,14 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string pi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string pi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t r = precalcSqrtSumSquares;\n" << "\t\treal_t temp = r * " << pi << ";\n" << "\t\treal_t sr = sin(temp);\n" << "\t\treal_t cr = cos(temp);\n" - << "\t\treal_t vv = xform->m_VariationWeights[" << varIndex << "] * precalcAtanxy / Zeps(" << pi << ");\n" + << "\t\treal_t vv = " << weight << " * precalcAtanxy / Zeps(" << pi << ");\n" << "\n" << "\t\tvOut.x = vv * sr;\n" << "\t\tvOut.y = vv * cr;\n" @@ -1374,12 +1392,13 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string l = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string r = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string l = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string r = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string absc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cl = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cr = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cl = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cr = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t roundX = (real_t)(int)(vIn.x >= 0 ? (int)(vIn.x + (real_t)(0.5)) : (int)(vIn.x - (real_t)(0.5)));\n" << "\t\treal_t roundY = (real_t)(int)(vIn.y >= 0 ? (int)(vIn.y + (real_t)(0.5)) : (int)(vIn.y - (real_t)(0.5)));\n" @@ -1388,8 +1407,8 @@ public: << "\n" << "\t\tif (MwcNext01(mwc) >= " << cr << ")\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetX * " << absc << " + roundX);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (offsetY * " << absc << " + roundY);\n" + << "\t\t vOut.x = " << weight << " * (offsetX * " << absc << " + roundX);\n" + << "\t\t vOut.y = " << weight << " * (offsetY * " << absc << " + roundY);\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" @@ -1397,26 +1416,26 @@ public: << "\t\t {\n" << "\t\t if (offsetX >= 0)\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetX * " << absc << " + roundX + " << cl << ");\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (offsetY * " << absc << " + roundY + " << cl << " * offsetY / offsetX);\n" + << "\t\t vOut.x = " << weight << " * (offsetX * " << absc << " + roundX + " << cl << ");\n" + << "\t\t vOut.y = " << weight << " * (offsetY * " << absc << " + roundY + " << cl << " * offsetY / offsetX);\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetX * " << absc << " + roundX - " << cl << ");\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (offsetY * " << absc << " + roundY - " << cl << " * offsetY / offsetX);\n" + << "\t\t vOut.x = " << weight << " * (offsetX * " << absc << " + roundX - " << cl << ");\n" + << "\t\t vOut.y = " << weight << " * (offsetY * " << absc << " + roundY - " << cl << " * offsetY / offsetX);\n" << "\t\t }\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" << "\t\t if(offsetY >= 0)\n" << "\t\t {\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (offsetY * " << absc << " + roundY + " << cl << ");\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetX * " << absc << " + roundX + offsetX / offsetY * " << cl << ");\n" + << "\t\t vOut.y = " << weight << " * (offsetY * " << absc << " + roundY + " << cl << ");\n" + << "\t\t vOut.x = " << weight << " * (offsetX * " << absc << " + roundX + offsetX / offsetY * " << cl << ");\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (offsetY * " << absc << " + roundY - " << cl << ");\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (offsetX * " << absc << " + roundX - offsetX / offsetY * " << cl << ");\n" + << "\t\t vOut.y = " << weight << " * (offsetY * " << absc << " + roundY - " << cl << ");\n" + << "\t\t vOut.x = " << weight << " * (offsetX * " << absc << " + roundX - offsetX / offsetY * " << cl << ");\n" << "\t\t }\n" << "\t\t }\n" << "\t\t}\n" @@ -1441,12 +1460,12 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_C, prefix + "boarders2_c", T(0.5))); - m_Params.push_back(ParamWithName(&m_Left, prefix + "boarders2_left", T(0.5))); + m_Params.push_back(ParamWithName(&m_C, prefix + "boarders2_c", T(0.5))); + m_Params.push_back(ParamWithName(&m_Left, prefix + "boarders2_left", T(0.5))); m_Params.push_back(ParamWithName(&m_Right, prefix + "boarders2_right", T(0.5))); m_Params.push_back(ParamWithName(true, &m_AbsC, prefix + "boarders2_cabs"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_Cl, prefix + "boarders2_cl")); - m_Params.push_back(ParamWithName(true, &m_Cr, prefix + "boarders2_cr")); + m_Params.push_back(ParamWithName(true, &m_Cl, prefix + "boarders2_cl")); + m_Params.push_back(ParamWithName(true, &m_Cr, prefix + "boarders2_cr")); } private: @@ -1486,9 +1505,10 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * sqrt(precalcSumSquares + sin(precalcAtanyx * " << a << ") + 1);\n" + << "\t\treal_t r = " << weight << " * sqrt(precalcSumSquares + sin(precalcAtanyx * " << a << ") + 1);\n" << "\n" << "\t\tvOut.x = r * precalcCosa;\n" << "\t\tvOut.y = r * precalcSina;\n" @@ -1552,15 +1572,16 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string size = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rnd = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cs = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ncx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ncy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rnd = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cs = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ncx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ncy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t dx, dy;\n" << "\t\treal_t rnx = " << rnd << " * MwcNext01(mwc);\n" @@ -1579,9 +1600,9 @@ public: << "\t\t dy = " << cy << " + rny;\n" << "\t\t}\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + dx);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + dy);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.x = " << weight << " * (vIn.x + dx);\n" + << "\t\tvOut.y = " << weight << " * (vIn.y + dy);\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -1605,13 +1626,13 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_X, prefix + "checks_x", T(0.5))); - m_Params.push_back(ParamWithName(&m_Y, prefix + "checks_y", T(0.5))); + m_Params.push_back(ParamWithName(&m_X, prefix + "checks_x", T(0.5))); + m_Params.push_back(ParamWithName(&m_Y, prefix + "checks_y", T(0.5))); m_Params.push_back(ParamWithName(&m_Size, prefix + "checks_size", T(0.5))); - m_Params.push_back(ParamWithName(&m_Rnd, prefix + "checks_rnd")); - m_Params.push_back(ParamWithName(true, &m_Cs, prefix + "checks_cs"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_Cx, prefix + "checks_cx")); - m_Params.push_back(ParamWithName(true, &m_Cy, prefix + "checks_cy")); + m_Params.push_back(ParamWithName(&m_Rnd, prefix + "checks_rnd")); + m_Params.push_back(ParamWithName(true, &m_Cs, prefix + "checks_cs"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_Cx, prefix + "checks_cx")); + m_Params.push_back(ParamWithName(true, &m_Cy, prefix + "checks_cy")); m_Params.push_back(ParamWithName(true, &m_Ncx, prefix + "checks_ncx")); m_Params.push_back(ParamWithName(true, &m_Ncy, prefix + "checks_ncy")); } @@ -1682,7 +1703,8 @@ public: intmax_t i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string hole = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string hole = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string vvar4pi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t side;\n" @@ -1791,7 +1813,8 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string hole = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string hole = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t side;\n" << "\t\treal_t perimeter;\n" @@ -1817,7 +1840,7 @@ public: << "\t\t side = absy;\n" << "\t\t}\n" << "\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * (side + " << hole << ");\n" + << "\t\treal_t r = " << weight << " * (side + " << hole << ");\n" << "\t\treal_t val = MPI4 * perimeter / side - MPI4;\n" << "\n" << "\t\tvOut.x = r * cos(val);\n" @@ -1872,17 +1895,18 @@ public: int i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string repeat = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string repeat = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string amountX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string amountY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string phaseX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string phaseY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ax = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ay = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string px = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string py = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string fr = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string vv2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string phaseX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string phaseY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ax = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ay = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string px = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string py = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string fr = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string vv2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t x = (real_t)(0.5) * vIn.x + (real_t)(0.5);\n" << "\t\treal_t y = (real_t)(0.5) * vIn.y + (real_t)(0.5);\n" @@ -1907,8 +1931,8 @@ public: { m_Ax = M_2PI * std::abs(m_AmountX); m_Ay = M_2PI * std::abs(m_AmountY); - m_Px = T(M_PI) * m_PhaseX; - m_Py = T(M_PI) * m_PhaseY; + m_Px = T(M_PI) * m_PhaseX; + m_Py = T(M_PI) * m_PhaseY; m_Fr = std::abs(m_Repeat); m_Vv2 = 2 * m_Weight; } @@ -1918,16 +1942,16 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Repeat, prefix + "coswrap_repeat", 1, eParamType::INTEGER_NONZERO)); + m_Params.push_back(ParamWithName(&m_Repeat, prefix + "coswrap_repeat", 1, eParamType::INTEGER_NONZERO)); m_Params.push_back(ParamWithName(&m_AmountX, prefix + "coswrap_amount_x")); m_Params.push_back(ParamWithName(&m_AmountY, prefix + "coswrap_amount_y")); - m_Params.push_back(ParamWithName(&m_PhaseX, prefix + "coswrap_phase_x", 0, eParamType::REAL_CYCLIC, -1, 1)); - m_Params.push_back(ParamWithName(&m_PhaseY, prefix + "coswrap_phase_y", 0, eParamType::REAL_CYCLIC, -1, 1)); - m_Params.push_back(ParamWithName(true, &m_Ax, prefix + "coswrap_ax"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_Ay, prefix + "coswrap_ay")); - m_Params.push_back(ParamWithName(true, &m_Px, prefix + "coswrap_px")); - m_Params.push_back(ParamWithName(true, &m_Py, prefix + "coswrap_py")); - m_Params.push_back(ParamWithName(true, &m_Fr, prefix + "coswrap_fr")); + m_Params.push_back(ParamWithName(&m_PhaseX, prefix + "coswrap_phase_x", 0, eParamType::REAL_CYCLIC, -1, 1)); + m_Params.push_back(ParamWithName(&m_PhaseY, prefix + "coswrap_phase_y", 0, eParamType::REAL_CYCLIC, -1, 1)); + m_Params.push_back(ParamWithName(true, &m_Ax, prefix + "coswrap_ax"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_Ay, prefix + "coswrap_ay")); + m_Params.push_back(ParamWithName(true, &m_Px, prefix + "coswrap_px")); + m_Params.push_back(ParamWithName(true, &m_Py, prefix + "coswrap_py")); + m_Params.push_back(ParamWithName(true, &m_Fr, prefix + "coswrap_fr")); m_Params.push_back(ParamWithName(true, &m_Vv2, prefix + "coswrap_vv2")); } @@ -1973,8 +1997,9 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" - << "\t\treal_t avgr = xform->m_VariationWeights[" << varIndex << "] * (sqrt(SQR(vIn.y) + SQR(vIn.x + 1)) / sqrt(SQR(vIn.y) + SQR(vIn.x - 1)));\n" + << "\t\treal_t avgr = " << weight << " * (sqrt(SQR(vIn.y) + SQR(vIn.x + 1)) / sqrt(SQR(vIn.y) + SQR(vIn.x - 1)));\n" << "\t\treal_t avga = (atan2(vIn.y, vIn.x - 1) - atan2(vIn.y, vIn.x + 1)) / 2;\n" << "\t\treal_t s = sin(avga);\n" << "\t\treal_t c = cos(avga);\n" @@ -2018,18 +2043,19 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string real = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string imag = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string k = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string t = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string k = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string t = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t expor = exp(vIn.x * " << k << " - vIn.y * " << t << ");\n" << "\t\treal_t temp = vIn.x * " << t << " + vIn.y * " << k << ";\n" << "\t\treal_t snv = sin(temp);\n" << "\t\treal_t csv = cos(temp);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * expor * csv;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * expor * snv;\n" + << "\t\tvOut.x = " << weight << " * expor * csv;\n" + << "\t\tvOut.y = " << weight << " * expor * snv;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -2102,6 +2128,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string rootFace = "parVars[" + ToUpper(m_Params[i++].Name()) + index; if (m_VarType == eVariationType::VARTYPE_REG) @@ -2110,9 +2137,9 @@ public: << "\t\tvOut.x = vOut.y = vOut.z = 0;\n" << "\n" << "\t\tif (MwcNext01(mwc) < " << rootFace << ")\n" - << "\t\t outPoint->m_Z = max(xform->m_VariationWeights[" << varIndex << "], (real_t)(0.0));\n" + << "\t\t outPoint->m_Z = max(" << weight << ", (real_t)(0.0));\n" << "\t\telse\n" - << "\t\t outPoint->m_Z = xform->m_VariationWeights[" << varIndex << "] * MwcNext01(mwc);\n" + << "\t\t outPoint->m_Z = " << weight << " * MwcNext01(mwc);\n" << "\t}\n"; } else @@ -2122,9 +2149,9 @@ public: << "\t\tvOut.y = vIn.y;\n" << "\n" << "\t\tif (MwcNext01(mwc) < " << rootFace << ")\n" - << "\t\t vOut.z = max(xform->m_VariationWeights[" << varIndex << "], (real_t)(0.0));\n" + << "\t\t vOut.z = max(" << weight << ", (real_t)(0.0));\n" << "\t\telse\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * MwcNext01(mwc);\n" + << "\t\t vOut.z = " << weight << " * MwcNext01(mwc);\n" << "\t}\n"; } @@ -2169,14 +2196,15 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t a = M_2PI / (precalcSqrtSumSquares + 1);\n" << "\t\treal_t r = (precalcAtanyx * M1PI + 1) * (real_t)(0.5);\n" << "\t\treal_t s = sin(a);\n" << "\t\treal_t c = cos(a);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * r * c;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * r * s;\n" + << "\t\tvOut.x = " << weight << " * r * c;\n" + << "\t\tvOut.y = " << weight << " * r * s;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -2217,7 +2245,8 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string five = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params. + string weight = WeightDefineString(); + string five = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params. string natLog = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t temp = vIn.y * " << natLog << ";\n" @@ -2229,8 +2258,8 @@ public: << "\t\treal_t eradius1 = exp(vIn.x * " << natLog << ");\n" << "\t\treal_t eradius2 = exp((vIn.x * " << natLog << " - vIn.y * MPI) * -(real_t)(1.0));\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (eradius1 * cnum1 - eradius2 * cnum2) * " << five << ";\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (eradius1 * snum1 - eradius2 * snum2) * " << five << ";\n" + << "\t\tvOut.x = " << weight << " * (eradius1 * cnum1 - eradius2 * cnum2) * " << five << ";\n" + << "\t\tvOut.y = " << weight << " * (eradius1 * snum1 - eradius2 * snum2) * " << five << ";\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -2247,7 +2276,7 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(true, &m_Five, prefix + "fibonacci_five"));//Precalcs only, no params. + m_Params.push_back(ParamWithName(true, &m_Five, prefix + "fibonacci_five"));//Precalcs only, no params. m_Params.push_back(ParamWithName(true, &m_NatLog, prefix + "fibonacci_nat_log")); } @@ -2290,9 +2319,10 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string sc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string sc2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string five = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string sc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string sc2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string five = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string natLog = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t temp = vIn.y * " << natLog << ";\n" @@ -2304,8 +2334,8 @@ public: << "\t\treal_t eradius1 = " << sc << " * exp(" << sc2 << " * (vIn.x * " << natLog << "));\n" << "\t\treal_t eradius2 = " << sc << " * exp(" << sc2 << " * ((vIn.x * " << natLog << " - vIn.y * MPI) * -1));\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (eradius1 * cnum1 - eradius2 * cnum2) * " << five << ";\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (eradius1 * snum1 - eradius2 * snum2) * " << five << ";\n" + << "\t\tvOut.x = " << weight << " * (eradius1 * cnum1 - eradius2 * cnum2) * " << five << ";\n" + << "\t\tvOut.y = " << weight << " * (eradius1 * snum1 - eradius2 * snum2) * " << five << ";\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -2322,9 +2352,9 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Sc, prefix + "fibonacci2_sc", 1)); + m_Params.push_back(ParamWithName(&m_Sc, prefix + "fibonacci2_sc", 1)); m_Params.push_back(ParamWithName(&m_Sc2, prefix + "fibonacci2_sc2", 1)); - m_Params.push_back(ParamWithName(true, &m_Five, prefix + "fibonacci2_five"));//Precalcs. + m_Params.push_back(ParamWithName(true, &m_Five, prefix + "fibonacci2_five"));//Precalcs. m_Params.push_back(ParamWithName(true, &m_NatLog, prefix + "fibonacci2_nat_log")); } @@ -2395,6 +2425,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string v2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params. ss << "\t{\n" << "\t\treal_t d, r = precalcSqrtSumSquares;\n" @@ -2410,7 +2441,7 @@ public: << "\t\t else\n" << "\t\t {\n" << "\t\t d = r + vIn.x;\n" - << "\t\t r = xform->m_VariationWeights[" << varIndex << "] / sqrt(r * (SQR(vIn.y) + SQR(d)));\n" + << "\t\t r = " << weight << " / sqrt(r * (SQR(vIn.y) + SQR(d)));\n" << "\t\t vOut.x = r * d;\n" << "\t\t vOut.y = r * vIn.y;\n" << "\t\t }\n" @@ -2426,7 +2457,7 @@ public: << "\t\t else\n" << "\t\t {\n" << "\t\t d = r + vIn.x;\n" - << "\t\t r = xform->m_VariationWeights[" << varIndex << "] / sqrt(r * (SQR(vIn.y) + SQR(d)));\n" + << "\t\t r = " << weight << " / sqrt(r * (SQR(vIn.y) + SQR(d)));\n" << "\t\t vOut.x = -(r * d);\n" << "\t\t vOut.y = r * vIn.y;\n" << "\t\t }\n" @@ -2536,6 +2567,7 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t x = LRint(vIn.x);\n" << "\t\treal_t y = LRint(vIn.y);\n" @@ -2546,26 +2578,26 @@ public: << "\t\t {\n" << "\t\t if (-y >= x)\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + 1);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * (vIn.x + 1);\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + 1);\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * (vIn.y + 1);\n" << "\t\t }\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" << "\t\t if (y <= x)\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + 1);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * (vIn.x + 1);\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y - 1);\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * (vIn.y - 1);\n" << "\t\t }\n" << "\t\t }\n" << "\t\t}\n" @@ -2575,26 +2607,26 @@ public: << "\t\t {\n" << "\t\t if (y >= x)\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x - 1);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * (vIn.x - 1);\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + 1);\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * (vIn.y + 1);\n" << "\t\t }\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" << "\t\t if (y > -x)\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x - 1);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * (vIn.x - 1);\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y - 1);\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * (vIn.y - 1);\n" << "\t\t }\n" << "\t\t }\n" << "\t\t}\n" @@ -2644,15 +2676,16 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string inside = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t r, delta = pow(precalcAtanyx / MPI + 1, " << a << ");\n" << "\n" << "\t\tif (" << inside << " != 0)\n" - << "\t\t r = xform->m_VariationWeights[" << varIndex << "] * delta / (precalcSqrtSumSquares + delta);\n" + << "\t\t r = " << weight << " * delta / (precalcSqrtSumSquares + delta);\n" << "\t\telse\n" - << "\t\t r = xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares + delta;\n" + << "\t\t r = " << weight << " * precalcSqrtSumSquares + delta;\n" << "\n" << "\t\tvOut.x = r * precalcCosa;\n" << "\t\tvOut.y = r * precalcSina;\n" @@ -2707,9 +2740,10 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string p = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string q = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string p = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string q = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string real = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string imag = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" @@ -2717,7 +2751,7 @@ public: << "\t\treal_t b = vIn.y - " << imag << ";\n" << "\t\treal_t c = " << real << " * vIn.x - " << imag << " * vIn.y + 1;\n" << "\t\treal_t d = " << real << " * vIn.y + " << imag << " * vIn.x;\n" - << "\t\treal_t vr = xform->m_VariationWeights[" << varIndex << "] / (SQR(c) + SQR(d));\n" + << "\t\treal_t vr = " << weight << " / (SQR(c) + SQR(d));\n" << "\n" << "\t\tvOut.x = vr * (a * c + b * d);\n" << "\t\tvOut.y = vr * (b * c - a * d);\n" @@ -2799,10 +2833,11 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string p = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string q = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string p = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string q = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string pa = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string r = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string r = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t temp = MwcNext(mwc) * " << pa << ";\n" << "\t\treal_t sina = sin(temp);\n" @@ -2813,7 +2848,7 @@ public: << "\t\treal_t b = vIn.y - im;\n" << "\t\treal_t c = re * vIn.x - im * vIn.y + 1;\n" << "\t\treal_t d = re * vIn.y + im * vIn.x;\n" - << "\t\treal_t vr = xform->m_VariationWeights[" << varIndex << "] / (SQR(c) + SQR(d));\n" + << "\t\treal_t vr = " << weight << " / (SQR(c) + SQR(d));\n" << "\n" << "\t\tvOut.x = vr * (a * c + b * d);\n" << "\t\tvOut.y = vr * (b * c - a * d);\n" @@ -2843,7 +2878,7 @@ protected: m_Params.push_back(ParamWithName(&m_P, prefix + "hypertile1_p", 3, eParamType::INTEGER, 3, T(0x7fffffff))); m_Params.push_back(ParamWithName(&m_Q, prefix + "hypertile1_q", 7, eParamType::INTEGER, 3, T(0x7fffffff))); m_Params.push_back(ParamWithName(true, &m_Pa, prefix + "hypertile1_pa"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_R, prefix + "hypertile1_r")); + m_Params.push_back(ParamWithName(true, &m_R, prefix + "hypertile1_r")); } private: @@ -2890,10 +2925,11 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string p = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string q = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string p = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string q = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string pa = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string r = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string r = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t a = vIn.x + " << r << ";\n" << "\t\treal_t b = vIn.y;\n" @@ -2901,7 +2937,7 @@ public: << "\t\treal_t d = " << r << " * vIn.y;\n" << "\t\treal_t x = (a * c + b * d);\n" << "\t\treal_t y = (b * c - a * d);\n" - << "\t\treal_t vr = xform->m_VariationWeights[" << varIndex << "] / (SQR(c) + SQR(d));\n" + << "\t\treal_t vr = " << weight << " / (SQR(c) + SQR(d));\n" << "\t\treal_t temp = MwcNext(mwc) * " << pa << ";\n" << "\t\treal_t sina = sin(temp);\n" << "\t\treal_t cosa = cos(temp);\n" @@ -2934,7 +2970,7 @@ protected: m_Params.push_back(ParamWithName(&m_P, prefix + "hypertile2_p", 3, eParamType::INTEGER, 3, T(0x7fffffff))); m_Params.push_back(ParamWithName(&m_Q, prefix + "hypertile2_q", 7, eParamType::INTEGER, 3, T(0x7fffffff))); m_Params.push_back(ParamWithName(true, &m_Pa, prefix + "hypertile2_pa"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_R, prefix + "hypertile2_r")); + m_Params.push_back(ParamWithName(true, &m_R, prefix + "hypertile2_r")); } private: @@ -2964,7 +3000,7 @@ public: T x2cx = m_C2x * helper.In.x; T y2cy = m_C2y * helper.In.y; T d = m_Weight / Zeps(m_C2 * r2 + x2cx - y2cy + 1); - helper.Out.x = d * (helper.In.x * m_S2x - m_Cx * ( y2cy - r2 - 1)); + helper.Out.x = d * (helper.In.x * m_S2x - m_Cx * (y2cy - r2 - 1)); helper.Out.y = d * (helper.In.y * m_S2y + m_Cy * (-x2cx - r2 - 1)); helper.Out.z = d * (helper.In.z * m_S2z); } @@ -2975,24 +3011,25 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string p = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string q = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cz = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string p = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string q = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cz = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string s2x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string s2y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string s2z = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string c2x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string c2y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string c2z = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t r2 = precalcSumSquares + vIn.z;\n" << "\t\treal_t x2cx = " << c2x << " * vIn.x;\n" << "\t\treal_t y2cy = " << c2y << " * vIn.y;\n" - << "\t\treal_t d = xform->m_VariationWeights[" << varIndex << "] / Zeps(" << c2 << " * r2 + x2cx - y2cy + 1);\n" + << "\t\treal_t d = " << weight << " / Zeps(" << c2 << " * r2 + x2cx - y2cy + 1);\n" << "\n" << "\t\tvOut.x = d * (vIn.x * " << s2x << " - " << cx << "* ( y2cy - r2 - 1));\n" << "\t\tvOut.y = d * (vIn.y * " << s2y << " + " << cy << "* (-x2cx - r2 - 1));\n" @@ -3036,16 +3073,16 @@ protected: m_Params.push_back(ParamWithName(&m_P, prefix + "hypertile3D_p", 3, eParamType::INTEGER, 3, T(0x7fffffff))); m_Params.push_back(ParamWithName(&m_Q, prefix + "hypertile3D_q", 7, eParamType::INTEGER, 3, T(0x7fffffff))); m_Params.push_back(ParamWithName(&m_N, prefix + "hypertile3D_n", 0, eParamType::INTEGER)); - m_Params.push_back(ParamWithName(true, &m_Cx, prefix + "hypertile3D_cx"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_Cy, prefix + "hypertile3D_cy")); - m_Params.push_back(ParamWithName(true, &m_Cz, prefix + "hypertile3D_cz")); + m_Params.push_back(ParamWithName(true, &m_Cx, prefix + "hypertile3D_cx"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_Cy, prefix + "hypertile3D_cy")); + m_Params.push_back(ParamWithName(true, &m_Cz, prefix + "hypertile3D_cz")); m_Params.push_back(ParamWithName(true, &m_S2x, prefix + "hypertile3D_s2x")); m_Params.push_back(ParamWithName(true, &m_S2y, prefix + "hypertile3D_s2y")); m_Params.push_back(ParamWithName(true, &m_S2z, prefix + "hypertile3D_s2z")); m_Params.push_back(ParamWithName(true, &m_C2x, prefix + "hypertile3D_c2x")); m_Params.push_back(ParamWithName(true, &m_C2y, prefix + "hypertile3D_c2y")); m_Params.push_back(ParamWithName(true, &m_C2z, prefix + "hypertile3D_c2z")); - m_Params.push_back(ParamWithName(true, &m_C2, prefix + "hypertile3D_c2")); + m_Params.push_back(ParamWithName(true, &m_C2, prefix + "hypertile3D_c2")); } private: @@ -3089,7 +3126,7 @@ public: T x2cx = 2 * cx * helper.In.x; T y2cy = 2 * cy * helper.In.x; T d = m_Weight / Zeps(m_C2 * r2 + x2cx - y2cy + 1); - helper.Out.x = d * (helper.In.x * s2x - cx * ( y2cy - r2 - 1)); + helper.Out.x = d * (helper.In.x * s2x - cx * (y2cy - r2 - 1)); helper.Out.y = d * (helper.In.y * s2y + cy * (-x2cx - r2 - 1)); helper.Out.z = d * (helper.In.z * m_S2z); } @@ -3100,11 +3137,12 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string p = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string q = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string pa = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string r = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string p = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string q = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string pa = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string r = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string s2z = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t temp = MwcNext(mwc) * " << pa << ";\n" @@ -3115,7 +3153,7 @@ public: << "\t\treal_t r2 = precalcSumSquares + SQR(vIn.z);\n" << "\t\treal_t x2cx = 2 * cx * vIn.x;\n" << "\t\treal_t y2cy = 2 * cy * vIn.x;\n" - << "\t\treal_t d = xform->m_VariationWeights[" << varIndex << "] / Zeps(" << c2 << " * r2 + x2cx - y2cy + 1);\n" + << "\t\treal_t d = " << weight << " / Zeps(" << c2 << " * r2 + x2cx - y2cy + 1);\n" << "\n" << "\t\tvOut.x = d * (vIn.x * s2x - cx * ( y2cy - r2 - 1));\n" << "\t\tvOut.y = d * (vIn.y * s2y + cy * (-x2cx - r2 - 1));\n" @@ -3153,9 +3191,9 @@ protected: m_Params.clear(); m_Params.push_back(ParamWithName(&m_P, prefix + "hypertile3D1_p", 3, eParamType::INTEGER, 3, T(0x7fffffff))); m_Params.push_back(ParamWithName(&m_Q, prefix + "hypertile3D1_q", 7, eParamType::INTEGER, 3, T(0x7fffffff))); - m_Params.push_back(ParamWithName(true, &m_Pa, prefix + "hypertile3D1_pa"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_R, prefix + "hypertile3D1_r")); - m_Params.push_back(ParamWithName(true, &m_C2, prefix + "hypertile3D1_c2")); + m_Params.push_back(ParamWithName(true, &m_Pa, prefix + "hypertile3D1_pa"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_R, prefix + "hypertile3D1_r")); + m_Params.push_back(ParamWithName(true, &m_C2, prefix + "hypertile3D1_c2")); m_Params.push_back(ParamWithName(true, &m_S2z, prefix + "hypertile3D1_s2z")); } @@ -3203,11 +3241,12 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string p = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string q = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string pa = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string p = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string q = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string pa = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string c2x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string s2x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string s2y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; @@ -3217,7 +3256,7 @@ public: << "\t\treal_t x2cx = " << c2x << " * vIn.x;\n" << "\t\treal_t x = vIn.x * " << s2x << " - " << cx << " * (-r2 - 1);\n" << "\t\treal_t y = vIn.y * " << s2y << ";\n" - << "\t\treal_t vr = xform->m_VariationWeights[" << varIndex << "] / (" << c2 << " * r2 + x2cx + 1);\n" + << "\t\treal_t vr = " << weight << " / (" << c2 << " * r2 + x2cx + 1);\n" << "\t\treal_t temp = MwcNext(mwc) * " << pa << ";\n" << "\t\treal_t sina = sin(temp);\n" << "\t\treal_t cosa = cos(temp);\n" @@ -3256,9 +3295,9 @@ protected: m_Params.clear(); m_Params.push_back(ParamWithName(&m_P, prefix + "hypertile3D2_p", 3, eParamType::INTEGER, 3, T(0x7fffffff))); m_Params.push_back(ParamWithName(&m_Q, prefix + "hypertile3D2_q", 7, eParamType::INTEGER, 3, T(0x7fffffff))); - m_Params.push_back(ParamWithName(true, &m_Pa, prefix + "hypertile3D2_pa"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_Cx, prefix + "hypertile3D2_cx")); - m_Params.push_back(ParamWithName(true, &m_C2, prefix + "hypertile3D2_c2")); + m_Params.push_back(ParamWithName(true, &m_Pa, prefix + "hypertile3D2_pa"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_Cx, prefix + "hypertile3D2_cx")); + m_Params.push_back(ParamWithName(true, &m_C2, prefix + "hypertile3D2_c2")); m_Params.push_back(ParamWithName(true, &m_C2x, prefix + "hypertile3D2_c2x")); m_Params.push_back(ParamWithName(true, &m_S2x, prefix + "hypertile3D2_s2x")); m_Params.push_back(ParamWithName(true, &m_S2y, prefix + "hypertile3D2_s2y")); @@ -3308,6 +3347,7 @@ public: intmax_t i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string v = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params. ss << "\t{\n" << "\t\treal_t a = MPI / (precalcSqrtSumSquares + 1);\n" @@ -3372,23 +3412,24 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string d = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string e = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string f = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string d = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string e = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string f = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string absn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string absn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t x = " << a << " * vIn.x + " << b << " * vIn.y + " << e << ";\n" << "\t\treal_t y = " << c << " * vIn.x + " << d << " * vIn.y + " << f << ";\n" << "\t\treal_t angle = (atan2(y, x) + M_2PI * MwcNextRange(mwc, (uint)" << absn << ")) / " << power << ";\n" << "\t\treal_t sina = sin(angle);\n" << "\t\treal_t cosa = cos(angle);\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * pow(SQR(x) + SQR(y), " << cn << ");\n" + << "\t\treal_t r = " << weight << " * pow(SQR(x) + SQR(y), " << cn << ");\n" << "\n" << "\t\tvOut.x = r * cosa;\n" << "\t\tvOut.y = r * sina;\n" @@ -3411,16 +3452,16 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_A, prefix + "julian2_a", 1)); - m_Params.push_back(ParamWithName(&m_B, prefix + "julian2_b")); - m_Params.push_back(ParamWithName(&m_C, prefix + "julian2_c")); - m_Params.push_back(ParamWithName(&m_D, prefix + "julian2_d", 1)); - m_Params.push_back(ParamWithName(&m_E, prefix + "julian2_e")); - m_Params.push_back(ParamWithName(&m_F, prefix + "julian2_f")); + m_Params.push_back(ParamWithName(&m_A, prefix + "julian2_a", 1)); + m_Params.push_back(ParamWithName(&m_B, prefix + "julian2_b")); + m_Params.push_back(ParamWithName(&m_C, prefix + "julian2_c")); + m_Params.push_back(ParamWithName(&m_D, prefix + "julian2_d", 1)); + m_Params.push_back(ParamWithName(&m_E, prefix + "julian2_e")); + m_Params.push_back(ParamWithName(&m_F, prefix + "julian2_f")); m_Params.push_back(ParamWithName(&m_Power, prefix + "julian2_power", 2, eParamType::INTEGER_NONZERO)); - m_Params.push_back(ParamWithName(&m_Dist, prefix + "julian2_dist", 1)); + m_Params.push_back(ParamWithName(&m_Dist, prefix + "julian2_dist", 1)); m_Params.push_back(ParamWithName(true, &m_AbsN, prefix + "julian2_absn"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "julian2_cn")); + m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "julian2_cn")); } private: @@ -3467,16 +3508,17 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string divisor = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string divisor = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string halfInvPower = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string invPower = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string invPower2Pi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invPower = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invPower2Pi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t a = precalcAtanyx * " << invPower << " + MwcNext(mwc) * " << invPower2Pi << ";\n" << "\t\treal_t sina = sin(a);\n" << "\t\treal_t cosa = cos(a);\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * pow(precalcSumSquares, " << halfInvPower << ");\n" + << "\t\treal_t r = " << weight << " * pow(precalcSumSquares, " << halfInvPower << ");\n" << "\n" << "\t\tvOut.x = r * cosa;\n" << "\t\tvOut.y = r * sina;\n" @@ -3497,11 +3539,11 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Power, prefix + "juliaq_power", 3, eParamType::INTEGER_NONZERO)); + m_Params.push_back(ParamWithName(&m_Power, prefix + "juliaq_power", 3, eParamType::INTEGER_NONZERO)); m_Params.push_back(ParamWithName(&m_Divisor, prefix + "juliaq_divisor", 2, eParamType::INTEGER_NONZERO)); m_Params.push_back(ParamWithName(true, &m_HalfInvPower, prefix + "juliaq_half_inv_power"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_InvPower, prefix + "juliaq_inv_power")); - m_Params.push_back(ParamWithName(true, &m_InvPower2pi, prefix + "juliaq_inv_power_2pi")); + m_Params.push_back(ParamWithName(true, &m_InvPower, prefix + "juliaq_inv_power")); + m_Params.push_back(ParamWithName(true, &m_InvPower2pi, prefix + "juliaq_inv_power_2pi")); } private: @@ -3546,11 +3588,12 @@ public: intmax_t i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string p2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string vp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string p2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string vp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t angle = precalcAtanyx * " << power << ";\n" << "\t\treal_t sina = sin(angle);\n" @@ -3583,7 +3626,7 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_C, prefix + "murl_c")); + m_Params.push_back(ParamWithName(&m_C, prefix + "murl_c")); m_Params.push_back(ParamWithName(&m_Power, prefix + "murl_power", 2, eParamType::INTEGER, 2, T(0x7fffffff))); m_Params.push_back(ParamWithName(true, &m_Cp, prefix + "murl_cp"));//Precalc. m_Params.push_back(ParamWithName(true, &m_P2, prefix + "murl_p2")); @@ -3638,12 +3681,13 @@ public: intmax_t i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string p2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string invp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string p2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string invp2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string vp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string vp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t angle = precalcAtanyx * " << power << ";\n" << "\t\treal_t sina = sin(angle);\n" @@ -3685,12 +3729,12 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_C, prefix + "murl2_c", 0, eParamType::REAL, -1, 1)); + m_Params.push_back(ParamWithName(&m_C, prefix + "murl2_c", 0, eParamType::REAL, -1, 1)); m_Params.push_back(ParamWithName(&m_Power, prefix + "murl2_power", 1, eParamType::INTEGER_NONZERO)); - m_Params.push_back(ParamWithName(true, &m_P2, prefix + "murl2_p2"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_InvP, prefix + "murl2_invp")); + m_Params.push_back(ParamWithName(true, &m_P2, prefix + "murl2_p2"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_InvP, prefix + "murl2_invp")); m_Params.push_back(ParamWithName(true, &m_InvP2, prefix + "murl2_invp2")); - m_Params.push_back(ParamWithName(true, &m_Vp, prefix + "murl2_vp")); + m_Params.push_back(ParamWithName(true, &m_Vp, prefix + "murl2_vp")); } private: @@ -3737,19 +3781,20 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string parity = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string nnz = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string vvar = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string vvar2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string absn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string isOdd = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string nnz = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string vvar = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string vvar2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string absn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string isOdd = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t x = (" << isOdd << " != 0) ? vIn.x : " << vvar << " * precalcAtanxy;\n" << "\t\treal_t y = (" << isOdd << " != 0) ? vIn.y : " << vvar2 << " * log(precalcSumSquares);\n" << "\t\treal_t angle = (atan2(y, x) + M_2PI * MwcNextRange(mwc, (uint)" << absn << ")) / " << nnz << ";\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * pow(SQR(x) + SQR(y), " << cn << ") * ((" << isOdd << " == 0) ? 1 : " << parity << ");\n" + << "\t\treal_t r = " << weight << " * pow(SQR(x) + SQR(y), " << cn << ") * ((" << isOdd << " == 0) ? 1 : " << parity << ");\n" << "\t\treal_t sina = sin(angle) * r;\n" << "\t\treal_t cosa = cos(angle) * r;\n" << "\n" @@ -3778,12 +3823,12 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Parity, prefix + "npolar_parity", 0, eParamType::INTEGER)); - m_Params.push_back(ParamWithName(&m_N, prefix + "npolar_n", 1, eParamType::INTEGER)); - m_Params.push_back(ParamWithName(true, &m_Nnz, prefix + "npolar_nnz"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_Vvar, prefix + "npolar_vvar")); + m_Params.push_back(ParamWithName(&m_N, prefix + "npolar_n", 1, eParamType::INTEGER)); + m_Params.push_back(ParamWithName(true, &m_Nnz, prefix + "npolar_nnz"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_Vvar, prefix + "npolar_vvar")); m_Params.push_back(ParamWithName(true, &m_Vvar2, prefix + "npolar_vvar_2")); - m_Params.push_back(ParamWithName(true, &m_AbsN, prefix + "npolar_absn")); - m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "npolar_cn")); + m_Params.push_back(ParamWithName(true, &m_AbsN, prefix + "npolar_absn")); + m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "npolar_cn")); m_Params.push_back(ParamWithName(true, &m_IsOdd, prefix + "npolar_isodd")); } @@ -3836,7 +3881,7 @@ public: } else { - xo = - (r + 1) / (2 * helper.In.x); + xo = -(r + 1) / (2 * helper.In.x); ro = std::sqrt(SQR(-helper.In.x - xo) + SQR(helper.In.y)); theta = std::atan2(T(1), ro); a = fmod(m_In * theta + std::atan2(helper.In.y, xo + helper.In.x) + theta, 2 * theta) - theta; @@ -3861,7 +3906,7 @@ public: a = fmod(m_Out * theta + std::atan2(y, xo - x) + theta, 2 * theta) - theta; sincos(a, &s, &c); x = (xo - c * ro); - y = s * ro; + y = s * ro; theta = std::atan2(y, x); sincos(theta, &ts, &tc); r = 1 / std::sqrt(SQR(x) + SQR(y)); @@ -3870,13 +3915,13 @@ public: } else { - xo = - (SQR(x) + SQR(y) + 1) / (2 * x); + xo = -(SQR(x) + SQR(y) + 1) / (2 * x); ro = std::sqrt(SQR(-x - xo) + SQR(y)); theta = std::atan2(T(1), ro); a = fmod(m_Out * theta + std::atan2(y, xo + x) + theta, 2 * theta) - theta; sincos(a, &s, &c); x = (xo - c * ro); - y = s * ro; + y = s * ro; theta = std::atan2(y, x); sincos(theta, &ts, &tc); r = 1 / std::sqrt(SQR(x) + SQR(y)); @@ -3894,8 +3939,9 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string in = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string out = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string in = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string out = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t r, a;\n" << "\t\treal_t xo;\n" @@ -3917,8 +3963,8 @@ public: << "\t\t s = sin(a);\n" << "\t\t c = cos(a);\n" << "\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (xo - c * ro);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * s * ro;\n" + << "\t\t vOut.x = " << weight << " * (xo - c * ro);\n" + << "\t\t vOut.y = " << weight << " * s * ro;\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" @@ -3929,8 +3975,8 @@ public: << "\t\t s = sin(a);\n" << "\t\t c = cos(a);\n" << "\n" - << "\t\t vOut.x = -(xform->m_VariationWeights[" << varIndex << "] * (xo - c * ro));\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * s * ro;\n" + << "\t\t vOut.x = -(" << weight << " * (xo - c * ro));\n" + << "\t\t vOut.y = " << weight << " * s * ro;\n" << "\t\t }\n" << "\t\t}\n" << "\t\telse\n" @@ -3957,8 +4003,8 @@ public: << "\t\t tc = cos(theta);\n" << "\t\t r = 1 / sqrt(SQR(x) + SQR(y));\n" << "\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * r * tc;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * r * ts;\n" + << "\t\t vOut.x = " << weight << " * r * tc;\n" + << "\t\t vOut.y = " << weight << " * r * ts;\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" @@ -3976,8 +4022,8 @@ public: << "\t\t tc = cos(theta);\n" << "\t\t r = 1 / sqrt(SQR(x) + SQR(y));\n" << "\n" - << "\t\t vOut.x = -(xform->m_VariationWeights[" << varIndex << "] * r * tc);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * r * ts;\n" + << "\t\t vOut.x = -(" << weight << " * r * tc);\n" + << "\t\t vOut.y = " << weight << " * r * ts;\n" << "\t\t }\n" << "\t\t}\n" << "\n" @@ -3996,7 +4042,7 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_In, prefix + "ortho_in", 0, eParamType::REAL_CYCLIC, T(-M_PI), T(M_PI))); + m_Params.push_back(ParamWithName(&m_In, prefix + "ortho_in", 0, eParamType::REAL_CYCLIC, T(-M_PI), T(M_PI))); m_Params.push_back(ParamWithName(&m_Out, prefix + "ortho_out", 0, eParamType::REAL_CYCLIC, T(-M_PI), T(M_PI))); } @@ -4023,8 +4069,8 @@ public: { T x = m_C1x + (SQR(m_C1r) * (helper.In.x - m_C1x)) / Zeps(Sqr(helper.In.x - m_C1x) + Sqr(helper.In.y - m_C1y)); T y = m_C1y + (SQR(m_C1r) * (helper.In.y - m_C1y)) / Zeps(Sqr(helper.In.x - m_C1x) + Sqr(helper.In.y - m_C1y)); - helper.Out.x = m_C2x + (SQR(m_C2r) * (x - m_C2x)) / Zeps(Sqr(x - m_C2x) + Sqr(y - m_C2y)); - helper.Out.y = m_C2y + (SQR(m_C2r) * (y - m_C2y)) / Zeps(Sqr(x - m_C2x) + Sqr(y - m_C2y)); + helper.Out.x = m_C2x + (SQR(m_C2r) * (x - m_C2x)) / Zeps(Sqr(x - m_C2x) + Sqr(y - m_C2y)); + helper.Out.y = m_C2y + (SQR(m_C2r) * (y - m_C2y)) / Zeps(Sqr(x - m_C2x) + Sqr(y - m_C2y)); helper.Out.z = DefaultZ(helper); } @@ -4034,6 +4080,7 @@ public: intmax_t i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string c1r = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string c1a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string c2r = "parVars[" + ToUpper(m_Params[i++].Name()) + index; @@ -4133,13 +4180,14 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string r = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cz = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string r = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cz = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string c2x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string c2y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string c2z = "parVars[" + ToUpper(m_Params[i++].Name()) + index; @@ -4152,7 +4200,7 @@ public: << "\t\treal_t y2cy = " << c2y << " * vIn.y;\n" << "\t\treal_t z2cz = " << c2z << " * vIn.z;\n" << "\t\treal_t val = Zeps(" << c2 << " * r2 - x2cx - y2cy - z2cz + (real_t)(1.0));\n" - << "\t\treal_t d = xform->m_VariationWeights[" << varIndex << "] / val;\n" + << "\t\treal_t d = " << weight << " / val;\n" << "\n" << "\t\tvOut.x = d * (vIn.x * " << s2x << " + " << cx << " * (y2cy + z2cz - r2 - (real_t)(1.0)));\n" << "\t\tvOut.y = d * (vIn.y * " << s2y << " + " << cy << " * (x2cx + z2cz - r2 - (real_t)(1.0)));\n" @@ -4169,7 +4217,7 @@ public: virtual void Precalc() override { m_Cx = -m_R * std::cos(m_A * T(M_PI_2)) * std::cos(m_B * T(M_PI_2)); - m_Cy = m_R * std::sin(m_A * T(M_PI_2)) * std::cos(m_B * T(M_PI_2)); + m_Cy = m_R * std::sin(m_A * T(M_PI_2)) * std::cos(m_B * T(M_PI_2)); m_Cz = -m_R * std::sin(m_B * T(M_PI_2)); m_C2 = SQR(m_Cx) + SQR(m_Cy) + SQR(m_Cz); m_C2x = 2 * m_Cx; @@ -4188,10 +4236,10 @@ protected: m_Params.push_back(ParamWithName(&m_R, prefix + "poincare3D_r")); m_Params.push_back(ParamWithName(&m_A, prefix + "poincare3D_a")); m_Params.push_back(ParamWithName(&m_B, prefix + "poincare3D_b")); - m_Params.push_back(ParamWithName(true, &m_Cx, prefix + "poincare3D_cx"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_Cy, prefix + "poincare3D_cy")); - m_Params.push_back(ParamWithName(true, &m_Cz, prefix + "poincare3D_cz")); - m_Params.push_back(ParamWithName(true, &m_C2, prefix + "poincare3D_c2")); + m_Params.push_back(ParamWithName(true, &m_Cx, prefix + "poincare3D_cx"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_Cy, prefix + "poincare3D_cy")); + m_Params.push_back(ParamWithName(true, &m_Cz, prefix + "poincare3D_cz")); + m_Params.push_back(ParamWithName(true, &m_C2, prefix + "poincare3D_c2")); m_Params.push_back(ParamWithName(true, &m_C2x, prefix + "poincare3D_c2x")); m_Params.push_back(ParamWithName(true, &m_C2y, prefix + "poincare3D_c2y")); m_Params.push_back(ParamWithName(true, &m_C2z, prefix + "poincare3D_c2z")); @@ -4245,16 +4293,17 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string powx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string powy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string lcx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string lcy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string scx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string scy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string lcx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string lcy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\treal_t xp = pow(fabs(xform->m_VariationWeights[" << varIndex << "]) * fabs(vIn.x), " << powx << ");\n" - << "\t\treal_t yp = pow(fabs(xform->m_VariationWeights[" << varIndex << "]) * fabs(vIn.y), " << powy << ");\n" - << "\t\treal_t zp = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\treal_t xp = pow(fabs(" << weight << ") * fabs(vIn.x), " << powx << ");\n" + << "\t\treal_t yp = pow(fabs(" << weight << ") * fabs(vIn.y), " << powy << ");\n" + << "\t\treal_t zp = " << weight << " * vIn.z;\n" << "\n" << "\t\tvOut.x = xp * Sign(vIn.x) + " << lcx << " * vIn.x + " << scx << ";\n" << "\t\tvOut.y = yp * Sign(vIn.y) + " << lcy << " * vIn.y + " << scy << ";\n" @@ -4270,10 +4319,10 @@ protected: m_Params.clear(); m_Params.push_back(ParamWithName(&m_Powx, prefix + "polynomial_powx", 1)); m_Params.push_back(ParamWithName(&m_Powy, prefix + "polynomial_powy", 1)); - m_Params.push_back(ParamWithName(&m_Lcx, prefix + "polynomial_lcx")); - m_Params.push_back(ParamWithName(&m_Lcy, prefix + "polynomial_lcy")); - m_Params.push_back(ParamWithName(&m_Scx, prefix + "polynomial_scx")); - m_Params.push_back(ParamWithName(&m_Scy, prefix + "polynomial_scy")); + m_Params.push_back(ParamWithName(&m_Lcx, prefix + "polynomial_lcx")); + m_Params.push_back(ParamWithName(&m_Lcy, prefix + "polynomial_lcy")); + m_Params.push_back(ParamWithName(&m_Scx, prefix + "polynomial_scx")); + m_Params.push_back(ParamWithName(&m_Scy, prefix + "polynomial_scy")); } virtual vector OpenCLGlobalFuncNames() const override @@ -4322,8 +4371,9 @@ public: int i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string zscale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string vpi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string vpi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t c0 = vIn.x * " << vpi << ";\n" << "\t\treal_t c1 = vIn.y * " << vpi << ";\n" @@ -4351,7 +4401,7 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_ZScale, prefix + "psphere_zscale")); - m_Params.push_back(ParamWithName(true, &m_Vpi, prefix + "psphere_vpi"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_Vpi, prefix + "psphere_vpi"));//Precalc. } private: @@ -4377,8 +4427,8 @@ public: { T xsqr = helper.In.x * helper.In.x; T ysqr = helper.In.y * helper.In.y; - T xcb = helper.In.x * helper.In.x * helper.In.x; - T ycb = helper.In.y * helper.In.y * helper.In.y; + T xcb = helper.In.x * helper.In.x * helper.In.x; + T ycb = helper.In.y * helper.In.y * helper.In.y; T tr = m_T3 * (xcb - 3 * helper.In.x * ysqr) + m_T2 * (xsqr - ysqr) + m_T1 * helper.In.x + m_Tc; T ti = m_T3 * (3 * xsqr * helper.In.y - ycb) + m_T2 * 2 * helper.In.x * helper.In.y + m_T1 * helper.In.y; T br = m_B3 * (xcb - 3 * helper.In.x * ysqr) + m_B2 * (xsqr - ysqr) + m_B1 * helper.In.x + m_Bc; @@ -4395,6 +4445,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string t3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string t2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string t1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; @@ -4417,8 +4468,8 @@ public: << "\n" << "\t\treal_t r3den = 1 / Zeps(br * br + bi * bi);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (tr * br + ti * bi) * r3den;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (ti * br - tr * bi) * r3den;\n" + << "\t\tvOut.x = " << weight << " * (tr * br + ti * bi) * r3den;\n" + << "\t\tvOut.y = " << weight << " * (ti * br - tr * bi) * r3den;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -4486,9 +4537,9 @@ public: T d1 = wave * m_Pxa + d; T d2 = wave * m_Pixa + d; //We got two offsets, so we also got two new positions (u,v). - T u1 = m_CenterX + nx * d1; + T u1 = m_CenterX + nx * d1; T v1 = -m_CenterY + ny * d1; - T u2 = m_CenterX + nx * d2; + T u2 = m_CenterX + nx * d2; T v2 = -m_CenterY + ny * d2; //Interpolate the two positions by the given phase and //invert the multiplication with scale from before. @@ -4503,21 +4554,22 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string frequency = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string velocity = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string velocity = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string amplitude = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string centerx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string centery = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string phase = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string f = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string p = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string s = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string is = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string vxp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string pxa = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string pixa = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string centerx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string centery = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string phase = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string f = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string p = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string s = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string is = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string vxp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string pxa = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string pixa = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t x = (vIn.x * " << s << ") - " << centerx << ";\n" << "\t\treal_t y = (vIn.y * " << s << ") + " << centery << ";\n" @@ -4537,8 +4589,8 @@ public: << "\t\treal_t u2 = " << centerx << " + nx * d2;\n" << "\t\treal_t v2 = -" << centery << " + ny * d2;\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * Lerp(u1, u2, " << p << ") * " << is << ";\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * Lerp(v1, v2, " << p << ") * " << is << ";\n" + << "\t\tvOut.x = " << weight << " * Lerp(u1, u2, " << p << ") * " << is << ";\n" + << "\t\tvOut.y = " << weight << " * Lerp(v1, v2, " << p << ") * " << is << ";\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -4568,18 +4620,18 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Frequency, prefix + "ripple_frequency", 2)); - m_Params.push_back(ParamWithName(&m_Velocity, prefix + "ripple_velocity", 1)); + m_Params.push_back(ParamWithName(&m_Velocity, prefix + "ripple_velocity", 1)); m_Params.push_back(ParamWithName(&m_Amplitude, prefix + "ripple_amplitude", T(0.5))); - m_Params.push_back(ParamWithName(&m_CenterX, prefix + "ripple_centerx")); - m_Params.push_back(ParamWithName(&m_CenterY, prefix + "ripple_centery")); - m_Params.push_back(ParamWithName(&m_Phase, prefix + "ripple_phase")); - m_Params.push_back(ParamWithName(&m_Scale, prefix + "ripple_scale", 1)); - m_Params.push_back(ParamWithName(true, &m_F, prefix + "ripple_f"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_A, prefix + "ripple_a")); - m_Params.push_back(ParamWithName(true, &m_P, prefix + "ripple_p")); - m_Params.push_back(ParamWithName(true, &m_S, prefix + "ripple_s")); - m_Params.push_back(ParamWithName(true, &m_Is, prefix + "ripple_is")); - m_Params.push_back(ParamWithName(true, &m_Vxp, prefix + "ripple_vxp")); + m_Params.push_back(ParamWithName(&m_CenterX, prefix + "ripple_centerx")); + m_Params.push_back(ParamWithName(&m_CenterY, prefix + "ripple_centery")); + m_Params.push_back(ParamWithName(&m_Phase, prefix + "ripple_phase")); + m_Params.push_back(ParamWithName(&m_Scale, prefix + "ripple_scale", 1)); + m_Params.push_back(ParamWithName(true, &m_F, prefix + "ripple_f"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_A, prefix + "ripple_a")); + m_Params.push_back(ParamWithName(true, &m_P, prefix + "ripple_p")); + m_Params.push_back(ParamWithName(true, &m_S, prefix + "ripple_s")); + m_Params.push_back(ParamWithName(true, &m_Is, prefix + "ripple_is")); + m_Params.push_back(ParamWithName(true, &m_Vxp, prefix + "ripple_vxp")); m_Params.push_back(ParamWithName(true, &m_Pxa, prefix + "ripple_pxa")); m_Params.push_back(ParamWithName(true, &m_Pixa, prefix + "ripple_pixa")); } @@ -4633,13 +4685,14 @@ public: intmax_t i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string shiftX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string shiftY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string sx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string sy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ax = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ay = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string vv = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string sx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string sy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ax = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ay = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string vv = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t c0 = " << ax << " / (1 + exp(" << sx << " * vIn.x));\n" << "\t\treal_t c1 = " << ay << " / (1 + exp(" << sy << " * vIn.y));\n" @@ -4755,14 +4808,15 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string ampX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ampY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string ampX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ampY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string freqX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string freqY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string fx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string fy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ax = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ay = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string fx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string fy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ax = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ay = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t x = vIn.x;\n" << "\t\treal_t y = vIn.y;\n" @@ -4772,8 +4826,8 @@ public: << "\t\treal_t ty = Lerp(vIn.y, sy, " << ay << ");\n" << "\t\treal_t tz = vIn.z;\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * tx;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * ty;\n" + << "\t\tvOut.x = " << weight << " * tx;\n" + << "\t\tvOut.y = " << weight << " * ty;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -4797,8 +4851,8 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_AmpX, prefix + "sinusgrid_ampx", T(0.5))); - m_Params.push_back(ParamWithName(&m_AmpY, prefix + "sinusgrid_ampy", T(0.5))); + m_Params.push_back(ParamWithName(&m_AmpX, prefix + "sinusgrid_ampx", T(0.5))); + m_Params.push_back(ParamWithName(&m_AmpY, prefix + "sinusgrid_ampy", T(0.5))); m_Params.push_back(ParamWithName(&m_FreqX, prefix + "sinusgrid_freqx", 1)); m_Params.push_back(ParamWithName(&m_FreqY, prefix + "sinusgrid_freqy", 1)); m_Params.push_back(ParamWithName(true, &m_Fx, prefix + "sinusgrid_fx"));//Precalc. @@ -4860,10 +4914,11 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string distort = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\treal_t x = vIn.x * xform->m_VariationWeights[" << varIndex << "] * (real_t)(0.05);\n" - << "\t\treal_t y = vIn.y * xform->m_VariationWeights[" << varIndex << "] * (real_t)(0.05);\n" + << "\t\treal_t x = vIn.x * " << weight << " * (real_t)(0.05);\n" + << "\t\treal_t y = vIn.y * " << weight << " * (real_t)(0.05);\n" << "\t\treal_t x2 = SQR(x);\n" << "\t\treal_t y2 = SQR(y);\n" << "\t\treal_t xPlusy = x + y;\n" @@ -4877,8 +4932,8 @@ public: << "\n" << "\t\tresult /= divident;\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x + result;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y + result;\n" + << "\t\tvOut.x = " << weight << " * vIn.x + result;\n" + << "\t\tvOut.y = " << weight << " * vIn.y + result;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -4923,8 +4978,9 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "];\n" + << "\t\treal_t r = " << weight << ";\n" << "\n" << "\t\tif (vIn.x > 0)\n" << "\t\t r /= precalcSumSquares;\n" @@ -4967,6 +5023,7 @@ public: intmax_t i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string vvar2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params. ss << "\t{\n" << "\t\treal_t r = exp(vIn.y);\n" @@ -5034,18 +5091,19 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string freqX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string freqY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string freqX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string freqY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string scaleX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string scaleY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string incX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string incY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string absn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string incX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string incY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string absn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t angle = (precalcAtanyx + M_2PI * MwcNextRange(mwc, (uint)" << absn << ")) / " << power << ";\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * pow(precalcSumSquares, " << cn << ");\n" + << "\t\treal_t r = " << weight << " * pow(precalcSumSquares, " << cn << ");\n" << "\t\treal_t sina = sin(angle);\n" << "\t\treal_t cosa = cos(angle);\n" << "\t\treal_t xn = r * cosa;\n" @@ -5055,8 +5113,8 @@ public: << "\t\treal_t dx = xn + (real_t)(0.5) * (" << scaleX << " * siny + fabs(xn) * " << incX << " * siny);\n" << "\t\treal_t dy = yn + (real_t)(0.5) * (" << scaleY << " * sinx + fabs(yn) * " << incY << " * sinx);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * dx;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * dy;\n" + << "\t\tvOut.x = " << weight << " * dx;\n" + << "\t\tvOut.y = " << weight << " * dy;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -5076,15 +5134,15 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_FreqX, prefix + "wavesn_freqx", 2)); - m_Params.push_back(ParamWithName(&m_FreqY, prefix + "wavesn_freqy", 2)); + m_Params.push_back(ParamWithName(&m_FreqX, prefix + "wavesn_freqx", 2)); + m_Params.push_back(ParamWithName(&m_FreqY, prefix + "wavesn_freqy", 2)); m_Params.push_back(ParamWithName(&m_ScaleX, prefix + "wavesn_scalex", 1)); m_Params.push_back(ParamWithName(&m_ScaleY, prefix + "wavesn_scaley", 1)); - m_Params.push_back(ParamWithName(&m_IncX, prefix + "wavesn_incx")); - m_Params.push_back(ParamWithName(&m_IncY, prefix + "wavesn_incy")); - m_Params.push_back(ParamWithName(&m_Power, prefix + "wavesn_power", 1, eParamType::INTEGER_NONZERO)); + m_Params.push_back(ParamWithName(&m_IncX, prefix + "wavesn_incx")); + m_Params.push_back(ParamWithName(&m_IncY, prefix + "wavesn_incy")); + m_Params.push_back(ParamWithName(&m_Power, prefix + "wavesn_power", 1, eParamType::INTEGER_NONZERO)); m_Params.push_back(ParamWithName(true, &m_AbsN, prefix + "wavesn_absn"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "wavesn_cn")); + m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "wavesn_cn")); } private: @@ -5145,11 +5203,12 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string angle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string ratio = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cosa = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string sina = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rat = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cosa = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string sina = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rat = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t r2_4 = precalcSumSquares + 4;\n" << "\n" @@ -5163,13 +5222,13 @@ public: << "\n" << "\t\tif (x > 0)\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * y;\n" + << "\t\t vOut.x = " << weight << " * x;\n" + << "\t\t vOut.y = " << weight << " * y;\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * x;\n" - << "\t\t vOut.y = -xform->m_VariationWeights[" << varIndex << "] * y;\n" + << "\t\t vOut.x = " << weight << " * x;\n" + << "\t\t vOut.y = -" << weight << " * y;\n" << "\t\t}\n" << "\n" << "\t\tvOut.z = " << DefaultZCl() @@ -5193,7 +5252,7 @@ protected: m_Params.push_back(ParamWithName(&m_Ratio, prefix + "xheart_ratio")); m_Params.push_back(ParamWithName(true, &m_Cosa, prefix + "xheart_cosa"));//Precalc. m_Params.push_back(ParamWithName(true, &m_Sina, prefix + "xheart_sina")); - m_Params.push_back(ParamWithName(true, &m_Rat, prefix + "xheart_rat")); + m_Params.push_back(ParamWithName(true, &m_Rat, prefix + "xheart_rat")); } private: @@ -5246,6 +5305,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; @@ -5262,9 +5322,9 @@ public: << "\t\treal_t um = sqrt(SQR(u) + SQR(vIn.x)) * Sign(u);\n" << "\t\treal_t vm = sqrt(SQR(v) + SQR(vIn.y)) * Sign(v);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * um;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * vm;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.x = " << weight << " * um;\n" + << "\t\tvOut.y = " << weight << " * vm;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -5319,6 +5379,7 @@ public: intmax_t i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string weight01 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tvOut.x = " << weight01 << " / tan(vIn.x) * cos(vIn.y);\n" @@ -5371,14 +5432,15 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t sinx = sin(vIn.x);\n" << "\t\treal_t sinx2 = SQR(sinx);\n" << "\t\treal_t cosx = cos(vIn.x);\n" << "\t\treal_t coshy1 = cosh(vIn.y) + 1.0;\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sinx * coshy1 * sinx2;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * cosx * coshy1 * sinx2;\n" + << "\t\tvOut.x = " << weight << " * sinx * coshy1 * sinx2;\n" + << "\t\tvOut.y = " << weight << " * cosx * coshy1 * sinx2;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -5417,8 +5479,9 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" - << "\t\treal_t d = xform->m_VariationWeights[" << varIndex << "] / precalcSumSquares;\n" + << "\t\treal_t d = " << weight << " / precalcSumSquares;\n" << "\t\treal_t sinx = sin(vIn.x);\n" << "\t\treal_t sinx2 = SQR(sinx);\n" << "\t\treal_t cosx = cos(vIn.x);\n" @@ -5478,16 +5541,17 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string r = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string divisor = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string spread = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string halfC = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string d = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string halfD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ang = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string invSpread = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string r = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string divisor = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string spread = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string halfC = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string d = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string halfD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ang = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invSpread = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string fullSpread = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t a = precalcAtanyx;\n" @@ -5502,7 +5566,7 @@ public: << "\t\t a -= " << fullSpread << ";\n" << "\n" << "\t\treal_t lnr2 = log(precalcSumSquares);\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * exp(" << halfC << " * lnr2 - " << d << " * a);\n" + << "\t\treal_t r = " << weight << " * exp(" << halfC << " * lnr2 - " << d << " * a);\n" << "\t\treal_t temp = " << c << " * a + " << halfD << " * lnr2 + " << ang << " * MwcNext(mwc);\n" << "\n" << "\t\tvOut.x = r * cos(temp);\n" @@ -5529,16 +5593,16 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_R, prefix + "cpow2_r", 1)); - m_Params.push_back(ParamWithName(&m_A, prefix + "cpow2_a")); + m_Params.push_back(ParamWithName(&m_R, prefix + "cpow2_r", 1)); + m_Params.push_back(ParamWithName(&m_A, prefix + "cpow2_a")); m_Params.push_back(ParamWithName(&m_Divisor, prefix + "cpow2_divisor", 1, eParamType::INTEGER_NONZERO)); - m_Params.push_back(ParamWithName(&m_Spread, prefix + "cpow2_spread", 1, eParamType::INTEGER, 1, T(0x7FFFFFFF))); - m_Params.push_back(ParamWithName(true, &m_C, prefix + "cpow2_c"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_HalfC, prefix + "cpow2_halfc")); - m_Params.push_back(ParamWithName(true, &m_D, prefix + "cpow2_d")); - m_Params.push_back(ParamWithName(true, &m_HalfD, prefix + "cpow2_halfd")); - m_Params.push_back(ParamWithName(true, &m_Ang, prefix + "cpow2_ang")); - m_Params.push_back(ParamWithName(true, &m_InvSpread, prefix + "cpow2_inv_spread")); + m_Params.push_back(ParamWithName(&m_Spread, prefix + "cpow2_spread", 1, eParamType::INTEGER, 1, T(0x7FFFFFFF))); + m_Params.push_back(ParamWithName(true, &m_C, prefix + "cpow2_c"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_HalfC, prefix + "cpow2_halfc")); + m_Params.push_back(ParamWithName(true, &m_D, prefix + "cpow2_d")); + m_Params.push_back(ParamWithName(true, &m_HalfD, prefix + "cpow2_halfd")); + m_Params.push_back(ParamWithName(true, &m_Ang, prefix + "cpow2_ang")); + m_Params.push_back(ParamWithName(true, &m_InvSpread, prefix + "cpow2_inv_spread")); m_Params.push_back(ParamWithName(true, &m_FullSpread, prefix + "cpow2_full_spread")); } diff --git a/Source/Ember/Variations03.h b/Source/Ember/Variations03.h index f501f7b..19a88f0 100644 --- a/Source/Ember/Variations03.h +++ b/Source/Ember/Variations03.h @@ -32,12 +32,13 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string effect = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t temp = 1 / Zeps(cos(vIn.y)) + " << effect << " * MPI;\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (tanh(vIn.x) * temp);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (tanh(vIn.y) * temp);\n" + << "\t\tvOut.x = " << weight << " * (tanh(vIn.x) * temp);\n" + << "\t\tvOut.y = " << weight << " * (tanh(vIn.y) * temp);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -82,10 +83,11 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.x = " << weight << " * vIn.x;\n" + << "\t\tvOut.y = " << weight << " * vIn.y;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -120,14 +122,15 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string numerator = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string numerator = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string denominator = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string root = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string correctN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string correctD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string root = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string correctN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string correctD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\treal_t r2 = pow(precalcSumSquares, " << power << " * (real_t)(0.5)) * xform->m_VariationWeights[" << varIndex << "];\n" + << "\t\treal_t r2 = pow(precalcSumSquares, " << power << " * (real_t)(0.5)) * " << weight << ";\n" << "\t\treal_t ran = (precalcAtanyx / Zeps(" << denominator << ") + (" << root << " * M_2PI * floor(MwcNext01(mwc) * " << denominator << ") / Zeps(" << denominator << "))) * " << numerator << ";\n" << "\n" << "\t\tvOut.x = r2 * cos(ran);\n" @@ -152,11 +155,11 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Numerator, prefix + "pow_block_numerator", 3));//Original used a prefix of pow_, which is incompatible with Ember's design. + m_Params.push_back(ParamWithName(&m_Numerator, prefix + "pow_block_numerator", 3));//Original used a prefix of pow_, which is incompatible with Ember's design. m_Params.push_back(ParamWithName(&m_Denominator, prefix + "pow_block_denominator", 2)); - m_Params.push_back(ParamWithName(&m_Root, prefix + "pow_block_root", 1)); - m_Params.push_back(ParamWithName(&m_Correctn, prefix + "pow_block_correctn", 1)); - m_Params.push_back(ParamWithName(&m_Correctd, prefix + "pow_block_correctd", 1)); + m_Params.push_back(ParamWithName(&m_Root, prefix + "pow_block_root", 1)); + m_Params.push_back(ParamWithName(&m_Correctn, prefix + "pow_block_correctn", 1)); + m_Params.push_back(ParamWithName(&m_Correctd, prefix + "pow_block_correctd", 1)); m_Params.push_back(ParamWithName(true, &m_Power, prefix + "pow_block_power"));//Precalc. } @@ -197,13 +200,14 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t u = sqrt(ClampGte(Zeps(" << a << ") * SQR(vIn.x) + Zeps(" << b << ") * SQR(vIn.y), (real_t)(0.0)));\n" << "\n" - << "\t\tvOut.x = cos(u) * tan(vIn.x) * xform->m_VariationWeights[" << varIndex << "];\n" - << "\t\tvOut.y = sin(u) * tan(vIn.y) * xform->m_VariationWeights[" << varIndex << "];\n" + << "\t\tvOut.x = cos(u) * tan(vIn.x) * " << weight << ";\n" + << "\t\tvOut.y = sin(u) * tan(vIn.y) * " << weight << ";\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -250,9 +254,10 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x - ((SQR(vIn.x) * vIn.x) / 3)) + vIn.x * SQR(vIn.y);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y - ((SQR(vIn.y) * vIn.y) / 3)) + vIn.y * SQR(vIn.x);\n" + << "\t\tvOut.x = " << weight << " * (vIn.x - ((SQR(vIn.x) * vIn.x) / 3)) + vIn.x * SQR(vIn.y);\n" + << "\t\tvOut.y = " << weight << " * (vIn.y - ((SQR(vIn.y) * vIn.y) / 3)) + vIn.y * SQR(vIn.x);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -291,8 +296,9 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t r = Zeps(pow(precalcSqrtSumSquares, " << dist << "));\n" << "\t\tint n = floor(" << power << " * MwcNext01(mwc));\n" @@ -300,8 +306,8 @@ public: << "\t\treal_t sina = sin(alpha);\n" << "\t\treal_t cosa = cos(alpha);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cosa / r;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sina / r;\n" + << "\t\tvOut.x = " << weight << " * cosa / r;\n" + << "\t\tvOut.y = " << weight << " * sina / r;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -318,7 +324,7 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Power, prefix + "SphericalN_Power", 1)); - m_Params.push_back(ParamWithName(&m_Dist, prefix + "SphericalN_Dist", 1)); + m_Params.push_back(ParamWithName(&m_Dist, prefix + "SphericalN_Dist", 1)); } private: @@ -344,13 +350,13 @@ public: { T sin45 = std::sin(45 * DEG_2_RAD_T);//Was 45 radians? They probably meant to convert this from degrees. T cos45 = std::cos(45 * DEG_2_RAD_T); - helper.Out.x = ((m_Rotate * helper.In.x) * cos45 - helper.In.y * sin45 + m_LineUp) + m_X; + helper.Out.x = ((m_Rotate * helper.In.x) * cos45 - helper.In.y * sin45 + m_LineUp) + m_X; //The if function splits the plugin in two. if (helper.In.y > 0) helper.Out.y = ((m_Rotate * helper.In.y) * cos45 + helper.In.x * sin45 + m_Pull + m_LineUp) + m_Y; else - helper.Out.y = (m_Rotate * helper.In.y) * cos45 + helper.In.x * sin45 - m_Pull - m_LineUp; + helper.Out.y = (m_Rotate * helper.In.y) * cos45 + helper.In.x * sin45 - m_Pull - m_LineUp; helper.Out.z = DefaultZ(helper); } @@ -361,11 +367,12 @@ public: intmax_t i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string pull = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string pull = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string rotate = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string lineUp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t sin45 = sin(45 * DEG_2_RAD);\n" << "\t\treal_t cos45 = cos(45 * DEG_2_RAD);\n" @@ -387,11 +394,11 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Pull, prefix + "Kaleidoscope_pull")); - m_Params.push_back(ParamWithName(&m_Rotate, prefix + "Kaleidoscope_rotate", 1)); + m_Params.push_back(ParamWithName(&m_Pull, prefix + "Kaleidoscope_pull")); + m_Params.push_back(ParamWithName(&m_Rotate, prefix + "Kaleidoscope_rotate", 1)); m_Params.push_back(ParamWithName(&m_LineUp, prefix + "Kaleidoscope_line_up", 1)); - m_Params.push_back(ParamWithName(&m_X, prefix + "Kaleidoscope_x")); - m_Params.push_back(ParamWithName(&m_Y, prefix + "Kaleidoscope_y")); + m_Params.push_back(ParamWithName(&m_X, prefix + "Kaleidoscope_x")); + m_Params.push_back(ParamWithName(&m_Y, prefix + "Kaleidoscope_y")); } private: @@ -465,22 +472,23 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string radius1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string phi1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string radius1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string phi1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string thickness = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string contrast = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string pow = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string x1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string contrast = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string pow = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string x1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t x, y, z;\n" << "\n" << "\t\tif (precalcSqrtSumSquares < " << radius << ")\n" << "\t\t{\n" << "\t\t GlynnSim1Circle(&" << radius1 << ", &" << thickness << ", &" << x1 << ", &" << y1 << ", mwc, &x, &y);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * y;\n" + << "\t\t vOut.x = " << weight << " * x;\n" + << "\t\t vOut.y = " << weight << " * y;\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" @@ -502,13 +510,13 @@ public: << "\t\t if (z < SQR(" << radius1 << "))\n" << "\t\t {\n" << "\t\t GlynnSim1Circle(&" << radius1 << ", &" << thickness << ", &" << x1 << ", &" << y1 << ", mwc, &x, &y);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * y;\n" + << "\t\t vOut.x = " << weight << " * x;\n" + << "\t\t vOut.y = " << weight << " * y;\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * y;\n" + << "\t\t vOut.x = " << weight << " * x;\n" + << "\t\t vOut.y = " << weight << " * y;\n" << "\t\t }\n" << "\t\t}\n" << "\n" @@ -553,14 +561,14 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Radius, prefix + "GlynnSim1_radius", 1)); - m_Params.push_back(ParamWithName(&m_Radius1, prefix + "GlynnSim1_radius1", T(0.1))); - m_Params.push_back(ParamWithName(&m_Phi1, prefix + "GlynnSim1_phi1")); + m_Params.push_back(ParamWithName(&m_Radius, prefix + "GlynnSim1_radius", 1)); + m_Params.push_back(ParamWithName(&m_Radius1, prefix + "GlynnSim1_radius1", T(0.1))); + m_Params.push_back(ParamWithName(&m_Phi1, prefix + "GlynnSim1_phi1")); m_Params.push_back(ParamWithName(&m_Thickness, prefix + "GlynnSim1_thickness", T(0.1), eParamType::REAL, 0, 1)); - m_Params.push_back(ParamWithName(&m_Contrast, prefix + "GlynnSim1_contrast", T(1.5))); - m_Params.push_back(ParamWithName(&m_Pow, prefix + "GlynnSim1_pow", T(0.5), eParamType::REAL, 0, 1)); - m_Params.push_back(ParamWithName(true, &m_X1, prefix + "GlynnSim1_x1"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_Y1, prefix + "GlynnSim1_y1")); + m_Params.push_back(ParamWithName(&m_Contrast, prefix + "GlynnSim1_contrast", T(1.5))); + m_Params.push_back(ParamWithName(&m_Pow, prefix + "GlynnSim1_pow", T(0.5), eParamType::REAL, 0, 1)); + m_Params.push_back(ParamWithName(true, &m_X1, prefix + "GlynnSim1_x1"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_Y1, prefix + "GlynnSim1_y1")); } private: @@ -633,24 +641,25 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string thickness = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string contrast = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string pow = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string phi1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string phi2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string phi10 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string phi20 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string gamma = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string delta = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string contrast = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string pow = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string phi1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string phi2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string phi10 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string phi20 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string gamma = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string delta = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t x, y;\n" << "\n" << "\t\tif (precalcSqrtSumSquares < " << radius << ")\n" << "\t\t{\n" << "\t\t GlynnSim2Circle(&" << radius << ", &" << thickness << ", &" << phi10 << ", &" << delta << ", &" << gamma << ", mwc, &x,&y);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * y;\n" + << "\t\t vOut.x = " << weight << " * x;\n" + << "\t\t vOut.y = " << weight << " * y;\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" @@ -658,13 +667,13 @@ public: << "\n" << "\t\t if (MwcNext01(mwc) > " << contrast << " * pow(alpha, " << pow << "))\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * SQR(alpha) * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * SQR(alpha) * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * SQR(alpha) * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * SQR(alpha) * vIn.y;\n" << "\t\t }\n" << "\t\t}\n" << "\n" @@ -708,12 +717,12 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Radius, prefix + "GlynnSim2_radius", 1)); + m_Params.push_back(ParamWithName(&m_Radius, prefix + "GlynnSim2_radius", 1)); m_Params.push_back(ParamWithName(&m_Thickness, prefix + "GlynnSim2_thickness", T(0.1), eParamType::REAL, 0, 1)); - m_Params.push_back(ParamWithName(&m_Contrast, prefix + "GlynnSim2_contrast", T(0.5), eParamType::REAL, 0, 1)); - m_Params.push_back(ParamWithName(&m_Pow, prefix + "GlynnSim2_pow", T(1.5))); - m_Params.push_back(ParamWithName(&m_Phi1, prefix + "GlynnSim2_Phi1")); - m_Params.push_back(ParamWithName(&m_Phi2, prefix + "GlynnSim2_Phi2", 360)); + m_Params.push_back(ParamWithName(&m_Contrast, prefix + "GlynnSim2_contrast", T(0.5), eParamType::REAL, 0, 1)); + m_Params.push_back(ParamWithName(&m_Pow, prefix + "GlynnSim2_pow", T(1.5))); + m_Params.push_back(ParamWithName(&m_Phi1, prefix + "GlynnSim2_Phi1")); + m_Params.push_back(ParamWithName(&m_Phi2, prefix + "GlynnSim2_Phi2", 360)); m_Params.push_back(ParamWithName(true, &m_Phi10, prefix + "GlynnSim2_Phi10"));//Precalc. m_Params.push_back(ParamWithName(true, &m_Phi20, prefix + "GlynnSim2_Phi20")); m_Params.push_back(ParamWithName(true, &m_Gamma, prefix + "GlynnSim2_Gamma")); @@ -792,22 +801,23 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string thickness = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string thickness = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string thickness2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string contrast = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string pow = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string radius1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string radius2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string gamma = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string contrast = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string pow = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string radius1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string radius2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string gamma = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t x, y;\n" << "\n" << "\t\tif (precalcSqrtSumSquares < " << radius1 << ")\n" << "\t\t{\n" << "\t\t GlynnSim3Circle(&" << radius << ", &" << radius1 << ", &" << radius2 << ", &" << thickness << ", &" << gamma << ", mwc, &x,&y);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * y;\n" + << "\t\t vOut.x = " << weight << " * x;\n" + << "\t\t vOut.y = " << weight << " * y;\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" @@ -815,13 +825,13 @@ public: << "\n" << "\t\t if (MwcNext01(mwc) > " << contrast << " * pow(alpha, " << pow << "))\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * SQR(alpha) * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * SQR(alpha) * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * SQR(alpha) * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * SQR(alpha) * vIn.y;\n" << "\t\t }\n" << "\t\t}\n" << "\n" @@ -868,14 +878,14 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Radius, prefix + "GlynnSim3_radius", 1)); - m_Params.push_back(ParamWithName(&m_Thickness, prefix + "GlynnSim3_thickness", T(0.1))); + m_Params.push_back(ParamWithName(&m_Radius, prefix + "GlynnSim3_radius", 1)); + m_Params.push_back(ParamWithName(&m_Thickness, prefix + "GlynnSim3_thickness", T(0.1))); m_Params.push_back(ParamWithName(&m_Thickness2, prefix + "GlynnSim3_thickness2", T(0.1))); - m_Params.push_back(ParamWithName(&m_Contrast, prefix + "GlynnSim3_contrast", T(0.5), eParamType::REAL, 0, 1)); - m_Params.push_back(ParamWithName(&m_Pow, prefix + "GlynnSim3_pow", T(1.5))); + m_Params.push_back(ParamWithName(&m_Contrast, prefix + "GlynnSim3_contrast", T(0.5), eParamType::REAL, 0, 1)); + m_Params.push_back(ParamWithName(&m_Pow, prefix + "GlynnSim3_pow", T(1.5))); m_Params.push_back(ParamWithName(true, &m_Radius1, prefix + "GlynnSim3_radius1"));//Precalc. m_Params.push_back(ParamWithName(true, &m_Radius2, prefix + "GlynnSim3_radius2")); - m_Params.push_back(ParamWithName(true, &m_Gamma, prefix + "GlynnSim3_Gamma")); + m_Params.push_back(ParamWithName(true, &m_Gamma, prefix + "GlynnSim3_Gamma")); } private: @@ -945,10 +955,11 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string range = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string range = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string length = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string alpha = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string alpha = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t f = MwcNext01(mwc) * " << power << " * 2;\n" << "\t\treal_t angle = (real_t)(int)(f);\n" @@ -967,8 +978,8 @@ public: << "\n" << "\t\treal_t temp = angle - MPI2;\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * z * cos(temp);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * z * sin(temp);\n" + << "\t\tvOut.x = " << weight << " * z * cos(temp);\n" + << "\t\tvOut.y = " << weight << " * z * sin(temp);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -989,7 +1000,7 @@ protected: m_Params.push_back(ParamWithName(&m_Power, prefix + "starblur_power", 5, eParamType::INTEGER_NONZERO)); m_Params.push_back(ParamWithName(&m_Range, prefix + "starblur_range", T(0.4016228317))); m_Params.push_back(ParamWithName(true, &m_Length, prefix + "starblur_length"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_Alpha, prefix + "starblur_alpha")); + m_Params.push_back(ParamWithName(true, &m_Alpha, prefix + "starblur_alpha")); } private: @@ -1030,12 +1041,13 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t ang = MwcNext01(mwc) * M_2PI;\n" << "\t\treal_t s = sin(ang);\n" << "\t\treal_t c = cos(ang);\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * (" << power << " == 1 ? acos(MwcNext01(mwc) * 2 - 1) / MPI : acos(exp(log(MwcNext01(mwc)) * " << power << ") * 2 - 1) / MPI);\n" + << "\t\treal_t r = " << weight << " * (" << power << " == 1 ? acos(MwcNext01(mwc) * 2 - 1) / MPI : acos(exp(log(MwcNext01(mwc)) * " << power << ") * 2 - 1) / MPI);\n" << "\n" << "\t\tvOut.x = r * c;\n" << "\t\tvOut.y = r * s;\n" @@ -1080,12 +1092,13 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t rad = sqrt(MwcNext01(mwc));\n" << "\t\treal_t temp = MwcNext01(mwc) * M_2PI;\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cos(temp) * rad;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sin(temp) * rad;\n" + << "\t\tvOut.x = " << weight << " * cos(temp) * rad;\n" + << "\t\tvOut.y = " << weight << " * sin(temp) * rad;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -1124,16 +1137,17 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t coeff = fabs(vIn.z);\n" << "\n" << "\t\tif (coeff != 0 && " << power << " != 1)\n" << "\t\t coeff = exp(log(coeff) * " << power << ");\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (transX + vIn.x * coeff);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (transY + vIn.y * coeff);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * (transZ + vIn.z * coeff);\n" + << "\t\tvOut.x = " << weight << " * (transX + vIn.x * coeff);\n" + << "\t\tvOut.y = " << weight << " * (transY + vIn.y * coeff);\n" + << "\t\tvOut.z = " << weight << " * (transZ + vIn.z * coeff);\n" << "\t}\n"; return ss.str(); } @@ -1199,12 +1213,13 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string scatterDist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string zero = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string workPower = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string alpha = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string zero = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string workPower = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string alpha = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t xang = (precalcAtanyx + MPI) / " << alpha << ";\n" << "\n" @@ -1223,14 +1238,14 @@ public: << "\t\t {\n" << "\t\t real_t rdc = xr + (MwcNext01(mwc) * (real_t)(0.5) * " << scatterDist << ");\n" << "\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * rdc * cos(precalcAtanyx);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * rdc * sin(precalcAtanyx);\n" + << "\t\t vOut.x = " << weight << " * rdc * cos(precalcAtanyx);\n" + << "\t\t vOut.y = " << weight << " * rdc * sin(precalcAtanyx);\n" << "\t\t }\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t}\n" << "\n" << "\t\tvOut.z = " << DefaultZCl() @@ -1251,12 +1266,12 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Power, prefix + "cropn_power", -5)); - m_Params.push_back(ParamWithName(&m_Radius, prefix + "cropn_radius", 1)); + m_Params.push_back(ParamWithName(&m_Power, prefix + "cropn_power", -5)); + m_Params.push_back(ParamWithName(&m_Radius, prefix + "cropn_radius", 1)); m_Params.push_back(ParamWithName(&m_ScatterDist, prefix + "cropn_scatterdist")); - m_Params.push_back(ParamWithName(&m_Zero, prefix + "cropn_zero", 0, eParamType::INTEGER, 0, 1)); + m_Params.push_back(ParamWithName(&m_Zero, prefix + "cropn_zero", 0, eParamType::INTEGER, 0, 1)); m_Params.push_back(ParamWithName(true, &m_WorkPower, prefix + "cropn_workpower"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_Alpha, prefix + "cropn_alpha")); + m_Params.push_back(ParamWithName(true, &m_Alpha, prefix + "cropn_alpha")); } private: @@ -1297,16 +1312,17 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string width = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string alpha = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t xang = (precalcAtanyx + M_3PI + " << alpha << " / 2) / " << alpha << ";\n" << "\t\treal_t zang = ((xang - (int)xang) * " << width << " + (int)xang) * " << alpha << " - MPI - " << alpha << " / 2 * " << width << ";\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares * cos(zang);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares * sin(zang);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.x = " << weight << " * precalcSqrtSumSquares * cos(zang);\n" + << "\t\tvOut.y = " << weight << " * precalcSqrtSumSquares * sin(zang);\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -1321,7 +1337,7 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_N, prefix + "shredrad_n", 4, eParamType::REAL_NONZERO)); + m_Params.push_back(ParamWithName(&m_N, prefix + "shredrad_n", 4, eParamType::REAL_NONZERO)); m_Params.push_back(ParamWithName(&m_Width, prefix + "shredrad_width", T(0.5), eParamType::REAL, -1, 1)); m_Params.push_back(ParamWithName(true, &m_Alpha, prefix + "shredrad_alpha"));//Precalc. } @@ -1377,19 +1393,20 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string mode = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string prescale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string mode = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string prescale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string postscale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string symmetry = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string comp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string dataHelp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string symmetry = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string comp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string dataHelp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tif (precalcSqrtSumSquares < " << radius << ")\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" @@ -1403,10 +1420,10 @@ public: << "\n" << "\t\t real_t rad = " << radius << " + (precalcSqrtSumSquares - " << radius << ") * delta;\n" << "\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * rad * cos(precalcAtanyx);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * rad * sin(precalcAtanyx);\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" - //<< "\t\t transZ += xform->m_VariationWeights[" << varIndex << "] * outPoint->m_Z;\n"//Original had this which is probably wrong. + << "\t\t vOut.x = " << weight << " * rad * cos(precalcAtanyx);\n" + << "\t\t vOut.y = " << weight << " * rad * sin(precalcAtanyx);\n" + << "\t\t vOut.z = " << weight << " * vIn.z;\n" + //<< "\t\t transZ += " << weight << " * outPoint->m_Z;\n"//Original had this which is probably wrong. << "\t\t}\n" << "\t}\n"; return ss.str(); @@ -1422,12 +1439,12 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Mode, prefix + "blob2_mode", 0, eParamType::INTEGER, -1, 1)); - m_Params.push_back(ParamWithName(&m_N, prefix + "blob2_n", 5, eParamType::INTEGER)); - m_Params.push_back(ParamWithName(&m_Radius, prefix + "blob2_radius")); - m_Params.push_back(ParamWithName(&m_Prescale, prefix + "blob2_prescale", 1)); - m_Params.push_back(ParamWithName(&m_Postscale, prefix + "blob2_postscale", T(0.5))); - m_Params.push_back(ParamWithName(&m_Symmetry, prefix + "blob2_symmetry", 0, eParamType::REAL, -1, 1)); + m_Params.push_back(ParamWithName(&m_Mode, prefix + "blob2_mode", 0, eParamType::INTEGER, -1, 1)); + m_Params.push_back(ParamWithName(&m_N, prefix + "blob2_n", 5, eParamType::INTEGER)); + m_Params.push_back(ParamWithName(&m_Radius, prefix + "blob2_radius")); + m_Params.push_back(ParamWithName(&m_Prescale, prefix + "blob2_prescale", 1)); + m_Params.push_back(ParamWithName(&m_Postscale, prefix + "blob2_postscale", T(0.5))); + m_Params.push_back(ParamWithName(&m_Symmetry, prefix + "blob2_symmetry", 0, eParamType::REAL, -1, 1)); m_Params.push_back(ParamWithName(&m_Compensation, prefix + "blob2_compensation", 0, eParamType::REAL, 0, 1)); m_Params.push_back(ParamWithName(true, &m_DeltaHelp, prefix + "blob2_deltahelp"));//Precalc. } @@ -1474,12 +1491,13 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string absn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t z = vIn.z / " << absn << ";\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * pow(precalcSumSquares + SQR(z), " << cn << ");\n" + << "\t\treal_t r = " << weight << " * pow(precalcSumSquares + SQR(z), " << cn << ");\n" << "\t\treal_t tmp = r * precalcSqrtSumSquares;\n" << "\t\treal_t ang = (precalcAtanyx + M_2PI * MwcNextRange(mwc, (uint)" << absn << ")) / " << n << ";\n" << "\n" @@ -1511,7 +1529,7 @@ protected: m_Params.clear(); m_Params.push_back(ParamWithName(&m_N, prefix + "julia3D_power", 2, eParamType::INTEGER_NONZERO)); m_Params.push_back(ParamWithName(true, &m_AbsN, prefix + "julia3D_absn"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "julia3D_cn")); + m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "julia3D_cn")); } private: @@ -1549,11 +1567,12 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string absn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * pow(precalcSumSquares, " << cn << ");\n" + << "\t\treal_t r = " << weight << " * pow(precalcSumSquares, " << cn << ");\n" << "\t\treal_t temp = (precalcAtanyx + M_2PI * MwcNextRange(mwc, (uint)" << absn << ")) / " << n << ";\n" << "\n" << "\t\tvOut.x = r * cos(temp);\n" @@ -1584,7 +1603,7 @@ protected: m_Params.clear(); m_Params.push_back(ParamWithName(&m_N, prefix + "julia3Dz_power", 2, eParamType::INTEGER_NONZERO)); m_Params.push_back(ParamWithName(true, &m_AbsN, prefix + "julia3Dz_absn"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "julia3Dz_cn")); + m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "julia3Dz_cn")); } private: @@ -1620,11 +1639,12 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string powx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string powy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\tvOut.x = SignNz(vIn.x) * pow(fabs(vIn.x), " << powx << ") * xform->m_VariationWeights[" << varIndex << "];\n" - << "\t\tvOut.y = SignNz(vIn.y) * pow(fabs(vIn.y), " << powy << ") * xform->m_VariationWeights[" << varIndex << "];\n" + << "\t\tvOut.x = SignNz(vIn.x) * pow(fabs(vIn.x), " << powx << ") * " << weight << ";\n" + << "\t\tvOut.y = SignNz(vIn.y) * pow(fabs(vIn.y), " << powy << ") * " << weight << ";\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -1676,13 +1696,14 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string powx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string powy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string powz = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\tvOut.x = (real_t)(vIn.x < 0 ? -1 : 1) * pow(fabs(vIn.x), " << powx << ") * xform->m_VariationWeights[" << varIndex << "];\n" - << "\t\tvOut.y = (real_t)(vIn.y < 0 ? -1 : 1) * pow(fabs(vIn.y), " << powy << ") * xform->m_VariationWeights[" << varIndex << "];\n" - << "\t\tvOut.z = (real_t)(vIn.z < 0 ? -1 : 1) * pow(fabs(vIn.z), " << powz << ") * xform->m_VariationWeights[" << varIndex << "];\n" + << "\t\tvOut.x = (real_t)(vIn.x < 0 ? -1 : 1) * pow(fabs(vIn.x), " << powx << ") * " << weight << ";\n" + << "\t\tvOut.y = (real_t)(vIn.y < 0 ? -1 : 1) * pow(fabs(vIn.y), " << powy << ") * " << weight << ";\n" + << "\t\tvOut.z = (real_t)(vIn.z < 0 ? -1 : 1) * pow(fabs(vIn.z), " << powz << ") * " << weight << ";\n" << "\t}\n"; return ss.str(); } @@ -1731,10 +1752,11 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / Zeps(precalcSumSquares);\n" + << "\t\treal_t r = " << weight << " / Zeps(precalcSumSquares);\n" << "\n" << "\t\tvOut.x = vIn.x * r * " << x << ";\n" << "\t\tvOut.y = vIn.y * r * " << y << ";\n" @@ -1790,11 +1812,12 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string z = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / Zeps(precalcSumSquares + SQR(vIn.z));\n" + << "\t\treal_t r = " << weight << " / Zeps(precalcSumSquares + SQR(vIn.z));\n" << "\n" << "\t\tvOut.x = vIn.x * r * " << x << ";\n" << "\t\tvOut.y = vIn.y * r * " << y << ";\n" @@ -1855,23 +1878,24 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string d = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string d = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string tmin = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string ymin = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string tmax = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string ymax = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t t = (" << tmax << " - " << tmin << ") * MwcNext01(mwc) + " << tmin << ";\n" << "\t\treal_t y = (" << ymax << " - " << ymin << ") * MwcNext01(mwc) + " << ymin << ";\n" << "\t\treal_t x1 = (" << a << " + " << b << ") * cos(t) - " << c1 << " * cos((" << a << " + " << b << ") / " << b << " * t);\n" << "\t\treal_t y1 = (" << a << " + " << b << ") * sin(t) - " << c2 << " * sin((" << a << " + " << b << ") / " << b << " * t);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (x1 + " << d << " * cos(t) + y);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (y1 + " << d << " * sin(t) + y);\n" + << "\t\tvOut.x = " << weight << " * (x1 + " << d << " * cos(t) + y);\n" + << "\t\tvOut.y = " << weight << " * (y1 + " << d << " * sin(t) + y);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -1882,15 +1906,15 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_A, prefix + "Spirograph_a", 3)); - m_Params.push_back(ParamWithName(&m_B, prefix + "Spirograph_b", 2)); - m_Params.push_back(ParamWithName(&m_D, prefix + "Spirograph_d", 1)); + m_Params.push_back(ParamWithName(&m_A, prefix + "Spirograph_a", 3)); + m_Params.push_back(ParamWithName(&m_B, prefix + "Spirograph_b", 2)); + m_Params.push_back(ParamWithName(&m_D, prefix + "Spirograph_d", 1)); m_Params.push_back(ParamWithName(&m_TMin, prefix + "Spirograph_tmin", -1)); m_Params.push_back(ParamWithName(&m_YMin, prefix + "Spirograph_ymin", -1)); m_Params.push_back(ParamWithName(&m_TMax, prefix + "Spirograph_tmax", 1)); m_Params.push_back(ParamWithName(&m_YMax, prefix + "Spirograph_ymax", 1)); - m_Params.push_back(ParamWithName(&m_C1, prefix + "Spirograph_c1", 0)); - m_Params.push_back(ParamWithName(&m_C2, prefix + "Spirograph_c2", 0)); + m_Params.push_back(ParamWithName(&m_C1, prefix + "Spirograph_c1", 0)); + m_Params.push_back(ParamWithName(&m_C2, prefix + "Spirograph_c2", 0)); } private: @@ -1932,6 +1956,7 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t sinX = sin(vIn.x);\n" << "\t\treal_t cosX = cos(vIn.x);\n" @@ -1940,8 +1965,8 @@ public: << "\t\treal_t bx = Cube(cosX*cosY);\n" << "\t\treal_t by = Cube(sinX*cosY);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cosX * bx;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * cosX * by;\n" + << "\t\tvOut.x = " << weight << " * cosX * bx;\n" + << "\t\tvOut.y = " << weight << " * cosX * by;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -1976,11 +2001,12 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t e = 1 / precalcSumSquares + SQR(M2PI);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (xform->m_VariationWeights[" << varIndex << "] / precalcSumSquares * vIn.x / e);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (xform->m_VariationWeights[" << varIndex << "] / precalcSumSquares * vIn.y / e);\n" + << "\t\tvOut.x = " << weight << " * (" << weight << " / precalcSumSquares * vIn.x / e);\n" + << "\t\tvOut.y = " << weight << " * (" << weight << " / precalcSumSquares * vIn.y / e);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -2047,6 +2073,7 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t inZ, otherZ, tempTz, tempPz;\n" << "\t\tinZ = vIn.z;\n" @@ -2098,9 +2125,9 @@ public: << "\t\treal_t d = precalcSumSquares + SQR(tempTz);\n" << "\t\treal_t e = 1 / d + SQR(M2PI);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (xform->m_VariationWeights[" << varIndex << "] / d * vIn.x / e);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (xform->m_VariationWeights[" << varIndex << "] / d * vIn.y / e);\n" - << "\t\tvOut.z = tempPz + xform->m_VariationWeights[" << varIndex << "] * (xform->m_VariationWeights[" << varIndex << "] / d * tempTz / e);\n" + << "\t\tvOut.x = " << weight << " * (" << weight << " / d * vIn.x / e);\n" + << "\t\tvOut.y = " << weight << " * (" << weight << " / d * vIn.y / e);\n" + << "\t\tvOut.z = tempPz + " << weight << " * (" << weight << " / d * tempTz / e);\n" << "\t}\n"; return ss.str(); } @@ -2131,13 +2158,14 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t d = Zeps(precalcSumSquares);\n" << "\t\treal_t c1 = Zeps(SQR(vIn.x));\n" << "\t\treal_t c2 = Zeps(SQR(vIn.y));\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (((real_t)(1.0) / d) * cos(c1) * sin(c2));\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (((real_t)(1.0) / d) * sin(c1) * sin(c2));\n" + << "\t\tvOut.x = " << weight << " * (((real_t)(1.0) / d) * cos(c1) * sin(c2));\n" + << "\t\tvOut.y = " << weight << " * (((real_t)(1.0) / d) * sin(c1) * sin(c2));\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -2202,6 +2230,7 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t a = precalcAtanyx;\n" << "\n" @@ -2212,28 +2241,28 @@ public: << "\n" << "\t\tif (p <= 1 * precalcSqrtSumSquares)\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * p;\n" + << "\t\t vOut.x = " << weight << " * precalcSqrtSumSquares;\n" + << "\t\t vOut.y = " << weight << " * p;\n" << "\t\t}\n" << "\t\telse if (p <= 3 * precalcSqrtSumSquares)\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (2 * precalcSqrtSumSquares - p);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares;\n" + << "\t\t vOut.x = " << weight << " * (2 * precalcSqrtSumSquares - p);\n" + << "\t\t vOut.y = " << weight << " * precalcSqrtSumSquares;\n" << "\t\t}\n" << "\t\telse if (p <= 5 * precalcSqrtSumSquares)\n" << "\t\t{\n" - << "\t\t vOut.x = -(xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (4 * precalcSqrtSumSquares - p);\n" + << "\t\t vOut.x = -(" << weight << " * precalcSqrtSumSquares);\n" + << "\t\t vOut.y = " << weight << " * (4 * precalcSqrtSumSquares - p);\n" << "\t\t}\n" << "\t\telse if (p <= 7 * precalcSqrtSumSquares)\n" << "\t\t{\n" - << "\t\t vOut.x = -(xform->m_VariationWeights[" << varIndex << "] * (6 * precalcSqrtSumSquares - p));\n" - << "\t\t vOut.y = -(xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares);\n" + << "\t\t vOut.x = -(" << weight << " * (6 * precalcSqrtSumSquares - p));\n" + << "\t\t vOut.y = -(" << weight << " * precalcSqrtSumSquares);\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares;\n" - << "\t\t vOut.y = -(xform->m_VariationWeights[" << varIndex << "] * (8 * precalcSqrtSumSquares - p));\n" + << "\t\t vOut.x = " << weight << " * precalcSqrtSumSquares;\n" + << "\t\t vOut.y = -(" << weight << " * (8 * precalcSqrtSumSquares - p));\n" << "\t\t}\n" << "\n" << "\t\tvOut.z = " << DefaultZCl() @@ -2283,13 +2312,14 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string size = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rand = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string size = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rand = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string invSize = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. ss << "\t{\n" - << "\t\treal_t dx, dy, r = xform->m_VariationWeights[" << varIndex << "] / Zeps(precalcSumSquares);\n" + << "\t\treal_t dx, dy, r = " << weight << " / Zeps(precalcSumSquares);\n" << "\t\tint isXY = LRint(vIn.x * " << invSize << ") + LRint(vIn.y * " << invSize << ");\n" << "\n" << "\t\tif (isXY & 1)\n" @@ -2303,8 +2333,8 @@ public: << "\t\t dy = " << y << " + " << rand << " * MwcNext01(mwc);\n" << "\t\t}\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (sin(vIn.x) * r + dx);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (sin(vIn.y) * r + dy);\n" + << "\t\tvOut.x = " << weight << " * (sin(vIn.x) * r + dx);\n" + << "\t\tvOut.y = " << weight << " * (sin(vIn.y) * r + dy);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -2325,8 +2355,8 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_X, prefix + "sschecks_x", T(0.5))); - m_Params.push_back(ParamWithName(&m_Y, prefix + "sschecks_y", T(0.5))); + m_Params.push_back(ParamWithName(&m_X, prefix + "sschecks_x", T(0.5))); + m_Params.push_back(ParamWithName(&m_Y, prefix + "sschecks_y", T(0.5))); m_Params.push_back(ParamWithName(&m_Size, prefix + "sschecks_size", T(0.5))); m_Params.push_back(ParamWithName(&m_Rand, prefix + "sschecks_rnd")); m_Params.push_back(ParamWithName(true, &m_InvSize, prefix + "sschecks_inv_size"));//Precalc. @@ -2371,18 +2401,19 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string xDistort = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string yDistort = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string invN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string inv2PiN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string inv2PiN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t preX = vIn.x * (" << xDistort << " + 1);\n" << "\t\treal_t preY = vIn.y * (" << yDistort << " + 1);\n" << "\t\treal_t temp = atan2(preY, preX) * " << invN << " + MwcNext(mwc) * " << inv2PiN << ";\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * pow(precalcSumSquares, " << cN << ");\n" + << "\t\treal_t r = " << weight << " * pow(precalcSumSquares, " << cN << ");\n" << "\n" << "\t\tvOut.x = r * cos(temp);\n" << "\t\tvOut.y = r * sin(temp);\n" @@ -2404,12 +2435,12 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Power, prefix + "phoenix_julia_power", 2)); - m_Params.push_back(ParamWithName(&m_Dist, prefix + "phoenix_julia_dist", 1)); + m_Params.push_back(ParamWithName(&m_Power, prefix + "phoenix_julia_power", 2)); + m_Params.push_back(ParamWithName(&m_Dist, prefix + "phoenix_julia_dist", 1)); m_Params.push_back(ParamWithName(&m_XDistort, prefix + "phoenix_julia_x_distort", T(-0.5)));//Original omitted phoenix_ prefix. m_Params.push_back(ParamWithName(&m_YDistort, prefix + "phoenix_julia_y_distort")); - m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "phoenix_julia_cn"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_InvN, prefix + "phoenix_julia_invn")); + m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "phoenix_julia_cn"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_InvN, prefix + "phoenix_julia_invn")); m_Params.push_back(ParamWithName(true, &m_Inv2PiN, prefix + "phoenix_julia_inv2pin")); } @@ -2455,6 +2486,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string reA = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string imA = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string reB = "parVars[" + ToUpper(m_Params[i++].Name()) + index; @@ -2470,9 +2502,9 @@ public: << "\t\treal_t vIm = " << reC << " * vIn.y + " << imC << " * vIn.x + " << imD << ";\n" << "\t\treal_t vDenom = Zeps(vRe * vRe + vIm * vIm);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (uRe * vRe + uIm * vIm) / vDenom;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (uIm * vRe - uRe * vIm) / vDenom;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.x = " << weight << " * (uRe * vRe + uIm * vIm) / vDenom;\n" + << "\t\tvOut.y = " << weight << " * (uIm * vRe - uRe * vIm) / vDenom;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -2552,16 +2584,17 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string reA = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string imA = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string reB = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string imB = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string reC = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string imC = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string reD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string imD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string reA = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string imA = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string reB = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string imB = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string reC = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string imC = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string reD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string imD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tint n;\n" << "\n" @@ -2584,8 +2617,8 @@ public: << "\t\tn = (int)floor(" << power << " * MwcNext01(mwc));\n" << "\t\talpha = (atan2(y, x) + n * M_2PI) / floor(" << power << ");\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * r * cos(alpha);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * r * sin(alpha);\n" + << "\t\tvOut.x = " << weight << " * r * cos(alpha);\n" + << "\t\tvOut.y = " << weight << " * r * sin(alpha);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -2602,16 +2635,16 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Re_A, prefix + "MobiusNRe_A", 1)); - m_Params.push_back(ParamWithName(&m_Im_A, prefix + "MobiusNIm_A")); - m_Params.push_back(ParamWithName(&m_Re_B, prefix + "MobiusNRe_B")); - m_Params.push_back(ParamWithName(&m_Im_B, prefix + "MobiusNIm_B")); - m_Params.push_back(ParamWithName(&m_Re_C, prefix + "MobiusNRe_C")); - m_Params.push_back(ParamWithName(&m_Im_C, prefix + "MobiusNIm_C")); - m_Params.push_back(ParamWithName(&m_Re_D, prefix + "MobiusNRe_D", 1)); - m_Params.push_back(ParamWithName(&m_Im_D, prefix + "MobiusNIm_D")); + m_Params.push_back(ParamWithName(&m_Re_A, prefix + "MobiusNRe_A", 1)); + m_Params.push_back(ParamWithName(&m_Im_A, prefix + "MobiusNIm_A")); + m_Params.push_back(ParamWithName(&m_Re_B, prefix + "MobiusNRe_B")); + m_Params.push_back(ParamWithName(&m_Im_B, prefix + "MobiusNIm_B")); + m_Params.push_back(ParamWithName(&m_Re_C, prefix + "MobiusNRe_C")); + m_Params.push_back(ParamWithName(&m_Im_C, prefix + "MobiusNIm_C")); + m_Params.push_back(ParamWithName(&m_Re_D, prefix + "MobiusNRe_D", 1)); + m_Params.push_back(ParamWithName(&m_Im_D, prefix + "MobiusNIm_D")); m_Params.push_back(ParamWithName(&m_Power, prefix + "MobiusN_Power", 2)); - m_Params.push_back(ParamWithName(&m_Dist, prefix + "MobiusN_Dist", 1)); + m_Params.push_back(ParamWithName(&m_Dist, prefix + "MobiusN_Dist", 1)); } private: @@ -2699,10 +2732,11 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string width = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rectX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rectY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string width = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rectX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rectY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string rotateX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string rotateY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string rotxSin = "parVars[" + ToUpper(m_Params[i++].Name()) + index; @@ -2751,8 +2785,8 @@ public: << "\t\tmy = ry;\n" << "\t\tmz = rz * " << rotxCos << " + rx * " << rotxSin << ";\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * mx;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * my;\n" + << "\t\tvOut.x = " << weight << " * mx;\n" + << "\t\tvOut.y = " << weight << " * my;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -2771,10 +2805,10 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Radius, prefix + "mobius_strip_radius", 2)); - m_Params.push_back(ParamWithName(&m_Width, prefix + "mobius_strip_width", 1)); - m_Params.push_back(ParamWithName(&m_RectX, prefix + "mobius_strip_rect_x", M_2PI)); - m_Params.push_back(ParamWithName(&m_RectY, prefix + "mobius_strip_rect_y", 1)); + m_Params.push_back(ParamWithName(&m_Radius, prefix + "mobius_strip_radius", 2)); + m_Params.push_back(ParamWithName(&m_Width, prefix + "mobius_strip_width", 1)); + m_Params.push_back(ParamWithName(&m_RectX, prefix + "mobius_strip_rect_x", M_2PI)); + m_Params.push_back(ParamWithName(&m_RectY, prefix + "mobius_strip_rect_y", 1)); m_Params.push_back(ParamWithName(&m_RotateX, prefix + "mobius_strip_rotate_x")); m_Params.push_back(ParamWithName(&m_RotateY, prefix + "mobius_strip_rotate_y")); m_Params.push_back(ParamWithName(true, &m_RotxSin, prefix + "mobius_strip_rotxsin"));//Precalc. @@ -2827,21 +2861,22 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string min = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string max = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string d = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string e = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string d = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string e = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t t = (" << max << " - " << min << ") * MwcNext01(mwc) + " << min << ";\n" << "\t\treal_t y = MwcNext01(mwc) - (real_t)(0.5);\n" << "\t\treal_t x1 = sin(" << a << " * t + " << d << ");\n" << "\t\treal_t y1 = sin(" << b << " * t);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (x1 + " << c << " * t + " << e << " * y);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (y1 + " << c << " * t + " << e << " * y);\n" + << "\t\tvOut.x = " << weight << " * (x1 + " << c << " * t + " << e << " * y);\n" + << "\t\tvOut.y = " << weight << " * (y1 + " << c << " * t + " << e << " * y);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -2854,11 +2889,11 @@ protected: m_Params.clear(); m_Params.push_back(ParamWithName(&m_Min, prefix + "Lissajous_tmin", -T(M_PI))); m_Params.push_back(ParamWithName(&m_Max, prefix + "Lissajous_tmax", T(M_PI))); - m_Params.push_back(ParamWithName(&m_A, prefix + "Lissajous_a", 3)); - m_Params.push_back(ParamWithName(&m_B, prefix + "Lissajous_b", 2)); - m_Params.push_back(ParamWithName(&m_C, prefix + "Lissajous_c")); - m_Params.push_back(ParamWithName(&m_D, prefix + "Lissajous_d")); - m_Params.push_back(ParamWithName(&m_E, prefix + "Lissajous_e")); + m_Params.push_back(ParamWithName(&m_A, prefix + "Lissajous_a", 3)); + m_Params.push_back(ParamWithName(&m_B, prefix + "Lissajous_b", 2)); + m_Params.push_back(ParamWithName(&m_C, prefix + "Lissajous_c")); + m_Params.push_back(ParamWithName(&m_D, prefix + "Lissajous_d")); + m_Params.push_back(ParamWithName(&m_E, prefix + "Lissajous_e")); } private: @@ -2903,6 +2938,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t cn = cos(" << n << " * vIn.y);\n" @@ -2911,9 +2947,9 @@ public: << "\t\treal_t sy = sin(vIn.y);\n" << "\t\treal_t cy = cos(vIn.y);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (cy * (cn * cx));\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (cy * (cn * sx));\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * (sy * cn);\n" + << "\t\tvOut.x = " << weight << " * (cy * (cn * cx));\n" + << "\t\tvOut.y = " << weight << " * (cy * (cn * sx));\n" + << "\t\tvOut.z = " << weight << " * (sy * cn);\n" << "\t}\n"; return ss.str(); } @@ -2970,9 +3006,10 @@ public: intmax_t i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string even = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string odd = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string size = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string even = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string odd = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string size = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string sizeDiv2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t a = precalcAtanyx;\n" @@ -3006,7 +3043,7 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Even, prefix + "target_even", 0, eParamType::REAL_CYCLIC, 0, M_2PI)); - m_Params.push_back(ParamWithName(&m_Odd, prefix + "target_odd", 0, eParamType::REAL_CYCLIC, 0, M_2PI)); + m_Params.push_back(ParamWithName(&m_Odd, prefix + "target_odd", 0, eParamType::REAL_CYCLIC, 0, M_2PI)); m_Params.push_back(ParamWithName(&m_Size, prefix + "target_size", 1, eParamType::REAL, EPS, TMAX)); m_Params.push_back(ParamWithName(true, &m_SizeDiv2, prefix + "target_size_2"));//Precalc. } @@ -3050,11 +3087,12 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string r = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string inv = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string sor = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string invTimesR = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string r = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string inv = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string sor = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invTimesR = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string oneMinusInv = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string oneMinusSor = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" @@ -3064,9 +3102,9 @@ public: << "\t\treal_t cy = cos(vIn.y);\n" << "\t\treal_t ir = " << invTimesR << " + (" << oneMinusInv << " * (" << r << " * cos(" << n << " * vIn.x)));\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (cx * (ir + sy));\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (sx * (ir + sy));\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * (" << sor << " * cy) + (" << oneMinusSor << " * vIn.y);\n" + << "\t\tvOut.x = " << weight << " * (cx * (ir + sy));\n" + << "\t\tvOut.y = " << weight << " * (sx * (ir + sy));\n" + << "\t\tvOut.z = " << weight << " * (" << sor << " * cy) + (" << oneMinusSor << " * vIn.y);\n" << "\t}\n"; return ss.str(); } @@ -3083,8 +3121,8 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_R, prefix + "taurus_r", 3)); - m_Params.push_back(ParamWithName(&m_N, prefix + "taurus_n", 5)); + m_Params.push_back(ParamWithName(&m_R, prefix + "taurus_r", 3)); + m_Params.push_back(ParamWithName(&m_N, prefix + "taurus_n", 5)); m_Params.push_back(ParamWithName(&m_Inv, prefix + "taurus_inv", T(1.5))); m_Params.push_back(ParamWithName(&m_Sor, prefix + "taurus_sor", 1)); m_Params.push_back(ParamWithName(true, &m_InvTimesR, prefix + "taurus_inv_times_r"));//Precalc. @@ -3152,16 +3190,17 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string num = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ka = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string num = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ka = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string knpi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string kakn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string pikn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tint alt;\n" << "\t\treal_t a = precalcAtanyx;\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares;\n" + << "\t\treal_t r = " << weight << " * precalcSqrtSumSquares;\n" << "\n" << "\t\tif (a >= 0)\n" << "\t\t{\n" @@ -3203,9 +3242,9 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_A, prefix + "collideoscope_a", 0, eParamType::REAL_CYCLIC, 0, 1)); + m_Params.push_back(ParamWithName(&m_A, prefix + "collideoscope_a", 0, eParamType::REAL_CYCLIC, 0, 1)); m_Params.push_back(ParamWithName(&m_Num, prefix + "collideoscope_num", 1, eParamType::INTEGER)); - m_Params.push_back(ParamWithName(true, &m_Ka, prefix + "collideoscope_ka"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_Ka, prefix + "collideoscope_ka"));//Precalc. m_Params.push_back(ParamWithName(true, &m_KnPi, prefix + "collideoscope_kn_pi")); m_Params.push_back(ParamWithName(true, &m_KaKn, prefix + "collideoscope_ka_kn")); m_Params.push_back(ParamWithName(true, &m_PiKn, prefix + "collideoscope_pi_kn")); @@ -3254,8 +3293,9 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t tau = (real_t)(0.5) * (log(Sqr(vIn.x + (real_t)(1.0)) + SQR(vIn.y)) - log(Sqr(vIn.x - (real_t)(1.0)) + SQR(vIn.y)));\n" << "\t\treal_t sigma = MPI - atan2(vIn.y, vIn.x + (real_t)(1.0)) - atan2(vIn.y, (real_t)(1.0) - vIn.x);\n" @@ -3265,8 +3305,8 @@ public: << "\n" << "\t\treal_t temp = cosh(tau) - cos(sigma);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sinh(tau) / temp;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sin(sigma) / temp;\n" + << "\t\tvOut.x = " << weight << " * sinh(tau) / temp;\n" + << "\t\tvOut.y = " << weight << " * sin(sigma) / temp;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -3282,7 +3322,7 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Radius, prefix + "bMod_radius", 1, eParamType::REAL, 0, TMAX)); + m_Params.push_back(ParamWithName(&m_Radius, prefix + "bMod_radius", 1, eParamType::REAL, 0, TMAX)); m_Params.push_back(ParamWithName(&m_Distance, prefix + "bMod_distance", 0, eParamType::REAL_CYCLIC, 0, 2)); } @@ -3322,7 +3362,8 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string in = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string in = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string out = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t tau = (real_t)(0.5) * (log(Sqr(vIn.x + (real_t)(1.0)) + SQR(vIn.y)) - log(Sqr(vIn.x - (real_t)(1.0)) + SQR(vIn.y)));\n" @@ -3332,8 +3373,8 @@ public: << "\n" << "\t\treal_t temp = cosh(tau) - cos(sigma);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sinh(tau) / temp;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sin(sigma) / temp;\n" + << "\t\tvOut.x = " << weight << " * sinh(tau) / temp;\n" + << "\t\tvOut.y = " << weight << " * sin(sigma) / temp;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -3349,7 +3390,7 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_In, prefix + "bSwirl_in")); + m_Params.push_back(ParamWithName(&m_In, prefix + "bSwirl_in")); m_Params.push_back(ParamWithName(&m_Out, prefix + "bSwirl_out")); } @@ -3395,10 +3436,11 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string rotate = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string move = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string split = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string move = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string split = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t tau = (real_t)(0.5) * (log(Sqr(vIn.x + (real_t)(1.0)) + SQR(vIn.y)) - log(Sqr(vIn.x - (real_t)(1.0)) + SQR(vIn.y))) / " << power << " + " << move << ";\n" << "\t\treal_t sigma = MPI - atan2(vIn.y, vIn.x + (real_t)(1.0)) - atan2(vIn.y, (real_t)(1.0) - vIn.x) + " << rotate << ";\n" @@ -3412,8 +3454,8 @@ public: << "\n" << "\t\treal_t temp = cosh(tau) - cos(sigma);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sinh(tau) / temp;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sin(sigma) / temp;\n" + << "\t\tvOut.x = " << weight << " * sinh(tau) / temp;\n" + << "\t\tvOut.y = " << weight << " * sin(sigma) / temp;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -3430,9 +3472,9 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Rotate, prefix + "bTransform_rotate")); - m_Params.push_back(ParamWithName(&m_Power, prefix + "bTransform_power", 1, eParamType::INTEGER, 1, T(INT_MAX))); - m_Params.push_back(ParamWithName(&m_Move, prefix + "bTransform_move")); - m_Params.push_back(ParamWithName(&m_Split, prefix + "bTransform_split")); + m_Params.push_back(ParamWithName(&m_Power, prefix + "bTransform_power", 1, eParamType::INTEGER, 1, T(INT_MAX))); + m_Params.push_back(ParamWithName(&m_Move, prefix + "bTransform_move")); + m_Params.push_back(ParamWithName(&m_Split, prefix + "bTransform_split")); } private: @@ -3479,9 +3521,10 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string num = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ca = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string num = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ca = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string cnPi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string caCn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string piCn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; @@ -3497,8 +3540,8 @@ public: << "\n" << "\t\treal_t temp = cosh(tau) - cos(sigma);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sinh(tau) / temp;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sin(sigma) / temp;\n" + << "\t\tvOut.x = " << weight << " * sinh(tau) / temp;\n" + << "\t\tvOut.y = " << weight << " * sin(sigma) / temp;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -3513,7 +3556,7 @@ public: { m_CnPi = m_Num * T(M_1_PI); m_PiCn = T(M_PI) / m_Num; - m_Ca = T(M_PI) * m_A; + m_Ca = T(M_PI) * m_A; m_CaCn = m_Ca / m_Num; } @@ -3522,9 +3565,9 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_A, prefix + "bCollide_a", 0, eParamType::REAL_CYCLIC, 0, 1)); + m_Params.push_back(ParamWithName(&m_A, prefix + "bCollide_a", 0, eParamType::REAL_CYCLIC, 0, 1)); m_Params.push_back(ParamWithName(&m_Num, prefix + "bCollide_num", 1, eParamType::INTEGER, 1, T(INT_MAX))); - m_Params.push_back(ParamWithName(true, &m_Ca, prefix + "bCollide_ca"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_Ca, prefix + "bCollide_ca"));//Precalc. m_Params.push_back(ParamWithName(true, &m_CnPi, prefix + "bCollide_cn_pi")); m_Params.push_back(ParamWithName(true, &m_CaCn, prefix + "bCollide_ca_cn")); m_Params.push_back(ParamWithName(true, &m_PiCn, prefix + "bCollide_pi_cn")); @@ -3592,34 +3635,35 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string shift = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t x, c2;\n" << "\n" - << "\t\tif (fabs(vIn.y) <= xform->m_VariationWeights[" << varIndex << "])\n" + << "\t\tif (fabs(vIn.y) <= " << weight << ")\n" << "\t\t{\n" - << "\t\t c2 = sqrt(SQR(xform->m_VariationWeights[" << varIndex << "]) - SQR(vIn.y));\n" + << "\t\t c2 = sqrt(SQR(" << weight << ") - SQR(vIn.y));\n" << "\n" << "\t\t if (fabs(vIn.x) <= c2)\n" << "\t\t {\n" - << "\t\t x = vIn.x + " << shift << " * xform->m_VariationWeights[" << varIndex << "];\n" + << "\t\t x = vIn.x + " << shift << " * " << weight << ";\n" << "\n" << "\t\t if (fabs(x) >= c2)\n" - << "\t\t vOut.x = -(xform->m_VariationWeights[" << varIndex << "] * vIn.x);\n" + << "\t\t vOut.x = -(" << weight << " * vIn.x);\n" << "\t\t else\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * x;\n" + << "\t\t vOut.x = " << weight << " * x;\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" << "\t\t }\n" << "\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t}\n" << "\n" << "\t\tvOut.z = " << DefaultZCl() @@ -3671,14 +3715,15 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string ww = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" + << "\t\tvOut.x = " << weight << " * vIn.x;\n" << "\n" << "\t\tif (precalcSumSquares > " << ww << ")\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\telse\n" - << "\t\t vOut.y = -(xform->m_VariationWeights[" << varIndex << "] * vIn.y);\n" + << "\t\t vOut.y = -(" << weight << " * vIn.y);\n" << "\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; @@ -3729,13 +3774,14 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" + << "\t\tvOut.x = " << weight << " * vIn.x;\n" << "\n" << "\t\tif (vIn.x > 0)\n" - << "\t\t vOut.y = -(xform->m_VariationWeights[" << varIndex << "] * vIn.y);\n" + << "\t\t vOut.y = -(" << weight << " * vIn.y);\n" << "\t\telse\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; @@ -3801,9 +3847,10 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string num = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ca = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string num = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ca = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string cnPi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string caCn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string piCn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; @@ -3839,8 +3886,8 @@ public: << "\t\t nu *= -1;\n" << "\t\t}\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * xmax * cos(nu);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sqrt(xmax - 1) * sqrt(xmax + 1) * sin(nu);\n" + << "\t\tvOut.x = " << weight << " * xmax * cos(nu);\n" + << "\t\tvOut.y = " << weight << " * sqrt(xmax - 1) * sqrt(xmax + 1) * sin(nu);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -3855,7 +3902,7 @@ public: { m_CnPi = m_Num * T(M_1_PI); m_PiCn = T(M_PI) / m_Num; - m_Ca = T(M_PI) * m_A; + m_Ca = T(M_PI) * m_A; m_CaCn = m_Ca / m_Num; } @@ -3864,9 +3911,9 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_A, prefix + "eCollide_a", 0, eParamType::REAL_CYCLIC, 0, 1)); + m_Params.push_back(ParamWithName(&m_A, prefix + "eCollide_a", 0, eParamType::REAL_CYCLIC, 0, 1)); m_Params.push_back(ParamWithName(&m_Num, prefix + "eCollide_num", 1, eParamType::INTEGER, 1, T(INT_MAX))); - m_Params.push_back(ParamWithName(true, &m_Ca, prefix + "eCollide_ca"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_Ca, prefix + "eCollide_ca"));//Precalc. m_Params.push_back(ParamWithName(true, &m_CnPi, prefix + "eCollide_cn_pi")); m_Params.push_back(ParamWithName(true, &m_CaCn, prefix + "eCollide_ca_cn")); m_Params.push_back(ParamWithName(true, &m_PiCn, prefix + "eCollide_pi_cn")); @@ -3932,8 +3979,9 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string sign = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string sign = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t x, r2 = precalcSumSquares;\n" << "\n" @@ -3963,8 +4011,8 @@ public: << "\t\tnu = nu / " << power << " + M_2PI / " << power << " * floor(MwcNext01(mwc) * " << power << ");\n" << "\t\tmu /= " << power << ";\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cosh(mu) * cos(nu);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sinh(mu) * sin(nu);\n" + << "\t\tvOut.x = " << weight << " * cosh(mu) * cos(nu);\n" + << "\t\tvOut.y = " << weight << " * sinh(mu) * sin(nu);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -4026,9 +4074,9 @@ public: if (mu < m_Radius && -mu < m_Radius) { if (nu > 0) - mu = fmod(mu + m_Radius + m_Distance * m_Radius, 2 * m_Radius) - m_Radius; + mu = fmod(mu + m_Radius + m_Distance * m_Radius, 2 * m_Radius) - m_Radius; else - mu = fmod(mu - m_Radius - m_Distance * m_Radius, 2 * m_Radius) + m_Radius; + mu = fmod(mu - m_Radius - m_Distance * m_Radius, 2 * m_Radius) + m_Radius; } helper.Out.x = m_Weight * std::cosh(mu) * std::cos(nu); @@ -4042,8 +4090,9 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t tmp = precalcSumSquares + 1;\n" << "\t\treal_t tmp2 = 2 * vIn.x;\n" @@ -4066,8 +4115,8 @@ public: << "\t\t mu = fmod(mu - " << radius << " - " << dist << " * " << radius << ", 2 * " << radius << ") + " << radius << ";\n" << "\t\t}\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cosh(mu) * cos(nu);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sinh(mu) * sin(nu);\n" + << "\t\tvOut.x = " << weight << " * cosh(mu) * cos(nu);\n" + << "\t\tvOut.y = " << weight << " * sinh(mu) * sin(nu);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -4083,7 +4132,7 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Radius, prefix + "eMod_radius", 1, eParamType::REAL, 0, TMAX)); + m_Params.push_back(ParamWithName(&m_Radius, prefix + "eMod_radius", 1, eParamType::REAL, 0, TMAX)); m_Params.push_back(ParamWithName(&m_Distance, prefix + "eMod_distance", 0, eParamType::REAL_CYCLIC, 0, 2)); } @@ -4141,7 +4190,8 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string move = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string move = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string rotate = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t tmp = precalcSumSquares + 1;\n" @@ -4170,8 +4220,8 @@ public: << "\n" << "\t\tnu += " << rotate << ";\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cosh(mu) * cos(nu);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sinh(mu) * sin(nu);\n" + << "\t\tvOut.x = " << weight << " * cosh(mu) * cos(nu);\n" + << "\t\tvOut.y = " << weight << " * sinh(mu) * sin(nu);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -4187,7 +4237,7 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Move, prefix + "eMotion_move")); + m_Params.push_back(ParamWithName(&m_Move, prefix + "eMotion_move")); m_Params.push_back(ParamWithName(&m_Rotate, prefix + "eMotion_rotate", 0, eParamType::REAL_CYCLIC, 0, M_2PI)); } @@ -4236,8 +4286,9 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string push = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string push = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string rotate = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t tmp = precalcSumSquares + 1;\n" @@ -4257,8 +4308,8 @@ public: << "\t\tmu *= " << dist << ";\n" << "\t\tmu += " << push << ";\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cosh(mu) * cos(nu);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sinh(mu) * sin(nu);\n" + << "\t\tvOut.x = " << weight << " * cosh(mu) * cos(nu);\n" + << "\t\tvOut.y = " << weight << " * sinh(mu) * sin(nu);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -4274,8 +4325,8 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Push, prefix + "ePush_push")); - m_Params.push_back(ParamWithName(&m_Dist, prefix + "ePush_dist", 1)); + m_Params.push_back(ParamWithName(&m_Push, prefix + "ePush_push")); + m_Params.push_back(ParamWithName(&m_Dist, prefix + "ePush_dist", 1)); m_Params.push_back(ParamWithName(&m_Rotate, prefix + "ePush_rotate", 0, eParamType::REAL_CYCLIC, T(-M_PI), T(M_PI))); } @@ -4325,6 +4376,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string rotate = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t tmp = precalcSumSquares + 1;\n" @@ -4341,8 +4393,8 @@ public: << "\n" << "\t\tnu = fmod(nu + " << rotate << " + MPI, M_2PI) - MPI;\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * xmax * cos(nu);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sqrt(xmax - 1) * sqrt(xmax + 1) * sin(nu);\n" + << "\t\tvOut.x = " << weight << " * xmax * cos(nu);\n" + << "\t\tvOut.y = " << weight << " * sqrt(xmax - 1) * sqrt(xmax + 1) * sin(nu);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -4411,8 +4463,9 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string angle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string angle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t tmp = precalcSumSquares + 1;\n" << "\t\treal_t tmp2 = 2 * vIn.x;\n" @@ -4436,8 +4489,8 @@ public: << "\t\tif (nu < -MPI)\n" << "\t\t nu += M_2PI;\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cosh(mu) * cos(nu);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sinh(mu) * sin(nu);\n" + << "\t\tvOut.x = " << weight << " * cosh(mu) * cos(nu);\n" + << "\t\tvOut.y = " << weight << " * sinh(mu) * sin(nu);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); diff --git a/Source/Ember/Variations04.h b/Source/Ember/Variations04.h index e27cf20..a1ffc64 100644 --- a/Source/Ember/Variations04.h +++ b/Source/Ember/Variations04.h @@ -42,7 +42,8 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string in = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string in = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string out = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t tmp = precalcSumSquares + 1;\n" @@ -60,8 +61,8 @@ public: << "\n" << "\t\tnu = nu + mu * " << out << " + " << in << " / mu;\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cosh(mu) * cos(nu);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sinh(mu) * sin(nu);\n" + << "\t\tvOut.x = " << weight << " * cosh(mu) * cos(nu);\n" + << "\t\tvOut.y = " << weight << " * sinh(mu) * sin(nu);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -77,7 +78,7 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_In, prefix + "eSwirl_in")); + m_Params.push_back(ParamWithName(&m_In, prefix + "eSwirl_in")); m_Params.push_back(ParamWithName(&m_Out, prefix + "eSwirl_out")); } @@ -213,11 +214,12 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string spinIn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string spinIn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string spinOut = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string space = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string in4 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string out4 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string space = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string in4 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string out4 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t x = fabs(vIn.x);\n" << "\t\treal_t y = fabs(vIn.y);\n" @@ -225,7 +227,7 @@ public: << "\t\treal_t p;\n" << "\t\treal_t x2, y2;\n" << "\n" - << "\t\tif (x > xform->m_VariationWeights[" << varIndex << "] || y > xform->m_VariationWeights[" << varIndex << "])\n" + << "\t\tif (x > " << weight << " || y > " << weight << ")\n" << "\t\t{\n" << "\t\t if (x > y)\n" << "\t\t {\n" @@ -273,8 +275,8 @@ public: << "\t\t x2 = x2 + x2 / s * " << space << ";\n" << "\t\t }\n" << "\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * x2;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * y2;\n" + << "\t\t vOut.x = " << weight << " * x2;\n" + << "\t\t vOut.y = " << weight << " * y2;\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" @@ -301,23 +303,23 @@ public: << "\n" << "\t\t if (p <= 2 * s)\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * s;\n" - << "\t\t vOut.y = -(xform->m_VariationWeights[" << varIndex << "] * (s - p));\n" + << "\t\t vOut.x = " << weight << " * s;\n" + << "\t\t vOut.y = -(" << weight << " * (s - p));\n" << "\t\t }\n" << "\t\t else if (p <= 4 * s)\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (3 * s - p);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * s;\n" + << "\t\t vOut.x = " << weight << " * (3 * s - p);\n" + << "\t\t vOut.y = " << weight << " * s;\n" << "\t\t }\n" << "\t\t else if (p <= 6 * s)\n" << "\t\t {\n" - << "\t\t vOut.x = -(xform->m_VariationWeights[" << varIndex << "] * s);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (5 * s - p);\n" + << "\t\t vOut.x = -(" << weight << " * s);\n" + << "\t\t vOut.y = " << weight << " * (5 * s - p);\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = -(xform->m_VariationWeights[" << varIndex << "] * (7 * s - p));\n" - << "\t\t vOut.y = -(xform->m_VariationWeights[" << varIndex << "] * s);\n" + << "\t\t vOut.x = -(" << weight << " * (7 * s - p));\n" + << "\t\t vOut.y = -(" << weight << " * s);\n" << "\t\t }\n" << "\t\t}\n" << "\n" @@ -337,10 +339,10 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_SpinIn, prefix + "lazyTravis_spin_in", 1, eParamType::REAL_CYCLIC, 0, 2)); + m_Params.push_back(ParamWithName(&m_SpinIn, prefix + "lazyTravis_spin_in", 1, eParamType::REAL_CYCLIC, 0, 2)); m_Params.push_back(ParamWithName(&m_SpinOut, prefix + "lazyTravis_spin_out", 0, eParamType::REAL_CYCLIC, 0, 2)); - m_Params.push_back(ParamWithName(&m_Space, prefix + "lazyTravis_space")); - m_Params.push_back(ParamWithName(true, &m_In4, prefix + "lazyTravis_in4"));//Precalc. + m_Params.push_back(ParamWithName(&m_Space, prefix + "lazyTravis_space")); + m_Params.push_back(ParamWithName(true, &m_In4, prefix + "lazyTravis_in4"));//Precalc. m_Params.push_back(ParamWithName(true, &m_Out4, prefix + "lazyTravis_out4")); } @@ -429,7 +431,8 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string invPower = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t x = fabs(vIn.x);\n" @@ -460,28 +463,28 @@ public: << "\n" << "\t\tif (p <= s)\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * s;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * p;\n" + << "\t\t vOut.x = " << weight << " * s;\n" + << "\t\t vOut.y = " << weight << " * p;\n" << "\t\t}\n" << "\t\telse if (p <= 3 * s)\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (2 * s - p);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * s;\n" + << "\t\t vOut.x = " << weight << " * (2 * s - p);\n" + << "\t\t vOut.y = " << weight << " * s;\n" << "\t\t}\n" << "\t\telse if (p <= 5 * s)\n" << "\t\t{\n" - << "\t\t vOut.x = -(xform->m_VariationWeights[" << varIndex << "] * s);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (4 * s - p);\n" + << "\t\t vOut.x = -(" << weight << " * s);\n" + << "\t\t vOut.y = " << weight << " * (4 * s - p);\n" << "\t\t}\n" << "\t\telse if (p <= 7 * s)\n" << "\t\t{\n" - << "\t\t vOut.x = -(xform->m_VariationWeights[" << varIndex << "] * (6 * s - p));\n" - << "\t\t vOut.y = -(xform->m_VariationWeights[" << varIndex << "] * s);\n" + << "\t\t vOut.x = -(" << weight << " * (6 * s - p));\n" + << "\t\t vOut.y = -(" << weight << " * s);\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * s;\n" - << "\t\t vOut.y = -(xform->m_VariationWeights[" << varIndex << "] * (8 * s - p));\n" + << "\t\t vOut.x = " << weight << " * s;\n" + << "\t\t vOut.y = -(" << weight << " * (8 * s - p));\n" << "\t\t}\n" << "\n" << "\t\tvOut.z = " << DefaultZCl() @@ -542,7 +545,8 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string invScale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t r = precalcSqrtSumSquares;\n" @@ -552,8 +556,8 @@ public: << "\t\telse\n" << "\t\t r *= " << invScale << ";\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * r * precalcCosa;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * r * precalcSina;\n" + << "\t\tvOut.x = " << weight << " * r * precalcCosa;\n" + << "\t\tvOut.y = " << weight << " * r * precalcSina;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -601,11 +605,12 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t d = Zeps(precalcSumSquares);\n" << "\n" - << "\t\tvOut.x = (xform->m_VariationWeights[" << varIndex << "] / d) * (tanh(d) * ((real_t)(2.0) * vIn.x));\n" - << "\t\tvOut.y = (xform->m_VariationWeights[" << varIndex << "] / d) * (cos(d) * ((real_t)(2.0) * vIn.y));\n" + << "\t\tvOut.x = (" << weight << " / d) * (tanh(d) * ((real_t)(2.0) * vIn.x));\n" + << "\t\tvOut.y = (" << weight << " / d) * (cos(d) * ((real_t)(2.0) * vIn.y));\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -640,11 +645,12 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t d = Zeps(precalcSumSquares);\n" << "\n" - << "\t\tvOut.x = (xform->m_VariationWeights[" << varIndex << "] / (real_t)(2.0)) * (tanh(d) * ((real_t)(2.0) * vIn.x));\n" - << "\t\tvOut.y = (xform->m_VariationWeights[" << varIndex << "] / (real_t)(2.0)) * (cos(d) * ((real_t)(2.0) * vIn.y));\n" + << "\t\tvOut.x = (" << weight << " / (real_t)(2.0)) * (tanh(d) * ((real_t)(2.0) * vIn.x));\n" + << "\t\tvOut.y = (" << weight << " / (real_t)(2.0)) * (cos(d) * ((real_t)(2.0) * vIn.y));\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -695,6 +701,7 @@ public: int i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string rxSin = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params. string rxCos = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" @@ -777,6 +784,7 @@ public: int i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string rySin = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params. string ryCos = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" @@ -856,6 +864,7 @@ public: int i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string rzSin = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params. string rzCos = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" @@ -1143,11 +1152,12 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string strength = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string offset = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string centerX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string centerY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string s2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string offset = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string centerX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string centerY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string s2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t sx = vIn.x - " << centerX << ";\n" << "\t\treal_t sy = vIn.y - " << centerY << ";\n" @@ -1156,8 +1166,8 @@ public: << "\t\tr = r < 0 ? 0 : r;\n" << "\t\tr *= " << s2 << ";\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + (MwcNext01(mwc) - (real_t)(0.5)) * r);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + (MwcNext01(mwc) - (real_t)(0.5)) * r);\n" + << "\t\tvOut.x = " << weight << " * (vIn.x + (MwcNext01(mwc) - (real_t)(0.5)) * r);\n" + << "\t\tvOut.y = " << weight << " * (vIn.y + (MwcNext01(mwc) - (real_t)(0.5)) * r);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -1174,9 +1184,9 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Strength, prefix + "rblur_strength", 1)); - m_Params.push_back(ParamWithName(&m_Offset, prefix + "rblur_offset", 1)); - m_Params.push_back(ParamWithName(&m_CenterX, prefix + "rblur_center_x")); - m_Params.push_back(ParamWithName(&m_CenterY, prefix + "rblur_center_y")); + m_Params.push_back(ParamWithName(&m_Offset, prefix + "rblur_offset", 1)); + m_Params.push_back(ParamWithName(&m_CenterX, prefix + "rblur_center_x")); + m_Params.push_back(ParamWithName(&m_CenterY, prefix + "rblur_center_y")); m_Params.push_back(ParamWithName(true, &m_S2, prefix + "rblur_s2"));//Precalc. } @@ -1221,17 +1231,18 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string sep = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string n = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string sep = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string absN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t jun = Zeps(fabs(" << n << "));\n" << "\n" << "\t\treal_t a = (atan2(vIn.y, pow(fabs(vIn.x), " << sep << ")) + M_2PI * floor(MwcNext01(mwc) * " << absN << ")) / jun;\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * pow(precalcSumSquares, " << cn << " * " << a << ");\n" + << "\t\treal_t r = " << weight << " * pow(precalcSumSquares, " << cn << " * " << a << ");\n" << "\n" << "\t\tvOut.x = r * cos(a) + " << b << ";\n" << "\t\tvOut.y = r * sin(a) + " << b << ";\n" @@ -1262,12 +1273,12 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_N, prefix + "juliaNab_n", 1)); - m_Params.push_back(ParamWithName(&m_A, prefix + "juliaNab_a", 1)); - m_Params.push_back(ParamWithName(&m_B, prefix + "juliaNab_b", 1)); + m_Params.push_back(ParamWithName(&m_N, prefix + "juliaNab_n", 1)); + m_Params.push_back(ParamWithName(&m_A, prefix + "juliaNab_a", 1)); + m_Params.push_back(ParamWithName(&m_B, prefix + "juliaNab_b", 1)); m_Params.push_back(ParamWithName(&m_Sep, prefix + "juliaNab_separ", 1)); m_Params.push_back(ParamWithName(true, &m_AbsN, prefix + "juliaNab_absn"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "juliaNab_cn")); + m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "juliaNab_cn")); } private: @@ -1309,14 +1320,15 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string w = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t sqX = SQR(vIn.x);\n" << "\t\treal_t sqY = SQR(vIn.y);\n" << "\t\treal_t v = (sqX + sqY) * " << w << ";\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sin(vIn.x) * (sqX + " << w << " - v);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sin(vIn.y) * (sqY + " << w << " - v);\n" + << "\t\tvOut.x = " << weight << " * sin(vIn.x) * (sqX + " << w << " - v);\n" + << "\t\tvOut.y = " << weight << " * sin(vIn.y) * (sqY + " << w << " - v);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -1395,9 +1407,10 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string m_k = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string step = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string num = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string m_k = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string step = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string num = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string xSeed = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string ySeed = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" @@ -1435,8 +1448,8 @@ public: << "\t\t }\n" << "\t\t}\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (" << m_k << " * (vIn.x - x0) + x0);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (" << m_k << " * (vIn.y - y0) + y0);\n" + << "\t\tvOut.x = " << weight << " * (" << m_k << " * (vIn.x - x0) + x0);\n" + << "\t\tvOut.y = " << weight << " * (" << m_k << " * (vIn.y - y0) + y0);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -1462,9 +1475,9 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_K, prefix + "Voron_K", T(0.99))); - m_Params.push_back(ParamWithName(&m_Step, prefix + "Voron_Step", T(0.25), eParamType::REAL_NONZERO)); - m_Params.push_back(ParamWithName(&m_Num, prefix + "Voron_Num", 1, eParamType::INTEGER, 1, 25)); + m_Params.push_back(ParamWithName(&m_K, prefix + "Voron_K", T(0.99))); + m_Params.push_back(ParamWithName(&m_Step, prefix + "Voron_Step", T(0.25), eParamType::REAL_NONZERO)); + m_Params.push_back(ParamWithName(&m_Num, prefix + "Voron_Num", 1, eParamType::INTEGER, 1, 25)); m_Params.push_back(ParamWithName(&m_XSeed, prefix + "Voron_XSeed", 3, eParamType::INTEGER)); m_Params.push_back(ParamWithName(&m_YSeed, prefix + "Voron_YSeed", 7, eParamType::INTEGER)); } @@ -1513,11 +1526,11 @@ public: case 1: a = (rand.Rand(ISAAC_INT(m_Slices)) + rand.Frand01()) / m_Slices; - r = (rand.Rand(ISAAC_INT(m_Slices)) + m_YThickness) / m_Slices; + r = (rand.Rand(ISAAC_INT(m_Slices)) + m_YThickness) / m_Slices; break; case 2: - a = (rand.Rand(ISAAC_INT(m_Slices)) + m_XThickness) / m_Slices; + a = (rand.Rand(ISAAC_INT(m_Slices)) + m_XThickness) / m_Slices; r = (rand.Rand(ISAAC_INT(m_Slices)) + rand.Frand01()) / m_Slices; break; @@ -1544,12 +1557,13 @@ public: int i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string slices = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string slices = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string xThickness = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string yThickness = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rotation = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string sinr = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cosr = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rotation = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string sinr = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cosr = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t a = 0, r = 0;\n" << "\n" @@ -1595,10 +1609,10 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Slices, prefix + "waffle_slices", 6, eParamType::INTEGER_NONZERO)); + m_Params.push_back(ParamWithName(&m_Slices, prefix + "waffle_slices", 6, eParamType::INTEGER_NONZERO)); m_Params.push_back(ParamWithName(&m_XThickness, prefix + "waffle_xthickness", T(0.5))); m_Params.push_back(ParamWithName(&m_YThickness, prefix + "waffle_ythickness", T(0.5))); - m_Params.push_back(ParamWithName(&m_Rotation, prefix + "waffle_rotation")); + m_Params.push_back(ParamWithName(&m_Rotation, prefix + "waffle_rotation")); m_Params.push_back(ParamWithName(true, &m_SinR, prefix + "waffle_sinr")); m_Params.push_back(ParamWithName(true, &m_CosR, prefix + "waffle_cosr")); } @@ -1634,10 +1648,11 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) - (real_t)(0.5));\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) - (real_t)(0.5));\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) - (real_t)(0.5));\n" + << "\t\tvOut.x = " << weight << " * (MwcNext01(mwc) - (real_t)(0.5));\n" + << "\t\tvOut.y = " << weight << " * (MwcNext01(mwc) - (real_t)(0.5));\n" + << "\t\tvOut.z = " << weight << " * (MwcNext01(mwc) - (real_t)(0.5));\n" << "\t}\n"; return ss.str(); } @@ -1701,30 +1716,31 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string rho = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string phi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string m1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string m2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string a1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string a2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string b1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string b2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string n1_1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string n1_2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string n2_1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string n2_2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string n3_1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string n3_2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string rho = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string phi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string m1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string m2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string a1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string a2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string b1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string b2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string n1_1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string n1_2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string n2_1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string n2_2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string n3_1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string n3_2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string spiral = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string toroid = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string n1n_1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string n1n_2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string an2_1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string an2_2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string bn3_1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string bn3_2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string m4_1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string m4_2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string n1n_1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string n1n_2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string an2_1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string an2_2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string bn3_1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string bn3_2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string m4_1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string m4_2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string rho2pi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string phi2pi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" @@ -1757,15 +1773,15 @@ public: << "\n" << "\t\tif ((int)" << toroid << " == 1)\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * cosr * (r1 + r2 * cosp);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * sinr * (r1 + r2 * cosp);\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * r2 * sinp;\n" + << "\t\t vOut.x = " << weight << " * cosr * (r1 + r2 * cosp);\n" + << "\t\t vOut.y = " << weight << " * sinr * (r1 + r2 * cosp);\n" + << "\t\t vOut.z = " << weight << " * r2 * sinp;\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * r1 * cosr * r2 * cosp;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * r1 * sinr * r2 * cosp;\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * r2 * sinp;\n" + << "\t\t vOut.x = " << weight << " * r1 * cosr * r2 * cosp;\n" + << "\t\t vOut.y = " << weight << " * r1 * sinr * r2 * cosp;\n" + << "\t\t vOut.z = " << weight << " * r2 * sinp;\n" << "\t\t}\n" << "\t}\n"; return ss.str(); @@ -1790,30 +1806,30 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Rho, prefix + "SuperShape3D_rho", T(9.9))); - m_Params.push_back(ParamWithName(&m_Phi, prefix + "SuperShape3D_phi", T(2.5))); - m_Params.push_back(ParamWithName(&m_M1, prefix + "SuperShape3D_m1", 6)); - m_Params.push_back(ParamWithName(&m_M2, prefix + "SuperShape3D_m2", 3)); - m_Params.push_back(ParamWithName(&m_A1, prefix + "SuperShape3D_a1", 1)); - m_Params.push_back(ParamWithName(&m_A2, prefix + "SuperShape3D_a2", 1)); - m_Params.push_back(ParamWithName(&m_B1, prefix + "SuperShape3D_b1", 1)); - m_Params.push_back(ParamWithName(&m_B2, prefix + "SuperShape3D_b2", 1)); - m_Params.push_back(ParamWithName(&m_N1_1, prefix + "SuperShape3D_n1_1", 1)); - m_Params.push_back(ParamWithName(&m_N1_2, prefix + "SuperShape3D_n1_2", 1)); - m_Params.push_back(ParamWithName(&m_N2_1, prefix + "SuperShape3D_n2_1", 1)); - m_Params.push_back(ParamWithName(&m_N2_2, prefix + "SuperShape3D_n2_2", 1)); - m_Params.push_back(ParamWithName(&m_N3_1, prefix + "SuperShape3D_n3_1", 1)); - m_Params.push_back(ParamWithName(&m_N3_2, prefix + "SuperShape3D_n3_2", 1)); - m_Params.push_back(ParamWithName(&m_Spiral, prefix + "SuperShape3D_spiral")); + m_Params.push_back(ParamWithName(&m_Rho, prefix + "SuperShape3D_rho", T(9.9))); + m_Params.push_back(ParamWithName(&m_Phi, prefix + "SuperShape3D_phi", T(2.5))); + m_Params.push_back(ParamWithName(&m_M1, prefix + "SuperShape3D_m1", 6)); + m_Params.push_back(ParamWithName(&m_M2, prefix + "SuperShape3D_m2", 3)); + m_Params.push_back(ParamWithName(&m_A1, prefix + "SuperShape3D_a1", 1)); + m_Params.push_back(ParamWithName(&m_A2, prefix + "SuperShape3D_a2", 1)); + m_Params.push_back(ParamWithName(&m_B1, prefix + "SuperShape3D_b1", 1)); + m_Params.push_back(ParamWithName(&m_B2, prefix + "SuperShape3D_b2", 1)); + m_Params.push_back(ParamWithName(&m_N1_1, prefix + "SuperShape3D_n1_1", 1)); + m_Params.push_back(ParamWithName(&m_N1_2, prefix + "SuperShape3D_n1_2", 1)); + m_Params.push_back(ParamWithName(&m_N2_1, prefix + "SuperShape3D_n2_1", 1)); + m_Params.push_back(ParamWithName(&m_N2_2, prefix + "SuperShape3D_n2_2", 1)); + m_Params.push_back(ParamWithName(&m_N3_1, prefix + "SuperShape3D_n3_1", 1)); + m_Params.push_back(ParamWithName(&m_N3_2, prefix + "SuperShape3D_n3_2", 1)); + m_Params.push_back(ParamWithName(&m_Spiral, prefix + "SuperShape3D_spiral")); m_Params.push_back(ParamWithName(&m_Toroidmap, prefix + "SuperShape3D_toroidmap", 0, eParamType::INTEGER, 0, 1)); - m_Params.push_back(ParamWithName(true, &m_N1n_1, prefix + "SuperShape3D_n1n1"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_N1n_2, prefix + "SuperShape3D_n1n2")); - m_Params.push_back(ParamWithName(true, &m_An2_1, prefix + "SuperShape3D_an21")); - m_Params.push_back(ParamWithName(true, &m_An2_2, prefix + "SuperShape3D_an22")); - m_Params.push_back(ParamWithName(true, &m_Bn3_1, prefix + "SuperShape3D_bn31")); - m_Params.push_back(ParamWithName(true, &m_Bn3_2, prefix + "SuperShape3D_bn32")); - m_Params.push_back(ParamWithName(true, &m_M4_1, prefix + "SuperShape3D_m41")); - m_Params.push_back(ParamWithName(true, &m_M4_2, prefix + "SuperShape3D_m42")); + m_Params.push_back(ParamWithName(true, &m_N1n_1, prefix + "SuperShape3D_n1n1"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_N1n_2, prefix + "SuperShape3D_n1n2")); + m_Params.push_back(ParamWithName(true, &m_An2_1, prefix + "SuperShape3D_an21")); + m_Params.push_back(ParamWithName(true, &m_An2_2, prefix + "SuperShape3D_an22")); + m_Params.push_back(ParamWithName(true, &m_Bn3_1, prefix + "SuperShape3D_bn31")); + m_Params.push_back(ParamWithName(true, &m_Bn3_2, prefix + "SuperShape3D_bn32")); + m_Params.push_back(ParamWithName(true, &m_M4_1, prefix + "SuperShape3D_m41")); + m_Params.push_back(ParamWithName(true, &m_M4_2, prefix + "SuperShape3D_m42")); m_Params.push_back(ParamWithName(true, &m_Rho2Pi, prefix + "SuperShape3D_rho2pi")); m_Params.push_back(ParamWithName(true, &m_Phi2Pi, prefix + "SuperShape3D_phi2pi")); } @@ -1864,7 +1880,7 @@ public: virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override { T t, rX, rY, rZ; - t = Zeps(helper.m_PrecalcSumSquares + SQR(helper.In.z)); + t = Zeps(helper.m_PrecalcSumSquares + SQR(helper.In.z)); rX = m_Weight / std::pow(t, m_StretchX); rY = m_Weight / std::pow(t, m_StretchY); helper.Out.x = helper.In.x * rX; @@ -1884,23 +1900,24 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string stretchX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string stretchY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string stretchZ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string zOn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string zOn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t t, rX, rY, rZ;\n" << "\n" << "\t\tt = Zeps(precalcSumSquares + SQR(vIn.z));\n" - << "\t\trX = xform->m_VariationWeights[" << varIndex << "] / pow(t, " << stretchX << ");\n" - << "\t\trY = xform->m_VariationWeights[" << varIndex << "] / pow(t, " << stretchY << ");\n" + << "\t\trX = " << weight << " / pow(t, " << stretchX << ");\n" + << "\t\trY = " << weight << " / pow(t, " << stretchY << ");\n" << "\n" << "\t\tvOut.x = vIn.x * rX;\n" << "\t\tvOut.y = vIn.y * rY;\n" << "\n" << "\t\tif ((int)" << zOn << " == 1)\n" << "\t\t{\n" - << "\t\trZ = xform->m_VariationWeights[" << varIndex << "] / pow(t, " << stretchZ << ");\n" + << "\t\trZ = " << weight << " / pow(t, " << stretchZ << ");\n" << "\n" << "\t\tvOut.z = vIn.z * rZ;\n" << "\t\t}\n" @@ -1921,7 +1938,7 @@ protected: m_Params.push_back(ParamWithName(&m_StretchX, prefix + "sphyp3D_stretchX", 1)); m_Params.push_back(ParamWithName(&m_StretchY, prefix + "sphyp3D_stretchY", 1)); m_Params.push_back(ParamWithName(&m_StretchZ, prefix + "sphyp3D_stretchZ", 1)); - m_Params.push_back(ParamWithName(&m_ZOn, prefix + "sphyp3D_zOn", 1, eParamType::INTEGER, 0, 1)); + m_Params.push_back(ParamWithName(&m_ZOn, prefix + "sphyp3D_zOn", 1, eParamType::INTEGER, 0, 1)); } private: @@ -1999,12 +2016,13 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string scatterArea = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string zero = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ca = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string zero = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ca = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t xi = vIn.x - " << x << ";\n" << "\t\treal_t yi = vIn.y - " << y << ";\n" @@ -2015,7 +2033,7 @@ public: ss << "\t\ttransX -= " << x << ";\n" << "\t\ttransY -= " << y << ";\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"; + << "\t\tvOut.z = " << weight << " * vIn.z;\n"; } else { @@ -2044,18 +2062,18 @@ public: << "\t\t}\n" << "\t\telse if (cr0 && !esc)\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * xi + " << x << ";\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * yi + " << y << ";\n" + << "\t\t vOut.x = " << weight << " * xi + " << x << ";\n" + << "\t\t vOut.y = " << weight << " * yi + " << y << ";\n" << "\t\t}\n" << "\t\telse if (!cr0 && esc)\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * rdc * c + " << x << ";\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * rdc * s + " << y << ";\n" + << "\t\t vOut.x = " << weight << " * rdc * c + " << x << ";\n" + << "\t\t vOut.y = " << weight << " * rdc * s + " << y << ";\n" << "\t\t}\n" << "\t\telse if (!cr0 && !esc)\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * xi + " << x << ";\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * yi + " << y << ";\n" + << "\t\t vOut.x = " << weight << " * xi + " << x << ";\n" + << "\t\t vOut.y = " << weight << " * yi + " << y << ";\n" << "\t\t}\n" << "\t}\n"; return ss.str(); @@ -2071,12 +2089,12 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Radius, prefix + "circlecrop_radius", 1)); - m_Params.push_back(ParamWithName(&m_X, prefix + "circlecrop_x")); - m_Params.push_back(ParamWithName(&m_Y, prefix + "circlecrop_y")); + m_Params.push_back(ParamWithName(&m_Radius, prefix + "circlecrop_radius", 1)); + m_Params.push_back(ParamWithName(&m_X, prefix + "circlecrop_x")); + m_Params.push_back(ParamWithName(&m_Y, prefix + "circlecrop_y")); m_Params.push_back(ParamWithName(&m_ScatterArea, prefix + "circlecrop_scatter_area")); - m_Params.push_back(ParamWithName(&m_Zero, prefix + "circlecrop_zero", 1, eParamType::INTEGER, 0, 1)); - m_Params.push_back(ParamWithName(true, &m_Ca, prefix + "circlecrop_ca")); + m_Params.push_back(ParamWithName(&m_Zero, prefix + "circlecrop_zero", 1, eParamType::INTEGER, 0, 1)); + m_Params.push_back(ParamWithName(true, &m_Ca, prefix + "circlecrop_ca")); } private: @@ -2122,19 +2140,20 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string d = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string e = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string f = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string absn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string d = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string e = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string f = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string absn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tconst real_t z = vIn.z / " << absn << ";\n" - << "\t\tconst real_t radiusOut = xform->m_VariationWeights[" << varIndex << "] * pow(precalcSumSquares + z * z, " << cn << ");\n" + << "\t\tconst real_t radiusOut = " << weight << " * pow(precalcSumSquares + z * z, " << cn << ");\n" << "\t\tconst real_t x = " << a << " * vIn.x + " << b << " * vIn.y + " << e << ";\n" << "\t\tconst real_t y = " << c << " * vIn.x + " << d << " * vIn.y + " << f << ";\n" << "\t\tconst real_t rand = (int)(MwcNext01(mwc) * " << absn << ");\n" @@ -2159,16 +2178,16 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Dist, prefix + "julian3Dx_dist", 1)); + m_Params.push_back(ParamWithName(&m_Dist, prefix + "julian3Dx_dist", 1)); m_Params.push_back(ParamWithName(&m_Power, prefix + "julian3Dx_power", 2, eParamType::INTEGER_NONZERO)); - m_Params.push_back(ParamWithName(&m_A, prefix + "julian3Dx_a", 1)); - m_Params.push_back(ParamWithName(&m_B, prefix + "julian3Dx_b")); - m_Params.push_back(ParamWithName(&m_C, prefix + "julian3Dx_c")); - m_Params.push_back(ParamWithName(&m_D, prefix + "julian3Dx_d", 1)); - m_Params.push_back(ParamWithName(&m_E, prefix + "julian3Dx_e")); - m_Params.push_back(ParamWithName(&m_F, prefix + "julian3Dx_f")); + m_Params.push_back(ParamWithName(&m_A, prefix + "julian3Dx_a", 1)); + m_Params.push_back(ParamWithName(&m_B, prefix + "julian3Dx_b")); + m_Params.push_back(ParamWithName(&m_C, prefix + "julian3Dx_c")); + m_Params.push_back(ParamWithName(&m_D, prefix + "julian3Dx_d", 1)); + m_Params.push_back(ParamWithName(&m_E, prefix + "julian3Dx_e")); + m_Params.push_back(ParamWithName(&m_F, prefix + "julian3Dx_f")); m_Params.push_back(ParamWithName(true, &m_AbsN, prefix + "julian3Dx_absn"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "julian3Dx_cn")); + m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "julian3Dx_cn")); } private: @@ -2257,19 +2276,20 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string spin = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string space = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string twist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string spin = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string space = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string twist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string sqrWeight = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tif (vIn.x > 0 && vIn.y > 0)\n" << "\t\t{\n" << "\t\t real_t r = 1 / precalcSqrtSumSquares;\n" << "\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * r * cos(precalcAtanyx);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * r * sin(precalcAtanyx);\n" + << "\t\t vOut.x = " << weight << " * r * cos(precalcAtanyx);\n" + << "\t\t vOut.y = " << weight << " * r * sin(precalcAtanyx);\n" << "\t\t}\n" << "\t\telse if (vIn.x > 0 && vIn.y < 0)\n" << "\t\t{\n" @@ -2277,15 +2297,15 @@ public: << "\n" << "\t\t if (r2 < " << sqrWeight << ")\n" << "\t\t {\n" - << "\t\t real_t r = xform->m_VariationWeights[" << varIndex << "] * sqrt(" << sqrWeight << " / r2 - 1);\n" + << "\t\t real_t r = " << weight << " * sqrt(" << sqrWeight << " / r2 - 1);\n" << "\n" << "\t\t vOut.x = r * vIn.x;\n" << "\t\t vOut.y = r * vIn.y;\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t }\n" << "\t\t}\n" << "\t\telse if (vIn.x < 0 && vIn.y > 0)\n" @@ -2294,25 +2314,25 @@ public: << "\t\t real_t y = vIn.y + " << y << ";\n" << "\t\t real_t r = sqrt(SQR(x) + SQR(y));\n" << "\n" - << "\t\t if (r < xform->m_VariationWeights[" << varIndex << "])\n" + << "\t\t if (r < " << weight << ")\n" << "\t\t {\n" - << "\t\t real_t a = atan2(y, x) + " << spin << " + " << twist << " * (xform->m_VariationWeights[" << varIndex << "] - r);\n" + << "\t\t real_t a = atan2(y, x) + " << spin << " + " << twist << " * (" << weight << " - r);\n" << "\n" - << "\t\t r *= xform->m_VariationWeights[" << varIndex << "];\n" + << "\t\t r *= " << weight << ";\n" << "\t\t vOut.x = r * cos(a) + " << x << ";\n" << "\t\t vOut.y = r * sin(a) - " << y << ";\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t r = xform->m_VariationWeights[" << varIndex << "] * (1 + " << space << " / Zeps(r));\n" + << "\t\t r = " << weight << " * (1 + " << space << " / Zeps(r));\n" << "\t\t vOut.x = r * x + " << x << ";\n" << "\t\t vOut.y = r * y - " << y << ";\n" << "\t\t }\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t}\n" << "\n" << "\t\tvOut.z = " << DefaultZCl() @@ -2335,11 +2355,11 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Spin, prefix + "fourth_spin", T(M_PI), eParamType::REAL_CYCLIC, 0, M_2PI)); + m_Params.push_back(ParamWithName(&m_Spin, prefix + "fourth_spin", T(M_PI), eParamType::REAL_CYCLIC, 0, M_2PI)); m_Params.push_back(ParamWithName(&m_Space, prefix + "fourth_space")); m_Params.push_back(ParamWithName(&m_Twist, prefix + "fourth_twist")); - m_Params.push_back(ParamWithName(&m_X, prefix + "fourth_x")); - m_Params.push_back(ParamWithName(&m_Y, prefix + "fourth_y")); + m_Params.push_back(ParamWithName(&m_X, prefix + "fourth_x")); + m_Params.push_back(ParamWithName(&m_Y, prefix + "fourth_y")); m_Params.push_back(ParamWithName(true, &m_SqrWeight, prefix + "fourth_sqr_weight"));//Precalc. } @@ -2407,6 +2427,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string at = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string ax = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string ay = "parVars[" + ToUpper(m_Params[i++].Name()) + index; @@ -2452,7 +2473,7 @@ public: << "\t\treal_t dx = t4 * x2 + x4 * t2 - z4 * y2 + x5;\n" << "\t\treal_t dy = t4 * y2 + y4 * t2 + z4 * x2 + y5;\n" << "\t\treal_t dz = z4 * t2 + x4 * y2 - y4 * x2 + z5;\n" - << "\t\treal_t ni = xform->m_VariationWeights[" << varIndex << "] / (SQR(dt) + SQR(dx) + SQR(dy) + SQR(dz));\n" + << "\t\treal_t ni = " << weight << " / (SQR(dt) + SQR(dx) + SQR(dy) + SQR(dz));\n" << "\n" << "\t\tvOut.x = (nt * dt + nx * dx + ny * dy + nz * dz) * ni;\n" << "\t\tvOut.y = (nx * dt - nt * dx - ny * dz + nz * dy) * ni;\n" @@ -2534,6 +2555,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tconst real_t zr = Hypot(vIn.z, precalcSqrtSumSquares);\n" @@ -2541,9 +2563,9 @@ public: << "\t\tconst real_t ps = sin(phi);\n" << "\t\tconst real_t pc = cos(phi);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * cos(precalcAtanyx) * ps * (zr + " << radius << ");\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sin(precalcAtanyx) * ps * (zr + " << radius << ");\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * pc * (zr + " << radius << ");\n" + << "\t\tvOut.x = " << weight << " * cos(precalcAtanyx) * ps * (zr + " << radius << ");\n" + << "\t\tvOut.y = " << weight << " * sin(precalcAtanyx) * ps * (zr + " << radius << ");\n" + << "\t\tvOut.z = " << weight << " * pc * (zr + " << radius << ");\n" << "\t}\n"; return ss.str(); } @@ -2602,14 +2624,15 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string z = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string z = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string xOrigin = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string yOrigin = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string zOrigin = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * (Sqr(vIn.x - " << xOrigin << ") + \n" + << "\t\treal_t r = " << weight << " * (Sqr(vIn.x - " << xOrigin << ") + \n" << "\t\t Sqr(vIn.y - " << yOrigin << ") + \n" << "\t\t Sqr(vIn.z - " << zOrigin << ")) *\n" << "\t\t (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - 2);\n" @@ -2690,13 +2713,14 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string sx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string sy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string dc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c2x2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string sx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string sy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string dc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c2x2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string dcAdjust = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string powerInv = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" @@ -2708,11 +2732,11 @@ public: << "\t\tconst real_t im = Spread(" << c1 << " * y + " << c2x2 << " * x * y, " << sy << ");\n" << "\t\treal_t c = Zeps(Powq4c(SQR(re) + SQR(im), " << powerInv << "));\n" << "\n" - << "\t\tconst real_t r = xform->m_VariationWeights[" << varIndex << "] / c;\n" + << "\t\tconst real_t r = " << weight << " / c;\n" << "\n" << "\t\tvOut.x = (x * re + y * im) * r;\n" << "\t\tvOut.y = (y * re - x * im) * r;\n" - << "\t\tvOut.z = (z * xform->m_VariationWeights[" << varIndex << "]) / c;\n" + << "\t\tvOut.z = (z * " << weight << ") / c;\n" << "\t\toutPoint->m_ColorX = clamp(outPoint->m_ColorX + " << dcAdjust << " * c, (real_t)(0.0), (real_t)(1.0));\n" << "\t}\n"; return ss.str(); @@ -2737,12 +2761,12 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Power, prefix + "curl_sp_pow", 1, eParamType::REAL_NONZERO)); - m_Params.push_back(ParamWithName(&m_C1, prefix + "curl_sp_c1")); - m_Params.push_back(ParamWithName(&m_C2, prefix + "curl_sp_c2")); - m_Params.push_back(ParamWithName(&m_Sx, prefix + "curl_sp_sx")); - m_Params.push_back(ParamWithName(&m_Sy, prefix + "curl_sp_sy")); - m_Params.push_back(ParamWithName(&m_Dc, prefix + "curl_sp_dc")); - m_Params.push_back(ParamWithName(true, &m_C2x2, prefix + "curl_sp_c2_x2")); + m_Params.push_back(ParamWithName(&m_C1, prefix + "curl_sp_c1")); + m_Params.push_back(ParamWithName(&m_C2, prefix + "curl_sp_c2")); + m_Params.push_back(ParamWithName(&m_Sx, prefix + "curl_sp_sx")); + m_Params.push_back(ParamWithName(&m_Sy, prefix + "curl_sp_sy")); + m_Params.push_back(ParamWithName(&m_Dc, prefix + "curl_sp_dc")); + m_Params.push_back(ParamWithName(true, &m_C2x2, prefix + "curl_sp_c2_x2")); m_Params.push_back(ParamWithName(true, &m_DcAdjust, prefix + "curl_sp_dc_adjust")); m_Params.push_back(ParamWithName(true, &m_PowerInv, prefix + "curl_sp_power_inv")); } @@ -2798,24 +2822,25 @@ public: int i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string thetaPeriod = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string thetaPhase = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string thetaAmp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string phiPeriod = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string phiPhase = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string phiAmp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rperiod = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rphase = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ramp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string at = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string bt = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ct = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ap = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string bp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ar = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string br = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cr = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string thetaPhase = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string thetaAmp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string phiPeriod = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string phiPhase = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string phiAmp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rperiod = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rphase = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ramp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string at = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string bt = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ct = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ap = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string bp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ar = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string br = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cr = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t r = sqrt(fabs(precalcSumSquares + vIn.z));\n" << "\n" @@ -2862,14 +2887,14 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_ThetaPeriod, prefix + "heat_theta_period", 1)); - m_Params.push_back(ParamWithName(&m_ThetaPhase, prefix + "heat_theta_phase")); - m_Params.push_back(ParamWithName(&m_ThetaAmp, prefix + "heat_theta_amp", 1)); - m_Params.push_back(ParamWithName(&m_PhiPeriod, prefix + "heat_phi_period", 1)); - m_Params.push_back(ParamWithName(&m_PhiPhase, prefix + "heat_phi_phase")); - m_Params.push_back(ParamWithName(&m_PhiAmp, prefix + "heat_phi_amp")); - m_Params.push_back(ParamWithName(&m_Rperiod, prefix + "heat_r_period", 1)); - m_Params.push_back(ParamWithName(&m_Rphase, prefix + "heat_r_phase")); - m_Params.push_back(ParamWithName(&m_Ramp, prefix + "heat_r_amp")); + m_Params.push_back(ParamWithName(&m_ThetaPhase, prefix + "heat_theta_phase")); + m_Params.push_back(ParamWithName(&m_ThetaAmp, prefix + "heat_theta_amp", 1)); + m_Params.push_back(ParamWithName(&m_PhiPeriod, prefix + "heat_phi_period", 1)); + m_Params.push_back(ParamWithName(&m_PhiPhase, prefix + "heat_phi_phase")); + m_Params.push_back(ParamWithName(&m_PhiAmp, prefix + "heat_phi_amp")); + m_Params.push_back(ParamWithName(&m_Rperiod, prefix + "heat_r_period", 1)); + m_Params.push_back(ParamWithName(&m_Rphase, prefix + "heat_r_phase")); + m_Params.push_back(ParamWithName(&m_Ramp, prefix + "heat_r_amp")); m_Params.push_back(ParamWithName(true, &m_At, prefix + "heat_at")); m_Params.push_back(ParamWithName(true, &m_Bt, prefix + "heat_bt")); m_Params.push_back(ParamWithName(true, &m_Ct, prefix + "heat_ct")); @@ -2980,6 +3005,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string a1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string b1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string c1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; @@ -3036,8 +3062,8 @@ public: << "\t\t break;\n" << "\t\t}\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (fp1x + fp2x);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (fp1y + fp2y);\n" + << "\t\tvOut.x = " << weight << " * (fp1x + fp2x);\n" + << "\t\tvOut.y = " << weight << " * (fp1y + fp2y);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -3136,15 +3162,16 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t absV = Hypot(vIn.y, vIn.z);\n" << "\t\treal_t s = sin(vIn.x);\n" << "\t\treal_t c = cos(vIn.x);\n" << "\t\treal_t sh = sinh(absV);\n" << "\t\treal_t ch = cosh(absV);\n" - << "\t\treal_t d = xform->m_VariationWeights[" << varIndex << "] * c * sh / Zeps(absV);\n" + << "\t\treal_t d = " << weight << " * c * sh / Zeps(absV);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * s * ch;\n" + << "\t\tvOut.x = " << weight << " * s * ch;\n" << "\t\tvOut.y = d * vIn.y;\n" << "\t\tvOut.z = d * vIn.z;\n" << "\t}\n"; @@ -3185,15 +3212,16 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t absV = Hypot(vIn.y, vIn.z);\n" << "\t\treal_t s = sin(absV);\n" << "\t\treal_t c = cos(absV);\n" << "\t\treal_t sh = sinh(vIn.x);\n" << "\t\treal_t ch = cosh(vIn.x);\n" - << "\t\treal_t d = xform->m_VariationWeights[" << varIndex << "] * ch * s / Zeps(absV);\n" + << "\t\treal_t d = " << weight << " * ch * s / Zeps(absV);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sh * c;\n" + << "\t\tvOut.x = " << weight << " * sh * c;\n" << "\t\tvOut.y = d * vIn.y;\n" << "\t\tvOut.z = d * vIn.z;\n" << "\t}\n"; @@ -3226,7 +3254,7 @@ public: T sh = std::sinh(absV); T ch = std::cosh(absV); T d = ni * s * sh / Zeps(absV); - helper.Out.x = c * ch * ni; + helper.Out.x = c * ch * ni; helper.Out.y = -(d * helper.In.y); helper.Out.z = -(d * helper.In.z); } @@ -3235,9 +3263,10 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t absV = Hypot(vIn.y, vIn.z);\n" - << "\t\treal_t ni = xform->m_VariationWeights[" << varIndex << "] / Zeps(precalcSumSquares + SQR(vIn.z));\n" + << "\t\treal_t ni = " << weight << " / Zeps(precalcSumSquares + SQR(vIn.z));\n" << "\t\treal_t s = sin(-vIn.x);\n" << "\t\treal_t c = cos(-vIn.x);\n" << "\t\treal_t sh = sinh(absV);\n" @@ -3277,7 +3306,7 @@ public: T sh = std::sinh(helper.In.x); T ch = std::cosh(helper.In.x); T d = ni * sh * s / Zeps(absV); - helper.Out.x = ch * c * ni; + helper.Out.x = ch * c * ni; helper.Out.y = -(d * helper.In.y); helper.Out.z = -(d * helper.In.z); } @@ -3286,9 +3315,10 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t absV = Hypot(vIn.y, vIn.z);\n" - << "\t\treal_t ni = xform->m_VariationWeights[" << varIndex << "] / Zeps(precalcSumSquares + SQR(vIn.z));\n" + << "\t\treal_t ni = " << weight << " / Zeps(precalcSumSquares + SQR(vIn.z));\n" << "\t\treal_t s = sin(absV);\n" << "\t\treal_t c = cos(absV);\n" << "\t\treal_t sh = sinh(vIn.x);\n" @@ -3342,10 +3372,11 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t sysz = SQR(vIn.y) + SQR(vIn.z);\n" << "\t\treal_t absV = sqrt(sysz);\n" - << "\t\treal_t ni = xform->m_VariationWeights[" << varIndex << "] / Zeps(SQR(vIn.x) + sysz);\n" + << "\t\treal_t ni = " << weight << " / Zeps(SQR(vIn.x) + sysz);\n" << "\t\treal_t s = sin(vIn.x);\n" << "\t\treal_t c = cos(vIn.x);\n" << "\t\treal_t sh = sinh(absV);\n" @@ -3403,10 +3434,11 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t sysz = SQR(vIn.y) + SQR(vIn.z);\n" << "\t\treal_t absV = sqrt(sysz);\n" - << "\t\treal_t ni = xform->m_VariationWeights[" << varIndex << "] / Zeps(SQR(vIn.x) + sysz);\n" + << "\t\treal_t ni = " << weight << " / Zeps(SQR(vIn.x) + sysz);\n" << "\t\treal_t s = sin(absV);\n" << "\t\treal_t c = cos(absV);\n" << "\t\treal_t sh = sinh(vIn.x);\n" @@ -3458,15 +3490,16 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t absV = Hypot(vIn.y, vIn.z);\n" << "\t\treal_t s = sin(vIn.x);\n" << "\t\treal_t c = cos(vIn.x);\n" << "\t\treal_t sh = sinh(absV);\n" << "\t\treal_t ch = cosh(absV);\n" - << "\t\treal_t d = -xform->m_VariationWeights[" << varIndex << "] * s * sh / Zeps(absV);\n" + << "\t\treal_t d = -" << weight << " * s * sh / Zeps(absV);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * c * ch;\n" + << "\t\tvOut.x = " << weight << " * c * ch;\n" << "\t\tvOut.y = d * vIn.y;\n" << "\t\tvOut.z = d * vIn.z;\n" << "\t}\n"; @@ -3507,15 +3540,16 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t absV = Hypot(vIn.y, vIn.z);\n" << "\t\treal_t s = sin(absV);\n" << "\t\treal_t c = cos(absV);\n" << "\t\treal_t sh = sinh(vIn.x);\n" << "\t\treal_t ch = cosh(vIn.x);\n" - << "\t\treal_t d = xform->m_VariationWeights[" << varIndex << "] * sh * s / Zeps(absV);\n" + << "\t\treal_t d = " << weight << " * sh * s / Zeps(absV);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * c * ch;\n" + << "\t\tvOut.x = " << weight << " * c * ch;\n" << "\t\tvOut.y = d * vIn.y;\n" << "\t\tvOut.z = d * vIn.z;\n" << "\t}\n"; @@ -3553,7 +3587,7 @@ public: T stcv = s * ch; T nstcv = -stcv; T ctcv = c * ch; - helper.Out.x = (stcv * ctcv + d * b * sysz) * ni; + helper.Out.x = (stcv * ctcv + d * b * sysz) * ni; helper.Out.y = -(nstcv * b * helper.In.y + d * helper.In.y * ctcv) * ni; helper.Out.z = -(nstcv * b * helper.In.z + d * helper.In.z * ctcv) * ni; } @@ -3562,10 +3596,11 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t sysz = SQR(vIn.y) + SQR(vIn.z);\n" << "\t\treal_t absV = sqrt(sysz);\n" - << "\t\treal_t ni = xform->m_VariationWeights[" << varIndex << "] / Zeps(SQR(vIn.x) + sysz);\n" + << "\t\treal_t ni = " << weight << " / Zeps(SQR(vIn.x) + sysz);\n" << "\t\treal_t s = sin(vIn.x);\n" << "\t\treal_t c = cos(vIn.x);\n" << "\t\treal_t sh = sinh(absV);\n" @@ -3623,10 +3658,11 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t sysz = SQR(vIn.y) + SQR(vIn.z);\n" << "\t\treal_t absV = sqrt(sysz);\n" - << "\t\treal_t ni = xform->m_VariationWeights[" << varIndex << "] / Zeps(Sqr(SQR(vIn.x) + sysz));\n" + << "\t\treal_t ni = " << weight << " / Zeps(Sqr(SQR(vIn.x) + sysz));\n" << "\t\treal_t s = sin(absV);\n" << "\t\treal_t c = cos(absV);\n" << "\t\treal_t sh = sinh(vIn.x);\n" @@ -3670,7 +3706,7 @@ public: T sh = std::sinh(absV); T ch = std::cosh(absV); T d = ni * c * sh / Zeps(absV); - helper.Out.x = s * ch * ni; + helper.Out.x = s * ch * ni; helper.Out.y = -(d * helper.In.y); helper.Out.z = -(d * helper.In.z); } @@ -3679,9 +3715,10 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t absV = Hypot(vIn.y, vIn.z);\n" - << "\t\treal_t ni = xform->m_VariationWeights[" << varIndex << "] / Zeps(precalcSumSquares + SQR(vIn.z));\n" + << "\t\treal_t ni = " << weight << " / Zeps(precalcSumSquares + SQR(vIn.z));\n" << "\t\treal_t s = sin(vIn.x);\n" << "\t\treal_t c = cos(vIn.x);\n" << "\t\treal_t sh = sinh(absV);\n" @@ -3721,7 +3758,7 @@ public: T sh = std::sinh(helper.In.x); T ch = std::cosh(helper.In.x); T d = ni * ch * s / Zeps(absV); - helper.Out.x = sh * c * ni; + helper.Out.x = sh * c * ni; helper.Out.y = -(d * helper.In.y); helper.Out.z = -(d * helper.In.z); } @@ -3730,9 +3767,10 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t absV = Hypot(vIn.y, vIn.z);\n" - << "\t\treal_t ni = xform->m_VariationWeights[" << varIndex << "] / Zeps(precalcSumSquares + SQR(vIn.z));\n" + << "\t\treal_t ni = " << weight << " / Zeps(precalcSumSquares + SQR(vIn.z));\n" << "\t\treal_t s = sin(absV);\n" << "\t\treal_t c = cos(absV);\n" << "\t\treal_t sh = sinh(vIn.x);\n" @@ -3779,6 +3817,7 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t absV = Hypot(vIn.y, vIn.z);\n" << "\t\treal_t e = exp(vIn.x);\n" @@ -3786,9 +3825,9 @@ public: << "\t\treal_t c = cos(absV);\n" << "\t\treal_t a = e * s / Zeps(absV);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * e * c;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * a * vIn.y;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * a * vIn.z;\n" + << "\t\tvOut.x = " << weight << " * e * c;\n" + << "\t\tvOut.y = " << weight << " * a * vIn.y;\n" + << "\t\tvOut.z = " << weight << " * a * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -3828,11 +3867,12 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string base = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string base = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string denom = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t absV = Hypot(vIn.y, vIn.z);\n" - << "\t\treal_t c = xform->m_VariationWeights[" << varIndex << "] * atan2(absV, vIn.x) / Zeps(absV);\n" + << "\t\treal_t c = " << weight << " * atan2(absV, vIn.x) / Zeps(absV);\n" << "\n" << "\t\tvOut.x = log(SQR(vIn.x) + SQR(absV)) * " << denom << ";\n" << "\t\tvOut.y = c * vIn.y;\n" @@ -3887,8 +3927,9 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] / Zeps(precalcSqrtSumSquares);\n" + << "\t\tvOut.x = " << weight << " / Zeps(precalcSqrtSumSquares);\n" << "\t\tvOut.y = precalcAtanyx;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; @@ -3933,6 +3974,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string q01 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string q02 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string q03 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; @@ -3950,10 +3992,10 @@ public: << "\t\treal_t sqy = SQR(vIn.y);\n" << "\t\treal_t xy = vIn.x * vIn.y;\n" << "\n" - << "\t\tvOut.x = (" << q01 << " + xform->m_VariationWeights[" << varIndex << "] * " << q02 << " * vIn.x + " << q03 << " * sqx) + \n" + << "\t\tvOut.x = (" << q01 << " + " << weight << " * " << q02 << " * vIn.x + " << q03 << " * sqx) + \n" << "\t\t (" << q04 << " * xy + " << q05 << " * vIn.y + " << q06 << " * sqy);\n" << "\t\tvOut.y = (" << q07 << " + " << q08 << " * vIn.x + " << q09 << " * sqx) + \n" - << "\t\t (" << q10 << " * xy + xform->m_VariationWeights[" << varIndex << "] * " << q11 << " * vIn.y + " << q12 << " * sqy);\n" + << "\t\t (" << q10 << " * xy + " << weight << " * " << q11 << " * vIn.y + " << q12 << " * sqy);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -4039,6 +4081,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string p = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index; @@ -4061,8 +4104,8 @@ public: << "\t\t yy = yymax;\n" << "\t\t}\n" << "\n" - << "\t\tvOut.x = xx * xform->m_VariationWeights[" << varIndex << "];\n" - << "\t\tvOut.y = yy * xform->m_VariationWeights[" << varIndex << "];\n" + << "\t\tvOut.x = xx * " << weight << ";\n" + << "\t\tvOut.y = yy * " << weight << ";\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -4229,17 +4272,18 @@ public: int i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string extended = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string exponent = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string arcWidth = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rotation = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string size = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string seed = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string oneOverEx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string absSeed = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string seed2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string extended = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string exponent = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string arcWidth = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rotation = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string size = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string seed = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string oneOverEx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string absSeed = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string seed2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string oneOverRmax = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tint extended = (int)" << extended << ";\n" << "\t\treal_t seed = " << absSeed << ";\n" @@ -4381,17 +4425,17 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Extended, prefix + "Truchet_extended", 0, eParamType::INTEGER, 0, 1)); - m_Params.push_back(ParamWithName(&m_Exponent, prefix + "Truchet_exponent", 2, eParamType::REAL_CYCLIC, T(0.001), 2)); + m_Params.push_back(ParamWithName(&m_Extended, prefix + "Truchet_extended", 0, eParamType::INTEGER, 0, 1)); + m_Params.push_back(ParamWithName(&m_Exponent, prefix + "Truchet_exponent", 2, eParamType::REAL_CYCLIC, T(0.001), 2)); m_Params.push_back(ParamWithName(&m_ArcWidth, prefix + "Truchet_arc_width", T(0.5), eParamType::REAL_CYCLIC, T(0.001), 1)); m_Params.push_back(ParamWithName(&m_Rotation, prefix + "Truchet_rotation")); - m_Params.push_back(ParamWithName(&m_Size, prefix + "Truchet_size", 1, eParamType::REAL_CYCLIC, T(0.001), 10)); - m_Params.push_back(ParamWithName(&m_Seed, prefix + "Truchet_seed", 50)); - m_Params.push_back(ParamWithName(true, &m_OneOverEx, prefix + "Truchet_one_over_ex"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_AbsSeed, prefix + "Truchet_abs_seed")); - m_Params.push_back(ParamWithName(true, &m_Seed2, prefix + "Truchet_seed2")); + m_Params.push_back(ParamWithName(&m_Size, prefix + "Truchet_size", 1, eParamType::REAL_CYCLIC, T(0.001), 10)); + m_Params.push_back(ParamWithName(&m_Seed, prefix + "Truchet_seed", 50)); + m_Params.push_back(ParamWithName(true, &m_OneOverEx, prefix + "Truchet_one_over_ex"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_AbsSeed, prefix + "Truchet_abs_seed")); + m_Params.push_back(ParamWithName(true, &m_Seed2, prefix + "Truchet_seed2")); m_Params.push_back(ParamWithName(true, &m_OneOverRmax, prefix + "Truchet_one_over_rmax")); - m_Params.push_back(ParamWithName(true, &m_Scale, prefix + "Truchet_scale")); + m_Params.push_back(ParamWithName(true, &m_Scale, prefix + "Truchet_scale")); } private: @@ -4453,21 +4497,22 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string deltaX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string deltaY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string areaX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string areaY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string deltaX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string deltaY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string areaX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string areaY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string centerX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string centerY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string gamma = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string square = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string dx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ax = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string dy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ay = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string gamma = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string square = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string dx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ax = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string dy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ay = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t oscX = GdoffsFosc(" << dx << ", 1);\n" << "\t\treal_t oscY = GdoffsFosc(" << dy << ", 1);\n" @@ -4487,9 +4532,9 @@ public: << "\t\t outY = GdoffsFlip(GdoffsFlip(inY, GdoffsFosc(inY, 4), oscY), GdoffsFosc(GdoffsFclp(" << b << " * inY), 4), oscY);\n" << "\t\t}\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * outX;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * outY;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.x = " << weight << " * outX;\n" + << "\t\tvOut.y = " << weight << " * outY;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -4524,21 +4569,21 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_DeltaX, prefix + "gdoffs_delta_x", 0, eParamType::REAL, 0, 16)); - m_Params.push_back(ParamWithName(&m_DeltaY, prefix + "gdoffs_delta_y", 0, eParamType::REAL, 0, 16)); - m_Params.push_back(ParamWithName(&m_AreaX, prefix + "gdoffs_area_x", 2)); - m_Params.push_back(ParamWithName(&m_AreaY, prefix + "gdoffs_area_y", 2)); + m_Params.push_back(ParamWithName(&m_DeltaX, prefix + "gdoffs_delta_x", 0, eParamType::REAL, 0, 16)); + m_Params.push_back(ParamWithName(&m_DeltaY, prefix + "gdoffs_delta_y", 0, eParamType::REAL, 0, 16)); + m_Params.push_back(ParamWithName(&m_AreaX, prefix + "gdoffs_area_x", 2)); + m_Params.push_back(ParamWithName(&m_AreaY, prefix + "gdoffs_area_y", 2)); m_Params.push_back(ParamWithName(&m_CenterX, prefix + "gdoffs_center_x")); m_Params.push_back(ParamWithName(&m_CenterY, prefix + "gdoffs_center_y")); - m_Params.push_back(ParamWithName(&m_Gamma, prefix + "gdoffs_gamma", 1, eParamType::INTEGER, 1, 6)); - m_Params.push_back(ParamWithName(&m_Square, prefix + "gdoffs_square", 0, eParamType::INTEGER, 0, 1)); + m_Params.push_back(ParamWithName(&m_Gamma, prefix + "gdoffs_gamma", 1, eParamType::INTEGER, 1, 6)); + m_Params.push_back(ParamWithName(&m_Square, prefix + "gdoffs_square", 0, eParamType::INTEGER, 0, 1)); m_Params.push_back(ParamWithName(true, &m_Dx, prefix + "gdoffs_dx")); m_Params.push_back(ParamWithName(true, &m_Ax, prefix + "gdoffs_ax")); m_Params.push_back(ParamWithName(true, &m_Cx, prefix + "gdoffs_cx")); m_Params.push_back(ParamWithName(true, &m_Dy, prefix + "gdoffs_dyd")); m_Params.push_back(ParamWithName(true, &m_Ay, prefix + "gdoffs_ay")); m_Params.push_back(ParamWithName(true, &m_Cy, prefix + "gdoffs_cy")); - m_Params.push_back(ParamWithName(true, &m_B, prefix + "gdoffs_b")); + m_Params.push_back(ParamWithName(true, &m_B, prefix + "gdoffs_b")); } private: @@ -4632,11 +4677,12 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string z = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / Zeps((SQR(SQR(vIn.x)) + SQR(vIn.z) + SQR(SQR(vIn.y)) + SQR(vIn.z)));\n" + << "\t\treal_t r = " << weight << " / Zeps((SQR(SQR(vIn.x)) + SQR(vIn.z) + SQR(SQR(vIn.y)) + SQR(vIn.z)));\n" << "\n" << "\t\tif (r < 2)\n" << "\t\t{\n" @@ -4646,11 +4692,11 @@ public: << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" + << "\t\t vOut.z = " << weight << " * vIn.z;\n" << "\n" - << "\t\t real_t t = xform->m_VariationWeights[" << varIndex << "] / Zeps((sqrt(SQR(vIn.x)) + sqrt(vIn.z) + sqrt(SQR(vIn.y)) + sqrt(vIn.z)));\n" + << "\t\t real_t t = " << weight << " / Zeps((sqrt(SQR(vIn.x)) + sqrt(vIn.z) + sqrt(SQR(vIn.y)) + sqrt(vIn.z)));\n" << "\n" << "\t\t if (r >= 0)\n" << "\t\t {\n" @@ -4660,25 +4706,25 @@ public: << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" + << "\t\t vOut.z = " << weight << " * vIn.z;\n" << "\t\t }\n" << "\n" << "\t\t if (vIn.x >= 0)\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + " << x << ");\n" + << "\t\t vOut.x = " << weight << " * (vIn.x + " << x << ");\n" << "\t\t else\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x - " << x << ");\n" + << "\t\t vOut.x = " << weight << " * (vIn.x - " << x << ");\n" << "\n" << "\t\t if (vIn.y >= 0)\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + " << y << ");\n" + << "\t\t vOut.y = " << weight << " * (vIn.y + " << y << ");\n" << "\t\t else\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y - " << y << ");\n" + << "\t\t vOut.y = " << weight << " * (vIn.y - " << y << ");\n" << "\n" << "\t\t if (vIn.z >= 0)\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * (vIn.z + " << z << ");\n" + << "\t\t vOut.z = " << weight << " * (vIn.z + " << z << ");\n" << "\t\t else\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * (vIn.z - " << z << ");\n" + << "\t\t vOut.z = " << weight << " * (vIn.z - " << z << ");\n" << "\t\t}\n" << "\t}\n"; return ss.str(); @@ -4769,6 +4815,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string r1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string d1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string r2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; @@ -4788,13 +4835,13 @@ public: << "\t\t r *= " << r2 << " / " << r1 << ";\n" << "\t\t temp = atan2(vIn.y, c1mx);\n" << "\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (r * cos(temp) - " << c2 << ");\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * r * sin(temp);\n" + << "\t\t vOut.x = " << weight << " * (r * cos(temp) - " << c2 << ");\n" + << "\t\t vOut.y = " << weight << " * r * sin(temp);\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t }\n" << "\t\t}\n" << "\t\telse\n" @@ -4807,13 +4854,13 @@ public: << "\t\t r *= " << r1 << " / " << r2 << ";\n" << "\t\t temp = atan2(vIn.y, c1mx);\n" << "\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (r * cos(temp) + " << c1 << ");\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * r * sin(temp);\n" + << "\t\t vOut.x = " << weight << " * (r * cos(temp) + " << c1 << ");\n" + << "\t\t vOut.y = " << weight << " * r * sin(temp);\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t }\n" << "\t\t}\n" << "\n" @@ -4881,9 +4928,10 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string re = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string im = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string re = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string im = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string reInv = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string im100 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" @@ -4892,8 +4940,8 @@ public: << "\t\treal_t temp = arg * " << reInv << " + lnmod * " << im100 << ";\n" << "\t\treal_t mod2 = exp(lnmod * " << reInv << " - arg * " << im100 << ");\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * mod2 * cos(temp);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * mod2 * sin(temp);\n" + << "\t\tvOut.x = " << weight << " * mod2 * cos(temp);\n" + << "\t\tvOut.y = " << weight << " * mod2 * sin(temp);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -4910,8 +4958,8 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Re, prefix + "Juliac_re", 2)); - m_Params.push_back(ParamWithName(&m_Im, prefix + "Juliac_im", 1)); + m_Params.push_back(ParamWithName(&m_Re, prefix + "Juliac_re", 2)); + m_Params.push_back(ParamWithName(&m_Im, prefix + "Juliac_im", 1)); m_Params.push_back(ParamWithName(&m_Dist, prefix + "Juliac_dist", 1)); m_Params.push_back(ParamWithName(true, &m_ReInv, prefix + "Juliac_re_inv")); m_Params.push_back(ParamWithName(true, &m_Im100, prefix + "Juliac_im100")); @@ -4950,14 +4998,15 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" - << "\t\treal_t r = MwcNext01(mwc) * xform->m_VariationWeights[" << varIndex << "] * precalcSqrtSumSquares;\n" + << "\t\treal_t r = MwcNext01(mwc) * " << weight << " * precalcSqrtSumSquares;\n" << "\t\treal_t sinr = sin(r);\n" << "\t\treal_t cosr = cos(r);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x * (cosr + sinr);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.x * (cosr - sinr);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z * (sinr - cosr);\n" + << "\t\tvOut.x = " << weight << " * vIn.x * (cosr + sinr);\n" + << "\t\tvOut.y = " << weight << " * vIn.x * (cosr - sinr);\n" + << "\t\tvOut.z = " << weight << " * vIn.z * (sinr - cosr);\n" << "\t}\n"; return ss.str(); } @@ -4991,16 +5040,17 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string blobLow = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string blobHigh = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string blobLow = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string blobHigh = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string blobWaves = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string blobDiff = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string blobDiff = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t r = precalcSqrtSumSquares * (" << blobLow << " + " << blobDiff << " * ((real_t)(0.5) + (real_t)(0.5) * sin(" << blobWaves << " * precalcAtanxy)));\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (precalcSina * r);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (precalcCosa * r);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * (sin(" << blobWaves << " * precalcAtanxy) * r);\n" + << "\t\tvOut.x = " << weight << " * (precalcSina * r);\n" + << "\t\tvOut.y = " << weight << " * (precalcCosa * r);\n" + << "\t\tvOut.z = " << weight << " * (sin(" << blobWaves << " * precalcAtanxy) * r);\n" << "\t}\n"; return ss.str(); } @@ -5012,8 +5062,8 @@ public: virtual void Random(QTIsaac& rand) override { - m_BlobLow = T(0.2) + T(0.5) * rand.Frand01(); - m_BlobHigh = T(0.8) + T(0.4) * rand.Frand01(); + m_BlobLow = T(0.2) + T(0.5) * rand.Frand01(); + m_BlobHigh = T(0.8) + T(0.4) * rand.Frand01(); m_BlobWaves = T(int(2 + 5 * rand.Frand01())); } @@ -5022,8 +5072,8 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_BlobLow, prefix + "blob3D_low")); - m_Params.push_back(ParamWithName(&m_BlobHigh, prefix + "blob3D_high", 1)); + m_Params.push_back(ParamWithName(&m_BlobLow, prefix + "blob3D_low")); + m_Params.push_back(ParamWithName(&m_BlobHigh, prefix + "blob3D_high", 1)); m_Params.push_back(ParamWithName(&m_BlobWaves, prefix + "blob3D_waves", 1)); m_Params.push_back(ParamWithName(true, &m_BlobDiff, prefix + "blob3D_diff"));//Precalc. } @@ -5073,15 +5123,16 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string mp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string v = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string v = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string vx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string vy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t t = Zeps((cos(vIn.x) + cos(vIn.y)) / " << mp << " + 1);\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / t;\n" + << "\t\treal_t r = " << weight << " / t;\n" << "\t\treal_t tmp = precalcSumSquares + 1;\n" << "\t\treal_t x2 = 2 * vIn.x;\n" << "\t\treal_t y2 = 2 * vIn.y;\n" @@ -5118,10 +5169,10 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_X, prefix + "blocky_x", 1)); - m_Params.push_back(ParamWithName(&m_Y, prefix + "blocky_y", 1)); + m_Params.push_back(ParamWithName(&m_X, prefix + "blocky_x", 1)); + m_Params.push_back(ParamWithName(&m_Y, prefix + "blocky_y", 1)); m_Params.push_back(ParamWithName(&m_Mp, prefix + "blocky_mp", 4, eParamType::REAL_NONZERO)); - m_Params.push_back(ParamWithName(true, &m_V, prefix + "blocky_v"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_V, prefix + "blocky_v"));//Precalc. m_Params.push_back(ParamWithName(true, &m_Vx, prefix + "blocky_vx")); m_Params.push_back(ParamWithName(true, &m_Vy, prefix + "blocky_vy")); } @@ -5212,10 +5263,11 @@ MAKEPREPOSTPARVAR(Blocky, blocky, BLOCKY) // { // ostringstream ss; // intmax_t varIndex = IndexInXform(); +// string weight = WeightDefineString(); // // ss << "\t{\n" -// << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" -// << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" +// << "\t\tvOut.x = " << weight << " * vIn.x;\n" +// << "\t\tvOut.z = " << weight << " * vIn.z;\n" // << "\t}\n"; // // return ss.str(); @@ -5243,10 +5295,11 @@ MAKEPREPOSTPARVAR(Blocky, blocky, BLOCKY) // { // ostringstream ss; // intmax_t varIndex = IndexInXform(); +// string weight = WeightDefineString(); // // ss << "\t{\n" -// << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" -// << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" +// << "\t\tvOut.y = " << weight << " * vIn.y;\n" +// << "\t\tvOut.z = " << weight << " * vIn.z;\n" // << "\t}\n"; // // return ss.str(); diff --git a/Source/Ember/Variations05.h b/Source/Ember/Variations05.h index 3c89495..94d33b5 100644 --- a/Source/Ember/Variations05.h +++ b/Source/Ember/Variations05.h @@ -39,20 +39,21 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string z = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t t = (real_t)(0.25) * (precalcSumSquares + SQR(vIn.z)) + 1;\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / t;\n" + << "\t\treal_t r = " << weight << " / t;\n" << "\n" << "\t\tvOut.x = vIn.x * r * " << x << ";\n" << "\t\tvOut.y = vIn.y * r * " << y << ";\n" << "\n" << "\t\tif (vIn.z >= 0)\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * (vIn.z + " << z << ");\n" + << "\t\t vOut.z = " << weight << " * (vIn.z + " << z << ");\n" << "\t\telse\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * (vIn.z - " << z << ");\n" + << "\t\t vOut.z = " << weight << " * (vIn.z - " << z << ");\n" << "\n" << "\t\tvOut.z += vIn.z * r * " << z << ";\n" << "\t}\n"; @@ -142,14 +143,15 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string sc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string k = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string dens1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string dens2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string sc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string k = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string dens1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string dens2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string reverse = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string seed = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string seed = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tint m = (int)floor((real_t)(0.5) * vIn.x / " << sc << ");\n" << "\t\tint n = (int)floor((real_t)(0.5) * vIn.y / " << sc << ");\n" @@ -193,8 +195,8 @@ public: << "\t\t }\n" << "\t\t}\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (x + (m * 2 + 1) * " << sc << ");\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (y + (n * 2 + 1) * " << sc << ");\n" + << "\t\tvOut.x = " << weight << " * (x + (m * 2 + 1) * " << sc << ");\n" + << "\t\tvOut.y = " << weight << " * (y + (n * 2 + 1) * " << sc << ");\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -225,14 +227,14 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Sc, prefix + "CircleLinear_Sc", 1, eParamType::REAL_NONZERO)); - m_Params.push_back(ParamWithName(&m_K, prefix + "CircleLinear_K", T(0.5))); - m_Params.push_back(ParamWithName(&m_Dens1, prefix + "CircleLinear_Dens1", T(0.5))); - m_Params.push_back(ParamWithName(&m_Dens2, prefix + "CircleLinear_Dens2", T(0.5))); + m_Params.push_back(ParamWithName(&m_Sc, prefix + "CircleLinear_Sc", 1, eParamType::REAL_NONZERO)); + m_Params.push_back(ParamWithName(&m_K, prefix + "CircleLinear_K", T(0.5))); + m_Params.push_back(ParamWithName(&m_Dens1, prefix + "CircleLinear_Dens1", T(0.5))); + m_Params.push_back(ParamWithName(&m_Dens2, prefix + "CircleLinear_Dens2", T(0.5))); m_Params.push_back(ParamWithName(&m_Reverse, prefix + "CircleLinear_Reverse", 1)); - m_Params.push_back(ParamWithName(&m_X, prefix + "CircleLinear_X", 10)); - m_Params.push_back(ParamWithName(&m_Y, prefix + "CircleLinear_Y", 10)); - m_Params.push_back(ParamWithName(&m_Seed, prefix + "CircleLinear_Seed", 0, eParamType::INTEGER)); + m_Params.push_back(ParamWithName(&m_X, prefix + "CircleLinear_X", 10)); + m_Params.push_back(ParamWithName(&m_Y, prefix + "CircleLinear_Y", 10)); + m_Params.push_back(ParamWithName(&m_Seed, prefix + "CircleLinear_Seed", 0, eParamType::INTEGER)); } private: @@ -301,10 +303,11 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string sc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string sc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string dens = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string seed = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tint m, n, iters = 0;\n" @@ -325,8 +328,8 @@ public: << "\t\t}\n" << "\t\twhile ((CircleRandDiscreteNoise2((int)(m + " << seed << "), n) > " << dens << ") || (u > ((real_t)(0.3) + (real_t)(0.7) * CircleRandDiscreteNoise2(m + 10, n + 3)) * " << sc << "));\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (x + (m * 2 + 1) * " << sc << ");\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (y + (n * 2 + 1) * " << sc << ");\n" + << "\t\tvOut.x = " << weight << " * (x + (m * 2 + 1) * " << sc << ");\n" + << "\t\tvOut.y = " << weight << " * (y + (n * 2 + 1) * " << sc << ");\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -357,10 +360,10 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Sc, prefix + "CircleRand_Sc", 1, eParamType::REAL_NONZERO)); + m_Params.push_back(ParamWithName(&m_Sc, prefix + "CircleRand_Sc", 1, eParamType::REAL_NONZERO)); m_Params.push_back(ParamWithName(&m_Dens, prefix + "CircleRand_Dens", T(0.5))); - m_Params.push_back(ParamWithName(&m_X, prefix + "CircleRand_X", 10)); - m_Params.push_back(ParamWithName(&m_Y, prefix + "CircleRand_Y", 10)); + m_Params.push_back(ParamWithName(&m_X, prefix + "CircleRand_X", 10)); + m_Params.push_back(ParamWithName(&m_Y, prefix + "CircleRand_Y", 10)); m_Params.push_back(ParamWithName(&m_Seed, prefix + "CircleRand_Seed", 0, eParamType::INTEGER)); } @@ -427,10 +430,11 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string sc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string sc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string dens = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string seed = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t ux, uy, u, x, y;\n" @@ -454,8 +458,8 @@ public: << "\t\t CircleTrans1CircleR(" << x << ", " << y << ", " << sc << ", " << seed << ", " << dens << ", &ux, &uy, mwc);\n" << "\t\t}\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * ux;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * uy;\n" + << "\t\tvOut.x = " << weight << " * ux;\n" + << "\t\tvOut.y = " << weight << " * uy;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -522,10 +526,10 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Sc, prefix + "CircleTrans1_Sc", 1, eParamType::REAL_NONZERO)); + m_Params.push_back(ParamWithName(&m_Sc, prefix + "CircleTrans1_Sc", 1, eParamType::REAL_NONZERO)); m_Params.push_back(ParamWithName(&m_Dens, prefix + "CircleTrans1_Dens", T(0.5))); - m_Params.push_back(ParamWithName(&m_X, prefix + "CircleTrans1_X", 10)); - m_Params.push_back(ParamWithName(&m_Y, prefix + "CircleTrans1_Y", 10)); + m_Params.push_back(ParamWithName(&m_X, prefix + "CircleTrans1_X", 10)); + m_Params.push_back(ParamWithName(&m_Y, prefix + "CircleTrans1_Y", 10)); m_Params.push_back(ParamWithName(&m_Seed, prefix + "CircleTrans1_Seed", 0, eParamType::INTEGER)); } @@ -620,53 +624,53 @@ public: switch (useNode) { - case 0 : + case 0: helper.Out.x = ((px - (m_Smooth * (1 - m_Fill) * px * exnze)) + (helper.In.x * m_Smooth * m_Fill * exnze)) + lattd; helper.Out.y = ((py - (m_Smooth * (1 - m_Fill) * py * wynze)) + (helper.In.y * m_Smooth * m_Fill * wynze)) + lattd; - helper.Out.z = ((pz - (m_Smooth * (1 - m_Fill) * pz * znxy)) + (helper.In.z * m_Smooth * m_Fill * znxy)) + lattd; + helper.Out.z = ((pz - (m_Smooth * (1 - m_Fill) * pz * znxy)) + (helper.In.z * m_Smooth * m_Fill * znxy)) + lattd; break; - case 1 : + case 1: helper.Out.x = ((px - (m_Smooth * (1 - m_Fill) * px * exnze)) + (helper.In.x * m_Smooth * m_Fill * exnze)) + lattd; helper.Out.y = ((py - (m_Smooth * (1 - m_Fill) * py * wynze)) + (helper.In.y * m_Smooth * m_Fill * wynze)) - lattd; - helper.Out.z = ((pz - (m_Smooth * (1 - m_Fill) * pz * znxy)) + (helper.In.z * m_Smooth * m_Fill * znxy)) + lattd; + helper.Out.z = ((pz - (m_Smooth * (1 - m_Fill) * pz * znxy)) + (helper.In.z * m_Smooth * m_Fill * znxy)) + lattd; break; - case 2 : + case 2: helper.Out.x = ((px - (m_Smooth * (1 - m_Fill) * px * exnze)) + (helper.In.x * m_Smooth * m_Fill * exnze)) + lattd; helper.Out.y = ((py - (m_Smooth * (1 - m_Fill) * py * wynze)) + (helper.In.y * m_Smooth * m_Fill * wynze)) + lattd; - helper.Out.z = ((pz - (m_Smooth * (1 - m_Fill) * pz * znxy)) + (helper.In.z * m_Smooth * m_Fill * znxy)) - lattd; + helper.Out.z = ((pz - (m_Smooth * (1 - m_Fill) * pz * znxy)) + (helper.In.z * m_Smooth * m_Fill * znxy)) - lattd; break; - case 3 : + case 3: helper.Out.x = ((px - (m_Smooth * (1 - m_Fill) * px * exnze)) + (helper.In.x * m_Smooth * m_Fill * exnze)) + lattd; helper.Out.y = ((py - (m_Smooth * (1 - m_Fill) * py * wynze)) + (helper.In.y * m_Smooth * m_Fill * wynze)) - lattd; - helper.Out.z = ((pz - (m_Smooth * (1 - m_Fill) * pz * znxy)) + (helper.In.z * m_Smooth * m_Fill * znxy)) - lattd; + helper.Out.z = ((pz - (m_Smooth * (1 - m_Fill) * pz * znxy)) + (helper.In.z * m_Smooth * m_Fill * znxy)) - lattd; break; - case 4 : + case 4: helper.Out.x = ((px - (m_Smooth * (1 - m_Fill) * px * exnze)) + (helper.In.x * m_Smooth * m_Fill * exnze)) - lattd; helper.Out.y = ((py - (m_Smooth * (1 - m_Fill) * py * wynze)) + (helper.In.y * m_Smooth * m_Fill * wynze)) + lattd; - helper.Out.z = ((pz - (m_Smooth * (1 - m_Fill) * pz * znxy)) + (helper.In.z * m_Smooth * m_Fill * znxy)) + lattd; + helper.Out.z = ((pz - (m_Smooth * (1 - m_Fill) * pz * znxy)) + (helper.In.z * m_Smooth * m_Fill * znxy)) + lattd; break; - case 5 : + case 5: helper.Out.x = ((px - (m_Smooth * (1 - m_Fill) * px * exnze)) + (helper.In.x * m_Smooth * m_Fill * exnze)) - lattd; helper.Out.y = ((py - (m_Smooth * (1 - m_Fill) * py * wynze)) + (helper.In.y * m_Smooth * m_Fill * wynze)) - lattd; - helper.Out.z = ((pz - (m_Smooth * (1 - m_Fill) * pz * znxy)) + (helper.In.z * m_Smooth * m_Fill * znxy)) + lattd; + helper.Out.z = ((pz - (m_Smooth * (1 - m_Fill) * pz * znxy)) + (helper.In.z * m_Smooth * m_Fill * znxy)) + lattd; break; - case 6 : + case 6: helper.Out.x = ((px - (m_Smooth * (1 - m_Fill) * px * exnze)) + (helper.In.x * m_Smooth * m_Fill * exnze)) - lattd; helper.Out.y = ((py - (m_Smooth * (1 - m_Fill) * py * wynze)) + (helper.In.y * m_Smooth * m_Fill * wynze)) + lattd; - helper.Out.z = ((pz - (m_Smooth * (1 - m_Fill) * pz * znxy)) + (helper.In.z * m_Smooth * m_Fill * znxy)) - lattd; + helper.Out.z = ((pz - (m_Smooth * (1 - m_Fill) * pz * znxy)) + (helper.In.z * m_Smooth * m_Fill * znxy)) - lattd; break; - case 7 : + case 7: default: helper.Out.x = ((px - (m_Smooth * (1 - m_Fill) * px * exnze)) + (helper.In.x * m_Smooth * m_Fill * exnze)) - lattd; helper.Out.y = ((py - (m_Smooth * (1 - m_Fill) * py * wynze)) + (helper.In.y * m_Smooth * m_Fill * wynze)) - lattd; - helper.Out.z = ((pz - (m_Smooth * (1 - m_Fill) * pz * znxy)) + (helper.In.z * m_Smooth * m_Fill * znxy)) - lattd; + helper.Out.z = ((pz - (m_Smooth * (1 - m_Fill) * pz * znxy)) + (helper.In.z * m_Smooth * m_Fill * znxy)) - lattd; break; } } @@ -677,15 +681,16 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string xpand = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string style = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string fill = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string smooth = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string smoothStyle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string xpand = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string style = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string fill = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string smooth = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string smoothStyle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tint useNode = MwcNext(mwc) & 7;\n" << "\t\treal_t exnze, wynze, znxy;\n" - << "\t\treal_t lattd = xform->m_VariationWeights[" << varIndex << "] * (real_t)(0.5);\n" + << "\t\treal_t lattd = " << weight << " * (real_t)(0.5);\n" << "\t\treal_t px, py, pz;\n" << "\n" << "\t\texnze = 1 - (" << smoothStyle << " * (1 - (cos(atan2(vIn.x, vIn.z)))));\n" @@ -791,8 +796,8 @@ protected: m_Params.clear(); m_Params.push_back(ParamWithName(&m_Xpand, prefix + "cubic3D_xpand", T(0.25))); m_Params.push_back(ParamWithName(&m_Style, prefix + "cubic3D_style")); - m_Params.push_back(ParamWithName(true, &m_Fill, prefix + "cubic3D_fill"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_Smooth, prefix + "cubic3D_smooth")); + m_Params.push_back(ParamWithName(true, &m_Fill, prefix + "cubic3D_fill"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_Smooth, prefix + "cubic3D_smooth")); m_Params.push_back(ParamWithName(true, &m_SmoothStyle, prefix + "cubic3D_smooth_style")); } @@ -855,53 +860,53 @@ public: switch (useNode) { - case 0 : + case 0: helper.Out.x = pxtx * m_Fill * exnze + lattd; helper.Out.y = pyty * m_Fill * wynze + lattd; - helper.Out.z = pztz * m_Fill * znxy + lattd; + helper.Out.z = pztz * m_Fill * znxy + lattd; break; - case 1 : + case 1: helper.Out.x = pxtx * m_Fill * exnze + lattd; helper.Out.y = pyty * m_Fill * wynze - lattd; - helper.Out.z = pztz * m_Fill * znxy + lattd; + helper.Out.z = pztz * m_Fill * znxy + lattd; break; - case 2 : + case 2: helper.Out.x = pxtx * m_Fill * exnze + lattd; helper.Out.y = pyty * m_Fill * wynze + lattd; - helper.Out.z = pztz * m_Fill * znxy - lattd; + helper.Out.z = pztz * m_Fill * znxy - lattd; break; - case 3 : + case 3: helper.Out.x = pxtx * m_Fill * exnze + lattd; helper.Out.y = pyty * m_Fill * wynze - lattd; - helper.Out.z = pztz * m_Fill * znxy - lattd; + helper.Out.z = pztz * m_Fill * znxy - lattd; break; - case 4 : + case 4: helper.Out.x = pxtx * m_Fill * exnze - lattd; helper.Out.y = pyty * m_Fill * wynze + lattd; - helper.Out.z = pztz * m_Fill * znxy + lattd; + helper.Out.z = pztz * m_Fill * znxy + lattd; break; - case 5 : + case 5: helper.Out.x = pxtx * m_Fill * exnze - lattd; helper.Out.y = pyty * m_Fill * wynze - lattd; - helper.Out.z = pztz * m_Fill * znxy + lattd; + helper.Out.z = pztz * m_Fill * znxy + lattd; break; - case 6 : + case 6: helper.Out.x = pxtx * m_Fill * exnze - lattd; helper.Out.y = pyty * m_Fill * wynze + lattd; - helper.Out.z = pztz * m_Fill * znxy - lattd; + helper.Out.z = pztz * m_Fill * znxy - lattd; break; - case 7 : + case 7: default: helper.Out.x = pxtx * m_Fill * exnze - lattd; helper.Out.y = pyty * m_Fill * wynze - lattd; - helper.Out.z = pztz * m_Fill * znxy - lattd; + helper.Out.z = pztz * m_Fill * znxy - lattd; break; } } @@ -912,12 +917,13 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string xpand = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string style = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string fill = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string fill = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tint useNode = MwcNext(mwc) & 7;\n" - << "\t\treal_t exnze, wynze, znxy, px, py, pz, lattd = xform->m_VariationWeights[" << varIndex << "];\n" + << "\t\treal_t exnze, wynze, znxy, px, py, pz, lattd = " << weight << ";\n" << "\n" << "\t\tif (" << style << " == 2)\n" << "\t\t{\n" @@ -1048,11 +1054,12 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t expx = exp(vIn.x) * (real_t)(0.5);\n" << "\t\treal_t expnx = (real_t)(0.25) / expx;\n" << "\t\treal_t boot = vIn.z == 0 ? precalcAtanyx : vIn.z;\n" - << "\t\treal_t tmp = xform->m_VariationWeights[" << varIndex << "] / Zeps(expx + expnx - (cos(vIn.y) * cos(boot)));\n" + << "\t\treal_t tmp = " << weight << " / Zeps(expx + expnx - (cos(vIn.y) * cos(boot)));\n" << "\n" << "\t\tvOut.x = (expx - expnx) * tmp;\n" << "\t\tvOut.y = sin(vIn.y) * tmp;\n" @@ -1108,6 +1115,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string xpow = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string ypow = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string zpow = "parVars[" + ToUpper(m_Params[i++].Name()) + index; @@ -1125,11 +1133,11 @@ public: << "\t\treal_t sucv = su * cv;\n" << "\t\treal_t x = pow(fabs(cucv), " << xpow << ") + (cucv * " << xpow << ") + ((real_t)(0.25) * atOmegaX);\n" << "\t\treal_t y = pow(fabs(sucv), " << ypow << ") + (sucv * " << ypow << ") + ((real_t)(0.25) * atOmegaY);\n" - << "\t\treal_t z = pow(fabs(sv), " << zpow << ") + sv * " << zpow << ";\n" + << "\t\treal_t z = pow(fabs(sv), " << zpow << ") + sv * " << zpow << ";\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * x;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * y;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * z;\n" + << "\t\tvOut.x = " << weight << " * x;\n" + << "\t\tvOut.y = " << weight << " * y;\n" + << "\t\tvOut.z = " << weight << " * z;\n" << "\t}\n"; return ss.str(); } @@ -1184,19 +1192,20 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string divisor = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string invPower = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string absInvPower = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string divisor = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invPower = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string absInvPower = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string halfInvPower = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string invPower2pi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invPower2pi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t temp = precalcAtanyx * " << invPower << " + MwcNext(mwc) * " << invPower2pi << ";\n" << "\t\treal_t sina = sin(temp);\n" << "\t\treal_t cosa = cos(temp);\n" << "\t\treal_t z = vIn.z * " << absInvPower << ";\n" << "\t\treal_t r2d = precalcSumSquares;\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * pow(r2d + SQR(z), " << halfInvPower << ");\n" + << "\t\treal_t r = " << weight << " * pow(r2d + SQR(z), " << halfInvPower << ");\n" << "\t\treal_t rsss = r * precalcSqrtSumSquares;\n" << "\n" << "\t\tvOut.x = rsss * cosa;\n" @@ -1219,12 +1228,12 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Power, prefix + "julia3Dq_power", 3, eParamType::INTEGER_NONZERO)); + m_Params.push_back(ParamWithName(&m_Power, prefix + "julia3Dq_power", 3, eParamType::INTEGER_NONZERO)); m_Params.push_back(ParamWithName(&m_Divisor, prefix + "julia3Dq_divisor", 2, eParamType::INTEGER_NONZERO)); - m_Params.push_back(ParamWithName(true, &m_InvPower, prefix + "julia3Dq_inv_power"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_AbsInvPower, prefix + "julia3Dq_abs_inv_power")); + m_Params.push_back(ParamWithName(true, &m_InvPower, prefix + "julia3Dq_inv_power"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_AbsInvPower, prefix + "julia3Dq_abs_inv_power")); m_Params.push_back(ParamWithName(true, &m_HalfInvPower, prefix + "julia3Dq_half_inv_power")); - m_Params.push_back(ParamWithName(true, &m_InvPower2pi, prefix + "julia3Dq_inv_power_2pi")); + m_Params.push_back(ParamWithName(true, &m_InvPower2pi, prefix + "julia3Dq_inv_power_2pi")); } private: @@ -1264,13 +1273,14 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string delta = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string phi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ux = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string uy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string uz = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string phi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ux = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string uy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string uz = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\treal_t r = MwcNext01(mwc) * xform->m_VariationWeights[" << varIndex << "];\n" + << "\t\treal_t r = MwcNext01(mwc) * " << weight << ";\n" << "\n" << "\t\tvOut.x = " << ux << " * r;\n" << "\t\tvOut.y = " << uy << " * r;\n" @@ -1298,7 +1308,7 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Delta, prefix + "line_delta")); - m_Params.push_back(ParamWithName(&m_Phi, prefix + "line_phi")); + m_Params.push_back(ParamWithName(&m_Phi, prefix + "line_phi")); m_Params.push_back(ParamWithName(true, &m_Ux, prefix + "line_ux"));//Precalc. m_Params.push_back(ParamWithName(true, &m_Uy, prefix + "line_uy")); m_Params.push_back(ParamWithName(true, &m_Uz, prefix + "line_uz")); @@ -1374,17 +1384,18 @@ public: ostringstream ss, ss2; intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; - string index = ss2.str(); - string sides = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string star = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string index = ss2.str(); + string sides = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string star = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string circle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string w2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string sina = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cosa = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string sins = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string coss = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string sinc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cosc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string w2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string sina = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cosa = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string sins = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string coss = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string sinc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cosc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tint i;\n" << "\t\treal_t xrt = vIn.x, yrt = vIn.y, swp;\n" @@ -1409,22 +1420,22 @@ public: << "\n" << "\t\tif (r2 > 0 && (r2 < " << w2 << "))\n" << "\t\t{\n" - << "\t\t real_t r = xform->m_VariationWeights[" << varIndex << "] * sqrt(fabs(" << w2 << " / r2 - 1));\n" + << "\t\t real_t r = " << weight << " * sqrt(fabs(" << w2 << " / r2 - 1));\n" << "\n" << "\t\t vOut.x = r * vIn.x;\n" << "\t\t vOut.y = r * vIn.y;\n" << "\t\t}\n" << "\t\telse if (r2 < 0)\n" << "\t\t{\n" - << "\t\t real_t r = xform->m_VariationWeights[" << varIndex << "] / sqrt(fabs(" << w2 << " / r2) - 1);\n" + << "\t\t real_t r = " << weight << " / sqrt(fabs(" << w2 << " / r2) - 1);\n" << "\n" << "\t\t vOut.x = r * vIn.x;\n" << "\t\t vOut.y = r * vIn.y;\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t}\n" << "\n" << "\t\tvOut.z = " << DefaultZCl() @@ -1451,7 +1462,7 @@ protected: m_Params.push_back(ParamWithName(&m_Sides, prefix + "loonie2_sides", 4, eParamType::INTEGER, 1, 50)); m_Params.push_back(ParamWithName(&m_Star, prefix + "loonie2_star", 0, eParamType::REAL, -1, 1)); m_Params.push_back(ParamWithName(&m_Circle, prefix + "loonie2_circle", 0, eParamType::REAL, -1, 1)); - m_Params.push_back(ParamWithName(true, &m_W2, prefix + "loonie2_w2"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_W2, prefix + "loonie2_w2"));//Precalc. m_Params.push_back(ParamWithName(true, &m_Sina, prefix + "loonie2_sina")); m_Params.push_back(ParamWithName(true, &m_Cosa, prefix + "loonie2_cosa")); m_Params.push_back(ParamWithName(true, &m_Sins, prefix + "loonie2_sins")); @@ -1504,8 +1515,8 @@ public: } else { - helper.Out.x = m_Weight * helper.In.x; - helper.Out.y = m_Weight * helper.In.y; + helper.Out.x = m_Weight * helper.In.x; + helper.Out.y = m_Weight * helper.In.y; } helper.Out.z = DefaultZ(helper); @@ -1517,6 +1528,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string w2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t r2;\n" @@ -1528,15 +1540,15 @@ public: << "\n" << "\t\tif (r2 < " << w2 << ")\n" << "\t\t{\n" - << "\t\t real_t r = xform->m_VariationWeights[" << varIndex << "] * sqrt(" << w2 << " / r2 - 1);\n" + << "\t\t real_t r = " << weight << " * sqrt(" << w2 << " / r2 - 1);\n" << "\n" << "\t\t vOut.x = r * vIn.x;\n" << "\t\t vOut.y = r * vIn.y;\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t}\n" << "\n" << "\t\tvOut.z = " << DefaultZCl() @@ -1602,6 +1614,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string vv = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t kikr = precalcAtanyx;\n" @@ -1610,7 +1623,7 @@ public: << "\n" << "\t\tif (r2 < " << vv << ")\n" << "\t\t{\n" - << "\t\t real_t r = xform->m_VariationWeights[" << varIndex << "] * sqrt(" << vv << " / r2 - 1);\n" + << "\t\t real_t r = " << weight << " * sqrt(" << vv << " / r2 - 1);\n" << "\n" << "\t\t vOut.x = r * vIn.x;\n" << "\t\t vOut.y = r * vIn.y;\n" @@ -1618,9 +1631,9 @@ public: << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * efTez * (real_t)(0.5);\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" + << "\t\t vOut.z = " << weight << " * efTez * (real_t)(0.5);\n" << "\t\t}\n" << "\t}\n"; return ss.str(); @@ -1674,18 +1687,19 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string twist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string tilt = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string tilt = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t t = precalcSumSquares * (real_t)(0.25) + 1;\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / t;\n" + << "\t\treal_t r = " << weight << " / t;\n" << "\n" << "\t\tvOut.x = vIn.x * r * " << x << ";\n" << "\t\tvOut.y = vIn.y * r * " << y << ";\n" - << "\t\tvOut.x += (1 - (" << twist << " * SQR(vIn.x)) + vIn.y) * xform->m_VariationWeights[" << varIndex << "];\n" - << "\t\tvOut.y += " << tilt << " * vIn.x * xform->m_VariationWeights[" << varIndex << "];\n" + << "\t\tvOut.x += (1 - (" << twist << " * SQR(vIn.x)) + vIn.y) * " << weight << ";\n" + << "\t\tvOut.y += " << tilt << " * vIn.x * " << weight << ";\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -1696,10 +1710,10 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_X, prefix + "mcarpet_x")); - m_Params.push_back(ParamWithName(&m_Y, prefix + "mcarpet_y")); + m_Params.push_back(ParamWithName(&m_X, prefix + "mcarpet_x")); + m_Params.push_back(ParamWithName(&m_Y, prefix + "mcarpet_y")); m_Params.push_back(ParamWithName(&m_Twist, prefix + "mcarpet_twist")); - m_Params.push_back(ParamWithName(&m_Tilt, prefix + "mcarpet_tilt")); + m_Params.push_back(ParamWithName(&m_Tilt, prefix + "mcarpet_tilt")); } private: @@ -1740,14 +1754,15 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string freq = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string freq = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t avgxy = (vIn.x + vIn.y) * (real_t)(0.5);\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + " << scale << " * sin(vIn.y * " << freq << "));\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + " << scale << " * sin(vIn.x * " << freq << "));\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * (vIn.z + " << scale << " * sin(avgxy * " << freq << "));\n" + << "\t\tvOut.x = " << weight << " * (vIn.x + " << scale << " * sin(vIn.y * " << freq << "));\n" + << "\t\tvOut.y = " << weight << " * (vIn.y + " << scale << " * sin(vIn.x * " << freq << "));\n" + << "\t\tvOut.z = " << weight << " * (vIn.z + " << scale << " * sin(avgxy * " << freq << "));\n" << "\t}\n"; return ss.str(); } @@ -1757,7 +1772,7 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Freq, prefix + "waves2_3D_freq", 2)); + m_Params.push_back(ParamWithName(&m_Freq, prefix + "waves2_3D_freq", 2)); m_Params.push_back(ParamWithName(&m_Scale, prefix + "waves2_3D_scale", 1)); } @@ -1796,17 +1811,18 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string slices = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rotation = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string slices = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rotation = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string thickness = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tint sl = (int)(MwcNext01(mwc) * " << slices << " + (real_t)(0.5));\n" << "\t\treal_t a = " << rotation << " + M_2PI * (sl + MwcNext01(mwc) * " << thickness << ") / " << slices << ";\n" - << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * MwcNext01(mwc);\n" + << "\t\treal_t r = " << weight << " * MwcNext01(mwc);\n" << "\n" << "\t\tvOut.x = r * cos(a);\n" << "\t\tvOut.y = r * sin(a);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * sin(r);\n" + << "\t\tvOut.z = " << weight << " * sin(r);\n" << "\t}\n"; return ss.str(); } @@ -1823,8 +1839,8 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Slices, prefix + "pie3D_slices", 6, eParamType::INTEGER_NONZERO, 1)); - m_Params.push_back(ParamWithName(&m_Rotation, prefix + "pie3D_rotation", T(0.5), eParamType::REAL_CYCLIC, 0, M_2PI)); + m_Params.push_back(ParamWithName(&m_Slices, prefix + "pie3D_slices", 6, eParamType::INTEGER_NONZERO, 1)); + m_Params.push_back(ParamWithName(&m_Rotation, prefix + "pie3D_rotation", T(0.5), eParamType::REAL_CYCLIC, 0, M_2PI)); m_Params.push_back(ParamWithName(&m_Thickness, prefix + "pie3D_thickness", T(0.5), eParamType::REAL, 0, 1)); } @@ -1872,13 +1888,14 @@ public: int i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string z = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string z = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string stc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string hw = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string vv = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hw = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string vv = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t otherZ, tempPZ = 0;\n" << "\t\treal_t tempTZ = vIn.z == 0 ? " << vv << " * " << stc << " * precalcAtanyx : vIn.z;\n"; @@ -1919,7 +1936,7 @@ public: m_X = T(0.2) + rand.Frand01(); m_Y = T(0.2) * rand.Frand01(); m_Z = T(0.2) * rand.Frand01(); - m_C = 5 * rand.Frand01(); + m_C = 5 * rand.Frand01(); } protected: @@ -1931,9 +1948,9 @@ protected: m_Params.push_back(ParamWithName(&m_Y, prefix + "popcorn2_3D_y", T(0.1))); m_Params.push_back(ParamWithName(&m_Z, prefix + "popcorn2_3D_z", T(0.1))); m_Params.push_back(ParamWithName(&m_C, prefix + "popcorn2_3D_c", 3)); - m_Params.push_back(ParamWithName(true, &m_SinTanC, prefix + "popcorn2_3D_sintanc")); + m_Params.push_back(ParamWithName(true, &m_SinTanC, prefix + "popcorn2_3D_sintanc")); m_Params.push_back(ParamWithName(true, &m_HalfWeight, prefix + "popcorn2_3D_half_weight")); - m_Params.push_back(ParamWithName(true, &m_Vv, prefix + "popcorn2_3D_vv")); + m_Params.push_back(ParamWithName(true, &m_Vv, prefix + "popcorn2_3D_vv")); } private: @@ -1968,10 +1985,11 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sin(vIn.x);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * sin(vIn.y);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * (atan2(SQR(vIn.x), SQR(vIn.y)) * cos(vIn.z));\n" + << "\t\tvOut.x = " << weight << " * sin(vIn.x);\n" + << "\t\tvOut.y = " << weight << " * sin(vIn.y);\n" + << "\t\tvOut.z = " << weight << " * (atan2(SQR(vIn.x), SQR(vIn.y)) * cos(vIn.z));\n" << "\t}\n"; return ss.str(); } @@ -2007,6 +2025,7 @@ public: int i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string invWeight = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t t = precalcSumSquares + SQR(vIn.z);\n" @@ -2073,14 +2092,15 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string xdist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string xwidth = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ydist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ywidth = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string xw = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string yw = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string onemx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string onemy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string xdist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string xwidth = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ydist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ywidth = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string xw = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string yw = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string onemx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string onemy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tconst int xpos = vIn.x < 0;\n" << "\t\tconst int ypos = vIn.y < 0;\n" @@ -2089,7 +2109,7 @@ public: << "\n" << "\t\tvOut.x = " << xw << " * ((xrng - (int)xrng) * " << xwidth << " + (int)xrng + ((real_t)(0.5) - xpos) * " << onemx << ");\n" << "\t\tvOut.y = " << yw << " * ((yrng - (int)yrng) * " << ywidth << " + (int)yrng + ((real_t)(0.5) - ypos) * " << onemy << ");\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -2108,11 +2128,11 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_XDistance, prefix + "shredlin_xdistance", 1, eParamType::REAL_NONZERO)); - m_Params.push_back(ParamWithName(&m_XWidth, prefix + "shredlin_xwidth", T(0.5), eParamType::REAL, -1, 1)); + m_Params.push_back(ParamWithName(&m_XWidth, prefix + "shredlin_xwidth", T(0.5), eParamType::REAL, -1, 1)); m_Params.push_back(ParamWithName(&m_YDistance, prefix + "shredlin_ydistance", 1, eParamType::REAL_NONZERO)); - m_Params.push_back(ParamWithName(&m_YWidth, prefix + "shredlin_ywidth", T(0.5), eParamType::REAL, -1, 1)); - m_Params.push_back(ParamWithName(true, &m_Xw, prefix + "shredlin_xw")); - m_Params.push_back(ParamWithName(true, &m_Yw, prefix + "shredlin_yw")); + m_Params.push_back(ParamWithName(&m_YWidth, prefix + "shredlin_ywidth", T(0.5), eParamType::REAL, -1, 1)); + m_Params.push_back(ParamWithName(true, &m_Xw, prefix + "shredlin_xw")); + m_Params.push_back(ParamWithName(true, &m_Yw, prefix + "shredlin_yw")); m_Params.push_back(ParamWithName(true, &m_1mX, prefix + "shredlin_1mx")); m_Params.push_back(ParamWithName(true, &m_1mY, prefix + "shredlin_1my")); } @@ -2198,12 +2218,13 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string px = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string py = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\treal_t b = xform->m_VariationWeights[" << varIndex << "] / (precalcSumSquares * (real_t)(0.25) + 1);\n" + << "\t\treal_t b = " << weight << " / (precalcSumSquares * (real_t)(0.25) + 1);\n" << "\t\treal_t roundX = rint(vIn.x);\n" << "\t\treal_t roundY = rint(vIn.y);\n" << "\t\treal_t offsetX = vIn.x - roundX;\n" @@ -2214,8 +2235,8 @@ public: << "\n" << "\t\tif (MwcNext01(mwc) >= (real_t)(0.75))\n" << "\t\t{\n" - << "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX);\n" - << "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY);\n" + << "\t\t vOut.x += " << weight << " * (offsetX * (real_t)(0.5) + roundX);\n" + << "\t\t vOut.y += " << weight << " * (offsetY * (real_t)(0.5) + roundY);\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" @@ -2223,26 +2244,26 @@ public: << "\t\t {\n" << "\t\t if (offsetX >= 0)\n" << "\t\t {\n" - << "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX + " << x << ");\n" - << "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY + " << y << " * offsetY / Zeps(offsetX));\n" + << "\t\t vOut.x += " << weight << " * (offsetX * (real_t)(0.5) + roundX + " << x << ");\n" + << "\t\t vOut.y += " << weight << " * (offsetY * (real_t)(0.5) + roundY + " << y << " * offsetY / Zeps(offsetX));\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX - " << y << ");\n" - << "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY - " << y << " * offsetY / Zeps(offsetX));\n" + << "\t\t vOut.x += " << weight << " * (offsetX * (real_t)(0.5) + roundX - " << y << ");\n" + << "\t\t vOut.y += " << weight << " * (offsetY * (real_t)(0.5) + roundY - " << y << " * offsetY / Zeps(offsetX));\n" << "\t\t }\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" << "\t\t if (offsetY >= 0)\n" << "\t\t {\n" - << "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY + " << y << ");\n" - << "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX + offsetX / Zeps(offsetY) * " << y << ");\n" + << "\t\t vOut.y += " << weight << " * (offsetY * (real_t)(0.5) + roundY + " << y << ");\n" + << "\t\t vOut.x += " << weight << " * (offsetX * (real_t)(0.5) + roundX + offsetX / Zeps(offsetY) * " << y << ");\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY - " << y << ");\n" - << "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX - offsetX / Zeps(offsetY) * " << x << ");\n" + << "\t\t vOut.y += " << weight << " * (offsetY * (real_t)(0.5) + roundY - " << y << ");\n" + << "\t\t vOut.x += " << weight << " * (offsetX * (real_t)(0.5) + roundX - offsetX / Zeps(offsetY) * " << x << ");\n" << "\t\t }\n" << "\t\t }\n" << "\t\t}\n" @@ -2264,8 +2285,8 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_X, prefix + "SplitBrdr_x", T(0.25)));//Original used a prefix of splitb_, which is incompatible with Ember's design. - m_Params.push_back(ParamWithName(&m_Y, prefix + "SplitBrdr_y", T(0.25))); + m_Params.push_back(ParamWithName(&m_X, prefix + "SplitBrdr_x", T(0.25)));//Original used a prefix of splitb_, which is incompatible with Ember's design. + m_Params.push_back(ParamWithName(&m_Y, prefix + "SplitBrdr_y", T(0.25))); m_Params.push_back(ParamWithName(&m_Px, prefix + "SplitBrdr_px")); m_Params.push_back(ParamWithName(&m_Py, prefix + "SplitBrdr_py")); } @@ -2305,6 +2326,7 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t a = MPI / (precalcSqrtSumSquares + 1);\n" << "\t\treal_t r = precalcAtanyx * M1PI;\n" @@ -2312,8 +2334,8 @@ public: << "\t\tif (r > 0)\n" << "\t\t a = MPI - a;\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * r * cos(a);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * r * sin(a);\n" + << "\t\tvOut.x = " << weight << " * r * cos(a);\n" + << "\t\tvOut.y = " << weight << " * r * sin(a);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -2383,17 +2405,18 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string scatter = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string minDist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string mulX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string mulY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string mulZ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string x0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string z0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string invert = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string type = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string boxPow = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string scatter = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string minDist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string mulX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string mulY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string mulZ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string x0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string z0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invert = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string type = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string boxPow = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string internalScatter = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tconst real_t ax = MwcNext0505(mwc);\n" @@ -2409,9 +2432,9 @@ public: << "\t\tswitch ((int)" << type << ")\n" << "\t\t{\n" << "\t\t case 0:\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + " << mulX << " * ax * rs);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + " << mulY << " * ay * rs);\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * (vIn.z + " << mulZ << " * az * rs);\n" + << "\t\t vOut.x = " << weight << " * (vIn.x + " << mulX << " * ax * rs);\n" + << "\t\t vOut.y = " << weight << " * (vIn.y + " << mulY << " * ay * rs);\n" + << "\t\t vOut.z = " << weight << " * (vIn.z + " << mulZ << " * az * rs);\n" << "\t\t break;\n" << "\t\t case 1:\n" << "\t\t sigma = asin(r == 0 ? 0 : vIn.z / r) + " << mulZ << " * az * rs;\n" @@ -2423,16 +2446,16 @@ public: << "\t\t phis = sin(phi);\n" << "\t\t phic = cos(phi);\n" << "\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (rad * sigmac * phic);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (rad * sigmac * phis);\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * (rad * sigmas);\n" + << "\t\t vOut.x = " << weight << " * (rad * sigmac * phic);\n" + << "\t\t vOut.y = " << weight << " * (rad * sigmac * phis);\n" + << "\t\t vOut.z = " << weight << " * (rad * sigmas);\n" << "\t\t break;\n" << "\t\t case 2:\n" << "\t\t scale = clamp(rs, (real_t)(0.0), (real_t)(0.9)) + (real_t)(0.1);\n" << "\t\t denom = 1 / scale;\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * Lerp(vIn.x, floor(vIn.x * denom) + scale * ax, " << mulX << " * rs) + " << mulX << " * pow(ax, " << boxPow << ") * rs * denom;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * Lerp(vIn.y, floor(vIn.y * denom) + scale * ay, " << mulY << " * rs) + " << mulY << " * pow(ay, " << boxPow << ") * rs * denom;\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * Lerp(vIn.z, floor(vIn.z * denom) + scale * az, " << mulZ << " * rs) + " << mulZ << " * pow(az, " << boxPow << ") * rs * denom;\n" + << "\t\t vOut.x = " << weight << " * Lerp(vIn.x, floor(vIn.x * denom) + scale * ax, " << mulX << " * rs) + " << mulX << " * pow(ax, " << boxPow << ") * rs * denom;\n" + << "\t\t vOut.y = " << weight << " * Lerp(vIn.y, floor(vIn.y * denom) + scale * ay, " << mulY << " * rs) + " << mulY << " * pow(ay, " << boxPow << ") * rs * denom;\n" + << "\t\t vOut.z = " << weight << " * Lerp(vIn.z, floor(vIn.z * denom) + scale * az, " << mulZ << " * rs) + " << mulZ << " * pow(az, " << boxPow << ") * rs * denom;\n" << "\t\t break;\n" << "\t\t}\n" << "\t}\n"; @@ -2456,15 +2479,15 @@ protected: m_Params.clear(); m_Params.push_back(ParamWithName(&m_Scatter, prefix + "falloff_scatter", 1, eParamType::REAL, EPS, TMAX)); m_Params.push_back(ParamWithName(&m_MinDist, prefix + "falloff_mindist", T(0.5), eParamType::REAL, 0, TMAX)); - m_Params.push_back(ParamWithName(&m_MulX, prefix + "falloff_mul_x", 1, eParamType::REAL, 0, 1)); - m_Params.push_back(ParamWithName(&m_MulY, prefix + "falloff_mul_y", 1, eParamType::REAL, 0, 1)); - m_Params.push_back(ParamWithName(&m_MulZ, prefix + "falloff_mul_z", 0, eParamType::REAL, 0, 1)); - m_Params.push_back(ParamWithName(&m_X0, prefix + "falloff_x0")); - m_Params.push_back(ParamWithName(&m_Y0, prefix + "falloff_y0")); - m_Params.push_back(ParamWithName(&m_Z0, prefix + "falloff_z0")); - m_Params.push_back(ParamWithName(&m_Invert, prefix + "falloff_invert", 0, eParamType::INTEGER, 0, 1)); - m_Params.push_back(ParamWithName(&m_Type, prefix + "falloff_type", 0, eParamType::INTEGER, 0, 2)); - m_Params.push_back(ParamWithName(&m_BoxPow, prefix + "falloff_boxpow", 2, eParamType::INTEGER, 2, 32));//Original defaulted this to 0 which directly contradicts the specified range of 2-32. + m_Params.push_back(ParamWithName(&m_MulX, prefix + "falloff_mul_x", 1, eParamType::REAL, 0, 1)); + m_Params.push_back(ParamWithName(&m_MulY, prefix + "falloff_mul_y", 1, eParamType::REAL, 0, 1)); + m_Params.push_back(ParamWithName(&m_MulZ, prefix + "falloff_mul_z", 0, eParamType::REAL, 0, 1)); + m_Params.push_back(ParamWithName(&m_X0, prefix + "falloff_x0")); + m_Params.push_back(ParamWithName(&m_Y0, prefix + "falloff_y0")); + m_Params.push_back(ParamWithName(&m_Z0, prefix + "falloff_z0")); + m_Params.push_back(ParamWithName(&m_Invert, prefix + "falloff_invert", 0, eParamType::INTEGER, 0, 1)); + m_Params.push_back(ParamWithName(&m_Type, prefix + "falloff_type", 0, eParamType::INTEGER, 0, 2)); + m_Params.push_back(ParamWithName(&m_BoxPow, prefix + "falloff_boxpow", 2, eParamType::INTEGER, 2, 32));//Original defaulted this to 0 which directly contradicts the specified range of 2-32. m_Params.push_back(ParamWithName(true, &m_InternalScatter, prefix + "falloff_internal_scatter")); } @@ -2565,18 +2588,19 @@ public: int i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string scatter = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string minDist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string mulX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string mulY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string mulZ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string mulC = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string x0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string z0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string invert = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string type = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rMax = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string mulX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string mulY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string mulZ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string mulC = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string x0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string z0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invert = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string type = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rMax = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tconst real_t randx = MwcNext0505(mwc);\n" << "\t\tconst real_t randy = MwcNext0505(mwc);\n" @@ -2656,15 +2680,15 @@ protected: m_Params.clear(); m_Params.push_back(ParamWithName(&m_Scatter, prefix + "falloff2_scatter", 1, eParamType::REAL, EPS, TMAX)); m_Params.push_back(ParamWithName(&m_MinDist, prefix + "falloff2_mindist", T(0.5), eParamType::REAL, 0, TMAX)); - m_Params.push_back(ParamWithName(&m_MulX, prefix + "falloff2_mul_x", 1, eParamType::REAL, 0, 1)); - m_Params.push_back(ParamWithName(&m_MulY, prefix + "falloff2_mul_y", 1, eParamType::REAL, 0, 1)); - m_Params.push_back(ParamWithName(&m_MulZ, prefix + "falloff2_mul_z", 0, eParamType::REAL, 0, 1)); - m_Params.push_back(ParamWithName(&m_MulC, prefix + "falloff2_mul_c", 0, eParamType::REAL, 0, 1)); - m_Params.push_back(ParamWithName(&m_X0, prefix + "falloff2_x0")); - m_Params.push_back(ParamWithName(&m_Y0, prefix + "falloff2_y0")); - m_Params.push_back(ParamWithName(&m_Z0, prefix + "falloff2_z0")); - m_Params.push_back(ParamWithName(&m_Invert, prefix + "falloff2_invert", 0, eParamType::INTEGER, 0, 1)); - m_Params.push_back(ParamWithName(&m_Type, prefix + "falloff2_type", 0, eParamType::INTEGER, 0, 2)); + m_Params.push_back(ParamWithName(&m_MulX, prefix + "falloff2_mul_x", 1, eParamType::REAL, 0, 1)); + m_Params.push_back(ParamWithName(&m_MulY, prefix + "falloff2_mul_y", 1, eParamType::REAL, 0, 1)); + m_Params.push_back(ParamWithName(&m_MulZ, prefix + "falloff2_mul_z", 0, eParamType::REAL, 0, 1)); + m_Params.push_back(ParamWithName(&m_MulC, prefix + "falloff2_mul_c", 0, eParamType::REAL, 0, 1)); + m_Params.push_back(ParamWithName(&m_X0, prefix + "falloff2_x0")); + m_Params.push_back(ParamWithName(&m_Y0, prefix + "falloff2_y0")); + m_Params.push_back(ParamWithName(&m_Z0, prefix + "falloff2_z0")); + m_Params.push_back(ParamWithName(&m_Invert, prefix + "falloff2_invert", 0, eParamType::INTEGER, 0, 1)); + m_Params.push_back(ParamWithName(&m_Type, prefix + "falloff2_type", 0, eParamType::INTEGER, 0, 2)); m_Params.push_back(ParamWithName(true, &m_RMax, prefix + "falloff2_rmax")); } @@ -2778,20 +2802,21 @@ public: int i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string blurType = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string blurShape = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string blurType = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string blurShape = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string blurStrength = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string minDist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string invertDist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string mulX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string mulY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string mulZ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string mulC = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string centerX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string centerY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string centerZ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string alpha = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rMax = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string minDist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invertDist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string mulX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string mulY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string mulZ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string mulC = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string centerX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string centerY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string centerZ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string alpha = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rMax = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tconst real_t randx = MwcNext0505(mwc);\n" << "\t\tconst real_t randy = MwcNext0505(mwc);\n" @@ -2883,19 +2908,19 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_BlurType, prefix + "falloff3_blur_type", 0, eParamType::INTEGER, 0, 3)); - m_Params.push_back(ParamWithName(&m_BlurShape, prefix + "falloff3_blur_shape", 0, eParamType::INTEGER, 0, 1)); - m_Params.push_back(ParamWithName(&m_BlurStrength, prefix + "falloff3_blur_strength", 1, eParamType::REAL, EPS, TMAX)); - m_Params.push_back(ParamWithName(&m_MinDistance, prefix + "falloff3_min_distance", T(0.5), eParamType::REAL, 0, TMAX)); + m_Params.push_back(ParamWithName(&m_BlurType, prefix + "falloff3_blur_type", 0, eParamType::INTEGER, 0, 3)); + m_Params.push_back(ParamWithName(&m_BlurShape, prefix + "falloff3_blur_shape", 0, eParamType::INTEGER, 0, 1)); + m_Params.push_back(ParamWithName(&m_BlurStrength, prefix + "falloff3_blur_strength", 1, eParamType::REAL, EPS, TMAX)); + m_Params.push_back(ParamWithName(&m_MinDistance, prefix + "falloff3_min_distance", T(0.5), eParamType::REAL, 0, TMAX)); m_Params.push_back(ParamWithName(&m_InvertDistance, prefix + "falloff3_invert_distance", 0, eParamType::INTEGER, 0, 1)); - m_Params.push_back(ParamWithName(&m_MulX, prefix + "falloff3_mul_x", 1, eParamType::REAL, 0, 1)); - m_Params.push_back(ParamWithName(&m_MulY, prefix + "falloff3_mul_y", 1, eParamType::REAL, 0, 1)); - m_Params.push_back(ParamWithName(&m_MulZ, prefix + "falloff3_mul_z", 0, eParamType::REAL, 0, 1)); - m_Params.push_back(ParamWithName(&m_MulC, prefix + "falloff3_mul_c", 0, eParamType::REAL, 0, 1)); - m_Params.push_back(ParamWithName(&m_CenterX, prefix + "falloff3_center_x")); - m_Params.push_back(ParamWithName(&m_CenterY, prefix + "falloff3_center_y")); - m_Params.push_back(ParamWithName(&m_CenterZ, prefix + "falloff3_center_z")); - m_Params.push_back(ParamWithName(&m_Alpha, prefix + "falloff3_alpha")); + m_Params.push_back(ParamWithName(&m_MulX, prefix + "falloff3_mul_x", 1, eParamType::REAL, 0, 1)); + m_Params.push_back(ParamWithName(&m_MulY, prefix + "falloff3_mul_y", 1, eParamType::REAL, 0, 1)); + m_Params.push_back(ParamWithName(&m_MulZ, prefix + "falloff3_mul_z", 0, eParamType::REAL, 0, 1)); + m_Params.push_back(ParamWithName(&m_MulC, prefix + "falloff3_mul_c", 0, eParamType::REAL, 0, 1)); + m_Params.push_back(ParamWithName(&m_CenterX, prefix + "falloff3_center_x")); + m_Params.push_back(ParamWithName(&m_CenterY, prefix + "falloff3_center_y")); + m_Params.push_back(ParamWithName(&m_CenterZ, prefix + "falloff3_center_z")); + m_Params.push_back(ParamWithName(&m_Alpha, prefix + "falloff3_alpha")); m_Params.push_back(ParamWithName(true, &m_RMax, prefix + "falloff3_rmax")); } @@ -2953,11 +2978,11 @@ public: offsetGa = -offsetGa; Hex(offsetAl, offsetBe, offsetGa, alpha, beta, rand); alpha = m_S2a - alpha; - beta = m_S2b - beta; + beta = m_S2b - beta; } alpha += m * m_S2a; - beta += n * m_S2b; + beta += n * m_S2b; InverseTrilinear(alpha, beta, x, y, rand); helper.Out.x = m_Weight * x; helper.Out.y = m_Weight * y; @@ -2970,34 +2995,35 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string width = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string sinC = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cosC = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ha = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string hb = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string hc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ab = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ac = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ba = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string bc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ca = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cb = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string s2a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string s2b = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string s2c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string s2ab = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string s2ac = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string s2bc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string width = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string b = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string sinC = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cosC = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ha = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hb = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ab = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ac = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ba = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string bc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ca = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cb = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string s2a = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string s2b = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string s2c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string s2ab = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string s2ac = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string s2bc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string width1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string width2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string width3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string absN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string absN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cn = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tint m, n;\n" << "\t\treal_t alpha, beta, offsetAl, offsetBe, offsetGa, x, y;\n" @@ -3074,14 +3100,14 @@ public: << "\t\t real_t inx = (beta - " << radius << " + (alpha - " << radius << ") * " << cosC << ") / " << sinC << ";\n" << "\t\t real_t iny = alpha - " << radius << ";\n" << "\t\t real_t angle = (atan2(iny, inx) + M_2PI * MwcNextRange(mwc, (int)" << absN << ")) / " << power << ";\n" - << "\t\t real_t r = xform->m_VariationWeights[" << varIndex << "] * pow(SQR(inx) + SQR(iny), " << cn << ");\n" + << "\t\t real_t r = " << weight << " * pow(SQR(inx) + SQR(iny), " << cn << ");\n" << "\n" << "\t\t x = r * cos(angle);\n" << "\t\t y = r * sin(angle);\n" << "\t\t}\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * x;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * y;\n" + << "\t\tvOut.x = " << weight << " * x;\n" + << "\t\tvOut.y = " << weight << " * y;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -3268,34 +3294,34 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Power, prefix + "xtrb_power", 2, eParamType::INTEGER_NONZERO)); + m_Params.push_back(ParamWithName(&m_Power, prefix + "xtrb_power", 2, eParamType::INTEGER_NONZERO)); m_Params.push_back(ParamWithName(&m_Radius, prefix + "xtrb_radius", 1)); - m_Params.push_back(ParamWithName(&m_Width, prefix + "xtrb_width", T(0.5))); - m_Params.push_back(ParamWithName(&m_Dist, prefix + "xtrb_dist", 1)); - m_Params.push_back(ParamWithName(&m_A, prefix + "xtrb_a", 1)); - m_Params.push_back(ParamWithName(&m_B, prefix + "xtrb_b", 1)); - m_Params.push_back(ParamWithName(true, &m_SinC, prefix + "xtrb_sinc"));//Precalcs. - m_Params.push_back(ParamWithName(true, &m_CosC, prefix + "xtrb_cosc")); - m_Params.push_back(ParamWithName(true, &m_Ha, prefix + "xtrb_ha")); - m_Params.push_back(ParamWithName(true, &m_Hb, prefix + "xtrb_hb")); - m_Params.push_back(ParamWithName(true, &m_Hc, prefix + "xtrb_hc")); - m_Params.push_back(ParamWithName(true, &m_Ab, prefix + "xtrb_ab")); - m_Params.push_back(ParamWithName(true, &m_Ac, prefix + "xtrb_ac")); - m_Params.push_back(ParamWithName(true, &m_Ba, prefix + "xtrb_ba")); - m_Params.push_back(ParamWithName(true, &m_Bc, prefix + "xtrb_bc")); - m_Params.push_back(ParamWithName(true, &m_Ca, prefix + "xtrb_ca")); - m_Params.push_back(ParamWithName(true, &m_Cb, prefix + "xtrb_cb")); - m_Params.push_back(ParamWithName(true, &m_S2a, prefix + "xtrb_s2a")); - m_Params.push_back(ParamWithName(true, &m_S2b, prefix + "xtrb_s2b")); - m_Params.push_back(ParamWithName(true, &m_S2c, prefix + "xtrb_s2c")); - m_Params.push_back(ParamWithName(true, &m_S2ab, prefix + "xtrb_s2ab")); - m_Params.push_back(ParamWithName(true, &m_S2ac, prefix + "xtrb_s2ac")); - m_Params.push_back(ParamWithName(true, &m_S2bc, prefix + "xtrb_s2bc")); + m_Params.push_back(ParamWithName(&m_Width, prefix + "xtrb_width", T(0.5))); + m_Params.push_back(ParamWithName(&m_Dist, prefix + "xtrb_dist", 1)); + m_Params.push_back(ParamWithName(&m_A, prefix + "xtrb_a", 1)); + m_Params.push_back(ParamWithName(&m_B, prefix + "xtrb_b", 1)); + m_Params.push_back(ParamWithName(true, &m_SinC, prefix + "xtrb_sinc"));//Precalcs. + m_Params.push_back(ParamWithName(true, &m_CosC, prefix + "xtrb_cosc")); + m_Params.push_back(ParamWithName(true, &m_Ha, prefix + "xtrb_ha")); + m_Params.push_back(ParamWithName(true, &m_Hb, prefix + "xtrb_hb")); + m_Params.push_back(ParamWithName(true, &m_Hc, prefix + "xtrb_hc")); + m_Params.push_back(ParamWithName(true, &m_Ab, prefix + "xtrb_ab")); + m_Params.push_back(ParamWithName(true, &m_Ac, prefix + "xtrb_ac")); + m_Params.push_back(ParamWithName(true, &m_Ba, prefix + "xtrb_ba")); + m_Params.push_back(ParamWithName(true, &m_Bc, prefix + "xtrb_bc")); + m_Params.push_back(ParamWithName(true, &m_Ca, prefix + "xtrb_ca")); + m_Params.push_back(ParamWithName(true, &m_Cb, prefix + "xtrb_cb")); + m_Params.push_back(ParamWithName(true, &m_S2a, prefix + "xtrb_s2a")); + m_Params.push_back(ParamWithName(true, &m_S2b, prefix + "xtrb_s2b")); + m_Params.push_back(ParamWithName(true, &m_S2c, prefix + "xtrb_s2c")); + m_Params.push_back(ParamWithName(true, &m_S2ab, prefix + "xtrb_s2ab")); + m_Params.push_back(ParamWithName(true, &m_S2ac, prefix + "xtrb_s2ac")); + m_Params.push_back(ParamWithName(true, &m_S2bc, prefix + "xtrb_s2bc")); m_Params.push_back(ParamWithName(true, &m_Width1, prefix + "xtrb_width1")); m_Params.push_back(ParamWithName(true, &m_Width2, prefix + "xtrb_width2")); m_Params.push_back(ParamWithName(true, &m_Width3, prefix + "xtrb_width3")); - m_Params.push_back(ParamWithName(true, &m_AbsN, prefix + "xtrb_absn")); - m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "xtrb_cn")); + m_Params.push_back(ParamWithName(true, &m_AbsN, prefix + "xtrb_absn")); + m_Params.push_back(ParamWithName(true, &m_Cn, prefix + "xtrb_cn")); } private: @@ -3551,19 +3577,20 @@ public: ostringstream ss, ss2; intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber(); + string weight = WeightDefineString(); string index = ss2.str() + "]"; string stateIndex = ss2.str(); - string majp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string zlift = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string seg60xStartIndex = ToUpper(m_Params[i].Name()) + stateIndex; i += 6;//Precalc. - string seg60yStartIndex = ToUpper(m_Params[i].Name()) + stateIndex; i += 6; + string majp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string zlift = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string seg60xStartIndex = ToUpper(m_Params[i].Name()) + stateIndex; i += 6;//Precalc. + string seg60yStartIndex = ToUpper(m_Params[i].Name()) + stateIndex; i += 6; string seg120xStartIndex = ToUpper(m_Params[i].Name()) + stateIndex; i += 3; string seg120yStartIndex = ToUpper(m_Params[i].Name()) + stateIndex; i += 3; - string halfScale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rswtch = "varState->" + m_Params[i++].Name() + stateIndex;//State. - string fcycle = "varState->" + m_Params[i++].Name() + stateIndex; - string bcycle = "varState->" + m_Params[i++].Name() + stateIndex; + string halfScale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rswtch = "varState->" + m_Params[i++].Name() + stateIndex;//State. + string fcycle = "varState->" + m_Params[i++].Name() + stateIndex; + string bcycle = "varState->" + m_Params[i++].Name() + stateIndex; ss << "\t{\n" << "\t\tif (" << fcycle << " > 5)\n" << "\t\t{\n" @@ -3580,7 +3607,7 @@ public: << "\t\tint posNeg = 1;\n" << "\t\tint loc;\n" << "\t\treal_t tempx, tempy;\n" - << "\t\treal_t lrmaj = xform->m_VariationWeights[" << varIndex << "];\n" + << "\t\treal_t lrmaj = " << weight << ";\n" << "\t\treal_t boost = 1;\n" << "\t\treal_t sumX, sumY;\n\n"; @@ -3690,28 +3717,28 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.reserve(25); - m_Params.push_back(ParamWithName(&m_MajP, prefix + "hexaplay3D_majp", 1, eParamType::REAL)); + m_Params.push_back(ParamWithName(&m_MajP, prefix + "hexaplay3D_majp", 1, eParamType::REAL)); m_Params.push_back(ParamWithName(&m_Scale, prefix + "hexaplay3D_scale", T(0.25), eParamType::REAL)); m_Params.push_back(ParamWithName(&m_ZLift, prefix + "hexaplay3D_zlift", T(0.25), eParamType::REAL)); - m_Params.push_back(ParamWithName(true, &m_Seg60[0].x, prefix + "hexaplay3D_seg60x0"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_Seg60[1].x, prefix + "hexaplay3D_seg60x1")); - m_Params.push_back(ParamWithName(true, &m_Seg60[2].x, prefix + "hexaplay3D_seg60x2")); - m_Params.push_back(ParamWithName(true, &m_Seg60[3].x, prefix + "hexaplay3D_seg60x3")); - m_Params.push_back(ParamWithName(true, &m_Seg60[4].x, prefix + "hexaplay3D_seg60x4")); - m_Params.push_back(ParamWithName(true, &m_Seg60[5].x, prefix + "hexaplay3D_seg60x5")); - m_Params.push_back(ParamWithName(true, &m_Seg60[0].y, prefix + "hexaplay3D_seg60y0")); - m_Params.push_back(ParamWithName(true, &m_Seg60[1].y, prefix + "hexaplay3D_seg60y1")); - m_Params.push_back(ParamWithName(true, &m_Seg60[2].y, prefix + "hexaplay3D_seg60y2")); - m_Params.push_back(ParamWithName(true, &m_Seg60[3].y, prefix + "hexaplay3D_seg60y3")); - m_Params.push_back(ParamWithName(true, &m_Seg60[4].y, prefix + "hexaplay3D_seg60y4")); - m_Params.push_back(ParamWithName(true, &m_Seg60[5].y, prefix + "hexaplay3D_seg60y5")); + m_Params.push_back(ParamWithName(true, &m_Seg60[0].x, prefix + "hexaplay3D_seg60x0"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_Seg60[1].x, prefix + "hexaplay3D_seg60x1")); + m_Params.push_back(ParamWithName(true, &m_Seg60[2].x, prefix + "hexaplay3D_seg60x2")); + m_Params.push_back(ParamWithName(true, &m_Seg60[3].x, prefix + "hexaplay3D_seg60x3")); + m_Params.push_back(ParamWithName(true, &m_Seg60[4].x, prefix + "hexaplay3D_seg60x4")); + m_Params.push_back(ParamWithName(true, &m_Seg60[5].x, prefix + "hexaplay3D_seg60x5")); + m_Params.push_back(ParamWithName(true, &m_Seg60[0].y, prefix + "hexaplay3D_seg60y0")); + m_Params.push_back(ParamWithName(true, &m_Seg60[1].y, prefix + "hexaplay3D_seg60y1")); + m_Params.push_back(ParamWithName(true, &m_Seg60[2].y, prefix + "hexaplay3D_seg60y2")); + m_Params.push_back(ParamWithName(true, &m_Seg60[3].y, prefix + "hexaplay3D_seg60y3")); + m_Params.push_back(ParamWithName(true, &m_Seg60[4].y, prefix + "hexaplay3D_seg60y4")); + m_Params.push_back(ParamWithName(true, &m_Seg60[5].y, prefix + "hexaplay3D_seg60y5")); m_Params.push_back(ParamWithName(true, &m_Seg120[0].x, prefix + "hexaplay3D_seg120x0")); m_Params.push_back(ParamWithName(true, &m_Seg120[1].x, prefix + "hexaplay3D_seg120x1")); m_Params.push_back(ParamWithName(true, &m_Seg120[2].x, prefix + "hexaplay3D_seg120x2")); m_Params.push_back(ParamWithName(true, &m_Seg120[0].y, prefix + "hexaplay3D_seg120y0")); m_Params.push_back(ParamWithName(true, &m_Seg120[1].y, prefix + "hexaplay3D_seg120y1")); m_Params.push_back(ParamWithName(true, &m_Seg120[2].y, prefix + "hexaplay3D_seg120y2")); - m_Params.push_back(ParamWithName(true, &m_HalfScale, prefix + "hexaplay3D_halfscale")); + m_Params.push_back(ParamWithName(true, &m_HalfScale, prefix + "hexaplay3D_halfscale")); m_Params.push_back(ParamWithName(true, true, &m_RSwtch, prefix + "hexaplay3D_rswtch"));//State. m_Params.push_back(ParamWithName(true, true, &m_FCycle, prefix + "hexaplay3D_fcycle")); m_Params.push_back(ParamWithName(true, true, &m_BCycle, prefix + "hexaplay3D_bcycle")); @@ -3881,14 +3908,15 @@ public: ostringstream ss, ss2; intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber(); + string weight = WeightDefineString(); string index = ss2.str() + "]"; string stateIndex = ss2.str(); - string majp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string zlift = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string side3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string seg60xStartIndex = ToUpper(m_Params[i].Name()) + stateIndex; i += 6;//Precalc. - string seg60yStartIndex = ToUpper(m_Params[i].Name()) + stateIndex; i += 6; + string majp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string zlift = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string side3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string seg60xStartIndex = ToUpper(m_Params[i].Name()) + stateIndex; i += 6;//Precalc. + string seg60yStartIndex = ToUpper(m_Params[i].Name()) + stateIndex; i += 6; string seg120xStartIndex = ToUpper(m_Params[i].Name()) + stateIndex; i += 3; string seg120yStartIndex = ToUpper(m_Params[i].Name()) + stateIndex; i += 3; string rswtch = "varState->" + m_Params[i++].Name() + stateIndex;//State. @@ -3907,7 +3935,7 @@ public: << "\t\t " << rswtch << " = trunc(MwcNext01(mwc) * 3.0);\n" << "\t\t}\n" << "\n" - << "\t\treal_t lrmaj = xform->m_VariationWeights[" << varIndex << "];\n" + << "\t\treal_t lrmaj = " << weight << ";\n" << "\t\treal_t smooth = 1;\n" << "\t\treal_t smRotxFP = 0;\n" << "\t\treal_t smRotyFP = 0;\n" @@ -4078,22 +4106,22 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.reserve(25); - m_Params.push_back(ParamWithName(&m_MajP, prefix + "hexnix3D_majp", 1, eParamType::REAL)); + m_Params.push_back(ParamWithName(&m_MajP, prefix + "hexnix3D_majp", 1, eParamType::REAL)); m_Params.push_back(ParamWithName(&m_Scale, prefix + "hexnix3D_scale", T(0.25), eParamType::REAL)); m_Params.push_back(ParamWithName(&m_ZLift, prefix + "hexnix3D_zlift")); m_Params.push_back(ParamWithName(&m_3side, prefix + "hexnix3D_3side", T(0.667), eParamType::REAL)); - m_Params.push_back(ParamWithName(true, &m_Seg60[0].x, prefix + "hexnix3D_seg60x0"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_Seg60[1].x, prefix + "hexnix3D_seg60x1")); - m_Params.push_back(ParamWithName(true, &m_Seg60[2].x, prefix + "hexnix3D_seg60x2")); - m_Params.push_back(ParamWithName(true, &m_Seg60[3].x, prefix + "hexnix3D_seg60x3")); - m_Params.push_back(ParamWithName(true, &m_Seg60[4].x, prefix + "hexnix3D_seg60x4")); - m_Params.push_back(ParamWithName(true, &m_Seg60[5].x, prefix + "hexnix3D_seg60x5")); - m_Params.push_back(ParamWithName(true, &m_Seg60[0].y, prefix + "hexnix3D_seg60y0")); - m_Params.push_back(ParamWithName(true, &m_Seg60[1].y, prefix + "hexnix3D_seg60y1")); - m_Params.push_back(ParamWithName(true, &m_Seg60[2].y, prefix + "hexnix3D_seg60y2")); - m_Params.push_back(ParamWithName(true, &m_Seg60[3].y, prefix + "hexnix3D_seg60y3")); - m_Params.push_back(ParamWithName(true, &m_Seg60[4].y, prefix + "hexnix3D_seg60y4")); - m_Params.push_back(ParamWithName(true, &m_Seg60[5].y, prefix + "hexnix3D_seg60y5")); + m_Params.push_back(ParamWithName(true, &m_Seg60[0].x, prefix + "hexnix3D_seg60x0"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_Seg60[1].x, prefix + "hexnix3D_seg60x1")); + m_Params.push_back(ParamWithName(true, &m_Seg60[2].x, prefix + "hexnix3D_seg60x2")); + m_Params.push_back(ParamWithName(true, &m_Seg60[3].x, prefix + "hexnix3D_seg60x3")); + m_Params.push_back(ParamWithName(true, &m_Seg60[4].x, prefix + "hexnix3D_seg60x4")); + m_Params.push_back(ParamWithName(true, &m_Seg60[5].x, prefix + "hexnix3D_seg60x5")); + m_Params.push_back(ParamWithName(true, &m_Seg60[0].y, prefix + "hexnix3D_seg60y0")); + m_Params.push_back(ParamWithName(true, &m_Seg60[1].y, prefix + "hexnix3D_seg60y1")); + m_Params.push_back(ParamWithName(true, &m_Seg60[2].y, prefix + "hexnix3D_seg60y2")); + m_Params.push_back(ParamWithName(true, &m_Seg60[3].y, prefix + "hexnix3D_seg60y3")); + m_Params.push_back(ParamWithName(true, &m_Seg60[4].y, prefix + "hexnix3D_seg60y4")); + m_Params.push_back(ParamWithName(true, &m_Seg60[5].y, prefix + "hexnix3D_seg60y5")); m_Params.push_back(ParamWithName(true, &m_Seg120[0].x, prefix + "hexnix3D_seg120x0")); m_Params.push_back(ParamWithName(true, &m_Seg120[1].x, prefix + "hexnix3D_seg120x1")); m_Params.push_back(ParamWithName(true, &m_Seg120[2].x, prefix + "hexnix3D_seg120x2")); @@ -4168,10 +4196,11 @@ public: ostringstream ss, ss2; intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber(); + string weight = WeightDefineString(); string index = ss2.str() + "]"; string stateIndex = ss2.str(); - string scalex = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string scaley = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scalex = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scaley = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string centerx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string centery = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string dropoff = "parVars[" + ToUpper(m_Params[i++].Name()) + index; @@ -4202,20 +4231,20 @@ public: if (m_VarType == eVariationType::VARTYPE_REG) { ss - << "\t\tvOut.x = c != 0 ? outPoint->m_X + i.x * xform->m_VariationWeights[" << varIndex << "] : " << dropoff << ";\n" - << "\t\tvOut.y = c != 0 ? outPoint->m_Y + i.y * xform->m_VariationWeights[" << varIndex << "] : " << dropoff << ";\n" + << "\t\tvOut.x = c != 0 ? outPoint->m_X + i.x * " << weight << " : " << dropoff << ";\n" + << "\t\tvOut.y = c != 0 ? outPoint->m_Y + i.y * " << weight << " : " << dropoff << ";\n" << "\t\toutPoint->m_X = 0;\n" << "\t\toutPoint->m_Y = 0;\n"; } else { ss - << "\t\tvOut.x = c != 0 ? i.x * xform->m_VariationWeights[" << varIndex << "] : " << dropoff << ";\n" - << "\t\tvOut.y = c != 0 ? i.y * xform->m_VariationWeights[" << varIndex << "] : " << dropoff << ";\n"; + << "\t\tvOut.x = c != 0 ? i.x * " << weight << " : " << dropoff << ";\n" + << "\t\tvOut.y = c != 0 ? i.y * " << weight << " : " << dropoff << ";\n"; } ss - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -4247,8 +4276,8 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.reserve(17); - m_Params.push_back(ParamWithName(&m_ScaleX, prefix + "hexcrop_scale_x", 1)); - m_Params.push_back(ParamWithName(&m_ScaleY, prefix + "hexcrop_scale_y", 1)); + m_Params.push_back(ParamWithName(&m_ScaleX, prefix + "hexcrop_scale_x", 1)); + m_Params.push_back(ParamWithName(&m_ScaleY, prefix + "hexcrop_scale_y", 1)); m_Params.push_back(ParamWithName(&m_CenterX, prefix + "hexcrop_center_x")); m_Params.push_back(ParamWithName(&m_CenterY, prefix + "hexcrop_center_y")); m_Params.push_back(ParamWithName(&m_Dropoff, prefix + "hexcrop_dropoff", T(1E10))); diff --git a/Source/Ember/Variations06.h b/Source/Ember/Variations06.h index 67f3844..9146472 100644 --- a/Source/Ember/Variations06.h +++ b/Source/Ember/Variations06.h @@ -143,12 +143,13 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string cellsize = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rotate = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rotsin = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rotcos = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rotate = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rotsin = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rotcos = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tint i, j;\n" << "\t\treal_t di, dj;\n" @@ -237,8 +238,8 @@ public: << "\t\tVx += P[0].x;\n" << "\t\tVy += P[0].y;\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * Vx;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * Vy;\n" + << "\t\tvOut.x = " << weight << " * Vx;\n" + << "\t\tvOut.y = " << weight << " * Vy;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -276,9 +277,9 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Cellsize, prefix + "hexes_cellsize", 1)); - m_Params.push_back(ParamWithName(&m_Power, prefix + "hexes_power", 1)); - m_Params.push_back(ParamWithName(&m_Rotate, prefix + "hexes_rotate", T(0.166))); - m_Params.push_back(ParamWithName(&m_Scale, prefix + "hexes_scale", 1)); + m_Params.push_back(ParamWithName(&m_Power, prefix + "hexes_power", 1)); + m_Params.push_back(ParamWithName(&m_Rotate, prefix + "hexes_rotate", T(0.166))); + m_Params.push_back(ParamWithName(&m_Scale, prefix + "hexes_scale", 1)); m_Params.push_back(ParamWithName(true, &m_RotSin, prefix + "hexes_rotsin"));//Precalc. m_Params.push_back(ParamWithName(true, &m_RotCos, prefix + "hexes_rotcos")); } @@ -381,31 +382,32 @@ public: intmax_t i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string numEdges = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string numStripes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ratioStripes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ratioHole = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string circumCircle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string adjustToLinear = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string equalBlur = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string exactCalc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string highlightEdges = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string numEdges = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string numStripes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ratioStripes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ratioHole = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string circumCircle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string adjustToLinear = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string equalBlur = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string exactCalc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string highlightEdges = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string ratioComplement = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. - string midAngle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string angStart = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string angStripes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string hasStripes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string negStripes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string maxStripes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string absStripes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string sina = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cosa = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string tan90M2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string arcTan1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string arcTan2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string speedCalc1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string speedCalc2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string adjustedWeight = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string midAngle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string angStart = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string angStripes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hasStripes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string negStripes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string maxStripes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string absStripes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string sina = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cosa = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string tan90M2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string arcTan1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string arcTan2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string speedCalc1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string speedCalc2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string adjustedWeight = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t xTmp, yTmp;\n" << "\t\tRandXyParams params;\n" @@ -818,31 +820,31 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.reserve(25); - m_Params.push_back(ParamWithName(&m_NumEdges, prefix + "nBlur_numEdges", 3, eParamType::INTEGER)); - m_Params.push_back(ParamWithName(&m_NumStripes, prefix + "nBlur_numStripes", 0, eParamType::INTEGER)); - m_Params.push_back(ParamWithName(&m_RatioStripes, prefix + "nBlur_ratioStripes", 1, eParamType::REAL, 0, 2)); - m_Params.push_back(ParamWithName(&m_RatioHole, prefix + "nBlur_ratioHole", 0, eParamType::REAL, 0, 1)); - m_Params.push_back(ParamWithName(&m_CircumCircle, prefix + "nBlur_circumCircle", 0, eParamType::INTEGER, 0, 1)); + m_Params.push_back(ParamWithName(&m_NumEdges, prefix + "nBlur_numEdges", 3, eParamType::INTEGER)); + m_Params.push_back(ParamWithName(&m_NumStripes, prefix + "nBlur_numStripes", 0, eParamType::INTEGER)); + m_Params.push_back(ParamWithName(&m_RatioStripes, prefix + "nBlur_ratioStripes", 1, eParamType::REAL, 0, 2)); + m_Params.push_back(ParamWithName(&m_RatioHole, prefix + "nBlur_ratioHole", 0, eParamType::REAL, 0, 1)); + m_Params.push_back(ParamWithName(&m_CircumCircle, prefix + "nBlur_circumCircle", 0, eParamType::INTEGER, 0, 1)); m_Params.push_back(ParamWithName(&m_AdjustToLinear, prefix + "nBlur_adjustToLinear", 1, eParamType::INTEGER, 0, 1)); - m_Params.push_back(ParamWithName(&m_EqualBlur, prefix + "nBlur_equalBlur", 1, eParamType::INTEGER, 0, 1)); - m_Params.push_back(ParamWithName(&m_ExactCalc, prefix + "nBlur_exactCalc", 0, eParamType::INTEGER, 0, 1)); + m_Params.push_back(ParamWithName(&m_EqualBlur, prefix + "nBlur_equalBlur", 1, eParamType::INTEGER, 0, 1)); + m_Params.push_back(ParamWithName(&m_ExactCalc, prefix + "nBlur_exactCalc", 0, eParamType::INTEGER, 0, 1)); m_Params.push_back(ParamWithName(&m_HighlightEdges, prefix + "nBlur_highlightEdges", 1)); m_Params.push_back(ParamWithName(true, &m_RatioComplement, prefix + "nBlur_ratioComplement"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_MidAngle, prefix + "nBlur_midAngle")); - m_Params.push_back(ParamWithName(true, &m_AngStart, prefix + "nBlur_angStart")); - m_Params.push_back(ParamWithName(true, &m_AngStripes, prefix + "nBlur_angStripes")); - m_Params.push_back(ParamWithName(true, &m_HasStripes, prefix + "nBlur_hasStripes")); - m_Params.push_back(ParamWithName(true, &m_NegStripes, prefix + "nBlur_negStripes")); - m_Params.push_back(ParamWithName(true, &m_MaxStripes, prefix + "nBlur_maxStripes")); - m_Params.push_back(ParamWithName(true, &m_AbsStripes, prefix + "nBlur_absStripes")); - m_Params.push_back(ParamWithName(true, &m_Sina, prefix + "nBlur_sina")); - m_Params.push_back(ParamWithName(true, &m_Cosa, prefix + "nBlur_cosa")); - m_Params.push_back(ParamWithName(true, &m_Tan90M2, prefix + "nBlur_tan90m2")); - m_Params.push_back(ParamWithName(true, &m_ArcTan1, prefix + "nBlur_arcTan1")); - m_Params.push_back(ParamWithName(true, &m_ArcTan2, prefix + "nBlur_arcTan2")); - m_Params.push_back(ParamWithName(true, &m_SpeedCalc1, prefix + "nBlur_speedCalc1")); - m_Params.push_back(ParamWithName(true, &m_SpeedCalc2, prefix + "nBlur_speedCalc2")); - m_Params.push_back(ParamWithName(true, &m_AdjustedWeight, prefix + "nBlur_adjustedWeight")); + m_Params.push_back(ParamWithName(true, &m_MidAngle, prefix + "nBlur_midAngle")); + m_Params.push_back(ParamWithName(true, &m_AngStart, prefix + "nBlur_angStart")); + m_Params.push_back(ParamWithName(true, &m_AngStripes, prefix + "nBlur_angStripes")); + m_Params.push_back(ParamWithName(true, &m_HasStripes, prefix + "nBlur_hasStripes")); + m_Params.push_back(ParamWithName(true, &m_NegStripes, prefix + "nBlur_negStripes")); + m_Params.push_back(ParamWithName(true, &m_MaxStripes, prefix + "nBlur_maxStripes")); + m_Params.push_back(ParamWithName(true, &m_AbsStripes, prefix + "nBlur_absStripes")); + m_Params.push_back(ParamWithName(true, &m_Sina, prefix + "nBlur_sina")); + m_Params.push_back(ParamWithName(true, &m_Cosa, prefix + "nBlur_cosa")); + m_Params.push_back(ParamWithName(true, &m_Tan90M2, prefix + "nBlur_tan90m2")); + m_Params.push_back(ParamWithName(true, &m_ArcTan1, prefix + "nBlur_arcTan1")); + m_Params.push_back(ParamWithName(true, &m_ArcTan2, prefix + "nBlur_arcTan2")); + m_Params.push_back(ParamWithName(true, &m_SpeedCalc1, prefix + "nBlur_speedCalc1")); + m_Params.push_back(ParamWithName(true, &m_SpeedCalc2, prefix + "nBlur_speedCalc2")); + m_Params.push_back(ParamWithName(true, &m_AdjustedWeight, prefix + "nBlur_adjustedWeight")); } private: @@ -1201,16 +1203,17 @@ public: ostringstream ss, ss2; intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber(); + string weight = WeightDefineString(); string index = ss2.str() + "]"; string stateIndex = ss2.str(); string polarweight = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string s = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string t = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string tempRad = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string abss = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string abst = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string st = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string s = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string t = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string tempRad = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string abss = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string abst = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string st = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string axStartIndex = ToUpper(m_Params[i].Name()) + stateIndex; i += 2; string bxStartIndex = ToUpper(m_Params[i].Name()) + stateIndex; i += 2; string cxStartIndex = ToUpper(m_Params[i].Name()) + stateIndex; i += 2; @@ -1246,8 +1249,8 @@ public: << "\t\t real_t rd = log(Sqr(r / " << tempRad << "));\n" << "\t\t real_t phi = atan2(y, x);\n" << "\n" - << "\t\t tempOut.x = xform->m_VariationWeights[" << varIndex << "] * Lerp(x, phi, rd * " << polarweight << ");\n" - << "\t\t tempOut.y = xform->m_VariationWeights[" << varIndex << "] * Lerp(y, r, rd * " << polarweight << ");\n" + << "\t\t tempOut.x = " << weight << " * Lerp(x, phi, rd * " << polarweight << ");\n" + << "\t\t tempOut.y = " << weight << " * Lerp(y, r, rd * " << polarweight << ");\n" << "\t\t}\n" << "\t\telse if (HitsSquareAroundOrigin(" << st << ", &xy))\n" << "\t\t{\n" @@ -1258,8 +1261,8 @@ public: << "\t\t HitsTriangle(&L, &D, &E, &xy, &u, &v) ||\n" << "\t\t HitsTriangle(&K, &F, &G, &xy, &u, &v))\n" << "\t\t {\n" - << "\t\t tempOut.x = xform->m_VariationWeights[" << varIndex << "] * x;\n" - << "\t\t tempOut.y = xform->m_VariationWeights[" << varIndex << "] * y;\n" + << "\t\t tempOut.x = " << weight << " * x;\n" + << "\t\t tempOut.y = " << weight << " * y;\n" << "\t\t }\n" << "\t\t else\n" << "\t\t clear = true;\n" @@ -1286,9 +1289,9 @@ public: ss << "\t\t}\n" << "\n" - << "\t\tvOut.x = tempOut.x + (xform->m_VariationWeights[" << varIndex << "] * x);\n" - << "\t\tvOut.y = tempOut.y + (xform->m_VariationWeights[" << varIndex << "] * y);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * z;\n" + << "\t\tvOut.x = tempOut.x + (" << weight << " * x);\n" + << "\t\tvOut.y = tempOut.y + (" << weight << " * y);\n" + << "\t\tvOut.z = " << weight << " * z;\n" << "\t}\n"; return ss.str(); } @@ -1371,37 +1374,37 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Polarweight, prefix + "octapol_polarweight")); - m_Params.push_back(ParamWithName(&m_Radius, prefix + "octapol_radius", 1)); - m_Params.push_back(ParamWithName(&m_S, prefix + "octapol_s", T(0.5))); - m_Params.push_back(ParamWithName(&m_T, prefix + "octapol_t", T(0.5))); + m_Params.push_back(ParamWithName(&m_Radius, prefix + "octapol_radius", 1)); + m_Params.push_back(ParamWithName(&m_S, prefix + "octapol_s", T(0.5))); + m_Params.push_back(ParamWithName(&m_T, prefix + "octapol_t", T(0.5))); m_Params.push_back(ParamWithName(true, &m_TempRad, prefix + "octapol_rad"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_AbsS, prefix + "octapol_abss")); - m_Params.push_back(ParamWithName(true, &m_AbsT, prefix + "octapol_abst")); - m_Params.push_back(ParamWithName(true, &m_St, prefix + "octapol_absst")); - m_Params.push_back(ParamWithName(true, &m_A.x, prefix + "octapol_ax")); - m_Params.push_back(ParamWithName(true, &m_A.y, prefix + "octapol_ay")); - m_Params.push_back(ParamWithName(true, &m_B.x, prefix + "octapol_bx")); - m_Params.push_back(ParamWithName(true, &m_B.y, prefix + "octapol_by")); - m_Params.push_back(ParamWithName(true, &m_C.x, prefix + "octapol_cx")); - m_Params.push_back(ParamWithName(true, &m_C.y, prefix + "octapol_cy")); - m_Params.push_back(ParamWithName(true, &m_D.x, prefix + "octapol_dx")); - m_Params.push_back(ParamWithName(true, &m_D.y, prefix + "octapol_dy")); - m_Params.push_back(ParamWithName(true, &m_E.x, prefix + "octapol_ex")); - m_Params.push_back(ParamWithName(true, &m_E.y, prefix + "octapol_ey")); - m_Params.push_back(ParamWithName(true, &m_F.x, prefix + "octapol_fx")); - m_Params.push_back(ParamWithName(true, &m_F.y, prefix + "octapol_fy")); - m_Params.push_back(ParamWithName(true, &m_G.x, prefix + "octapol_gx")); - m_Params.push_back(ParamWithName(true, &m_G.y, prefix + "octapol_gy")); - m_Params.push_back(ParamWithName(true, &m_H.x, prefix + "octapol_hx")); - m_Params.push_back(ParamWithName(true, &m_H.y, prefix + "octapol_hy")); - m_Params.push_back(ParamWithName(true, &m_I.x, prefix + "octapol_ix")); - m_Params.push_back(ParamWithName(true, &m_I.y, prefix + "octapol_iy")); - m_Params.push_back(ParamWithName(true, &m_J.x, prefix + "octapol_jx")); - m_Params.push_back(ParamWithName(true, &m_J.y, prefix + "octapol_jy")); - m_Params.push_back(ParamWithName(true, &m_K.x, prefix + "octapol_kx")); - m_Params.push_back(ParamWithName(true, &m_K.y, prefix + "octapol_ky")); - m_Params.push_back(ParamWithName(true, &m_L.x, prefix + "octapol_lx")); - m_Params.push_back(ParamWithName(true, &m_L.y, prefix + "octapol_ly")); + m_Params.push_back(ParamWithName(true, &m_AbsS, prefix + "octapol_abss")); + m_Params.push_back(ParamWithName(true, &m_AbsT, prefix + "octapol_abst")); + m_Params.push_back(ParamWithName(true, &m_St, prefix + "octapol_absst")); + m_Params.push_back(ParamWithName(true, &m_A.x, prefix + "octapol_ax")); + m_Params.push_back(ParamWithName(true, &m_A.y, prefix + "octapol_ay")); + m_Params.push_back(ParamWithName(true, &m_B.x, prefix + "octapol_bx")); + m_Params.push_back(ParamWithName(true, &m_B.y, prefix + "octapol_by")); + m_Params.push_back(ParamWithName(true, &m_C.x, prefix + "octapol_cx")); + m_Params.push_back(ParamWithName(true, &m_C.y, prefix + "octapol_cy")); + m_Params.push_back(ParamWithName(true, &m_D.x, prefix + "octapol_dx")); + m_Params.push_back(ParamWithName(true, &m_D.y, prefix + "octapol_dy")); + m_Params.push_back(ParamWithName(true, &m_E.x, prefix + "octapol_ex")); + m_Params.push_back(ParamWithName(true, &m_E.y, prefix + "octapol_ey")); + m_Params.push_back(ParamWithName(true, &m_F.x, prefix + "octapol_fx")); + m_Params.push_back(ParamWithName(true, &m_F.y, prefix + "octapol_fy")); + m_Params.push_back(ParamWithName(true, &m_G.x, prefix + "octapol_gx")); + m_Params.push_back(ParamWithName(true, &m_G.y, prefix + "octapol_gy")); + m_Params.push_back(ParamWithName(true, &m_H.x, prefix + "octapol_hx")); + m_Params.push_back(ParamWithName(true, &m_H.y, prefix + "octapol_hy")); + m_Params.push_back(ParamWithName(true, &m_I.x, prefix + "octapol_ix")); + m_Params.push_back(ParamWithName(true, &m_I.y, prefix + "octapol_iy")); + m_Params.push_back(ParamWithName(true, &m_J.x, prefix + "octapol_jx")); + m_Params.push_back(ParamWithName(true, &m_J.y, prefix + "octapol_jy")); + m_Params.push_back(ParamWithName(true, &m_K.x, prefix + "octapol_kx")); + m_Params.push_back(ParamWithName(true, &m_K.y, prefix + "octapol_ky")); + m_Params.push_back(ParamWithName(true, &m_L.x, prefix + "octapol_lx")); + m_Params.push_back(ParamWithName(true, &m_L.y, prefix + "octapol_ly")); } private: @@ -1559,34 +1562,35 @@ public: intmax_t i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string top = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string bottom = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string left = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string right = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string blur = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ratioBlur = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string directBlur = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string xInterval = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string yInterval = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string xInt2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string yInt2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string minInt2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string x0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string x0c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y0c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string setProb = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string setProbH = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string setProbQ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string setProbTQ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string setCompProb = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string setCompProbH = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string setCompProbQ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string top = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string bottom = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string left = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string right = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string blur = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ratioBlur = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string directBlur = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string xInterval = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string yInterval = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string xInt2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string yInt2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string minInt2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string x0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string x0c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y0c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string setProb = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string setProbH = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string setProbQ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string setProbTQ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string setCompProb = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string setCompProbH = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string setCompProbQ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string setCompProbTQ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string topBorder = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string bottomBorder = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string leftBorder = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rightBorder = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string topBorder = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string bottomBorder = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string leftBorder = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rightBorder = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t gradTmp, secTmp, xTmp = 0, yTmp = 0;\n" << "\n" @@ -1730,10 +1734,10 @@ public: } else { - m_TopBorder = m_Top + m_MinInt2 * m_RatioBlur; + m_TopBorder = m_Top + m_MinInt2 * m_RatioBlur; m_BottomBorder = m_Bottom - m_MinInt2 * m_RatioBlur; - m_LeftBorder = m_Left + m_MinInt2 * m_RatioBlur; - m_RightBorder = m_Right - m_MinInt2 * m_RatioBlur; + m_LeftBorder = m_Left + m_MinInt2 * m_RatioBlur; + m_RightBorder = m_Right - m_MinInt2 * m_RatioBlur; } } @@ -1747,34 +1751,34 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Top, prefix + "crob_top", -1)); - m_Params.push_back(ParamWithName(&m_Bottom, prefix + "crob_bottom", 1)); - m_Params.push_back(ParamWithName(&m_Left, prefix + "crob_left", -1)); - m_Params.push_back(ParamWithName(&m_Right, prefix + "crob_right", 1)); - m_Params.push_back(ParamWithName(&m_Blur, prefix + "crob_blur", 1, eParamType::INTEGER)); - m_Params.push_back(ParamWithName(&m_RatioBlur, prefix + "crob_ratioBlur", T(0.5), eParamType::REAL, 0, 1)); + m_Params.push_back(ParamWithName(&m_Top, prefix + "crob_top", -1)); + m_Params.push_back(ParamWithName(&m_Bottom, prefix + "crob_bottom", 1)); + m_Params.push_back(ParamWithName(&m_Left, prefix + "crob_left", -1)); + m_Params.push_back(ParamWithName(&m_Right, prefix + "crob_right", 1)); + m_Params.push_back(ParamWithName(&m_Blur, prefix + "crob_blur", 1, eParamType::INTEGER)); + m_Params.push_back(ParamWithName(&m_RatioBlur, prefix + "crob_ratioBlur", T(0.5), eParamType::REAL, 0, 1)); m_Params.push_back(ParamWithName(&m_DirectBlur, prefix + "crob_directBlur", 2)); - m_Params.push_back(ParamWithName(true, &m_XInterval, prefix + "crob_xinterval")); - m_Params.push_back(ParamWithName(true, &m_YInterval, prefix + "crob_yinterval")); - m_Params.push_back(ParamWithName(true, &m_XInt2, prefix + "crob_xint2")); - m_Params.push_back(ParamWithName(true, &m_YInt2, prefix + "crob_yint2")); - m_Params.push_back(ParamWithName(true, &m_MinInt2, prefix + "crob_minint2")); - m_Params.push_back(ParamWithName(true, &m_X0, prefix + "crob_x0")); - m_Params.push_back(ParamWithName(true, &m_Y0, prefix + "crob_y0")); - m_Params.push_back(ParamWithName(true, &m_X0c, prefix + "crob_x0c")); - m_Params.push_back(ParamWithName(true, &m_Y0c, prefix + "crob_y0c")); - m_Params.push_back(ParamWithName(true, &m_SetProb, prefix + "crob_set_prob")); - m_Params.push_back(ParamWithName(true, &m_SetProbH, prefix + "crob_set_prob_h")); - m_Params.push_back(ParamWithName(true, &m_SetProbQ, prefix + "crob_set_prob_q")); - m_Params.push_back(ParamWithName(true, &m_SetProbTQ, prefix + "crob_set_prob_tq")); - m_Params.push_back(ParamWithName(true, &m_SetCompProb, prefix + "crob_set_comp_prob")); - m_Params.push_back(ParamWithName(true, &m_SetCompProbH, prefix + "crob_set_comp_prob_h")); - m_Params.push_back(ParamWithName(true, &m_SetCompProbQ, prefix + "crob_set_comp_prob_q")); + m_Params.push_back(ParamWithName(true, &m_XInterval, prefix + "crob_xinterval")); + m_Params.push_back(ParamWithName(true, &m_YInterval, prefix + "crob_yinterval")); + m_Params.push_back(ParamWithName(true, &m_XInt2, prefix + "crob_xint2")); + m_Params.push_back(ParamWithName(true, &m_YInt2, prefix + "crob_yint2")); + m_Params.push_back(ParamWithName(true, &m_MinInt2, prefix + "crob_minint2")); + m_Params.push_back(ParamWithName(true, &m_X0, prefix + "crob_x0")); + m_Params.push_back(ParamWithName(true, &m_Y0, prefix + "crob_y0")); + m_Params.push_back(ParamWithName(true, &m_X0c, prefix + "crob_x0c")); + m_Params.push_back(ParamWithName(true, &m_Y0c, prefix + "crob_y0c")); + m_Params.push_back(ParamWithName(true, &m_SetProb, prefix + "crob_set_prob")); + m_Params.push_back(ParamWithName(true, &m_SetProbH, prefix + "crob_set_prob_h")); + m_Params.push_back(ParamWithName(true, &m_SetProbQ, prefix + "crob_set_prob_q")); + m_Params.push_back(ParamWithName(true, &m_SetProbTQ, prefix + "crob_set_prob_tq")); + m_Params.push_back(ParamWithName(true, &m_SetCompProb, prefix + "crob_set_comp_prob")); + m_Params.push_back(ParamWithName(true, &m_SetCompProbH, prefix + "crob_set_comp_prob_h")); + m_Params.push_back(ParamWithName(true, &m_SetCompProbQ, prefix + "crob_set_comp_prob_q")); m_Params.push_back(ParamWithName(true, &m_SetCompProbTQ, prefix + "crob_set_comp_prob_tq")); - m_Params.push_back(ParamWithName(true, &m_TopBorder, prefix + "crob_top_border")); - m_Params.push_back(ParamWithName(true, &m_BottomBorder, prefix + "crob_bottom_border")); - m_Params.push_back(ParamWithName(true, &m_LeftBorder, prefix + "crob_left_border")); - m_Params.push_back(ParamWithName(true, &m_RightBorder, prefix + "crob_right_border")); + m_Params.push_back(ParamWithName(true, &m_TopBorder, prefix + "crob_top_border")); + m_Params.push_back(ParamWithName(true, &m_BottomBorder, prefix + "crob_bottom_border")); + m_Params.push_back(ParamWithName(true, &m_LeftBorder, prefix + "crob_left_border")); + m_Params.push_back(ParamWithName(true, &m_RightBorder, prefix + "crob_right_border")); } private: @@ -2004,23 +2008,24 @@ public: ostringstream ss, ss2; intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber(); + string weight = WeightDefineString(); string index = ss2.str() + "]"; - string numberStripes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ratioStripes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string angleHole = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string exponentZ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string symmetryZ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string modusBlur = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string numberStripes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ratioStripes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string angleHole = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string exponentZ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string symmetryZ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string modusBlur = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string absNumberStripes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string angHoleTemp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string angStrip = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string angStrip1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string angStrip2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string invStripes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string angHoleComp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string invHole = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string s = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string angHoleTemp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string angStrip = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string angStrip1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string angStrip2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invStripes = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string angHoleComp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invHole = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string s = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" "\t\treal_t x = vIn.x, y = vIn.y, z = vIn.z;\n" "\t\treal_t xTmp, yTmp, angTmp, angRot, fac;\n" @@ -2193,9 +2198,9 @@ public: "\t\t }\n" "\t\t}\n" "\t\t\n" - "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * x;\n" - "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * y;\n" - "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * z;\n" + "\t\tvOut.x = " << weight << " * x;\n" + "\t\tvOut.y = " << weight << " * y;\n" + "\t\tvOut.z = " << weight << " * z;\n" "\t}\n"; return ss.str(); } @@ -2261,21 +2266,21 @@ protected: m_Params.clear(); m_Params.reserve(14); m_Params.push_back(ParamWithName(&m_NumberStripes, prefix + "bubbleT3D_number_of_stripes", 0, eParamType::INTEGER)); - m_Params.push_back(ParamWithName(&m_RatioStripes, prefix + "bubbleT3D_ratio_of_stripes", 1, eParamType::REAL, 0, 2)); - m_Params.push_back(ParamWithName(&m_AngleHole, prefix + "bubbleT3D_angle_of_hole", 0, eParamType::REAL, -360, 360)); - m_Params.push_back(ParamWithName(&m_ExponentZ, prefix + "bubbleT3D_exponentZ", 1)); - m_Params.push_back(ParamWithName(&m_SymmetryZ, prefix + "bubbleT3D_symmetryZ", 0, eParamType::INTEGER, 0, 1)); - m_Params.push_back(ParamWithName(&m_ModusBlur, prefix + "bubbleT3D_modusBlur", 0, eParamType::INTEGER, 0, 1)); + m_Params.push_back(ParamWithName(&m_RatioStripes, prefix + "bubbleT3D_ratio_of_stripes", 1, eParamType::REAL, 0, 2)); + m_Params.push_back(ParamWithName(&m_AngleHole, prefix + "bubbleT3D_angle_of_hole", 0, eParamType::REAL, -360, 360)); + m_Params.push_back(ParamWithName(&m_ExponentZ, prefix + "bubbleT3D_exponentZ", 1)); + m_Params.push_back(ParamWithName(&m_SymmetryZ, prefix + "bubbleT3D_symmetryZ", 0, eParamType::INTEGER, 0, 1)); + m_Params.push_back(ParamWithName(&m_ModusBlur, prefix + "bubbleT3D_modusBlur", 0, eParamType::INTEGER, 0, 1)); m_Params.push_back(ParamWithName(true, &m_AbsNumberStripes, prefix + "bubbleT3D_abs_number_of_stripes"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_AngleHoleTemp, prefix + "bubbleT3D_ang_hole_temp")); - m_Params.push_back(ParamWithName(true, &m_AngStrip, prefix + "bubbleT3D_ang_strip")); - m_Params.push_back(ParamWithName(true, &m_AngStrip1, prefix + "bubbleT3D_ang_strip1")); - m_Params.push_back(ParamWithName(true, &m_AngStrip2, prefix + "bubbleT3D_ang_strip2")); - m_Params.push_back(ParamWithName(true, &m_InvStripes, prefix + "bubbleT3D_inv_stripes")); - m_Params.push_back(ParamWithName(true, &m_AngHoleComp, prefix + "bubbleT3D_ang_hole_comp")); - m_Params.push_back(ParamWithName(true, &m_InvHole, prefix + "bubbleT3D_inv_hole")); - m_Params.push_back(ParamWithName(true, &m_C, prefix + "bubbleT3D_c")); - m_Params.push_back(ParamWithName(true, &m_S, prefix + "bubbleT3D_s")); + m_Params.push_back(ParamWithName(true, &m_AngleHoleTemp, prefix + "bubbleT3D_ang_hole_temp")); + m_Params.push_back(ParamWithName(true, &m_AngStrip, prefix + "bubbleT3D_ang_strip")); + m_Params.push_back(ParamWithName(true, &m_AngStrip1, prefix + "bubbleT3D_ang_strip1")); + m_Params.push_back(ParamWithName(true, &m_AngStrip2, prefix + "bubbleT3D_ang_strip2")); + m_Params.push_back(ParamWithName(true, &m_InvStripes, prefix + "bubbleT3D_inv_stripes")); + m_Params.push_back(ParamWithName(true, &m_AngHoleComp, prefix + "bubbleT3D_ang_hole_comp")); + m_Params.push_back(ParamWithName(true, &m_InvHole, prefix + "bubbleT3D_inv_hole")); + m_Params.push_back(ParamWithName(true, &m_C, prefix + "bubbleT3D_c")); + m_Params.push_back(ParamWithName(true, &m_S, prefix + "bubbleT3D_s")); } private: @@ -2756,41 +2761,42 @@ public: ostringstream ss, ss2; intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber(); + string weight = WeightDefineString(); string index = ss2.str() + "]"; - string synthA = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthMode = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthPower = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthMix = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthA = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthMode = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthPower = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthMix = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string synthSmooth = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthB = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthBType = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthBSkew = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthBFrq = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthBPhs = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthB = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthBType = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthBSkew = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthBFrq = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthBPhs = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string synthBLayer = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthC = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthCType = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthCSkew = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthCFrq = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthCPhs = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthC = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthCType = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthCSkew = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthCFrq = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthCPhs = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string synthCLayer = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthDType = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthDSkew = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthDFrq = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthDPhs = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthDType = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthDSkew = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthDFrq = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthDPhs = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string synthDLayer = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthE = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthEType = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthESkew = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthEFrq = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthEPhs = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthE = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthEType = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthESkew = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthEFrq = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthEPhs = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string synthELayer = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthF = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthFType = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthFSkew = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthFFrq = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string synthFPhs = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthF = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthFType = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthFSkew = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthFFrq = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string synthFPhs = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string synthFLayer = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t Vx, Vy, radius, theta;\n" @@ -2843,8 +2849,8 @@ public: << "\t\t thetaFactor = SynthValue(&synth, theta);\n" << "\t\t radius = Interpolate(radius, thetaFactor, synthSmooth);\n" << "\t\t s = sincos(theta, &c);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * radius * s;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * radius * c;\n" + << "\t\t vOut.x = " << weight << " * radius * s;\n" + << "\t\t vOut.y = " << weight << " * radius * c;\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_BUBBLE:\n" @@ -2855,8 +2861,8 @@ public: << "\t\t thetaFactor = SynthValue(&synth, theta);\n" << "\t\t radius = Interpolate(radius, thetaFactor, synthSmooth);\n" << "\t\t s = sincos(theta, &c);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * radius * s;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * radius * c;\n" + << "\t\t vOut.x = " << weight << " * radius * s;\n" + << "\t\t vOut.y = " << weight << " * radius * c;\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_BLUR_LEGACY:\n" @@ -2866,7 +2872,7 @@ public: << "\t\t Vy = radius * cos(theta);\n" << "\t\t radius = pow(Zeps(radius * radius), " << synthPower << " / 2);\n" << "\t\t thetaFactor = SynthValue(&synth, theta);\n" - << "\t\t radius = xform->m_VariationWeights[" << varIndex << "] * Interpolate(radius, thetaFactor, synthSmooth);\n" + << "\t\t radius = " << weight << " * Interpolate(radius, thetaFactor, synthSmooth);\n" << "\t\t vOut.x = Vx * radius;\n" << "\t\t vOut.y = Vy * radius;\n" << "\t\t break;\n" @@ -2878,8 +2884,8 @@ public: << "\t\t thetaFactor = SynthValue(&synth, theta);\n" << "\t\t radius = Interpolate(radius, thetaFactor, synthSmooth);\n" << "\t\t s = sincos(theta, &c);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * radius * s;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * radius * c;\n" + << "\t\t vOut.x = " << weight << " * radius * s;\n" + << "\t\t vOut.y = " << weight << " * radius * c;\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_BLUR_ZIGZAG:\n" @@ -2887,8 +2893,8 @@ public: << "\t\t theta = 2 * asin((MwcNext01(mwc) - 0.5) * 2);\n" << "\t\t thetaFactor = SynthValue(&synth, theta);\n" << "\t\t Vy = Interpolate(Vy, thetaFactor, synthSmooth);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (theta / MPI);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (Vy - 1);\n" + << "\t\t vOut.x = " << weight << " * (theta / MPI);\n" + << "\t\t vOut.y = " << weight << " * (Vy - 1);\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_RAWCIRCLE:\n" @@ -2897,61 +2903,61 @@ public: << "\t\t thetaFactor = SynthValue(&synth, theta);\n" << "\t\t radius = Interpolate(radius, thetaFactor, synthSmooth);\n" << "\t\t s = sincos(theta, &c);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * radius * s;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * radius * c;\n" + << "\t\t vOut.x = " << weight << " * radius * s;\n" + << "\t\t vOut.y = " << weight << " * radius * c;\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_RAWX:\n" << "\t\t Vx = vIn.x;\n" << "\t\t Vy = vIn.y;\n" << "\t\t thetaFactor = SynthValue(&synth, Vy);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * Interpolate(Vx, thetaFactor, synthSmooth);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * Vy;\n" + << "\t\t vOut.x = " << weight << " * Interpolate(Vx, thetaFactor, synthSmooth);\n" + << "\t\t vOut.y = " << weight << " * Vy;\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_RAWY:\n" << "\t\t Vx = vIn.x;\n" << "\t\t Vy = vIn.y;\n" << "\t\t thetaFactor = SynthValue(&synth, Vx);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * Vx;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * Interpolate(Vy, thetaFactor, synthSmooth);\n" + << "\t\t vOut.x = " << weight << " * Vx;\n" + << "\t\t vOut.y = " << weight << " * Interpolate(Vy, thetaFactor, synthSmooth);\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_RAWXY:\n" << "\t\t Vx = vIn.x;\n" << "\t\t Vy = vIn.y;\n" << "\t\t thetaFactor = SynthValue(&synth, Vy);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * Interpolate(Vx, thetaFactor, synthSmooth);\n" + << "\t\t vOut.x = " << weight << " * Interpolate(Vx, thetaFactor, synthSmooth);\n" << "\t\t thetaFactor = SynthValue(&synth, Vx);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * Interpolate(Vy, thetaFactor, synthSmooth);\n" + << "\t\t vOut.y = " << weight << " * Interpolate(Vy, thetaFactor, synthSmooth);\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_SHIFTX:\n" << "\t\t Vx = vIn.x;\n" << "\t\t Vy = vIn.y;\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (Vx + SynthValue(&synth, Vy) - 1);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * Vy;\n" + << "\t\t vOut.x = " << weight << " * (Vx + SynthValue(&synth, Vy) - 1);\n" + << "\t\t vOut.y = " << weight << " * Vy;\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_SHIFTY:\n" << "\t\t Vx = vIn.x;\n" << "\t\t Vy = vIn.y;\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * Vx;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (Vy + SynthValue(&synth, Vx) - 1);\n" + << "\t\t vOut.x = " << weight << " * Vx;\n" + << "\t\t vOut.y = " << weight << " * (Vy + SynthValue(&synth, Vx) - 1);\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_SHIFTXY:\n" << "\t\t Vx = vIn.x;\n" << "\t\t Vy = vIn.y;\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (Vx + SynthValue(&synth, Vy) - 1);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (Vy + SynthValue(&synth, Vx) - 1);\n" + << "\t\t vOut.x = " << weight << " * (Vx + SynthValue(&synth, Vy) - 1);\n" + << "\t\t vOut.y = " << weight << " * (Vy + SynthValue(&synth, Vx) - 1);\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_SINUSOIDAL:\n" << "\t\t Vx = vIn.x;\n" << "\t\t Vy = vIn.y;\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (SynthValue(&synth, Vx) - 1 + (1 - " << synthMix << ") * sin(Vx));\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (SynthValue(&synth, Vy) - 1 + (1 - " << synthMix << ") * sin(Vy));\n" + << "\t\t vOut.x = " << weight << " * (SynthValue(&synth, Vx) - 1 + (1 - " << synthMix << ") * sin(Vx));\n" + << "\t\t vOut.y = " << weight << " * (SynthValue(&synth, Vy) - 1 + (1 - " << synthMix << ") * sin(Vy));\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_SWIRL:\n" @@ -2959,8 +2965,8 @@ public: << "\t\t Vy = vIn.y;\n" << "\t\t radius = pow(Zeps(precalcSumSquares), " << synthPower << " / 2);\n" << "\t\t SynthSinCos(&synth, radius, &s, &c, synthSmooth);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (s * Vx - c * Vy);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (c * Vx + s * Vy);\n" + << "\t\t vOut.x = " << weight << " * (s * Vx - c * Vy);\n" + << "\t\t vOut.y = " << weight << " * (c * Vx + s * Vy);\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_HYPERBOLIC:\n" @@ -2969,8 +2975,8 @@ public: << "\t\t radius = pow(Zeps(precalcSumSquares), " << synthPower << " / 2);\n" << "\t\t theta = precalcAtanxy;\n" << "\t\t SynthSinCos(&synth, theta, &s, &c, synthSmooth);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * s / radius;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * c * radius;\n" + << "\t\t vOut.x = " << weight << " * s / radius;\n" + << "\t\t vOut.y = " << weight << " * c * radius;\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_JULIA:\n" @@ -2983,8 +2989,8 @@ public: << "\t\t theta += MPI;\n" << "\n" << "\t\t SynthSinCos(&synth, theta, &s, &c, synthSmooth);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * radius * c;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * radius * s;\n" + << "\t\t vOut.x = " << weight << " * radius * c;\n" + << "\t\t vOut.y = " << weight << " * radius * s;\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_DISC:\n" @@ -2993,8 +2999,8 @@ public: << "\t\t theta = precalcAtanxy / MPI;\n" << "\t\t radius = MPI * pow(Zeps(precalcSumSquares), " << synthPower << " / 2);\n" << "\t\t SynthSinCos(&synth, radius, &s, &c, synthSmooth);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * s * theta;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * c * theta;\n" + << "\t\t vOut.x = " << weight << " * s * theta;\n" + << "\t\t vOut.y = " << weight << " * c * theta;\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_RINGS:\n" @@ -3005,8 +3011,8 @@ public: << "\t\t mu = Zeps(SQR(" << synthPower << "));\n" << "\t\t radius += -2 * mu * (int)((radius + mu) / (2 * mu)) + radius * (1 - mu);\n" << "\t\t SynthSinCos(&synth, radius, &s, &c, synthSmooth);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * s * theta;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * c * theta;\n" + << "\t\t vOut.x = " << weight << " * s * theta;\n" + << "\t\t vOut.y = " << weight << " * c * theta;\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_CYLINDER:\n" @@ -3014,8 +3020,8 @@ public: << "\t\t Vy = vIn.y;\n" << "\t\t radius = pow(Zeps(precalcSumSquares), " << synthPower << " / 2);\n" << "\t\t SynthSinCos(&synth, Vx, &s, &c, synthSmooth);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * radius * s;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * radius * Vy;\n" + << "\t\t vOut.x = " << weight << " * radius * s;\n" + << "\t\t vOut.y = " << weight << " * radius * Vy;\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_BLUR_RING:\n" @@ -3024,8 +3030,8 @@ public: << "\t\t thetaFactor = SynthValue(&synth, theta);\n" << "\t\t radius = Interpolate(radius, thetaFactor, synthSmooth);\n" << "\t\t s = sincos(theta, &c);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * radius * s;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * radius * c;\n" + << "\t\t vOut.x = " << weight << " * radius * s;\n" + << "\t\t vOut.y = " << weight << " * radius * c;\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_BLUR_RING2:\n" @@ -3033,8 +3039,8 @@ public: << "\t\t radius = pow(Zeps(MwcNext01(mwc)), " << synthPower << ");\n" << "\t\t radius = SynthValue(&synth, theta) + 0.1 * radius;\n" << "\t\t s = sincos(theta, &c);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * radius * s;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * radius * c;\n" + << "\t\t vOut.x = " << weight << " * radius * s;\n" + << "\t\t vOut.y = " << weight << " * radius * c;\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_SHIFTTHETA:\n" @@ -3043,8 +3049,8 @@ public: << "\t\t radius = pow(Zeps(precalcSumSquares), " << synthPower << " / 2);\n" << "\t\t theta = precalcAtanxy - 1 + SynthValue(&synth, radius);\n" << "\t\t s = sincos(theta, &c);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * radius * s;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * radius * c;\n" + << "\t\t vOut.x = " << weight << " * radius * s;\n" + << "\t\t vOut.y = " << weight << " * radius * c;\n" << "\t\t break;\n" << "\t\tcase MODE_SHIFTNSTRETCH:\n" << "\t\t Vx = vIn.x;\n" @@ -3052,8 +3058,8 @@ public: << "\t\t radius = pow(Zeps(precalcSumSquares), " << synthPower << " / 2);\n" << "\t\t theta = precalcAtanxy - 1 + SynthValue(&synth, radius);\n" << "\t\t s = sincos(theta, &c);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * radius * s;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * radius * c;\n" + << "\t\t vOut.x = " << weight << " * radius * s;\n" + << "\t\t vOut.y = " << weight << " * radius * c;\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_SHIFTTANGENT:\n" @@ -3064,8 +3070,8 @@ public: << "\t\t mu = SynthValue(&synth, radius) - 1;\n" << "\t\t Vx += mu * c;\n" << "\t\t Vy -= mu * s;\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * Vx;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * Vy;\n" + << "\t\t vOut.x = " << weight << " * Vx;\n" + << "\t\t vOut.y = " << weight << " * Vy;\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_XMIRROR:\n" @@ -3073,8 +3079,8 @@ public: << "\t\t Vy = vIn.y;\n" << "\t\t mu = SynthValue(&synth, Vx) - 1;\n" << "\t\t Vy = 2 * mu - Vy;\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * Vx;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * Vy;\n" + << "\t\t vOut.x = " << weight << " * Vx;\n" + << "\t\t vOut.y = " << weight << " * Vy;\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_XYMIRROR:\n" @@ -3084,8 +3090,8 @@ public: << "\t\t radius = SynthValue(&synth, Vy) - 1;\n" << "\t\t Vy = 2 * mu - Vy;\n" << "\t\t Vx = 2 * radius - Vx;\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * Vx;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * Vy;\n" + << "\t\t vOut.x = " << weight << " * Vx;\n" + << "\t\t vOut.y = " << weight << " * Vy;\n" << "\t\t break;\n" << "\n" << "\t\tcase MODE_SPHERICAL2:\n" @@ -3098,8 +3104,8 @@ public: << "\t\t radius = Interpolate(radius, thetaFactor, synthSmooth);\n" << "\t\t radius = pow(radius, " << synthPower << ");\n" << "\t\t s = sincos(theta, &c);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * radius * s;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * radius * c;\n" + << "\t\t vOut.x = " << weight << " * radius * s;\n" + << "\t\t vOut.y = " << weight << " * radius * c;\n" << "\t\t break;\n" << "\t\t}\n" << "\n" @@ -3373,40 +3379,40 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.reserve(34); - m_Params.push_back(ParamWithName(&m_SynthA, prefix + "synth_a")); - m_Params.push_back(ParamWithName(&m_SynthMode, prefix + "synth_mode", 3, eParamType::INTEGER, MODE_SPHERICAL, MODE_SPHERICAL2)); - m_Params.push_back(ParamWithName(&m_SynthPower, prefix + "synth_power", -2)); - m_Params.push_back(ParamWithName(&m_SynthMix, prefix + "synth_mix")); + m_Params.push_back(ParamWithName(&m_SynthA, prefix + "synth_a")); + m_Params.push_back(ParamWithName(&m_SynthMode, prefix + "synth_mode", 3, eParamType::INTEGER, MODE_SPHERICAL, MODE_SPHERICAL2)); + m_Params.push_back(ParamWithName(&m_SynthPower, prefix + "synth_power", -2)); + m_Params.push_back(ParamWithName(&m_SynthMix, prefix + "synth_mix")); m_Params.push_back(ParamWithName(&m_SynthSmooth, prefix + "synth_smooth", 0, eParamType::INTEGER, LERP_LINEAR, LERP_BEZIER)); - m_Params.push_back(ParamWithName(&m_SynthB, prefix + "synth_b")); - m_Params.push_back(ParamWithName(&m_SynthBType, prefix + "synth_b_type", 0, eParamType::INTEGER, WAVE_SIN, WAVE_INGON)); - m_Params.push_back(ParamWithName(&m_SynthBSkew, prefix + "synth_b_skew")); - m_Params.push_back(ParamWithName(&m_SynthBFrq, prefix + "synth_b_frq", 1, eParamType::REAL)); - m_Params.push_back(ParamWithName(&m_SynthBPhs, prefix + "synth_b_phs")); + m_Params.push_back(ParamWithName(&m_SynthB, prefix + "synth_b")); + m_Params.push_back(ParamWithName(&m_SynthBType, prefix + "synth_b_type", 0, eParamType::INTEGER, WAVE_SIN, WAVE_INGON)); + m_Params.push_back(ParamWithName(&m_SynthBSkew, prefix + "synth_b_skew")); + m_Params.push_back(ParamWithName(&m_SynthBFrq, prefix + "synth_b_frq", 1, eParamType::REAL)); + m_Params.push_back(ParamWithName(&m_SynthBPhs, prefix + "synth_b_phs")); m_Params.push_back(ParamWithName(&m_SynthBLayer, prefix + "synth_b_layer", 0, eParamType::INTEGER, LAYER_ADD, LAYER_MIN)); - m_Params.push_back(ParamWithName(&m_SynthC, prefix + "synth_c")); - m_Params.push_back(ParamWithName(&m_SynthCType, prefix + "synth_c_type", 0, eParamType::INTEGER, WAVE_SIN, WAVE_INGON)); - m_Params.push_back(ParamWithName(&m_SynthCSkew, prefix + "synth_c_skew")); - m_Params.push_back(ParamWithName(&m_SynthCFrq, prefix + "synth_c_frq", 1, eParamType::REAL)); - m_Params.push_back(ParamWithName(&m_SynthCPhs, prefix + "synth_c_phs")); + m_Params.push_back(ParamWithName(&m_SynthC, prefix + "synth_c")); + m_Params.push_back(ParamWithName(&m_SynthCType, prefix + "synth_c_type", 0, eParamType::INTEGER, WAVE_SIN, WAVE_INGON)); + m_Params.push_back(ParamWithName(&m_SynthCSkew, prefix + "synth_c_skew")); + m_Params.push_back(ParamWithName(&m_SynthCFrq, prefix + "synth_c_frq", 1, eParamType::REAL)); + m_Params.push_back(ParamWithName(&m_SynthCPhs, prefix + "synth_c_phs")); m_Params.push_back(ParamWithName(&m_SynthCLayer, prefix + "synth_c_layer", 0, eParamType::INTEGER, LAYER_ADD, LAYER_MIN)); - m_Params.push_back(ParamWithName(&m_SynthD, prefix + "synth_d")); - m_Params.push_back(ParamWithName(&m_SynthDType, prefix + "synth_d_type", 0, eParamType::INTEGER, WAVE_SIN, WAVE_INGON)); - m_Params.push_back(ParamWithName(&m_SynthDSkew, prefix + "synth_d_skew")); - m_Params.push_back(ParamWithName(&m_SynthDFrq, prefix + "synth_d_frq", 1, eParamType::REAL)); - m_Params.push_back(ParamWithName(&m_SynthDPhs, prefix + "synth_d_phs")); + m_Params.push_back(ParamWithName(&m_SynthD, prefix + "synth_d")); + m_Params.push_back(ParamWithName(&m_SynthDType, prefix + "synth_d_type", 0, eParamType::INTEGER, WAVE_SIN, WAVE_INGON)); + m_Params.push_back(ParamWithName(&m_SynthDSkew, prefix + "synth_d_skew")); + m_Params.push_back(ParamWithName(&m_SynthDFrq, prefix + "synth_d_frq", 1, eParamType::REAL)); + m_Params.push_back(ParamWithName(&m_SynthDPhs, prefix + "synth_d_phs")); m_Params.push_back(ParamWithName(&m_SynthDLayer, prefix + "synth_d_layer", 0, eParamType::INTEGER, LAYER_ADD, LAYER_MIN)); - m_Params.push_back(ParamWithName(&m_SynthE, prefix + "synth_e")); - m_Params.push_back(ParamWithName(&m_SynthEType, prefix + "synth_e_type", 0, eParamType::INTEGER, WAVE_SIN, WAVE_INGON)); - m_Params.push_back(ParamWithName(&m_SynthESkew, prefix + "synth_e_skew")); - m_Params.push_back(ParamWithName(&m_SynthEFrq, prefix + "synth_e_frq", 1, eParamType::REAL)); - m_Params.push_back(ParamWithName(&m_SynthEPhs, prefix + "synth_e_phs")); + m_Params.push_back(ParamWithName(&m_SynthE, prefix + "synth_e")); + m_Params.push_back(ParamWithName(&m_SynthEType, prefix + "synth_e_type", 0, eParamType::INTEGER, WAVE_SIN, WAVE_INGON)); + m_Params.push_back(ParamWithName(&m_SynthESkew, prefix + "synth_e_skew")); + m_Params.push_back(ParamWithName(&m_SynthEFrq, prefix + "synth_e_frq", 1, eParamType::REAL)); + m_Params.push_back(ParamWithName(&m_SynthEPhs, prefix + "synth_e_phs")); m_Params.push_back(ParamWithName(&m_SynthELayer, prefix + "synth_e_layer", 0, eParamType::INTEGER, LAYER_ADD, LAYER_MIN)); - m_Params.push_back(ParamWithName(&m_SynthF, prefix + "synth_f")); - m_Params.push_back(ParamWithName(&m_SynthFType, prefix + "synth_f_type", 0, eParamType::INTEGER, WAVE_SIN, WAVE_INGON)); - m_Params.push_back(ParamWithName(&m_SynthFSkew, prefix + "synth_f_skew")); - m_Params.push_back(ParamWithName(&m_SynthFFrq, prefix + "synth_f_frq", 1, eParamType::REAL)); - m_Params.push_back(ParamWithName(&m_SynthFPhs, prefix + "synth_f_phs")); + m_Params.push_back(ParamWithName(&m_SynthF, prefix + "synth_f")); + m_Params.push_back(ParamWithName(&m_SynthFType, prefix + "synth_f_type", 0, eParamType::INTEGER, WAVE_SIN, WAVE_INGON)); + m_Params.push_back(ParamWithName(&m_SynthFSkew, prefix + "synth_f_skew")); + m_Params.push_back(ParamWithName(&m_SynthFFrq, prefix + "synth_f_frq", 1, eParamType::REAL)); + m_Params.push_back(ParamWithName(&m_SynthFPhs, prefix + "synth_f_phs")); m_Params.push_back(ParamWithName(&m_SynthFLayer, prefix + "synth_f_layer", 0, eParamType::INTEGER, LAYER_ADD, LAYER_MIN)); } @@ -3805,14 +3811,15 @@ public: ostringstream ss, ss2; intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber(); + string weight = WeightDefineString(); string index = ss2.str() + "]"; - string cellSize = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string distort = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string z = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cellSize = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string distort = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string z = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string halfCellSize = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cache = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cache = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tint di = -1, dj = -1;\n" << "\t\tint i = 0;\n" @@ -3861,8 +3868,8 @@ public: << "\t\tr = trgL / l;\n" << "\t\tdO *= r;\n" << "\t\tdO += p[4];\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * dO.x;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * dO.y;\n" + << "\t\tvOut.x = " << weight << " * dO.x;\n" + << "\t\tvOut.y = " << weight << " * dO.y;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -3884,12 +3891,12 @@ protected: m_Params.clear(); m_Params.reserve(8); m_Params.push_back(ParamWithName(&m_CellSize, prefix + "crackle_cellsize", 1, eParamType::REAL, T(0.0001))); - m_Params.push_back(ParamWithName(&m_Power, prefix + "crackle_power", T(0.2))); - m_Params.push_back(ParamWithName(&m_Distort, prefix + "crackle_distort")); - m_Params.push_back(ParamWithName(&m_Scale, prefix + "crackle_scale", 1)); - m_Params.push_back(ParamWithName(&m_Z, prefix + "crackle_z")); + m_Params.push_back(ParamWithName(&m_Power, prefix + "crackle_power", T(0.2))); + m_Params.push_back(ParamWithName(&m_Distort, prefix + "crackle_distort")); + m_Params.push_back(ParamWithName(&m_Scale, prefix + "crackle_scale", 1)); + m_Params.push_back(ParamWithName(&m_Z, prefix + "crackle_z")); m_Params.push_back(ParamWithName(true, &m_HalfCellSize, prefix + "crackle_half_cellsize")); - m_Params.push_back(ParamWithName(true, &(m_C[0][0].x), prefix + "crackle_cache", sizeof(m_C))); + m_Params.push_back(ParamWithName(true, &(m_C[0][0].x), prefix + "crackle_cache", sizeof(m_C))); } private: @@ -4134,25 +4141,26 @@ public: ostringstream ss, ss2; intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber(); + string weight = WeightDefineString(); string index = ss2.str() + "]"; string stateIndex = ss2.str(); - string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string roundstr = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string roundwidth = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string distortion = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string edge = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string scatter = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string offset = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rotation = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cropmode = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string staticc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string mode = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string radial = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string workradius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string workpower = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string alpha = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string roundcoeff = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string roundstr = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string roundwidth = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string distortion = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string edge = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scatter = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string offset = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rotation = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cropmode = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string staticc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string mode = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string radial = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string workradius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string workpower = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string alpha = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string roundcoeff = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string workrotation = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string x = "varState->" + m_Params[i++].Name() + stateIndex;//State. string y = "varState->" + m_Params[i++].Name() + stateIndex; @@ -4212,15 +4220,15 @@ public: << "\n" << "\t\t if (" << staticc << " > 1 || " << staticc << " == -1)\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * rad * c;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * rad * s;\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * zi;\n" + << "\t\t vOut.x = " << weight << " * rad * c;\n" + << "\t\t vOut.y = " << weight << " * rad * s;\n" + << "\t\t vOut.z = " << weight << " * zi;\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = vIn.x + (xform->m_VariationWeights[" << varIndex << "] * rad * c);\n" - << "\t\t vOut.y = vIn.y + (xform->m_VariationWeights[" << varIndex << "] * rad * s);\n" - << "\t\t vOut.z = vIn.z + (xform->m_VariationWeights[" << varIndex << "] * zi);\n" + << "\t\t vOut.x = vIn.x + (" << weight << " * rad * c);\n" + << "\t\t vOut.y = vIn.y + (" << weight << " * rad * s);\n" + << "\t\t vOut.z = vIn.z + (" << weight << " * zi);\n" << "\t\t }\n" << "\t\t }\n" << "\n" @@ -4284,15 +4292,15 @@ public: << "\n" << "\t\t if (" << staticc << " > 1 || " << staticc << " == -1)\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * rdc * c;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * rdc * s;\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * zi;\n" + << "\t\t vOut.x = " << weight << " * rdc * c;\n" + << "\t\t vOut.y = " << weight << " * rdc * s;\n" + << "\t\t vOut.z = " << weight << " * zi;\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = vIn.x + (xform->m_VariationWeights[" << varIndex << "] * rdc * c);\n" - << "\t\t vOut.y = vIn.y + (xform->m_VariationWeights[" << varIndex << "] * rdc * s);\n" - << "\t\t vOut.z = vIn.z + (xform->m_VariationWeights[" << varIndex << "] * zi);\n" + << "\t\t vOut.x = vIn.x + (" << weight << " * rdc * c);\n" + << "\t\t vOut.y = vIn.y + (" << weight << " * rdc * s);\n" + << "\t\t vOut.z = vIn.z + (" << weight << " * zi);\n" << "\t\t }\n" << "\t\t }\n" << "\t\t }\n" @@ -4314,15 +4322,15 @@ public: << "\t\t{\n" << "\t\t if (" << staticc << " == 3)\n" << "\t\t {\n" - << "\t\t " << x << " = xform->m_VariationWeights[" << varIndex << "] * transX;\n" - << "\t\t " << y << " = xform->m_VariationWeights[" << varIndex << "] * transY;\n" - << "\t\t " << z << " = xform->m_VariationWeights[" << varIndex << "] * transZ;\n" + << "\t\t " << x << " = " << weight << " * transX;\n" + << "\t\t " << y << " = " << weight << " * transY;\n" + << "\t\t " << z << " = " << weight << " * transZ;\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t " << x << " = xform->m_VariationWeights[" << varIndex << "] * xi;\n" - << "\t\t " << y << " = xform->m_VariationWeights[" << varIndex << "] * yi;\n" - << "\t\t " << z << " = xform->m_VariationWeights[" << varIndex << "] * zi;\n" + << "\t\t " << x << " = " << weight << " * xi;\n" + << "\t\t " << y << " = " << weight << " * yi;\n" + << "\t\t " << z << " = " << weight << " * zi;\n" << "\t\t }\n" << "\n" << "\t\t if (" << cropmode << " == 2)\n" @@ -4395,13 +4403,13 @@ protected: m_Params.push_back(ParamWithName(&m_Offset, prefix + "smartcrop_offset")); m_Params.push_back(ParamWithName(&m_Rotation, prefix + "smartcrop_rotation")); m_Params.push_back(ParamWithName(&m_Cropmode, prefix + "smartcrop_cropmode", 1, eParamType::INTEGER, -1, 2)); - m_Params.push_back(ParamWithName(&m_Static , prefix + "smartcrop_static", 1, eParamType::INTEGER, -1, 3)); - m_Params.push_back(ParamWithName(true, &m_Mode, prefix + "smartcrop_mode"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_Radial, prefix + "smartcrop_radial")); - m_Params.push_back(ParamWithName(true, &m_WorkRadius, prefix + "smartcrop_work_radius")); - m_Params.push_back(ParamWithName(true, &m_WorkPower, prefix + "smartcrop_work_power")); - m_Params.push_back(ParamWithName(true, &m_Alpha, prefix + "smartcrop_alpha")); - m_Params.push_back(ParamWithName(true, &m_RoundCoeff, prefix + "smartcrop_round_coeff")); + m_Params.push_back(ParamWithName(&m_Static, prefix + "smartcrop_static", 1, eParamType::INTEGER, -1, 3)); + m_Params.push_back(ParamWithName(true, &m_Mode, prefix + "smartcrop_mode"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_Radial, prefix + "smartcrop_radial")); + m_Params.push_back(ParamWithName(true, &m_WorkRadius, prefix + "smartcrop_work_radius")); + m_Params.push_back(ParamWithName(true, &m_WorkPower, prefix + "smartcrop_work_power")); + m_Params.push_back(ParamWithName(true, &m_Alpha, prefix + "smartcrop_alpha")); + m_Params.push_back(ParamWithName(true, &m_RoundCoeff, prefix + "smartcrop_round_coeff")); m_Params.push_back(ParamWithName(true, &m_WorkRotation, prefix + "smartcrop_work_rotation")); m_Params.push_back(ParamWithName(true, true, &m_X, prefix + "smartcrop_x"));//State. m_Params.push_back(ParamWithName(true, true, &m_Y, prefix + "smartcrop_y")); @@ -4455,9 +4463,10 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * erf(vIn.x);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * erf(vIn.y);\n" + << "\t\tvOut.x = " << weight << " * erf(vIn.x);\n" + << "\t\tvOut.y = " << weight << " * erf(vIn.y);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -4487,11 +4496,12 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t r2 = Sqr(sqrt(precalcSumSquares + SQR(vIn.z)));\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (fabs(vIn.x) >= 2 ? vIn.x / r2 : erf(vIn.x));\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (fabs(vIn.y) >= 2 ? vIn.y / r2 : erf(vIn.y));\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * (fabs(vIn.z) >= 2 ? vIn.z / r2 : erf(vIn.z));\n" + << "\t\tvOut.x = " << weight << " * (fabs(vIn.x) >= 2 ? vIn.x / r2 : erf(vIn.x));\n" + << "\t\tvOut.y = " << weight << " * (fabs(vIn.y) >= 2 ? vIn.y / r2 : erf(vIn.y));\n" + << "\t\tvOut.z = " << weight << " * (fabs(vIn.z) >= 2 ? vIn.z / r2 : erf(vIn.z));\n" << "\t}\n"; return ss.str(); } @@ -4618,24 +4628,25 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string angle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string hypergon = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string hypergonN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string hypergonR = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string star = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string starN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string starSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string lituus = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string lituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string super = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string superM = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string superN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string superN2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string superN3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string invLituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc - string tanStarSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string hypergonD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string superM4th = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string angle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergon = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonR = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string star = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string starN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string starSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string lituus = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string lituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string super = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superM = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invLituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc + string tanStarSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superM4th = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string oneOverSuperN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t a = precalcAtanyx;\n" @@ -4721,15 +4732,15 @@ public: << "\t\t total2 += " << super << " * pow(pow(fabs(c), " << superN2 << ") + pow(fabs(s), " << superN3 << "), " << oneOverSuperN1 << ");\n" << "\t\t }\n" << "\n" - << "\t\t r = xform->m_VariationWeights[" << varIndex << "] * total2 * r / total;\n" + << "\t\t r = " << weight << " * total2 * r / total;\n" << "\t\t s = sincos(a2, &c);\n" << "\t\t vOut.x = r * c;\n" << "\t\t vOut.y = r * s;\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t}\n" << "\n" << "\t\tvOut.z = " << DefaultZCl() @@ -4761,24 +4772,24 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Angle, prefix + "w_angle", 0, eParamType::REAL_CYCLIC, T(-M_PI), T(M_PI))); - m_Params.push_back(ParamWithName(&m_Hypergon, prefix + "w_hypergon")); + m_Params.push_back(ParamWithName(&m_Angle, prefix + "w_angle", 0, eParamType::REAL_CYCLIC, T(-M_PI), T(M_PI))); + m_Params.push_back(ParamWithName(&m_Hypergon, prefix + "w_hypergon")); m_Params.push_back(ParamWithName(&m_HypergonN, prefix + "w_hypergon_n", 4, eParamType::INTEGER, 3)); m_Params.push_back(ParamWithName(&m_HypergonR, prefix + "w_hypergon_r", 1)); - m_Params.push_back(ParamWithName(&m_Star, prefix + "w_star")); - m_Params.push_back(ParamWithName(&m_StarN, prefix + "w_star_n", 5, eParamType::INTEGER, 3)); + m_Params.push_back(ParamWithName(&m_Star, prefix + "w_star")); + m_Params.push_back(ParamWithName(&m_StarN, prefix + "w_star_n", 5, eParamType::INTEGER, 3)); m_Params.push_back(ParamWithName(&m_StarSlope, prefix + "w_star_slope", 2, eParamType::REAL, EPS, T(M_PI_2))); - m_Params.push_back(ParamWithName(&m_Lituus, prefix + "w_lituus")); - m_Params.push_back(ParamWithName(&m_LituusA, prefix + "w_lituus_a", 1)); - m_Params.push_back(ParamWithName(&m_Super, prefix + "w_super")); - m_Params.push_back(ParamWithName(&m_SuperM, prefix + "w_super_m", 1)); - m_Params.push_back(ParamWithName(&m_SuperN1, prefix + "w_super_n1", 1)); - m_Params.push_back(ParamWithName(&m_SuperN2, prefix + "w_super_n2", 1)); - m_Params.push_back(ParamWithName(&m_SuperN3, prefix + "w_super_n3", 1)); - m_Params.push_back(ParamWithName(true, &m_InvLituusA, prefix + "w_inv_lituus_a"));//Precalc - m_Params.push_back(ParamWithName(true, &m_TanStarSlope, prefix + "w_tan_star_slope")); - m_Params.push_back(ParamWithName(true, &m_HypergonD, prefix + "w_hypergon_d")); - m_Params.push_back(ParamWithName(true, &m_SuperM4th, prefix + "w_super_m_4th")); + m_Params.push_back(ParamWithName(&m_Lituus, prefix + "w_lituus")); + m_Params.push_back(ParamWithName(&m_LituusA, prefix + "w_lituus_a", 1)); + m_Params.push_back(ParamWithName(&m_Super, prefix + "w_super")); + m_Params.push_back(ParamWithName(&m_SuperM, prefix + "w_super_m", 1)); + m_Params.push_back(ParamWithName(&m_SuperN1, prefix + "w_super_n1", 1)); + m_Params.push_back(ParamWithName(&m_SuperN2, prefix + "w_super_n2", 1)); + m_Params.push_back(ParamWithName(&m_SuperN3, prefix + "w_super_n3", 1)); + m_Params.push_back(ParamWithName(true, &m_InvLituusA, prefix + "w_inv_lituus_a"));//Precalc + m_Params.push_back(ParamWithName(true, &m_TanStarSlope, prefix + "w_tan_star_slope")); + m_Params.push_back(ParamWithName(true, &m_HypergonD, prefix + "w_hypergon_d")); + m_Params.push_back(ParamWithName(true, &m_SuperM4th, prefix + "w_super_m_4th")); m_Params.push_back(ParamWithName(true, &m_OneOverSuperN1, prefix + "w_one_over_super_n1")); } @@ -4869,23 +4880,24 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string hypergon = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string hypergonN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string hypergonR = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string star = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string starN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string starSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string lituus = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string lituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string super = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string superM = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string superN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string superN2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string superN3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string invLituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc - string tanStarSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string hypergonD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string superM4th = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string hypergon = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonR = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string star = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string starN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string starSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string lituus = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string lituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string super = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superM = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invLituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc + string tanStarSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superM4th = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string oneOverSuperN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t a = precalcAtanyx;\n" @@ -4927,7 +4939,7 @@ public: << "\t\t total += " << super << " * pow(pow(fabs(c), " << superN2 << ") + pow(fabs(s), " << superN3 << "), " << oneOverSuperN1 << ");\n" << "\t\t}\n" << "\n" - << "\t\tr = xform->m_VariationWeights[" << varIndex << "] * sqrt(precalcSumSquares + Sqr(total));\n" + << "\t\tr = " << weight << " * sqrt(precalcSumSquares + Sqr(total));\n" << "\t\ts = sincos(a, &c);\n" << "\t\tvOut.x = r * c;\n" << "\t\tvOut.y = r * s;\n" @@ -4960,23 +4972,23 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Hypergon, prefix + "x_hypergon")); - m_Params.push_back(ParamWithName(&m_HypergonN, prefix + "x_hypergon_n", 4, eParamType::INTEGER, 3)); - m_Params.push_back(ParamWithName(&m_HypergonR, prefix + "x_hypergon_r", 1)); - m_Params.push_back(ParamWithName(&m_Star, prefix + "x_star")); - m_Params.push_back(ParamWithName(&m_StarN, prefix + "x_star_n", 5, eParamType::INTEGER, 3)); - m_Params.push_back(ParamWithName(&m_StarSlope, prefix + "x_star_slope", 2, eParamType::REAL, EPS, T(M_PI_2))); - m_Params.push_back(ParamWithName(&m_Lituus, prefix + "x_lituus")); - m_Params.push_back(ParamWithName(&m_LituusA, prefix + "x_lituus_a", 1)); - m_Params.push_back(ParamWithName(&m_Super, prefix + "x_super")); - m_Params.push_back(ParamWithName(&m_SuperM, prefix + "x_super_m", 1)); - m_Params.push_back(ParamWithName(&m_SuperN1, prefix + "x_super_n1", 1)); - m_Params.push_back(ParamWithName(&m_SuperN2, prefix + "x_super_n2", 1)); - m_Params.push_back(ParamWithName(&m_SuperN3, prefix + "x_super_n3", 1)); - m_Params.push_back(ParamWithName(true, &m_InvLituusA, prefix + "x_inv_lituus_a"));//Precalc - m_Params.push_back(ParamWithName(true, &m_TanStarSlope, prefix + "x_tan_star_slope")); - m_Params.push_back(ParamWithName(true, &m_HypergonD, prefix + "x_hypergon_d")); - m_Params.push_back(ParamWithName(true, &m_SuperM4th, prefix + "x_super_m_4th")); + m_Params.push_back(ParamWithName(&m_Hypergon, prefix + "x_hypergon")); + m_Params.push_back(ParamWithName(&m_HypergonN, prefix + "x_hypergon_n", 4, eParamType::INTEGER, 3)); + m_Params.push_back(ParamWithName(&m_HypergonR, prefix + "x_hypergon_r", 1)); + m_Params.push_back(ParamWithName(&m_Star, prefix + "x_star")); + m_Params.push_back(ParamWithName(&m_StarN, prefix + "x_star_n", 5, eParamType::INTEGER, 3)); + m_Params.push_back(ParamWithName(&m_StarSlope, prefix + "x_star_slope", 2, eParamType::REAL, EPS, T(M_PI_2))); + m_Params.push_back(ParamWithName(&m_Lituus, prefix + "x_lituus")); + m_Params.push_back(ParamWithName(&m_LituusA, prefix + "x_lituus_a", 1)); + m_Params.push_back(ParamWithName(&m_Super, prefix + "x_super")); + m_Params.push_back(ParamWithName(&m_SuperM, prefix + "x_super_m", 1)); + m_Params.push_back(ParamWithName(&m_SuperN1, prefix + "x_super_n1", 1)); + m_Params.push_back(ParamWithName(&m_SuperN2, prefix + "x_super_n2", 1)); + m_Params.push_back(ParamWithName(&m_SuperN3, prefix + "x_super_n3", 1)); + m_Params.push_back(ParamWithName(true, &m_InvLituusA, prefix + "x_inv_lituus_a"));//Precalc + m_Params.push_back(ParamWithName(true, &m_TanStarSlope, prefix + "x_tan_star_slope")); + m_Params.push_back(ParamWithName(true, &m_HypergonD, prefix + "x_hypergon_d")); + m_Params.push_back(ParamWithName(true, &m_SuperM4th, prefix + "x_super_m_4th")); m_Params.push_back(ParamWithName(true, &m_OneOverSuperN1, prefix + "x_one_over_super_n1")); } @@ -5066,23 +5078,24 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string hypergon = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string hypergonN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string hypergonR = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string star = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string starN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string starSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string lituus = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string lituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string super = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string superM = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string superN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string superN2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string superN3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string invLituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc - string tanStarSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string hypergonD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string superM4th = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string hypergon = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonR = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string star = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string starN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string starSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string lituus = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string lituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string super = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superM = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invLituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc + string tanStarSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superM4th = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string oneOverSuperN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t a = precalcAtanyx;\n" @@ -5124,7 +5137,7 @@ public: << "\t\t total += " << super << " * pow(pow(fabs(c), " << superN2 << ") + pow(fabs(s), " << superN3 << "), " << oneOverSuperN1 << ");\n" << "\t\t}\n" << "\n" - << "\t\tr = xform->m_VariationWeights[" << varIndex << "] * Sqr(total) / precalcSqrtSumSquares;\n" + << "\t\tr = " << weight << " * Sqr(total) / precalcSqrtSumSquares;\n" << "\t\ts = sincos(a, &c);\n" << "\t\tvOut.x = r * c;\n" << "\t\tvOut.y = r * s;\n" @@ -5157,23 +5170,23 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Hypergon, prefix + "y_hypergon")); - m_Params.push_back(ParamWithName(&m_HypergonN, prefix + "y_hypergon_n", 4, eParamType::INTEGER, 3)); - m_Params.push_back(ParamWithName(&m_HypergonR, prefix + "y_hypergon_r", 1)); - m_Params.push_back(ParamWithName(&m_Star, prefix + "y_star")); - m_Params.push_back(ParamWithName(&m_StarN, prefix + "y_star_n", 5, eParamType::INTEGER, 3)); - m_Params.push_back(ParamWithName(&m_StarSlope, prefix + "y_star_slope", 2, eParamType::REAL, EPS, T(M_PI_2))); - m_Params.push_back(ParamWithName(&m_Lituus, prefix + "y_lituus")); - m_Params.push_back(ParamWithName(&m_LituusA, prefix + "y_lituus_a", 1)); - m_Params.push_back(ParamWithName(&m_Super, prefix + "y_super")); - m_Params.push_back(ParamWithName(&m_SuperM, prefix + "y_super_m", 1)); - m_Params.push_back(ParamWithName(&m_SuperN1, prefix + "y_super_n1", 1)); - m_Params.push_back(ParamWithName(&m_SuperN2, prefix + "y_super_n2", 1)); - m_Params.push_back(ParamWithName(&m_SuperN3, prefix + "y_super_n3", 1)); - m_Params.push_back(ParamWithName(true, &m_InvLituusA, prefix + "y_inv_lituus_a"));//Precalc - m_Params.push_back(ParamWithName(true, &m_TanStarSlope, prefix + "y_tan_star_slope")); - m_Params.push_back(ParamWithName(true, &m_HypergonD, prefix + "y_hypergon_d")); - m_Params.push_back(ParamWithName(true, &m_SuperM4th, prefix + "y_super_m_4th")); + m_Params.push_back(ParamWithName(&m_Hypergon, prefix + "y_hypergon")); + m_Params.push_back(ParamWithName(&m_HypergonN, prefix + "y_hypergon_n", 4, eParamType::INTEGER, 3)); + m_Params.push_back(ParamWithName(&m_HypergonR, prefix + "y_hypergon_r", 1)); + m_Params.push_back(ParamWithName(&m_Star, prefix + "y_star")); + m_Params.push_back(ParamWithName(&m_StarN, prefix + "y_star_n", 5, eParamType::INTEGER, 3)); + m_Params.push_back(ParamWithName(&m_StarSlope, prefix + "y_star_slope", 2, eParamType::REAL, EPS, T(M_PI_2))); + m_Params.push_back(ParamWithName(&m_Lituus, prefix + "y_lituus")); + m_Params.push_back(ParamWithName(&m_LituusA, prefix + "y_lituus_a", 1)); + m_Params.push_back(ParamWithName(&m_Super, prefix + "y_super")); + m_Params.push_back(ParamWithName(&m_SuperM, prefix + "y_super_m", 1)); + m_Params.push_back(ParamWithName(&m_SuperN1, prefix + "y_super_n1", 1)); + m_Params.push_back(ParamWithName(&m_SuperN2, prefix + "y_super_n2", 1)); + m_Params.push_back(ParamWithName(&m_SuperN3, prefix + "y_super_n3", 1)); + m_Params.push_back(ParamWithName(true, &m_InvLituusA, prefix + "y_inv_lituus_a"));//Precalc + m_Params.push_back(ParamWithName(true, &m_TanStarSlope, prefix + "y_tan_star_slope")); + m_Params.push_back(ParamWithName(true, &m_HypergonD, prefix + "y_hypergon_d")); + m_Params.push_back(ParamWithName(true, &m_SuperM4th, prefix + "y_super_m_4th")); m_Params.push_back(ParamWithName(true, &m_OneOverSuperN1, prefix + "y_one_over_super_n1")); } @@ -5263,23 +5276,24 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string hypergon = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string hypergonN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string hypergonR = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string star = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string starN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string starSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string lituus = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string lituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string super = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string superM = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string superN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string superN2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string superN3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string invLituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc - string tanStarSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string hypergonD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string superM4th = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string hypergon = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonR = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string star = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string starN = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string starSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string lituus = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string lituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string super = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superM = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superN3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string invLituusA = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc + string tanStarSlope = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string hypergonD = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string superM4th = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string oneOverSuperN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t a = precalcAtanyx;\n" @@ -5322,7 +5336,7 @@ public: << "\t\t total += " << super << " * pow(pow(fabs(c), " << superN2 << ") + pow(fabs(s), " << superN3 << "), " << oneOverSuperN1 << ");\n" << "\t\t}\n" << "\n" - << "\t\tr = xform->m_VariationWeights[" << varIndex << "] * (precalcSqrtSumSquares + total);\n" + << "\t\tr = " << weight << " * (precalcSqrtSumSquares + total);\n" << "\t\ts = sincos(a, &c);\n" << "\t\tvOut.x = r * c;\n" << "\t\tvOut.y = r * s;\n" @@ -5355,23 +5369,23 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Hypergon, prefix + "z_hypergon")); - m_Params.push_back(ParamWithName(&m_HypergonN, prefix + "z_hypergon_n", 4, eParamType::INTEGER, 3)); - m_Params.push_back(ParamWithName(&m_HypergonR, prefix + "z_hypergon_r", 1)); - m_Params.push_back(ParamWithName(&m_Star, prefix + "z_star")); - m_Params.push_back(ParamWithName(&m_StarN, prefix + "z_star_n", 5, eParamType::INTEGER, 3)); - m_Params.push_back(ParamWithName(&m_StarSlope, prefix + "z_star_slope", 2, eParamType::REAL, EPS, T(M_PI_2))); - m_Params.push_back(ParamWithName(&m_Lituus, prefix + "z_lituus")); - m_Params.push_back(ParamWithName(&m_LituusA, prefix + "z_lituus_a", 1)); - m_Params.push_back(ParamWithName(&m_Super, prefix + "z_super")); - m_Params.push_back(ParamWithName(&m_SuperM, prefix + "z_super_m", 1)); - m_Params.push_back(ParamWithName(&m_SuperN1, prefix + "z_super_n1", 1)); - m_Params.push_back(ParamWithName(&m_SuperN2, prefix + "z_super_n2", 1)); - m_Params.push_back(ParamWithName(&m_SuperN3, prefix + "z_super_n3", 1)); - m_Params.push_back(ParamWithName(true, &m_InvLituusA, prefix + "z_inv_lituus_a"));//Precalc - m_Params.push_back(ParamWithName(true, &m_TanStarSlope, prefix + "z_tan_star_slope")); - m_Params.push_back(ParamWithName(true, &m_HypergonD, prefix + "z_hypergon_d")); - m_Params.push_back(ParamWithName(true, &m_SuperM4th, prefix + "z_super_m_4th")); + m_Params.push_back(ParamWithName(&m_Hypergon, prefix + "z_hypergon")); + m_Params.push_back(ParamWithName(&m_HypergonN, prefix + "z_hypergon_n", 4, eParamType::INTEGER, 3)); + m_Params.push_back(ParamWithName(&m_HypergonR, prefix + "z_hypergon_r", 1)); + m_Params.push_back(ParamWithName(&m_Star, prefix + "z_star")); + m_Params.push_back(ParamWithName(&m_StarN, prefix + "z_star_n", 5, eParamType::INTEGER, 3)); + m_Params.push_back(ParamWithName(&m_StarSlope, prefix + "z_star_slope", 2, eParamType::REAL, EPS, T(M_PI_2))); + m_Params.push_back(ParamWithName(&m_Lituus, prefix + "z_lituus")); + m_Params.push_back(ParamWithName(&m_LituusA, prefix + "z_lituus_a", 1)); + m_Params.push_back(ParamWithName(&m_Super, prefix + "z_super")); + m_Params.push_back(ParamWithName(&m_SuperM, prefix + "z_super_m", 1)); + m_Params.push_back(ParamWithName(&m_SuperN1, prefix + "z_super_n1", 1)); + m_Params.push_back(ParamWithName(&m_SuperN2, prefix + "z_super_n2", 1)); + m_Params.push_back(ParamWithName(&m_SuperN3, prefix + "z_super_n3", 1)); + m_Params.push_back(ParamWithName(true, &m_InvLituusA, prefix + "z_inv_lituus_a"));//Precalc + m_Params.push_back(ParamWithName(true, &m_TanStarSlope, prefix + "z_tan_star_slope")); + m_Params.push_back(ParamWithName(true, &m_HypergonD, prefix + "z_hypergon_d")); + m_Params.push_back(ParamWithName(true, &m_SuperM4th, prefix + "z_super_m_4th")); m_Params.push_back(ParamWithName(true, &m_OneOverSuperN1, prefix + "z_one_over_super_n1")); } diff --git a/Source/Ember/Variations07.h b/Source/Ember/Variations07.h index a07f9c7..c08ff5a 100644 --- a/Source/Ember/Variations07.h +++ b/Source/Ember/Variations07.h @@ -42,24 +42,25 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string z = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tif (vIn.x >= 0)\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + " << x << ");\n" + << "\t\t vOut.x = " << weight << " * (vIn.x + " << x << ");\n" << "\t\telse\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x - " << x << ");\n" + << "\t\t vOut.x = " << weight << " * (vIn.x - " << x << ");\n" << "\n" << "\t\tif (vIn.y >= 0)\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + " << y << ");\n" + << "\t\t vOut.y = " << weight << " * (vIn.y + " << y << ");\n" << "\t\telse\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y - " << y << ");\n" + << "\t\t vOut.y = " << weight << " * (vIn.y - " << y << ");\n" << "\n" << "\t\tif (vIn.z >= 0)\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * (vIn.z + " << z << ");\n" + << "\t\t vOut.z = " << weight << " * (vIn.z + " << z << ");\n" << "\t\telse\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * (vIn.z - " << z << ");\n" + << "\t\t vOut.z = " << weight << " * (vIn.z - " << z << ");\n" << "\t}\n"; return ss.str(); } @@ -152,18 +153,19 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string freqx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string freqy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string pwx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string pwy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string scalex = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string freqx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string freqy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string pwx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string pwy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scalex = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string scaleinfx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string scaley = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scaley = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string scaleinfy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string unity = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string jacok = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string six = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. - string siy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string unity = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string jacok = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string six = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. + string siy = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t CsX = 1;\n" << "\t\treal_t CsY = 1;\n" @@ -176,22 +178,22 @@ public: << "\t\tif (" << pwx << " >= 0 && " << pwx << " < 1e-4)\n" << "\t\t{\n" << "\t\t JacobiElliptic(vIn.y * " << freqx << ", " << jacok << ", &jcbSn, &jcbCn, &jcbDn);\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + CsX * jcbSn);\n" + << "\t\t vOut.x = " << weight << " * (vIn.x + CsX * jcbSn);\n" << "\t\t}\n" //<< "\t\telse if (" << pwx << " < 0 && " << pwx << " > -1e-4)\n" - //<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + CsX * _j1(vIn.y * " << freqx << "));\n"//This is not implemented in OpenCL. + //<< "\t\t vOut.x = " << weight << " * (vIn.x + CsX * _j1(vIn.y * " << freqx << "));\n"//This is not implemented in OpenCL. << "\t\telse\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + CsX * sin(SignNz(vIn.y) * pow(Zeps(fabs(vIn.y)), " << pwx << ") * " << freqx << "));\n" + << "\t\t vOut.x = " << weight << " * (vIn.x + CsX * sin(SignNz(vIn.y) * pow(Zeps(fabs(vIn.y)), " << pwx << ") * " << freqx << "));\n" << "\n" << "\t\tif (" << pwy << " >= 0 && " << pwy << " < 1e-4)\n" << "\t\t{\n" << "\t\t JacobiElliptic(vIn.x * " << freqy << ", " << jacok << ", &jcbSn, &jcbCn, &jcbDn);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + CsY * jcbSn);\n" + << "\t\t vOut.y = " << weight << " * (vIn.y + CsY * jcbSn);\n" << "\t\t}\n" //<< "\t\telse if (" << pwy << " < 0 && " << pwy << " > -1e-4)\n" - //<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + CsY * _j1(vIn.x * " << freqy << "));\n"//This is not implemented in OpenCL. + //<< "\t\t vOut.y = " << weight << " * (vIn.y + CsY * _j1(vIn.x * " << freqy << "));\n"//This is not implemented in OpenCL. << "\t\telse\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + CsY * sin(SignNz(vIn.x) * pow(Zeps(fabs(vIn.x)), " << pwy << ") * " << freqy << "));\n" + << "\t\t vOut.y = " << weight << " * (vIn.y + CsY * sin(SignNz(vIn.x) * pow(Zeps(fabs(vIn.x)), " << pwy << ") * " << freqy << "));\n" << "\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; @@ -214,16 +216,16 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Freqx, prefix + "waves2b_freqx", 2)); - m_Params.push_back(ParamWithName(&m_Freqy, prefix + "waves2b_freqy", 2)); - m_Params.push_back(ParamWithName(&m_Pwx, prefix + "waves2b_pwx", 1, eParamType::REAL, -10, 10)); - m_Params.push_back(ParamWithName(&m_Pwy, prefix + "waves2b_pwy", 1, eParamType::REAL, -10, 10)); - m_Params.push_back(ParamWithName(&m_Scalex, prefix + "waves2b_scalex", 1)); + m_Params.push_back(ParamWithName(&m_Freqx, prefix + "waves2b_freqx", 2)); + m_Params.push_back(ParamWithName(&m_Freqy, prefix + "waves2b_freqy", 2)); + m_Params.push_back(ParamWithName(&m_Pwx, prefix + "waves2b_pwx", 1, eParamType::REAL, -10, 10)); + m_Params.push_back(ParamWithName(&m_Pwy, prefix + "waves2b_pwy", 1, eParamType::REAL, -10, 10)); + m_Params.push_back(ParamWithName(&m_Scalex, prefix + "waves2b_scalex", 1)); m_Params.push_back(ParamWithName(&m_Scaleinfx, prefix + "waves2b_scaleinfx", 1)); - m_Params.push_back(ParamWithName(&m_Scaley, prefix + "waves2b_scaley", 1)); + m_Params.push_back(ParamWithName(&m_Scaley, prefix + "waves2b_scaley", 1)); m_Params.push_back(ParamWithName(&m_Scaleinfy, prefix + "waves2b_scaleinfy", 1)); - m_Params.push_back(ParamWithName(&m_Unity, prefix + "waves2b_unity", 1)); - m_Params.push_back(ParamWithName(&m_Jacok, prefix + "waves2b_jacok", T(0.25), eParamType::REAL, -1, 1)); + m_Params.push_back(ParamWithName(&m_Unity, prefix + "waves2b_unity", 1)); + m_Params.push_back(ParamWithName(&m_Jacok, prefix + "waves2b_jacok", T(0.25), eParamType::REAL, -1, 1)); m_Params.push_back(ParamWithName(true, &m_Six, prefix + "waves2b_six"));//Precalc. m_Params.push_back(ParamWithName(true, &m_Siy, prefix + "waves2b_siy")); } @@ -279,6 +281,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string k = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t snx, cnx, dnx;\n" @@ -289,7 +292,7 @@ public: << "\t\tnumX = cnx * cny;\n" << "\t\tnumY = -dnx * snx * dny * sny;\n" << "\t\tdenom = SQR(snx) * SQR(sny) * " << k << " + SQR(cny);\n" - << "\t\tdenom = xform->m_VariationWeights[" << varIndex << "] / Zeps(denom);\n" + << "\t\tdenom = " << weight << " / Zeps(denom);\n" << "\t\tvOut.x = denom * numX;\n" << "\t\tvOut.y = denom * numY;\n" << "\t\tvOut.z = " << DefaultZCl() @@ -350,6 +353,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string k = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t snx, cnx, dnx;\n" @@ -360,7 +364,7 @@ public: << "\t\tnumX = dnx * cny * dny;\n" << "\t\tnumY = -cnx * snx * sny * " << k << ";\n" << "\t\tdenom = SQR(snx) * SQR(sny) * " << k << " + SQR(cny);\n" - << "\t\tdenom = xform->m_VariationWeights[" << varIndex << "] / Zeps(denom);\n" + << "\t\tdenom = " << weight << " / Zeps(denom);\n" << "\t\tvOut.x = denom * numX;\n" << "\t\tvOut.y = denom * numY;\n" << "\t\tvOut.z = " << DefaultZCl() @@ -421,6 +425,7 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string k = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t snx, cnx, dnx;\n" @@ -431,7 +436,7 @@ public: << "\t\tnumX = snx * dny;\n" << "\t\tnumY = cnx * dnx * cny * sny;\n" << "\t\tdenom = SQR(snx) * SQR(sny) * " << k << " + SQR(cny);\n" - << "\t\tdenom = xform->m_VariationWeights[" << varIndex << "] / Zeps(denom);\n" + << "\t\tdenom = " << weight << " / Zeps(denom);\n" << "\t\tvOut.x = denom * numX;\n" << "\t\tvOut.y = denom * numY;\n" << "\t\tvOut.z = " << DefaultZCl() @@ -483,11 +488,12 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + (1 / Zeps(" << x << " * M_2PI)) * sin(" << x << " * M_2PI * vIn.x));\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + (1 / Zeps(" << y << " * M_2PI)) * sin(" << y << " * M_2PI * vIn.y));\n" + << "\t\tvOut.x = " << weight << " * (vIn.x + (1 / Zeps(" << x << " * M_2PI)) * sin(" << x << " * M_2PI * vIn.x));\n" + << "\t\tvOut.y = " << weight << " * (vIn.y + (1 / Zeps(" << y << " * M_2PI)) * sin(" << y << " * M_2PI * vIn.y));\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -536,11 +542,12 @@ public: { ostringstream ss, ss2; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * lgamma(precalcSqrtSumSquares);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * precalcAtanyx;\n" + << "\t\tvOut.x = " << weight << " * lgamma(precalcSqrtSumSquares);\n" + << "\t\tvOut.y = " << weight << " * precalcAtanyx;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -582,12 +589,12 @@ public: if (m_OptDir < 0) { - wag = std::sin(curve1 * T(M_PI) * m_AbsOptSc) + m_Wagsc * T(0.4) * rad + m_Crvsc * T(0.5) * (std::sin(curve2 * T(M_PI))); + wag = std::sin(curve1 * T(M_PI) * m_AbsOptSc) + m_Wagsc * T(0.4) * rad + m_Crvsc * T(0.5) * (std::sin(curve2 * T(M_PI))); wag3 = std::sin(curve4 * T(M_PI) * m_AbsOptSc) + m_Wagsc * SQR(rad) * T(0.4) + m_Crvsc * T(0.5) * (std::cos(curve3 * T(M_PI))); } else { - wag = std::sin(curve1 * T(M_PI) * m_AbsOptSc) + m_Wagsc * T(0.4) * rad + m_Crvsc * T(0.5) * (std::cos(curve3 * T(M_PI))); + wag = std::sin(curve1 * T(M_PI) * m_AbsOptSc) + m_Wagsc * T(0.4) * rad + m_Crvsc * T(0.5) * (std::cos(curve3 * T(M_PI))); wag3 = std::sin(curve4 * T(M_PI) * m_AbsOptSc) + m_Wagsc * SQR(rad) * T(0.4) + m_Crvsc * T(0.5) * (std::sin(curve2 * T(M_PI))); } @@ -643,33 +650,34 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string l = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string k = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string z1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string z2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string refSc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string opt = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string optSc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string opt3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string transp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string wagsc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string crvsc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string f = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string wigsc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string offset = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cycle = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. - string optDir = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string l = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string k = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string z1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string z2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string refSc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string opt = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string optSc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string opt3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string transp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string dist = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string wagsc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string crvsc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string f = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string wigsc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string offset = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cycle = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. + string optDir = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string petalsSign = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string numPetals = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string absOptSc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string smooth12 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string smooth3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string antiOpt1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ghost = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string freq = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string wigScale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string numPetals = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string absOptSc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string smooth12 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string smooth3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string antiOpt1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ghost = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string freq = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string wigScale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tint posNeg = 1;\n" << "\t\treal_t th = 0;\n" @@ -717,30 +725,30 @@ public: << "\t\t{\n" << "\t\t if (posNeg < 0)\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * 0.5 * " << refSc << " * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * cth;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * 0.5 * " << refSc << " * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * sth;\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * -0.5 * ((" << z2 << " * waggle + Sqr(rad * 0.5) * sin(wig) * " << wigScale << ") + " << dist << ");\n" + << "\t\t vOut.x = " << weight << " * 0.5 * " << refSc << " * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * cth;\n" + << "\t\t vOut.y = " << weight << " * 0.5 * " << refSc << " * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * sth;\n" + << "\t\t vOut.z = " << weight << " * -0.5 * ((" << z2 << " * waggle + Sqr(rad * 0.5) * sin(wig) * " << wigScale << ") + " << dist << ");\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * 0.5 * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * cth;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * 0.5 * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * sth;\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * 0.5 * ((" << z1 << " * waggle + Sqr(rad * 0.5) * sin(wig) * " << wigScale << ") + " << dist << ");\n" + << "\t\t vOut.x = " << weight << " * 0.5 * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * cth;\n" + << "\t\t vOut.y = " << weight << " * 0.5 * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * sth;\n" + << "\t\t vOut.z = " << weight << " * 0.5 * ((" << z1 << " * waggle + Sqr(rad * 0.5) * sin(wig) * " << wigScale << ") + " << dist << ");\n" << "\t\t }\n" << "\t\t}\n" << "\t\telse\n" << "\t\t{\n" << "\t\t if (posNeg < 0)\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * 0.5 * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * cth;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * 0.5 * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * sth;\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * 0.5 * ((" << z1 << " * waggle + Sqr(rad * 0.5) * sin(wig) * " << wigScale << ") + " << dist << ");\n" + << "\t\t vOut.x = " << weight << " * 0.5 * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * cth;\n" + << "\t\t vOut.y = " << weight << " * 0.5 * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * sth;\n" + << "\t\t vOut.z = " << weight << " * 0.5 * ((" << z1 << " * waggle + Sqr(rad * 0.5) * sin(wig) * " << wigScale << ") + " << dist << ");\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * 0.5 * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * cth;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * 0.5 * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * sth;\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * 0.5 * ((" << z1 << " * waggle + Sqr(rad * 0.5) * sin(wig) * " << wigScale << ") + " << dist << ");\n" + << "\t\t vOut.x = " << weight << " * 0.5 * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * cth;\n" + << "\t\t vOut.y = " << weight << " * 0.5 * (" << l << " * cos(" << numPetals << " * th + " << c << ")) * sth;\n" + << "\t\t vOut.z = " << weight << " * 0.5 * ((" << z1 << " * waggle + Sqr(rad * 0.5) * sin(wig) * " << wigScale << ") + " << dist << ");\n" << "\t\t }\n" << "\t\t}\n" << "\t}\n"; @@ -791,32 +799,32 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_L, prefix + "pRose3D_l", 1, eParamType::REAL_NONZERO)); - m_Params.push_back(ParamWithName(&m_K, prefix + "pRose3D_k", 3)); - m_Params.push_back(ParamWithName(&m_C, prefix + "pRose3D_c")); - m_Params.push_back(ParamWithName(&m_Z1, prefix + "pRose3D_z1", 1)); - m_Params.push_back(ParamWithName(&m_Z2, prefix + "pRose3D_z2", 1)); - m_Params.push_back(ParamWithName(&m_RefSc, prefix + "pRose3D_refSc", 1)); - m_Params.push_back(ParamWithName(&m_Opt, prefix + "pRose3D_opt", 1)); - m_Params.push_back(ParamWithName(&m_OptSc, prefix + "pRose3D_optSc", 1)); - m_Params.push_back(ParamWithName(&m_Opt3, prefix + "pRose3D_opt3")); + m_Params.push_back(ParamWithName(&m_K, prefix + "pRose3D_k", 3)); + m_Params.push_back(ParamWithName(&m_C, prefix + "pRose3D_c")); + m_Params.push_back(ParamWithName(&m_Z1, prefix + "pRose3D_z1", 1)); + m_Params.push_back(ParamWithName(&m_Z2, prefix + "pRose3D_z2", 1)); + m_Params.push_back(ParamWithName(&m_RefSc, prefix + "pRose3D_refSc", 1)); + m_Params.push_back(ParamWithName(&m_Opt, prefix + "pRose3D_opt", 1)); + m_Params.push_back(ParamWithName(&m_OptSc, prefix + "pRose3D_optSc", 1)); + m_Params.push_back(ParamWithName(&m_Opt3, prefix + "pRose3D_opt3")); m_Params.push_back(ParamWithName(&m_Transp, prefix + "pRose3D_transp", T(0.5))); - m_Params.push_back(ParamWithName(&m_Dist, prefix + "pRose3D_dist", 1)); - m_Params.push_back(ParamWithName(&m_Wagsc, prefix + "pRose3D_wagsc", 0)); - m_Params.push_back(ParamWithName(&m_Crvsc, prefix + "pRose3D_crvsc", 0)); - m_Params.push_back(ParamWithName(&m_F, prefix + "pRose3D_f", 3)); - m_Params.push_back(ParamWithName(&m_Wigsc, prefix + "pRose3D_wigsc")); + m_Params.push_back(ParamWithName(&m_Dist, prefix + "pRose3D_dist", 1)); + m_Params.push_back(ParamWithName(&m_Wagsc, prefix + "pRose3D_wagsc", 0)); + m_Params.push_back(ParamWithName(&m_Crvsc, prefix + "pRose3D_crvsc", 0)); + m_Params.push_back(ParamWithName(&m_F, prefix + "pRose3D_f", 3)); + m_Params.push_back(ParamWithName(&m_Wigsc, prefix + "pRose3D_wigsc")); m_Params.push_back(ParamWithName(&m_Offset, prefix + "pRose3D_offset")); - m_Params.push_back(ParamWithName(true, &m_Cycle, prefix + "pRose3D_cycle")); - m_Params.push_back(ParamWithName(true, &m_OptDir, prefix + "pRose3D_opt_dir")); + m_Params.push_back(ParamWithName(true, &m_Cycle, prefix + "pRose3D_cycle")); + m_Params.push_back(ParamWithName(true, &m_OptDir, prefix + "pRose3D_opt_dir")); m_Params.push_back(ParamWithName(true, &m_PetalsSign, prefix + "pRose3D_petals_sign")); - m_Params.push_back(ParamWithName(true, &m_NumPetals, prefix + "pRose3D_num_petals")); - m_Params.push_back(ParamWithName(true, &m_AbsOptSc, prefix + "pRose3D_abs_optSc")); - m_Params.push_back(ParamWithName(true, &m_Smooth12, prefix + "pRose3D_smooth12")); - m_Params.push_back(ParamWithName(true, &m_Smooth3, prefix + "pRose3D_smooth3")); - m_Params.push_back(ParamWithName(true, &m_AntiOpt1, prefix + "pRose3D_anti_opt1")); - m_Params.push_back(ParamWithName(true, &m_Ghost, prefix + "pRose3D_ghost")); - m_Params.push_back(ParamWithName(true, &m_Freq, prefix + "pRose3D_freq")); - m_Params.push_back(ParamWithName(true, &m_WigScale, prefix + "pRose3D_wig_scale")); + m_Params.push_back(ParamWithName(true, &m_NumPetals, prefix + "pRose3D_num_petals")); + m_Params.push_back(ParamWithName(true, &m_AbsOptSc, prefix + "pRose3D_abs_optSc")); + m_Params.push_back(ParamWithName(true, &m_Smooth12, prefix + "pRose3D_smooth12")); + m_Params.push_back(ParamWithName(true, &m_Smooth3, prefix + "pRose3D_smooth3")); + m_Params.push_back(ParamWithName(true, &m_AntiOpt1, prefix + "pRose3D_anti_opt1")); + m_Params.push_back(ParamWithName(true, &m_Ghost, prefix + "pRose3D_ghost")); + m_Params.push_back(ParamWithName(true, &m_Freq, prefix + "pRose3D_freq")); + m_Params.push_back(ParamWithName(true, &m_WigScale, prefix + "pRose3D_wig_scale")); } private: @@ -892,10 +900,11 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string base = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string base = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string fixPeriod = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string denom = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string fixPe = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string denom = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string fixPe = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\tint i, adp;\n" << "\t\treal_t atanPeriod = 0;\n" @@ -912,8 +921,8 @@ public: << "\n" << "\t\tatanPeriod *= " << fixPe << ";\n" << "\t\tvOut.x = " << denom << " * log(precalcSumSquares);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (precalcAtanyx + atanPeriod);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.y = " << weight << " * (precalcAtanyx + atanPeriod);\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t}\n"; return ss.str(); } @@ -936,8 +945,8 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Base, prefix + "log_db_base", 1)); - m_Params.push_back(ParamWithName(&m_FixPeriod, prefix + "log_db_fix_period", 1)); + m_Params.push_back(ParamWithName(&m_Base, prefix + "log_db_base", 1)); + m_Params.push_back(ParamWithName(&m_FixPeriod, prefix + "log_db_fix_period", 1)); m_Params.push_back(ParamWithName(true, &m_Denom, prefix + "log_db_denom")); m_Params.push_back(ParamWithName(true, &m_FixPe, prefix + "log_db_fix_pe")); } @@ -992,8 +1001,9 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string cs_radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cs_split = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cs_split = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t x1, y1;\n" << "\n" @@ -1009,8 +1019,8 @@ public: << "\t\t\tx1 = cos(a) * len;\n" << "\t\t\ty1 = sin(a) * len;\n" << "\t\t}" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * x1;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * y1;\n" + << "\t\tvOut.x = " << weight << " * x1;\n" + << "\t\tvOut.y = " << weight << " * y1;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -1022,7 +1032,7 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Radius, prefix + "circlesplit_radius", 1)); - m_Params.push_back(ParamWithName(&m_Split, prefix + "circlesplit_split", T(0.5))); + m_Params.push_back(ParamWithName(&m_Split, prefix + "circlesplit_split", T(0.5))); } private: @@ -1054,10 +1064,11 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x / Zeps(sqrt(SQR(vIn.x) + (real_t)1.0)));\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\tvOut.x = " << weight << " * (vIn.x / Zeps(sqrt(SQR(vIn.x) + (real_t)1.0)));\n" + << "\t\tvOut.y = " << weight << " * vIn.y;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -1099,12 +1110,13 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string spread = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t temp = (real_t) (Round(log(MwcNext01(mwc)) * (MwcNext(mwc) & 1 ? " << spread << " : -" << spread << ")));\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + temp);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\tvOut.x = " << weight << " * (vIn.x + temp);\n" + << "\t\tvOut.y = " << weight << " * vIn.y;\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -1235,105 +1247,106 @@ public: intmax_t i = 0; ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string exponent = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string arcWidth = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string seed = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string exponent = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string arcWidth = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string seed = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string finalexponent = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string oneOverEx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string width = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string seed2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string rmax = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - ss << "\t{\n" - << "\t\treal_t modbase = 65535;\n" - << "\t\treal_t multiplier = 32747;\n" - << "\t\treal_t offset = 12345;\n" - << "\n" - << "\t\treal_t x = vIn.x * " << scale << ";\n" - << "\t\treal_t y = vIn.y * " << scale << ";\n" - << "\t\treal_t intx = Round(x);\n" - << "\t\treal_t inty = Round(y);\n" - << "\n" - << "\t\treal_t r = x - intx;\n" - << "\n" - << "\t\tif (r < 0)\n" - << "\t\t\tx = r + 1;\n" - << "\t\telse\n" - << "\t\t\tx = r;\n" - << "\n" - << "\t\tr = y - inty;\n" - << "\n" - << "\t\tif (r < 0)\n" - << "\t\t\ty = r + 1;\n" - << "\t\telse\n" - << "\t\t\ty = r;\n" - << "\n" - << "\t\treal_t tiletype = 0;\n" - << "\n" - << "\t\tif (" << seed << " != 0)\n" - << "\t\t{\n" - << "\t\t\tif (" << seed << " == 1)\n" - << "\t\t\t{\n" - << "\t\t\t\ttiletype = " << seed << ";\n" - << "\t\t\t}\n" - << "\t\t\telse\n" - << "\t\t\t{\n" - << "\t\t\t\treal_t xrand = vIn.x;\n" - << "\t\t\t\treal_t yrand = vIn.y;\n" - << "\n" - << "\t\t\t\txrand = Round(fabs(xrand)) * " << seed2 << ";\n" - << "\t\t\t\tyrand = Round(fabs(yrand)) * " << seed2 << ";\n" - << "\n" - << "\t\t\t\treal_t niter = xrand + yrand + (xrand * yrand);\n" - << "\t\t\t\treal_t randint = (" << seed << " + niter) * " << seed2 << " * ((real_t) 0.5);\n" - << "\n" - << "\t\t\t\trandint = fmod((randint * multiplier + offset), modbase);\n" - << "\t\t\t\ttiletype = fmod(randint, 2);\n" - << "\t\t\t}\n" - << "\t\t}\n" - << "\n" - << "\t\treal_t r0, r1;\n" - << "\n" - << "\t\tif (tiletype < 1)\n" - << "\t\t{\n" - << "\t\t\tr0 = pow((pow(fabs(x), " << finalexponent << ") + pow(fabs(y), " << finalexponent << ")), " << oneOverEx << ");\n" - << "\t\t\tr1 = pow((pow(fabs(x-1), " << finalexponent << ") + pow(fabs(y-1), " << finalexponent << ")), " << oneOverEx << ");\n" - << "\t\t}\n" - << "\t\telse\n" - << "\t\t{\n" - << "\t\t\tr0 = pow((pow(fabs(x-1), " << finalexponent << ") + pow(fabs(y), " << finalexponent << ")), " << oneOverEx << ");\n" - << "\t\t\tr1 = pow((pow(fabs(x), " << finalexponent << ") + pow(fabs(y-1), " << finalexponent << ")), " << oneOverEx << ");\n" - << "\t\t}\n" - << "\n" - << "\t\treal_t x1, y1;\n" - << "\t\treal_t r00 = fabs(r0 - (real_t) 0.5) / " << rmax << ";\n" - << "\n" - << "\t\tif (r00 < 1.0)\n" - << "\t\t{\n" - << "\t\t\tx1 = 2 * (x + floor(vIn.x));\n" - << "\t\t\ty1 = 2 * (y + floor(vIn.y));\n" - << "\t\t}\n" - << "\t\telse\n" - << "\t\t{\n" - << "\t\t\tx1 = 0;\n" - << "\t\t\ty1 = 0;\n" - << "\t\t}\n" - << "\n" - << "\t\treal_t r11 = fabs(r1 - (real_t) 0.5) / " << rmax << ";\n" - << "\n" - << "\t\tif (r11 < 1)\n" - << "\t\t{\n" - << "\t\t\tvOut.x = x1 + (2 * (x + floor(vIn.x))) - vIn.x;\n" - << "\t\t\tvOut.y = y1 + (2 * (y + floor(vIn.y))) - vIn.y;\n" - << "\t\t}\n" - << "\t\telse\n" - << "\t\t{\n" - << "\t\t\tvOut.x = x1 - vIn.x;\n" - << "\t\t\tvOut.y = y1 - vIn.y;\n" - << "\t\t}\n" - << "\n" - << "\t\tvOut.z = " << DefaultZCl() - << "\t}\n"; + string oneOverEx = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string width = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string seed2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rmax = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + ss << "\t{\n" + << "\t\treal_t modbase = 65535;\n" + << "\t\treal_t multiplier = 32747;\n" + << "\t\treal_t offset = 12345;\n" + << "\n" + << "\t\treal_t x = vIn.x * " << scale << ";\n" + << "\t\treal_t y = vIn.y * " << scale << ";\n" + << "\t\treal_t intx = Round(x);\n" + << "\t\treal_t inty = Round(y);\n" + << "\n" + << "\t\treal_t r = x - intx;\n" + << "\n" + << "\t\tif (r < 0)\n" + << "\t\t\tx = r + 1;\n" + << "\t\telse\n" + << "\t\t\tx = r;\n" + << "\n" + << "\t\tr = y - inty;\n" + << "\n" + << "\t\tif (r < 0)\n" + << "\t\t\ty = r + 1;\n" + << "\t\telse\n" + << "\t\t\ty = r;\n" + << "\n" + << "\t\treal_t tiletype = 0;\n" + << "\n" + << "\t\tif (" << seed << " != 0)\n" + << "\t\t{\n" + << "\t\t\tif (" << seed << " == 1)\n" + << "\t\t\t{\n" + << "\t\t\t\ttiletype = " << seed << ";\n" + << "\t\t\t}\n" + << "\t\t\telse\n" + << "\t\t\t{\n" + << "\t\t\t\treal_t xrand = vIn.x;\n" + << "\t\t\t\treal_t yrand = vIn.y;\n" + << "\n" + << "\t\t\t\txrand = Round(fabs(xrand)) * " << seed2 << ";\n" + << "\t\t\t\tyrand = Round(fabs(yrand)) * " << seed2 << ";\n" + << "\n" + << "\t\t\t\treal_t niter = xrand + yrand + (xrand * yrand);\n" + << "\t\t\t\treal_t randint = (" << seed << " + niter) * " << seed2 << " * ((real_t) 0.5);\n" + << "\n" + << "\t\t\t\trandint = fmod((randint * multiplier + offset), modbase);\n" + << "\t\t\t\ttiletype = fmod(randint, 2);\n" + << "\t\t\t}\n" + << "\t\t}\n" + << "\n" + << "\t\treal_t r0, r1;\n" + << "\n" + << "\t\tif (tiletype < 1)\n" + << "\t\t{\n" + << "\t\t\tr0 = pow((pow(fabs(x), " << finalexponent << ") + pow(fabs(y), " << finalexponent << ")), " << oneOverEx << ");\n" + << "\t\t\tr1 = pow((pow(fabs(x-1), " << finalexponent << ") + pow(fabs(y-1), " << finalexponent << ")), " << oneOverEx << ");\n" + << "\t\t}\n" + << "\t\telse\n" + << "\t\t{\n" + << "\t\t\tr0 = pow((pow(fabs(x-1), " << finalexponent << ") + pow(fabs(y), " << finalexponent << ")), " << oneOverEx << ");\n" + << "\t\t\tr1 = pow((pow(fabs(x), " << finalexponent << ") + pow(fabs(y-1), " << finalexponent << ")), " << oneOverEx << ");\n" + << "\t\t}\n" + << "\n" + << "\t\treal_t x1, y1;\n" + << "\t\treal_t r00 = fabs(r0 - (real_t) 0.5) / " << rmax << ";\n" + << "\n" + << "\t\tif (r00 < 1.0)\n" + << "\t\t{\n" + << "\t\t\tx1 = 2 * (x + floor(vIn.x));\n" + << "\t\t\ty1 = 2 * (y + floor(vIn.y));\n" + << "\t\t}\n" + << "\t\telse\n" + << "\t\t{\n" + << "\t\t\tx1 = 0;\n" + << "\t\t\ty1 = 0;\n" + << "\t\t}\n" + << "\n" + << "\t\treal_t r11 = fabs(r1 - (real_t) 0.5) / " << rmax << ";\n" + << "\n" + << "\t\tif (r11 < 1)\n" + << "\t\t{\n" + << "\t\t\tvOut.x = x1 + (2 * (x + floor(vIn.x))) - vIn.x;\n" + << "\t\t\tvOut.y = y1 + (2 * (y + floor(vIn.y))) - vIn.y;\n" + << "\t\t}\n" + << "\t\telse\n" + << "\t\t{\n" + << "\t\t\tvOut.x = x1 - vIn.x;\n" + << "\t\t\tvOut.y = y1 - vIn.y;\n" + << "\t\t}\n" + << "\n" + << "\t\tvOut.z = " << DefaultZCl() + << "\t}\n"; return ss.str(); } @@ -1359,13 +1372,13 @@ protected: m_Params.clear(); m_Params.push_back(ParamWithName(&m_Exponent, prefix + "Truchet_fill_exponent", 2, eParamType::REAL_CYCLIC, T(0.001), 2)); m_Params.push_back(ParamWithName(&m_ArcWidth, prefix + "Truchet_fill_arc_width", T(0.5), eParamType::REAL_CYCLIC, T(0.001), 1)); - m_Params.push_back(ParamWithName(&m_Seed, prefix + "Truchet_fill_seed")); + m_Params.push_back(ParamWithName(&m_Seed, prefix + "Truchet_fill_seed")); m_Params.push_back(ParamWithName(true, &m_FinalExponent, prefix + "Truchet_fill_final_exponent"));//Precalc - m_Params.push_back(ParamWithName(true, &m_OneOverEx, prefix + "Truchet_fill_oneoverex")); - m_Params.push_back(ParamWithName(true, &m_Width, prefix + "Truchet_fill_width")); - m_Params.push_back(ParamWithName(true, &m_Seed2, prefix + "Truchet_fill_seed2")); - m_Params.push_back(ParamWithName(true, &m_Rmax, prefix + "Truchet_fill_rmax")); - m_Params.push_back(ParamWithName(true, &m_Scale, prefix + "Truchet_fill_scale")); + m_Params.push_back(ParamWithName(true, &m_OneOverEx, prefix + "Truchet_fill_oneoverex")); + m_Params.push_back(ParamWithName(true, &m_Width, prefix + "Truchet_fill_width")); + m_Params.push_back(ParamWithName(true, &m_Seed2, prefix + "Truchet_fill_seed2")); + m_Params.push_back(ParamWithName(true, &m_Rmax, prefix + "Truchet_fill_rmax")); + m_Params.push_back(ParamWithName(true, &m_Scale, prefix + "Truchet_fill_scale")); } private: @@ -1405,6 +1418,7 @@ public: factor = (dist < m_Null) ? T(0) : factor; helper.Out.x = m_Weight * (x0 + factor * std::sin(y0 * m_Freqx) * m_Scalex); helper.Out.y = m_Weight * (y0 + factor * std::sin(x0 * m_Freqy) * m_Scaley); + helper.Out.z = DefaultZ(helper); } virtual string OpenCLString() const override @@ -1413,11 +1427,12 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string freqX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string scaleX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string freqY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string scaleY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string nullVar = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string freqX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scaleX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string freqY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scaleY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string nullVar = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string distance = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t x0 = vIn.x;\n" @@ -1427,8 +1442,8 @@ public: << "\t\treal_t factor = (dist < " << distance << ") ? (dist - " << nullVar << ") / Zeps(" << distance << "-" << nullVar << ") : (real_t)(1.0);\n" << "\t\tfactor = (dist < " << nullVar << ") ? (real_t) 0.0 : factor;\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (x0 + factor * sin(y0 * " << freqX << ") * " << scaleX << ");\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (y0 + factor * sin(x0 * " << freqY << ") * " << scaleY << ");\n" + << "\t\tvOut.x = " << weight << " * (x0 + factor * sin(y0 * " << freqX << ") * " << scaleX << ");\n" + << "\t\tvOut.y = " << weight << " * (y0 + factor * sin(x0 * " << freqY << ") * " << scaleY << ");\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -1444,11 +1459,11 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_Freqx, prefix + "waves2_radial_freqx", 7)); - m_Params.push_back(ParamWithName(&m_Scalex, prefix + "waves2_radial_scalex", T(0.1))); - m_Params.push_back(ParamWithName(&m_Freqy, prefix + "waves2_radial_freqy", 13)); - m_Params.push_back(ParamWithName(&m_Scaley, prefix + "waves2_radial_scaley", T(0.1))); - m_Params.push_back(ParamWithName(&m_Null, prefix + "waves2_radial_null", 2)); + m_Params.push_back(ParamWithName(&m_Freqx, prefix + "waves2_radial_freqx", 7)); + m_Params.push_back(ParamWithName(&m_Scalex, prefix + "waves2_radial_scalex", T(0.1))); + m_Params.push_back(ParamWithName(&m_Freqy, prefix + "waves2_radial_freqy", 13)); + m_Params.push_back(ParamWithName(&m_Scaley, prefix + "waves2_radial_scaley", T(0.1))); + m_Params.push_back(ParamWithName(&m_Null, prefix + "waves2_radial_null", 2)); m_Params.push_back(ParamWithName(&m_Distance, prefix + "waves2_radial_distance", 10)); } @@ -1468,7 +1483,7 @@ template class Panorama1Variation : public Variation { public: - Panorama1Variation(T weight = 1.0) : Variation("panorama1", eVariationId::VAR_PANORAMA1, weight, true, false, false, false, false) + Panorama1Variation(T weight = 1.0) : Variation("panorama1", eVariationId::VAR_PANORAMA1, weight, true) { } @@ -1489,6 +1504,7 @@ public: { ostringstream ss, ss2; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); ss << "\t{\n" @@ -1496,8 +1512,8 @@ public: << "\t\treal_t x1 = transX * aux;\n" << "\t\treal_t y1 = transY * aux;\n" << "\t\taux = sqrt(x1 * x1 + y1 * y1);\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * atan2(x1, y1) * M1PI;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (aux - 0.5);\n" + << "\t\tvOut.x = " << weight << " * atan2(x1, y1) * M1PI;\n" + << "\t\tvOut.y = " << weight << " * (aux - 0.5);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); @@ -1511,7 +1527,7 @@ template class Panorama2Variation : public Variation { public: - Panorama2Variation(T weight = 1.0) : Variation("panorama2", eVariationId::VAR_PANORAMA2, weight, true, true, false, false, false) + Panorama2Variation(T weight = 1.0) : Variation("panorama2", eVariationId::VAR_PANORAMA2, weight, true, true) { } @@ -1532,6 +1548,7 @@ public: { ostringstream ss, ss2; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); ss << "\t{\n" @@ -1539,14 +1556,463 @@ public: << "\t\treal_t x1 = transX * aux;\n" << "\t\treal_t y1 = transY * aux;\n" << "\t\taux = sqrt(x1 * x1 + y1 * y1);\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * atan2(x1, y1) * M1PI;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (aux - 0.5);\n" + << "\t\tvOut.x = " << weight << " * atan2(x1, y1) * M1PI;\n" + << "\t\tvOut.y = " << weight << " * (aux - 0.5);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t}\n"; return ss.str(); } }; +/// +/// arcsinh. +/// +/* + template + class ArcsinhVariation : public ParametricVariation + { + public: + ArcsinhVariation(T weight = 1.0) : ParametricVariation("arcsinh", eVariationId::VAR_ARCSINH, weight, false, false, false, false, false) + { + } + + PARVARCOPY(ArcsinhVariation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + std::complex z(helper.m_TransX, helper.m_TransY); + std::complex result = m_Vpi * std::log(z + std::sqrt(z * z + 1.0)); + helper.Out.x = result.real(); + helper.Out.y = result.imag(); + helper.Out.z = DefaultZ(helper); + } + + virtual string OpenCLString() const override//Hold off on this for now, opencl doesn't have support for complex. + { + ostringstream ss, ss2; + + return ss.str(); + } + + virtual void Precalc() override + { + m_Vpi = m_Weight * M_2_PI; + } + + protected: + void Init() + { + string prefix = Prefix(); + m_Params.clear(); + m_Params.push_back(ParamWithName(true, &m_Vpi, prefix + "arcsinh_vpi"));//Precalc. + } + + private: + T m_Vpi;//Precalc. + };*/ + +/// +/// helicoid. +/// +template +class HelicoidVariation : public ParametricVariation +{ +public: + HelicoidVariation(T weight = 1.0) : ParametricVariation("helicoid", eVariationId::VAR_HELICOID, weight, true, true, false, false, true) + { + Init(); + } + + PARVARCOPY(HelicoidVariation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + T temp = helper.In.z * m_Freq2Pi + helper.m_PrecalcAtanyx; + T weightXdist = m_Weight * helper.m_PrecalcSqrtSumSquares; + helper.Out.x = weightXdist * std::cos(temp); + helper.Out.y = weightXdist * std::sin(temp); + helper.Out.z = m_Weight * helper.In.z; + } + + virtual string OpenCLString() const override + { + ostringstream ss, ss2; + intmax_t i = 0, varIndex = IndexInXform(); + ss2 << "_" << XformIndexInEmber() << "]"; + string index = ss2.str(); + string weight = WeightDefineString(); + string freq = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string freq2pi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + ss << "\t{\n" + << "\t\treal_t temp = vIn.z * " << freq2pi << " + precalcAtanyx;\n" + << "\t\treal_t weightXdist = " << weight << " * precalcSqrtSumSquares;\n" + << "\t\tvOut.x = weightXdist * cos(temp);\n" + << "\t\tvOut.y = weightXdist * sin(temp);\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" + << "\t}\n"; + return ss.str(); + } + + virtual void Precalc() override + { + m_Freq2Pi = m_Freq * M_2PI; + } + +protected: + void Init() + { + string prefix = Prefix(); + m_Params.clear(); + m_Params.push_back(ParamWithName(&m_Freq, prefix + "helicoid_frequency", 1)); + m_Params.push_back(ParamWithName(true, &m_Freq2Pi, prefix + "helicoid_frequency_2pi"));//Precalc. + } + +private: + T m_Freq; + T m_Freq2Pi;//Precalc. +}; + +/// +/// helix. +/// +template +class HelixVariation : public ParametricVariation +{ +public: + HelixVariation(T weight = 1.0) : ParametricVariation("helix", eVariationId::VAR_HELIX, weight) + { + Init(); + } + + PARVARCOPY(HelixVariation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + T temp = helper.In.z * m_Freq2Pi; + helper.Out.x = m_Weight * (helper.In.x + std::cos(temp) * m_Width); + helper.Out.y = m_Weight * (helper.In.y + std::sin(temp) * m_Width); + helper.Out.z = m_Weight * helper.In.z; + } + + virtual string OpenCLString() const override + { + ostringstream ss, ss2; + intmax_t i = 0, varIndex = IndexInXform(); + ss2 << "_" << XformIndexInEmber() << "]"; + string index = ss2.str(); + string weight = WeightDefineString(); + string freq = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string width = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string freq2pi = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + ss << "\t{\n" + << "\t\treal_t temp = vIn.z * " << freq2pi << ";\n" + << "\t\tvOut.x = " << weight << " * (vIn.x + cos(temp) * " << width << ");\n" + << "\t\tvOut.y = " << weight << " * (vIn.y + sin(temp) * " << width << ");\n" + << "\t\tvOut.z = " << weight << " * vIn.z ;\n" + << "\t}\n"; + return ss.str(); + } + + virtual void Precalc() override + { + m_Freq2Pi = m_Freq * M_2PI; + } + +protected: + void Init() + { + string prefix = Prefix(); + m_Params.clear(); + m_Params.push_back(ParamWithName(&m_Freq, prefix + "helix_frequency", 1)); + m_Params.push_back(ParamWithName(&m_Width, prefix + "helix_width", T(0.5))); + m_Params.push_back(ParamWithName(true, &m_Freq2Pi, prefix + "helix_frequency_2pi"));//Precalc. + } + +private: + T m_Freq; + T m_Width; + T m_Freq2Pi;//Precalc. +}; + +/// +/// sphereblur. +/// +template +class SphereblurVariation : public ParametricVariation +{ +public: + SphereblurVariation(T weight = 1.0) : ParametricVariation("sphereblur", eVariationId::VAR_SPHEREBLUR, weight) + { + Init(); + } + + PARVARCOPY(SphereblurVariation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + T ang = rand.Frand01() * M_2PI; + T angz = std::acos(rand.Frand01() * 2 - 1); + T r = m_Weight * std::exp(std::log(std::acos((m_Power == T(1.0) ? rand.Frand01() : std::exp(std::log(rand.Frand01()) * m_Power)) * 2 - 1) / T(M_PI)) / T(1.5)); + T s = std::sin(ang); + T c = std::cos(ang); + T sz = std::sin(angz); + T cz = std::cos(angz); + helper.Out.x = r * c * sz; + helper.Out.y = r * s * sz; + helper.Out.z = r * cz; + } + + virtual string OpenCLString() const override + { + ostringstream ss, ss2; + intmax_t i = 0, varIndex = IndexInXform(); + ss2 << "_" << XformIndexInEmber() << "]"; + string index = ss2.str(); + string weight = WeightDefineString(); + string power = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + ss << "\t{\n" + << "\t\treal_t ang = MwcNext01(mwc) * M_2PI;\n" + << "\t\treal_t angz = acos(MwcNext01(mwc) * 2 - 1);\n" + << "\t\treal_t r = " << weight << " * exp(log(acos((" << power << " == 1.0 ? MwcNext01(mwc) : exp(log(MwcNext01(mwc)) * " << power << ")) * 2 - 1) / M_PI) / 1.5);\n" + << "\t\treal_t s = sin(ang);\n" + << "\t\treal_t c = cos(ang);\n" + << "\t\treal_t sz = sin(angz);\n" + << "\t\treal_t cz = cos(angz);\n" + << "\t\tvOut.x = r * c * sz;\n" + << "\t\tvOut.y = r * s * sz;\n" + << "\t\tvOut.z = r * cz;\n" + << "\t}\n"; + return ss.str(); + } + + virtual void Precalc() override + { + if (m_Power < 0) + m_Power = 0; + } + +protected: + void Init() + { + string prefix = Prefix(); + m_Params.clear(); + m_Params.push_back(ParamWithName(&m_Power, prefix + "sphereblur_power", 1, eParamType::REAL, 0)); + } + +private: + T m_Power; +}; + +/// +/// cpow3. +/// +template +class Cpow3Variation : public ParametricVariation +{ +public: + Cpow3Variation(T weight = 1.0) : ParametricVariation("cpow3", eVariationId::VAR_CPOW3, weight, true, false, false, false, true) + { + Init(); + } + + PARVARCOPY(Cpow3Variation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + T a = helper.m_PrecalcAtanyx; + + if (a < 0) a += M_2PI; + + if (std::cos(a / 2) < rand.Frand11()) + a -= M_2PI; + + a += (rand.RandBit() ? M_2PI : -M_2PI) * std::round(std::log(rand.Frand01()) * m_Coeff); + T lnr2 = std::log(helper.m_PrecalcSumSquares); + T r = m_Weight * std::exp(m_HalfC * lnr2 - m_PrecalcD * a); + T temp = m_PrecalcC * a + m_HalfD * lnr2 + m_Ang * rand.Rand(); + helper.Out.x = r * std::cos(temp); + helper.Out.y = r * std::sin(temp); + helper.Out.z = DefaultZ(helper); + } + + virtual string OpenCLString() const override + { + ostringstream ss, ss2; + intmax_t i = 0, varIndex = IndexInXform(); + ss2 << "_" << XformIndexInEmber() << "]"; + string index = ss2.str(); + string weight = WeightDefineString(); + string r = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string d = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string divisor = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string spread = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string precalcc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string halfc = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string precalcd = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string halfd = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ang = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string coeff = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + ss << "\t{\n" + << "\t\treal_t a = precalcAtanyx;\n" + << "\n" + << "\t\tif (a < 0) a += M_2PI;\n" + << "\n" + << "\t\tif (cos(a / 2) < MwcNextNeg1Pos1(mwc))\n" + << "\t\ta -= M_2PI;\n" + << "\n" + << "\t\ta += ((MwcNext(mwc) & 1) ? M_2PI : -M_2PI) * round(log(MwcNext01(mwc)) * " << coeff << ");\n" + << "\t\treal_t lnr2 = log(precalcSumSquares);\n" + << "\t\treal_t r = " << weight << " * exp(" << halfc << " * lnr2 - " << precalcd << " * a);\n" + << "\t\treal_t temp = " << precalcc << " * a + " << halfd << " * lnr2 + " << ang << " * MwcNext(mwc);\n" + << "\t\tvOut.x = r * cos(temp);\n" + << "\t\tvOut.y = r * sin(temp);\n" + << "\t\tvOut.z = " << DefaultZCl() + << "\t}\n"; + return ss.str(); + } + + virtual void Precalc() override + { + m_Ang = M_2PI / Zeps(m_Divisor); + T a = std::atan2((m_D < 0 ? -std::log(-m_D) : std::log(m_D)) * m_R, M_2PI); + m_PrecalcC = std::cos(a) * m_R * std::cos(a) / m_Divisor; + m_PrecalcD = std::cos(a) * m_R * std::sin(a) / m_Divisor; + m_HalfC = m_PrecalcC / 2; + m_HalfD = m_PrecalcD / 2; + m_Coeff = m_PrecalcD == 0 ? 0 : T(-0.095) * m_Spread / m_PrecalcD; + } + +protected: + void Init() + { + string prefix = Prefix(); + m_Params.clear(); + m_Params.push_back(ParamWithName(&m_R, prefix + "cpow3_r", 1)); + m_Params.push_back(ParamWithName(&m_D, prefix + "cpow3_d", 1, eParamType::REAL_NONZERO)); + m_Params.push_back(ParamWithName(&m_Divisor, prefix + "cpow3_divisor", 1, eParamType::INTEGER_NONZERO)); + m_Params.push_back(ParamWithName(&m_Spread, prefix + "cpow3_spread", 1)); + m_Params.push_back(ParamWithName(true, &m_PrecalcC, prefix + "cpow3_precalc_c"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_HalfC, prefix + "cpow3_half_c")); + m_Params.push_back(ParamWithName(true, &m_PrecalcD, prefix + "cpow3_precalc_d")); + m_Params.push_back(ParamWithName(true, &m_HalfD, prefix + "cpow3_half_d")); + m_Params.push_back(ParamWithName(true, &m_Ang, prefix + "cpow3_ang")); + m_Params.push_back(ParamWithName(true, &m_Coeff, prefix + "cpow3_coeff")); + } + +private: + T m_R; + T m_D; + T m_Divisor; + T m_Spread; + T m_PrecalcC;//Precalc. + T m_HalfC; + T m_PrecalcD; + T m_HalfD; + T m_Ang; + T m_Coeff; +}; + +/// +/// concentric. +/// +template +class ConcentricVariation : public ParametricVariation +{ +public: + ConcentricVariation(T weight = 1.0) : ParametricVariation("concentric", eVariationId::VAR_CONCENTRIC, weight) + { + Init(); + } + + PARVARCOPY(ConcentricVariation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + T lvl = (Floor(rand.Frand01() * m_Density) / Zeps(m_Density)); //random level. should care if density=0 but meh, works fine + T randa = rand.Frand01() * M_2PI; //random angle + T randr = lvl * m_Radius; //calc radius of rings + + if (m_Rblur != 0) + randr += (std::sqrt(rand.Frand01()) * 2 - 1) * m_Rblur; //blur ring. sqrt is expensive but gives nice effect + + if (m_VarType == eVariationType::VARTYPE_REG) + { + outPoint.m_X = 0;//This variation intentionally assigns instead of summing. + outPoint.m_Y = 0; + outPoint.m_Z = 0; + } + + helper.Out.x = randr * std::cos(randa) * m_Weight; //polar to cartesian coords, origin is origin + helper.Out.y = randr * std::sin(randa) * m_Weight; + T zb = 0; + + if (m_Zblur != 0) + zb = (rand.Frand01() * 2 - 1) * m_Zblur; + + helper.Out.z = (-lvl + zb) * m_Weight; + } + + virtual string OpenCLString() const override + { + ostringstream ss, ss2; + intmax_t i = 0, varIndex = IndexInXform(); + ss2 << "_" << XformIndexInEmber() << "]"; + string index = ss2.str(); + string weight = WeightDefineString(); + string radius = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string density = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string rblur = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string zblur = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + ss << "\t{\n" + << "\t\treal_t lvl = floor(MwcNext01(mwc) * " << density << ") / Zeps(" << density << ");\n" + << "\t\treal_t randa = MwcNext01(mwc) * M_2PI;\n" + << "\t\treal_t randr = lvl * " << radius << ";\n" + << "\n" + << "\t\tif (" << rblur << " != 0)\n" + << "\t\t\trandr += (sqrt(MwcNext01(mwc)) * 2.0 - 1.0) * " << rblur << ";\n"; + + if (m_VarType == eVariationType::VARTYPE_REG) + { + ss << "\t\toutPoint->m_X = 0;\n" + << "\t\toutPoint->m_Y = 0;\n" + << "\t\toutPoint->m_Z = 0;\n"; + } + + ss << "\t\tvOut.x = randr * cos(randa) * " << weight << ";\n" + << "\t\tvOut.y = randr * sin(randa) * " << weight << ";\n" + << "\t\treal_t zb = 0;\n" + << "\n" + << "\t\tif (" << zblur << " != 0)\n" + << "\t\t\tzb = (MwcNext01(mwc) * 2.0 - 1.0) * " << zblur << ";\n" + << "\n" + << "\t\tvOut.z = (-lvl + zb) * " << weight << ";\n" + << "\t}\n"; + return ss.str(); + } + + virtual vector OpenCLGlobalFuncNames() const override + { + return vector { "Zeps" }; + } + +protected: + void Init() + { + string prefix = Prefix(); + m_Params.clear(); + m_Params.push_back(ParamWithName(&m_Radius, prefix + "concentric_radius", 1)); + m_Params.push_back(ParamWithName(&m_Density, prefix + "concentric_density", 10, eParamType::REAL_NONZERO)); + m_Params.push_back(ParamWithName(&m_Rblur, prefix + "concentric_R_blur")); + m_Params.push_back(ParamWithName(&m_Zblur, prefix + "concentric_Z_blur")); + } + +private: + T m_Radius; + T m_Density; + T m_Rblur; + T m_Zblur; +}; + MAKEPREPOSTPARVAR(Splits3D, splits3D, SPLITS3D) MAKEPREPOSTPARVAR(Waves2B, waves2b, WAVES2B) MAKEPREPOSTPARVAR(JacCn, jac_cn, JAC_CN) @@ -1563,4 +2029,10 @@ MAKEPREPOSTPARVAR(TruchetFill, Truchet_fill, TRUCHET_FILL) MAKEPREPOSTPARVAR(Waves2Radial, waves2_radial, WAVES2_RADIAL) MAKEPREPOSTVAR(Panorama1, panorama1, PANORAMA1) MAKEPREPOSTVAR(Panorama2, panorama2, PANORAMA2) +//MAKEPREPOSTPARVAR(Arcsinh, arcsinh, ARCSINH) +MAKEPREPOSTPARVAR(Helicoid, helicoid, HELICOID) +MAKEPREPOSTPARVAR(Helix, helix, HELIX) +MAKEPREPOSTPARVAR(Sphereblur, sphereblur, SPHEREBLUR) +MAKEPREPOSTPARVAR(Cpow3, cpow3, CPOW3) +MAKEPREPOSTPARVAR(Concentric, concentric, CONCENTRIC) } diff --git a/Source/Ember/VariationsDC.h b/Source/Ember/VariationsDC.h index 9893cee..1e1c1c9 100644 --- a/Source/Ember/VariationsDC.h +++ b/Source/Ember/VariationsDC.h @@ -51,18 +51,19 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Params. + string weight = WeightDefineString(); + string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Params. string centerX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string centerY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string bdcs = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. + string bdcs = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. ss << "\t{\n" << "\t\treal_t r = precalcSumSquares;\n" << "\t\treal_t r4_1 = Zeps(r / 4 + 1);\n" - << "\t\tr4_1 = xform->m_VariationWeights[" << varIndex << "] / r4_1;\n" + << "\t\tr4_1 = " << weight << " / r4_1;\n" << "\n" << "\t\tvOut.x = r4_1 * vIn.x;\n" << "\t\tvOut.y = r4_1 * vIn.y;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * (2 / r4_1 - 1);\n" + << "\t\tvOut.z = " << weight << " * (2 / r4_1 - 1);\n" << "\n" << "\t\treal_t sumX, sumY;\n\n"; @@ -105,7 +106,7 @@ protected: m_Params.clear(); m_Params.push_back(ParamWithName(&m_CenterX, prefix + "dc_bubble_centerx"));//Params. m_Params.push_back(ParamWithName(&m_CenterY, prefix + "dc_bubble_centery")); - m_Params.push_back(ParamWithName(&m_Scale, prefix + "dc_bubble_scale", 1)); + m_Params.push_back(ParamWithName(&m_Scale, prefix + "dc_bubble_scale", 1)); m_Params.push_back(ParamWithName(true, &m_Bdcs, prefix + "dc_bubble_bdcs"));//Precalc. } @@ -150,8 +151,9 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string origin = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Params. - string h = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. + string h = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. ss << "\t{\n" << "\t\tint x0 = (MwcNext(mwc) & 1) ? -1 : 1;\n" << "\t\tint y0 = (MwcNext(mwc) & 1) ? -1 : 1;\n" @@ -160,8 +162,8 @@ public: << "\t\treal_t x0_xor_y0 = (real_t)(x0 ^ y0);\n" << "\t\treal_t h = -" << h << " + (1 - x0_xor_y0) * " << h << ";\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (xform->m_A * x + xform->m_B * y + xform->m_E);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (xform->m_C * x + xform->m_D * y + xform->m_F);\n" + << "\t\tvOut.x = " << weight << " * (xform->m_A * x + xform->m_B * y + xform->m_E);\n" + << "\t\tvOut.y = " << weight << " * (xform->m_C * x + xform->m_D * y + xform->m_F);\n" << "\t\tvOut.z = " << DefaultZCl() << "\t\toutPoint->m_ColorX = fmod(fabs(outPoint->m_ColorX * (real_t)(0.5) * (1 + h) + x0_xor_y0 * (1 - h) * (real_t)(0.5)), (real_t)(1.0));\n" << "\t}\n"; @@ -260,15 +262,16 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string cubeC1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Params. - string cubeC2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cubeC3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cubeC4 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cubeC5 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cubeC6 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cubeX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cubeY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cubeZ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string cubeC1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Params. + string cubeC2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cubeC3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cubeC4 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cubeC5 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cubeC6 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cubeX = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cubeY = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cubeZ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string clampC1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. string clampC2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string clampC3 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; @@ -285,9 +288,9 @@ public: << "\t\tswitch (i)\n" << "\t\t{\n" << "\t\t case 0:\n" - << "\t\t x = xform->m_VariationWeights[" << varIndex << "] * (j ? -1 : 1);\n" - << "\t\t y = xform->m_VariationWeights[" << varIndex << "] * p;\n" - << "\t\t z = xform->m_VariationWeights[" << varIndex << "] * q;\n" + << "\t\t x = " << weight << " * (j ? -1 : 1);\n" + << "\t\t y = " << weight << " * p;\n" + << "\t\t z = " << weight << " * q;\n" << "\n" << "\t\t if (j)\n" << "\t\t outPoint->m_ColorX = " << clampC1 << ";\n" @@ -296,9 +299,9 @@ public: << "\n" << "\t\t break;\n" << "\t\t case 1:\n" - << "\t\t x =xform->m_VariationWeights[" << varIndex << "] * p;\n" - << "\t\t y =xform->m_VariationWeights[" << varIndex << "] * (j ? -1 : 1);\n" - << "\t\t z =xform->m_VariationWeights[" << varIndex << "] * q;\n" + << "\t\t x =" << weight << " * p;\n" + << "\t\t y =" << weight << " * (j ? -1 : 1);\n" + << "\t\t z =" << weight << " * q;\n" << "\n" << "\t\t if (j)\n" << "\t\t outPoint->m_ColorX = " << clampC3 << ";\n" @@ -307,9 +310,9 @@ public: << "\n" << "\t\t break;\n" << "\t\t case 2:\n" - << "\t\t x = xform->m_VariationWeights[" << varIndex << "] * p;\n" - << "\t\t y = xform->m_VariationWeights[" << varIndex << "] * q;\n" - << "\t\t z = xform->m_VariationWeights[" << varIndex << "] * (j ? -1 : 1);\n" + << "\t\t x = " << weight << " * p;\n" + << "\t\t y = " << weight << " * q;\n" + << "\t\t z = " << weight << " * (j ? -1 : 1);\n" << "\n" << "\t\t if (j)\n" << "\t\t outPoint->m_ColorX = " << clampC5 << ";\n" @@ -347,9 +350,9 @@ protected: m_Params.push_back(ParamWithName(&m_DcCubeC4, prefix + "dc_cube_c4")); m_Params.push_back(ParamWithName(&m_DcCubeC5, prefix + "dc_cube_c5")); m_Params.push_back(ParamWithName(&m_DcCubeC6, prefix + "dc_cube_c6")); - m_Params.push_back(ParamWithName(&m_DcCubeX, prefix + "dc_cube_x", 1)); - m_Params.push_back(ParamWithName(&m_DcCubeY, prefix + "dc_cube_y", 1)); - m_Params.push_back(ParamWithName(&m_DcCubeZ, prefix + "dc_cube_z", 1)); + m_Params.push_back(ParamWithName(&m_DcCubeX, prefix + "dc_cube_x", 1)); + m_Params.push_back(ParamWithName(&m_DcCubeY, prefix + "dc_cube_y", 1)); + m_Params.push_back(ParamWithName(&m_DcCubeZ, prefix + "dc_cube_z", 1)); m_Params.push_back(ParamWithName(true, &m_ClampC1, prefix + "dc_cube_clamp_c1"));//Precalc. m_Params.push_back(ParamWithName(true, &m_ClampC2, prefix + "dc_cube_clamp_c2")); m_Params.push_back(ParamWithName(true, &m_ClampC3, prefix + "dc_cube_clamp_c3")); @@ -424,24 +427,25 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string offset = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Params. - string angle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string blur = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string sina = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. - string cosa = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ldcs = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ldca = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string angle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string x = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string y = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string blur = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string sina = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. + string cosa = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ldcs = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ldca = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t temp = MwcNext(mwc) * M_2PI;\n" << "\t\treal_t sr = sin(temp);\n" << "\t\treal_t cr = cos(temp);\n" << "\t\treal_t r = " << blur << " * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - 2);\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sin(vIn.x + r * sr)* " << x << ";\n" + << "\t\tvOut.x = " << weight << " * sin(vIn.x + r * sr)* " << x << ";\n" << "\t\tvOut.y = r + vIn.y * " << y << ";\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * cos(vIn.x + r * cr);\n" + << "\t\tvOut.z = " << weight << " * cos(vIn.x + r * cr);\n" << "\n" << "\t\treal_t sumX, sumY;\n\n"; @@ -480,11 +484,11 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Offset, prefix + "dc_cylinder_offset"));//Params. - m_Params.push_back(ParamWithName(&m_Angle, prefix + "dc_cylinder_angle"));//Original used a prefix of dc_cyl_, which is incompatible with Ember's design. - m_Params.push_back(ParamWithName(&m_Scale, prefix + "dc_cylinder_scale", T(0.5))); - m_Params.push_back(ParamWithName(&m_X, prefix + "dc_cylinder_x", T(0.125)));//Original used a prefix of cyl_, which is incompatible with Ember's design. - m_Params.push_back(ParamWithName(&m_Y, prefix + "dc_cylinder_y", T(0.125))); - m_Params.push_back(ParamWithName(&m_Blur, prefix + "dc_cylinder_blur", 1)); + m_Params.push_back(ParamWithName(&m_Angle, prefix + "dc_cylinder_angle"));//Original used a prefix of dc_cyl_, which is incompatible with Ember's design. + m_Params.push_back(ParamWithName(&m_Scale, prefix + "dc_cylinder_scale", T(0.5))); + m_Params.push_back(ParamWithName(&m_X, prefix + "dc_cylinder_x", T(0.125)));//Original used a prefix of cyl_, which is incompatible with Ember's design. + m_Params.push_back(ParamWithName(&m_Y, prefix + "dc_cylinder_y", T(0.125))); + m_Params.push_back(ParamWithName(&m_Blur, prefix + "dc_cylinder_blur", 1)); m_Params.push_back(ParamWithName(true, &m_Sina, prefix + "dc_cylinder_sina"));//Precalc. m_Params.push_back(ParamWithName(true, &m_Cosa, prefix + "dc_cylinder_cosa")); m_Params.push_back(ParamWithName(true, &m_Ldcs, prefix + "dc_cylinder_ldcs")); @@ -596,6 +600,7 @@ public: { ostringstream ss; intmax_t varIndex = IndexInXform(); + string weight = WeightDefineString(); ss << "\t{\n" << "\t\treal_t x = LRint(vIn.x);\n" << "\t\treal_t y = LRint(vIn.y);\n" @@ -607,14 +612,14 @@ public: << "\t\t {\n" << "\t\t if (-y >= x)\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + 1);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * (vIn.x + 1);\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t c += (real_t)(0.25);\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + 1);\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * (vIn.y + 1);\n" << "\t\t c += (real_t)(0.75);\n" << "\t\t }\n" << "\t\t }\n" @@ -622,14 +627,14 @@ public: << "\t\t {\n" << "\t\t if (y <= x)\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + 1);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * (vIn.x + 1);\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t c += (real_t)(0.25);\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y - 1);\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * (vIn.y - 1);\n" << "\t\t c += (real_t)(0.75);\n" << "\t\t }\n" << "\t\t }\n" @@ -640,14 +645,14 @@ public: << "\t\t {\n" << "\t\t if (y >= x)\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x - 1);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * (vIn.x - 1);\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t c += (real_t)(0.25);\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + 1);\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * (vIn.y + 1);\n" << "\t\t c += (real_t)(0.75);\n" << "\t\t }\n" << "\t\t }\n" @@ -655,14 +660,14 @@ public: << "\t\t {\n" << "\t\t if (y > -x)\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x - 1);\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\t vOut.x = " << weight << " * (vIn.x - 1);\n" + << "\t\t vOut.y = " << weight << " * vIn.y;\n" << "\t\t c += (real_t)(0.25);\n" << "\t\t }\n" << "\t\t else\n" << "\t\t {\n" - << "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y - 1);\n" + << "\t\t vOut.x = " << weight << " * vIn.x;\n" + << "\t\t vOut.y = " << weight << " * (vIn.y - 1);\n" << "\t\t c += (real_t)(0.75);\n" << "\t\t }\n" << "\t\t }\n" @@ -724,17 +729,18 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string offset = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Params. - string angle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string ldcs = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. - string ldca = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string sina = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string cosa = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string angle = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string ldcs = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. + string ldca = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string sina = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string cosa = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.x = " << weight << " * vIn.x;\n" + << "\t\tvOut.y = " << weight << " * vIn.y;\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\n" << "\t\treal_t sumX, sumY;\n\n"; @@ -773,8 +779,8 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_Offset, prefix + "dc_linear_offset"));//Params. - m_Params.push_back(ParamWithName(&m_Angle, prefix + "dc_linear_angle")); - m_Params.push_back(ParamWithName(&m_Scale, prefix + "dc_linear_scale", 1)); + m_Params.push_back(ParamWithName(&m_Angle, prefix + "dc_linear_angle")); + m_Params.push_back(ParamWithName(&m_Scale, prefix + "dc_linear_scale", 1)); m_Params.push_back(ParamWithName(true, &m_Ldcs, prefix + "dc_linear_ldcs"));//Precalc. m_Params.push_back(ParamWithName(true, &m_Ldca, prefix + "dc_linear_ldca")); m_Params.push_back(ParamWithName(true, &m_Sina, prefix + "dc_linear_sina")); @@ -894,9 +900,10 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); + string weight = WeightDefineString(); string scatterArea = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Params. - string zeroEdges = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. + string zeroEdges = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string a = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. ss << "\t{\n" << "\t\tconst real_t\n" << "\t\txx = xform->m_A, xy = xform->m_B,\n" @@ -969,9 +976,9 @@ public: << "\t\t }\n" << "\t\t}\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (ox + u * xx + v * yx);\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (oy + u * xy + v * yy);\n" - << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" + << "\t\tvOut.x = " << weight << " * (ox + u * xx + v * yx);\n" + << "\t\tvOut.y = " << weight << " * (oy + u * xy + v * yy);\n" + << "\t\tvOut.z = " << weight << " * vIn.z;\n" << "\t\toutPoint->m_ColorX = fmod(fabs(u + v), (real_t)(1.0));\n" << "\t}\n"; return ss.str(); @@ -988,8 +995,8 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.push_back(ParamWithName(&m_ScatterArea, prefix + "dc_triangle_scatter_area", 0, eParamType::REAL, -1, 1));//Params. - m_Params.push_back(ParamWithName(&m_ZeroEdges, prefix + "dc_triangle_zero_edges", 0, eParamType::INTEGER, 0, 1)); - m_Params.push_back(ParamWithName(true, &m_A, prefix + "dc_triangle_a"));//Precalc. + m_Params.push_back(ParamWithName(&m_ZeroEdges, prefix + "dc_triangle_zero_edges", 0, eParamType::INTEGER, 0, 1)); + m_Params.push_back(ParamWithName(true, &m_A, prefix + "dc_triangle_a"));//Precalc. } private: @@ -1036,27 +1043,28 @@ public: intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber() << "]"; string index = ss2.str(); - string x0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Params. - string x1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string factor = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string weight = WeightDefineString(); + string x0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Params. + string x1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string factor = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string overwrite = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalc. - string clamp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string x0_ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string x1_ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string x1_m_x0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string clamp = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string x0_ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string x1_ = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string x1_m_x0 = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t zf = " << factor << " * (outPoint->m_ColorX - " << x0_ << ") / " << x1_m_x0 << ";\n" << "\n" << "\t\tif (" << clamp << " != 0)\n" << "\t\t zf = zf < 0 ? 0 : zf > 1 ? 1 : zf;\n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n" + << "\t\tvOut.x = " << weight << " * vIn.x;\n" + << "\t\tvOut.y = " << weight << " * vIn.y;\n" << "\n" << "\t\tif (" << overwrite << " == 0)\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z * zf;\n" + << "\t\t vOut.z = " << weight << " * vIn.z * zf;\n" << "\t\telse\n" - << "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * zf;\n" + << "\t\t vOut.z = " << weight << " * zf;\n" << "\t}\n"; return ss.str(); } @@ -1073,13 +1081,13 @@ protected: { string prefix = Prefix(); m_Params.clear(); - m_Params.push_back(ParamWithName(&m_X0, prefix + "dc_ztransl_x0", 0, eParamType::REAL, 0, 1));//Params. - m_Params.push_back(ParamWithName(&m_X1, prefix + "dc_ztransl_x1", 1, eParamType::REAL, 0, 1)); - m_Params.push_back(ParamWithName(&m_Factor, prefix + "dc_ztransl_factor", 1)); + m_Params.push_back(ParamWithName(&m_X0, prefix + "dc_ztransl_x0", 0, eParamType::REAL, 0, 1));//Params. + m_Params.push_back(ParamWithName(&m_X1, prefix + "dc_ztransl_x1", 1, eParamType::REAL, 0, 1)); + m_Params.push_back(ParamWithName(&m_Factor, prefix + "dc_ztransl_factor", 1)); m_Params.push_back(ParamWithName(&m_Overwrite, prefix + "dc_ztransl_overwrite", 1, eParamType::INTEGER, 0, 1)); - m_Params.push_back(ParamWithName(&m_Clamp, prefix + "dc_ztransl_clamp", 0, eParamType::INTEGER, 0, 1)); - m_Params.push_back(ParamWithName(true, &m_X0_, prefix + "dc_ztransl_x0_"));//Precalc. - m_Params.push_back(ParamWithName(true, &m_X1_, prefix + "dc_ztransl_x1_")); + m_Params.push_back(ParamWithName(&m_Clamp, prefix + "dc_ztransl_clamp", 0, eParamType::INTEGER, 0, 1)); + m_Params.push_back(ParamWithName(true, &m_X0_, prefix + "dc_ztransl_x0_"));//Precalc. + m_Params.push_back(ParamWithName(true, &m_X1_, prefix + "dc_ztransl_x1_")); m_Params.push_back(ParamWithName(true, &m_X1_m_x0, prefix + "dc_ztransl_x1_m_x0")); } @@ -1262,22 +1270,23 @@ public: ostringstream ss, ss2; intmax_t i = 0, varIndex = IndexInXform(); ss2 << "_" << XformIndexInEmber(); + string weight = WeightDefineString(); string index = ss2.str() + "]"; - string shape = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string map = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string selectCentre = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string selectRange = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string centre = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string range = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string edge = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string octaves = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string amps = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string freqs = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string z = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string shape = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string map = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string selectCentre = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string selectRange = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string centre = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string range = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string edge = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string octaves = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string amps = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string freqs = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string z = "parVars[" + ToUpper(m_Params[i++].Name()) + index; string selectBailout = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string notchBottom = "parVars[" + ToUpper(m_Params[i++].Name()) + index; - string notchTop = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string notchBottom = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string notchTop = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal4 v;\n" << "\t\treal_t vx, vy, col, r, theta, s, c, p, e;\n" @@ -1393,8 +1402,8 @@ public: << "\t\t}\n" << "\t\twhile ((e < " << notchBottom << " || e > " << notchTop << ") && t++ < iBailout); \n" << "\n" - << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * vx; \n" - << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * vy; \n" + << "\t\tvOut.x = " << weight << " * vx; \n" + << "\t\tvOut.y = " << weight << " * vy; \n" << "\t\tvOut.z = " << DefaultZCl() << "\t\tcol = " << centre << " + " << range << " * p; \n" << "\t\toutPoint->m_ColorX = col - floor(col); \n" @@ -1417,21 +1426,21 @@ protected: string prefix = Prefix(); m_Params.clear(); m_Params.reserve(15); - m_Params.push_back(ParamWithName(&m_Shape, prefix + "dc_perlin_shape", 0, eParamType::INTEGER, 0, 2));//Params. - m_Params.push_back(ParamWithName(&m_Map, prefix + "dc_perlin_map", 0, eParamType::INTEGER, 0, 5)); - m_Params.push_back(ParamWithName(&m_SelectCentre, prefix + "dc_perlin_select_centre", 0, eParamType::REAL, -1, 1)); - m_Params.push_back(ParamWithName(&m_SelectRange, prefix + "dc_perlin_select_range", 1, eParamType::REAL, T(0.1), 2)); - m_Params.push_back(ParamWithName(&m_Centre, prefix + "dc_perlin_centre", T(0.25))); - m_Params.push_back(ParamWithName(&m_Range, prefix + "dc_perlin_range", T(0.25))); - m_Params.push_back(ParamWithName(&m_Edge, prefix + "dc_perlin_edge")); - m_Params.push_back(ParamWithName(&m_Scale, prefix + "dc_perlin_scale", 1)); - m_Params.push_back(ParamWithName(&m_Octaves, prefix + "dc_perlin_octaves", 2, eParamType::INTEGER, 1, 5)); - m_Params.push_back(ParamWithName(&m_Amps, prefix + "dc_perlin_amps", 2)); - m_Params.push_back(ParamWithName(&m_Freqs, prefix + "dc_perlin_freqs", 2)); - m_Params.push_back(ParamWithName(&m_Z, prefix + "dc_perlin_z")); + m_Params.push_back(ParamWithName(&m_Shape, prefix + "dc_perlin_shape", 0, eParamType::INTEGER, 0, 2));//Params. + m_Params.push_back(ParamWithName(&m_Map, prefix + "dc_perlin_map", 0, eParamType::INTEGER, 0, 5)); + m_Params.push_back(ParamWithName(&m_SelectCentre, prefix + "dc_perlin_select_centre", 0, eParamType::REAL, -1, 1)); + m_Params.push_back(ParamWithName(&m_SelectRange, prefix + "dc_perlin_select_range", 1, eParamType::REAL, T(0.1), 2)); + m_Params.push_back(ParamWithName(&m_Centre, prefix + "dc_perlin_centre", T(0.25))); + m_Params.push_back(ParamWithName(&m_Range, prefix + "dc_perlin_range", T(0.25))); + m_Params.push_back(ParamWithName(&m_Edge, prefix + "dc_perlin_edge")); + m_Params.push_back(ParamWithName(&m_Scale, prefix + "dc_perlin_scale", 1)); + m_Params.push_back(ParamWithName(&m_Octaves, prefix + "dc_perlin_octaves", 2, eParamType::INTEGER, 1, 5)); + m_Params.push_back(ParamWithName(&m_Amps, prefix + "dc_perlin_amps", 2)); + m_Params.push_back(ParamWithName(&m_Freqs, prefix + "dc_perlin_freqs", 2)); + m_Params.push_back(ParamWithName(&m_Z, prefix + "dc_perlin_z")); m_Params.push_back(ParamWithName(&m_SelectBailout, prefix + "dc_perlin_select_bailout", 10, eParamType::INTEGER, 2, 1000)); m_Params.push_back(ParamWithName(true, &m_NotchBottom, prefix + "dc_perlin_notch_bottom")); - m_Params.push_back(ParamWithName(true, &m_NotchTop, prefix + "dc_perlin_notch_top")); + m_Params.push_back(ParamWithName(true, &m_NotchTop, prefix + "dc_perlin_notch_top")); } private: T m_Shape;//Params. @@ -1452,6 +1461,96 @@ private: shared_ptr> m_VarFuncs = VarFuncs::Instance(); }; +/// +/// randCubes. +/// +template +class RandCubesVariation : public ParametricVariation +{ +public: + RandCubesVariation(T weight = 1.0) : ParametricVariation("randCubes", eVariationId::VAR_RAND_CUBES, weight) + { + Init(); + } + + PARVARCOPY(RandCubesVariation) + + virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override + { + auto blockx = Floor(std::log(rand.Frand01()) * (rand.RandBit() ? m_Spread : -m_Spread)); + auto blocky = Floor(std::log(rand.Frand01()) * (rand.RandBit() ? m_Spread : -m_Spread)); + T z = VarFuncs::Hash(int(blockx * m_Seed)) + VarFuncs::Hash(int(blockx + blocky * m_Seed)); //random height for each block + + if (m_VarType == eVariationType::VARTYPE_REG) + { + outPoint.m_X = 0;//This variation intentionally assigns instead of summing. + outPoint.m_Y = 0; + outPoint.m_Z = 0; + } + + helper.Out.x = (blockx * m_Density + rand.Frand01()) * m_BlockSize; + helper.Out.y = (blocky * m_Density + rand.Frand01()) * m_BlockSize; + helper.Out.z = m_BlockHeight * z * std::pow(rand.Frand01(), T(0.125)); //fade out down + outPoint.m_ColorX = z / 2;//block height -> palette location + } + + virtual string OpenCLString() const override + { + ostringstream ss, ss2; + intmax_t i = 0, varIndex = IndexInXform(); + ss2 << "_" << XformIndexInEmber() << "]"; + string index = ss2.str(); + string weight = WeightDefineString(); + string blocksize = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string blockheight = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string spread = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string seed = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + string density = "parVars[" + ToUpper(m_Params[i++].Name()) + index; + ss << "\t{\n" + << "\t\treal_t blockx = floor(log(MwcNext01(mwc)) * ((MwcNext(mwc) & 1) ? " << spread << " : -" << spread << "));\n" + << "\t\treal_t blocky = floor(log(MwcNext01(mwc)) * ((MwcNext(mwc) & 1) ? " << spread << " : -" << spread << "));\n" + << "\t\treal_t z = Hash(blockx * " << seed << ") + Hash(blockx + blocky * " << seed << ");\n"; + + if (m_VarType == eVariationType::VARTYPE_REG) + { + ss << "\t\toutPoint->m_X = 0;\n" + << "\t\toutPoint->m_Y = 0;\n" + << "\t\toutPoint->m_Z = 0;\n"; + } + + ss << "\t\tvOut.x = (blockx * " << density << " + MwcNext01(mwc)) * " << blocksize << ";\n" + << "\t\tvOut.y = (blocky * " << density << " + MwcNext01(mwc)) * " << blocksize << ";\n" + << "\t\tvOut.z = " << blockheight << " * z * pow(MwcNext01(mwc), 0.125);\n" + << "\t\toutPoint->m_ColorX = z / 2;\n" + << "\t}\n"; + return ss.str(); + } + + virtual vector OpenCLGlobalFuncNames() const override + { + return vector { "Hash" }; + } + +protected: + void Init() + { + string prefix = Prefix(); + m_Params.clear(); + m_Params.push_back(ParamWithName(&m_BlockSize, prefix + "randCubes_blockSize", 1)); + m_Params.push_back(ParamWithName(&m_BlockHeight, prefix + "randCubes_blockHeight", 1)); + m_Params.push_back(ParamWithName(&m_Spread, prefix + "randCubes_spread", 3)); + m_Params.push_back(ParamWithName(&m_Seed, prefix + "randCubes_seed", 1, eParamType::INTEGER)); + m_Params.push_back(ParamWithName(&m_Density, prefix + "randCubes_density", 1)); + } + +private: + T m_BlockSize; + T m_BlockHeight; + T m_Spread; + T m_Seed; + T m_Density; +}; + MAKEPREPOSTPARVAR(DCBubble, dc_bubble, DC_BUBBLE) MAKEPREPOSTPARVAR(DCCarpet, dc_carpet, DC_CARPET) MAKEPREPOSTPARVARASSIGN(DCCube, dc_cube, DC_CUBE, eVariationAssignType::ASSIGNTYPE_SUM) @@ -1461,4 +1560,5 @@ MAKEPREPOSTPARVAR(DCLinear, dc_linear, DC_LINEAR) MAKEPREPOSTPARVAR(DCTriangle, dc_triangle, DC_TRIANGLE) MAKEPREPOSTPARVAR(DCZTransl, dc_ztransl, DC_ZTRANSL) MAKEPREPOSTPARVAR(DCPerlin, dc_perlin, DC_PERLIN) +MAKEPREPOSTPARVAR(RandCubes, randCubes, RAND_CUBES) } diff --git a/Source/Ember/Xform.h b/Source/Ember/Xform.h index 91ba577..04f88d1 100644 --- a/Source/Ember/Xform.h +++ b/Source/Ember/Xform.h @@ -656,9 +656,9 @@ public: { //There are no variations, so the affine transformed points can be assigned directly to the output points. T inX = inPoint->m_X; - outPoint->m_X = (m_Affine.A() * inX) + (m_Affine.B() * inPoint->m_Y) + m_Affine.C(); - outPoint->m_Y = (m_Affine.D() * inX) + (m_Affine.E() * inPoint->m_Y) + m_Affine.F(); - outPoint->m_Z = inPoint->m_Z; + outPoint->m_X = 0;//(m_Affine.A() * inX) + (m_Affine.B() * inPoint->m_Y) + m_Affine.C(); + outPoint->m_Y = 0;//(m_Affine.D() * inX) + (m_Affine.E() * inPoint->m_Y) + m_Affine.F(); + outPoint->m_Z = 0;//inPoint->m_Z; } //Apply post variations, these will modify outPoint. @@ -917,17 +917,15 @@ public: if (shouldFlatten)//Flatten was not present and neither was any variation name or parameter in the list. { - auto var = vl->GetVariationCopy(eVariationId::VAR_FLATTEN); + auto varflatten = vl->GetVariationCopy(eVariationId::VAR_FLATTEN); - if (AddVariation(var)) + if (!AddVariation(varflatten)) { - return true; - } - else - { - delete var; + delete varflatten; return false; } + + return true; } } diff --git a/Source/Ember/XmlToEmber.cpp b/Source/Ember/XmlToEmber.cpp index 791cad6..82dc176 100644 --- a/Source/Ember/XmlToEmber.cpp +++ b/Source/Ember/XmlToEmber.cpp @@ -45,7 +45,7 @@ XmlToEmber::XmlToEmber() if (!m_Init) { //This list is for variation params which are incorrect, but their parent variation name may or may not be correct. - //This has some overlap with the list below since some of these have parent variation names that are incorrect. + //This has some overlap with the list below since some of these have parent variation names that are also incorrect. m_BadParamNames = unordered_map { { "swtin_distort", "stwin_distort" }, //stwin. @@ -163,7 +163,16 @@ XmlToEmber::XmlToEmber() { "w2r_distance", "waves2_radial_distance" }, { "tf_exponent", "Truchet_fill_exponent" }, { "tf_arc_width", "Truchet_fill_arc_width" }, - { "tf_seed", "Truchet_fill_seed" } + { "tf_seed", "Truchet_fill_seed" }, + { "blockSize", "randCubes_blockSize" }, + { "blockHeight", "randCubes_blockHeight" }, + { "spread", "randCubes_spread" }, + { "seed", "randCubes_seed" }, + { "density", "randCubes_density" }, + { "radius", "concentric_radius" }, + //{ "density", "concentric_density" },//Can't have two, which means you can never properly paste from Apophysis with both of these in one xform. + { "R_blur", "concentric_R_blur" }, + { "Z_blur", "concentric_Z_blur" } }; m_FlattenNames = { @@ -191,6 +200,7 @@ XmlToEmber::XmlToEmber() "post_rotate_x", "post_rotate_y", "curl3D_cz", + "flatten"//Of course don't flatten if it's already present. }; //This is a vector of the incorrect variation names and their param names as they are in the legacy, badly named flam3/Apophysis code. vector badParams = @@ -284,7 +294,6 @@ template template class C> bool XmlToEmber::Parse(byte* buf, const char* filename, C, Alloc>& embers, bool useDefaults) { - char* bn; const char* xmlPtr; const char* loc = __FUNCTION__; size_t emberSize; @@ -298,16 +307,17 @@ bool XmlToEmber::Parse(byte* buf, const char* filename, C, Alloc>& e xmlPtr = CX(&buf[0]); bufSize = strlen(xmlPtr); //embers.reserve(bufSize / 2500);//The Xml text for an ember is around 2500 bytes, but can be much more. Pre-allocate to aovid unnecessary resizing. - doc = xmlReadMemory(xmlPtr, int(bufSize), filename, "ISO-8859-1", XML_PARSE_HUGE); + int flags = XML_PARSE_HUGE;// | XML_PARSE_RECOVER; + doc = xmlReadMemory(xmlPtr, int(bufSize), filename, "ISO-8859-1", flags); //t.Toc("xmlReadMemory"); if (doc == nullptr) { - doc = xmlReadMemory(xmlPtr, int(bufSize), filename, "UTF-8", XML_PARSE_HUGE); + doc = xmlReadMemory(xmlPtr, int(bufSize), filename, "UTF-8", flags); if (doc == nullptr) { - doc = xmlReadMemory(xmlPtr, int(bufSize), filename, "UTF-16", XML_PARSE_HUGE); + doc = xmlReadMemory(xmlPtr, int(bufSize), filename, "UTF-16", flags); } } @@ -321,8 +331,7 @@ bool XmlToEmber::Parse(byte* buf, const char* filename, C, Alloc>& e rootnode = xmlDocGetRootElement(doc); //Scan for nodes, starting with this node. //t.Tic(); - bn = basename(const_cast(filename)); - ScanForEmberNodes(rootnode, bn, embers, useDefaults); + ScanForEmberNodes(rootnode, filename, embers, useDefaults); xmlFreeDoc(doc); emberSize = embers.size(); auto first = embers.begin(); @@ -345,6 +354,11 @@ bool XmlToEmber::Parse(byte* buf, const char* filename, C, Alloc>& e secondToLast->m_Interp = eInterp::EMBER_INTERP_LINEAR; } } + else + { + AddToReport(string(loc) + " : Error parsing xml file " + string(filename) + ", no flames present."); + return false; + } //Finally, ensure that consecutive 'rotate' parameters never exceed //a difference of more than 180 degrees (+/-) for interpolation. @@ -438,7 +452,7 @@ bool XmlToEmber::Aton(const char* str, valT& val) /// True to use defaults if they are not present in the file, else false to use invalid values as placeholders to indicate the values were not present. template template class C> -void XmlToEmber::ScanForEmberNodes(xmlNode* curNode, char* parentFile, C, Alloc>& embers, bool useDefaults) +void XmlToEmber::ScanForEmberNodes(xmlNode* curNode, const char* parentFile, C, Alloc>& embers, bool useDefaults) { bool parseEmberSuccess; xmlNodePtr thisNode = nullptr; @@ -1025,6 +1039,7 @@ bool XmlToEmber::ParseEmberElement(xmlNode* emberNode, Ember& currentEmber } } + //If new_linear == 0, manually add a linear if (!fromEmber && !newLinear) currentEmber.Flatten(m_FlattenNames); @@ -1107,7 +1122,7 @@ bool XmlToEmber::ParseXform(xmlNode* childNode, Xform& xform, bool motion, xform.m_Name = string(attStr); std::replace(xform.m_Name.begin(), xform.m_Name.end(), ' ', '_'); } - else if (!Compare(curAtt->name, "symmetry"))//Legacy support. + else if (!fromEmber && !Compare(curAtt->name, "symmetry"))//Legacy support. { //Deprecated, set both color_speed and animate to this value. //Huh? Either set it or not? @@ -1284,6 +1299,8 @@ bool XmlToEmber::ParseXform(xmlNode* childNode, Xform& xform, bool motion, if (Aton(attStr, val)) { parVar->SetParamVal(name, val); + //if (!parVar->SetParamVal(name, val)) + // AddToReport(string(loc) + " : Failed to set parametric variation parameter " + name); } else { @@ -1382,7 +1399,7 @@ bool XmlToEmber::XmlContainsTag(xmlAttrPtr att, const char* name) /// The number of channels in each color /// True if there were no errors, else false. template -bool XmlToEmber::ParseHexColors(char* colstr, Ember& ember, size_t numColors, intmax_t chan) +bool XmlToEmber::ParseHexColors(const char* colstr, Ember& ember, size_t numColors, intmax_t chan) { stringstream ss, temp(colstr); ss >> std::hex; string s1, s; diff --git a/Source/Ember/XmlToEmber.h b/Source/Ember/XmlToEmber.h index 7bb44a1..d64fdb2 100644 --- a/Source/Ember/XmlToEmber.h +++ b/Source/Ember/XmlToEmber.h @@ -47,23 +47,23 @@ class EMBER_API XmlToEmber : public EmberReport public: XmlToEmber(); template class C> - bool Parse(byte* buf, const char* filename, C, Alloc>& embers, bool useDefaults = true); + bool Parse(byte* buf, const char* filename, C, Alloc>& embers, bool useDefaults); template class C> - bool Parse(const char* filename, C, Alloc>& embers, bool useDefaults = true); + bool Parse(const char* filename, C, Alloc>& embers, bool useDefaults); template bool Aton(const char* str, valT& val); static vector m_FlattenNames; private: template class C> - void ScanForEmberNodes(xmlNode* curNode, char* parentFile, C, Alloc>& embers, bool useDefaults); + void ScanForEmberNodes(xmlNode* curNode, const char* parentFile, C, Alloc>& embers, bool useDefaults); bool ParseEmberElement(xmlNode* emberNode, Ember& currentEmber); bool AttToEmberMotionFloat(xmlAttrPtr att, const char* attStr, eEmberMotionParam param, EmberMotion& motion); bool ParseXform(xmlNode* childNode, Xform& xform, bool motion, bool fromEmber); static string GetCorrectedParamName(const unordered_map& names, const char* name); static string GetCorrectedVariationName(vector, vector>>& vec, xmlAttrPtr att); static bool XmlContainsTag(xmlAttrPtr att, const char* name); - bool ParseHexColors(char* colstr, Ember& ember, size_t numColors, intmax_t chan); + bool ParseHexColors(const char* colstr, Ember& ember, size_t numColors, intmax_t chan); template bool ParseAndAssign(const xmlChar* name, const char* attStr, const char* str, valT& val, bool& b); diff --git a/Source/EmberCL/EmberCLStructs.h b/Source/EmberCL/EmberCLStructs.h index 63f839f..dd16b8d 100644 --- a/Source/EmberCL/EmberCLStructs.h +++ b/Source/EmberCL/EmberCLStructs.h @@ -72,7 +72,7 @@ static string ConstantDefinesString(bool doublePrecision) "#define COLORMAP_LENGTH 256u\n" "#define COLORMAP_LENGTH_MINUS_1 255\n" "#define DE_THRESH 100u\n" - "#define BadVal(x) (((x) != (x)) || ((x) > 1e10) || ((x) < -1e10))\n" + "#define BadVal(x) (((x) != (x)) || ((x) > 1e20) || ((x) < -1e20))\n" "#define SQR(x) ((x) * (x))\n" "#define CUBE(x) ((x) * (x) * (x))\n" "#define MPI ((real_t)M_PI)\n" @@ -158,9 +158,6 @@ static const char* PointCLStructString = "} Point;\n" "\n"; -#define MAX_CL_VARS 8//These must always match. -#define MAX_CL_VARS_STRING "8" - /// /// A structure on the host used to hold all of the needed information for an xform used on the device to iterate in OpenCL. /// Template argument expected to be float or double. @@ -169,12 +166,11 @@ template struct ALIGN XformCL { T m_A, m_B, m_C, m_D, m_E, m_F;//24 (48) - T m_VariationWeights[MAX_CL_VARS];//56 (112) - T m_PostA, m_PostB, m_PostC, m_PostD, m_PostE, m_PostF;//80 (160) - T m_DirectColor;//84 (168) - T m_ColorSpeedCache;//88 (176) - T m_OneMinusColorCache;//92 (184) - T m_Opacity;//96 (192) + T m_PostA, m_PostB, m_PostC, m_PostD, m_PostE, m_PostF;//48 (96) + T m_DirectColor;//52 (104) + T m_ColorSpeedCache;//56 (112) + T m_OneMinusColorCache;//60 (120) + T m_Opacity;//64 (128) }; /// @@ -184,7 +180,6 @@ static const char* XformCLStructString = "typedef struct __attribute__ " ALIGN_CL " _XformCL\n" "{\n" " real_t m_A, m_B, m_C, m_D, m_E, m_F;\n" - " real_t m_VariationWeights[" MAX_CL_VARS_STRING "];\n" " real_t m_PostA, m_PostB, m_PostC, m_PostD, m_PostE, m_PostF;\n" " real_t m_DirectColor;\n" " real_t m_ColorSpeedCache;\n" diff --git a/Source/EmberCL/FunctionMapper.cpp b/Source/EmberCL/FunctionMapper.cpp index a260f7d..dfdbf89 100644 --- a/Source/EmberCL/FunctionMapper.cpp +++ b/Source/EmberCL/FunctionMapper.cpp @@ -125,6 +125,16 @@ FunctionMapper::FunctionMapper() " *val1 = *val2;\n" " *val2 = tmp;\n" "}\n"; + s_GlobalMap["Hash"] = + "inline real_t Hash(int a)\n" + "{\n" + " a = (a ^ 61) ^ (a >> 16);\n" + " a = a + (a << 3);\n" + " a = a ^ (a >> 4);\n" + " a = a * 0x27d4eb2d;\n" + " a = a ^ (a >> 15);\n" + " return (real_t)a / INT_MAX;\n" + "}\n"; s_GlobalMap["Vratio"] = "inline real_t Vratio(real2* p, real2* q, real2* u)\n" "{\n" diff --git a/Source/EmberCL/IterOpenCLKernelCreator.cpp b/Source/EmberCL/IterOpenCLKernelCreator.cpp index cbae473..80dcb62 100644 --- a/Source/EmberCL/IterOpenCLKernelCreator.cpp +++ b/Source/EmberCL/IterOpenCLKernelCreator.cpp @@ -96,9 +96,9 @@ string IterOpenCLKernelCreator::CreateIterKernelString(const Ember& ember, if (xform->PreVariationCount() + xform->VariationCount() == 0) { xformFuncs << - " outPoint->m_X = (xform->m_A * inPoint->m_X) + (xform->m_B * inPoint->m_Y) + xform->m_C;\n" << - " outPoint->m_Y = (xform->m_D * inPoint->m_X) + (xform->m_E * inPoint->m_Y) + xform->m_F;\n" << - " outPoint->m_Z = inPoint->m_Z;\n"; + " outPoint->m_X = 0;\n" + " outPoint->m_Y = 0;\n" + " outPoint->m_Z = 0;\n"; } else { @@ -577,7 +577,7 @@ string IterOpenCLKernelCreator::GlobalFunctionsString(const Ember& ember) } /// -/// Create an OpenCL string of #defines and a corresponding host side vector for parametric variation values. +/// Create an OpenCL string of #defines and a corresponding host side vector for variation weights and parametric variation values. /// Parametric variations present a special problem in the iteration code. /// The values can't be passed in with the array of other xform values because /// the length of the parametric values is unknown. @@ -609,6 +609,7 @@ string IterOpenCLKernelCreator::GlobalFunctionsString(const Ember& ember) /// The variations use these #defines by first looking up the index of the /// xform they belong to in the parent ember and generating the OpenCL string based on that /// in their overridden OpenCLString() functions. +/// Note that variation weights are also included in this buffer and are looked up in a similar manner. /// Template argument expected to be float or double. /// /// The ember to create the values from @@ -618,7 +619,7 @@ string IterOpenCLKernelCreator::GlobalFunctionsString(const Ember& ember) template void IterOpenCLKernelCreator::ParVarIndexDefines(const Ember& ember, pair>& params, bool doVals, bool doString) { - size_t i = 0, j, k, size = 0; + size_t i = 0, size = 0; ostringstream os; if (doVals) @@ -626,13 +627,19 @@ void IterOpenCLKernelCreator::ParVarIndexDefines(const Ember& ember, pair< while (auto xform = ember.GetTotalXform(i)) { - size_t varCount = xform->TotalVariationCount(); + size_t j = 0; - for (j = 0; j < varCount; j++) + while (auto var = xform->GetVariation(j)) { - if (auto parVar = dynamic_cast*>(xform->GetVariation(j))) + if (doString) + os << "#define WEIGHT_" << i << "_" << j << " " << size++ << "\n";//Uniquely identify the weight of this variation in this xform. + + if (doVals) + params.second.push_back(var->m_Weight); + + if (auto parVar = dynamic_cast*>(var)) { - for (k = 0; k < parVar->ParamCount(); k++) + for (size_t k = 0; k < parVar->ParamCount(); k++) { if (!parVar->Params()[k].IsState()) { @@ -651,6 +658,8 @@ void IterOpenCLKernelCreator::ParVarIndexDefines(const Ember& ember, pair< } } } + + j++; } i++; diff --git a/Source/EmberCL/RendererCL.cpp b/Source/EmberCL/RendererCL.cpp index 407133b..242ac93 100644 --- a/Source/EmberCL/RendererCL.cpp +++ b/Source/EmberCL/RendererCL.cpp @@ -1772,9 +1772,6 @@ void RendererCL::ConvertEmber(Ember& ember, EmberCL& emberCL, xformsCL[i].m_ColorSpeedCache = xform->ColorSpeedCache(); xformsCL[i].m_OneMinusColorCache = xform->OneMinusColorCache(); xformsCL[i].m_Opacity = xform->m_Opacity; - - for (size_t varIndex = 0; varIndex < xform->TotalVariationCount() && varIndex < MAX_CL_VARS; varIndex++)//Assign all variation weights for this xform, with a max of MAX_CL_VARS. - xformsCL[i].m_VariationWeights[varIndex] = xform->GetVariation(varIndex)->m_Weight; } } diff --git a/Source/EmberGenome/EmberGenome.cpp b/Source/EmberGenome/EmberGenome.cpp index 918d6ae..4e228ee 100644 --- a/Source/EmberGenome/EmberGenome.cpp +++ b/Source/EmberGenome/EmberGenome.cpp @@ -669,7 +669,7 @@ bool EmberGenome(EmberOptions& opt) mutMeth = eMutateMode::MUTATE_NOT_SPECIFIED; } - os << tools.Mutate(orig, mutMeth, vars, opt.Symmetry(), T(opt.Speed()), MAX_CL_VARS); + os << tools.Mutate(orig, mutMeth, vars, opt.Symmetry(), T(opt.Speed()), 8); //Scan string returned for 'mutate color'. if (strstr(os.str().c_str(), "mutate color")) @@ -718,7 +718,7 @@ bool EmberGenome(EmberOptions& opt) { os << "random"; randomMode = true; - tools.Random(orig, vars, opt.Symmetry(), 0, MAX_CL_VARS); + tools.Random(orig, vars, opt.Symmetry(), 0, 8); orig.m_FinalRasW = 1920; orig.m_FinalRasH = 1080; aselp0 = nullptr; diff --git a/Source/EmberTester/EmberTester.cpp b/Source/EmberTester/EmberTester.cpp index 7f67733..657980d 100644 --- a/Source/EmberTester/EmberTester.cpp +++ b/Source/EmberTester/EmberTester.cpp @@ -255,7 +255,7 @@ void MakeTestAllVarsRegPrePostComboFile(const string& filename) EmberToXml writer; vector> embers; MakeTestAllVarsRegPrePost(embers); - writer.Save(filename, embers, 0, true, true, false); + writer.Save(filename, embers, 0, true, true, false, false, false); } void TestAtomicAdd() diff --git a/Source/Fractorium/AboutDialog.ui b/Source/Fractorium/AboutDialog.ui index 9dc78b8..7b5d84c 100644 --- a/Source/Fractorium/AboutDialog.ui +++ b/Source/Fractorium/AboutDialog.ui @@ -58,7 +58,7 @@ QFrame::NoFrame - <html><head/><body><p align="center">Fractorium 1.0.0.6</p><p align="center"><span style=" font-size:10pt;">A Qt-based fractal flame editor which uses a C++ re-write of the flam3 algorithm named Ember and a GPU capable version named EmberCL which implements a portion of the cuburn algorithm in OpenCL.</span></p><p align="center"><a href="http://fractorium.com"><span style=" text-decoration: underline; color:#0000ff;">fractorium.com</span></a><span style=" font-size:10pt;"><br/>Lead: Matt Feemster<br/>Contributors: Simon Detheridge, Michel Mastriani</span></p></body></html> + <html><head/><body><p align="center">Fractorium 1.0.0.7</p><p align="center"><span style=" font-size:10pt;">A Qt-based fractal flame editor which uses a C++ re-write of the flam3 algorithm named Ember and a GPU capable version named EmberCL which implements a portion of the cuburn algorithm in OpenCL.</span></p><p align="center"><a href="http://fractorium.com"><span style=" text-decoration: underline; color:#0000ff;">fractorium.com</span></a><span style=" font-size:10pt;"><br/>Lead: Matt Feemster<br/>Contributors: Simon Detheridge, Michel Mastriani</span></p></body></html> Qt::RichText diff --git a/Source/Fractorium/FinalRenderEmberController.cpp b/Source/Fractorium/FinalRenderEmberController.cpp index d406713..8184607 100644 --- a/Source/Fractorium/FinalRenderEmberController.cpp +++ b/Source/Fractorium/FinalRenderEmberController.cpp @@ -118,9 +118,9 @@ FinalRenderEmberController::FinalRenderEmberController(FractoriumFinalRenderD //Save backup Xml. if (doAll) - m_XmlWriter.Save(backup.toStdString().c_str(), m_EmberFile.m_Embers, 0, true, false, true); + m_XmlWriter.Save(backup.toStdString().c_str(), m_EmberFile.m_Embers, 0, true, false, true, false, false); else - m_XmlWriter.Save(backup.toStdString().c_str(), *m_Ember, 0, true, false, true); + m_XmlWriter.Save(backup.toStdString().c_str(), *m_Ember, 0, true, false, true, false, false); m_FinishedImageCount.store(0); SyncGuiToRenderer(); diff --git a/Source/Fractorium/Fractorium.cpp b/Source/Fractorium/Fractorium.cpp index 1cd05dd..a3646c1 100644 --- a/Source/Fractorium/Fractorium.cpp +++ b/Source/Fractorium/Fractorium.cpp @@ -112,10 +112,10 @@ Fractorium::Fractorium(QWidget* p) m_Controller->SetupVariationsTree(); m_Controller->FilteredVariations(); - if (m_Info->Ok() && m_Settings->OpenCL() && m_QualitySpin->value() < (30 * m_Settings->Devices().size())) - m_QualitySpin->setValue(30 * m_Settings->Devices().size()); + if (m_Info->Ok() && m_Settings->OpenCL() && m_QualitySpin->value() < (m_Settings->OpenClQuality() * m_Settings->Devices().size())) + m_QualitySpin->setValue(m_Settings->OpenClQuality() * m_Settings->Devices().size()); - int statusBarHeight = 20 * devicePixelRatio(); + int statusBarHeight = 20;// *devicePixelRatio(); ui.StatusBar->setMinimumHeight(statusBarHeight); ui.StatusBar->setMaximumHeight(statusBarHeight); m_RenderStatusLabel = new QLabel(this); @@ -222,6 +222,9 @@ Fractorium::~Fractorium() m_Settings->ShowGrid(ui.ActionDrawGrid->isChecked()); m_Settings->setValue("windowState", saveState()); m_Settings->sync(); + + if (m_Settings->LoadLast()) + m_Controller->SaveCurrentFileOnShutdown(); } /// @@ -330,8 +333,8 @@ bool Fractorium::eventFilter(QObject* o, QEvent* e) { if (o == ui.GLParentScrollArea && e->type() == QEvent::Resize) { - m_WidthSpin->DoubleClickNonZero(ui.GLParentScrollArea->width()); - m_HeightSpin->DoubleClickNonZero(ui.GLParentScrollArea->height()); + m_WidthSpin->DoubleClickNonZero(ui.GLParentScrollArea->width() * ui.GLDisplay->devicePixelRatioF()); + m_HeightSpin->DoubleClickNonZero(ui.GLParentScrollArea->height() * ui.GLDisplay->devicePixelRatioF()); } else if (auto ke = dynamic_cast(e)) { @@ -368,8 +371,8 @@ bool Fractorium::eventFilter(QObject* o, QEvent* e) /// The event void Fractorium::resizeEvent(QResizeEvent* e) { - m_WidthSpin->DoubleClickNonZero(ui.GLParentScrollArea->width()); - m_HeightSpin->DoubleClickNonZero(ui.GLParentScrollArea->height()); + m_WidthSpin->DoubleClickNonZero(ui.GLParentScrollArea->width() * ui.GLDisplay->devicePixelRatioF()); + m_HeightSpin->DoubleClickNonZero(ui.GLParentScrollArea->height() * ui.GLDisplay->devicePixelRatioF()); QMainWindow::resizeEvent(e); } diff --git a/Source/Fractorium/Fractorium.h b/Source/Fractorium/Fractorium.h index c0d5370..47af362 100644 --- a/Source/Fractorium/Fractorium.h +++ b/Source/Fractorium/Fractorium.h @@ -310,6 +310,7 @@ public slots: void OnXformsSelectAllButtonClicked(bool checked); void OnXformsSelectNoneButtonClicked(bool checked); bool IsXformSelected(size_t i); + int SelectedXformCount(bool includeFinal); //Xaos. void OnXaosChanged(double d); diff --git a/Source/Fractorium/Fractorium.ui b/Source/Fractorium/Fractorium.ui index 6537d8f..b330729 100644 --- a/Source/Fractorium/Fractorium.ui +++ b/Source/Fractorium/Fractorium.ui @@ -74,8 +74,8 @@ 0 0 - 1269 - 987 + 1259 + 980 @@ -2007,14 +2007,14 @@ 770 0 - 294 + 295 881 - 294 - 617 + 295 + 624 @@ -2689,13 +2689,13 @@ - 60 + 65 22 - 60 + 65 22 @@ -3700,8 +3700,8 @@ 0 0 - 263 - 722 + 128 + 686 @@ -5786,8 +5786,8 @@ 0 0 - 259 - 652 + 136 + 58 @@ -5920,7 +5920,7 @@ 0 0 291 - 851 + 854 @@ -7027,8 +7027,8 @@ 0 0 - 432 - 589 + 442 + 587 diff --git a/Source/Fractorium/FractoriumEmberController.cpp b/Source/Fractorium/FractoriumEmberController.cpp index 54e8328..2520ed5 100644 --- a/Source/Fractorium/FractoriumEmberController.cpp +++ b/Source/Fractorium/FractoriumEmberController.cpp @@ -344,7 +344,7 @@ void FractoriumEmberController::SetEmberPrivate(const Ember& ember, bool v dir.mkpath("."); string filename = path.toStdString() + "/last.flame"; - writer.Save(filename.c_str(), m_Ember, 0, true, true, false, true, true); + writer.Save(filename, m_Ember, 0, true, true, false, true, true); m_GLController->ResetMouseState(); FillXforms();//Must do this first because the palette setup in FillParamTablesAndPalette() uses the xforms combo. FillParamTablesAndPalette(); diff --git a/Source/Fractorium/FractoriumEmberController.h b/Source/Fractorium/FractoriumEmberController.h index 456dbd6..3a6b4e3 100644 --- a/Source/Fractorium/FractoriumEmberController.h +++ b/Source/Fractorium/FractoriumEmberController.h @@ -100,6 +100,7 @@ public: virtual void SaveCurrentAsXml() { } virtual void SaveEntireFileAsXml() { } virtual uint SaveCurrentToOpenedFile(bool render = true) { return 0; } + virtual void SaveCurrentFileOnShutdown() { } virtual void Undo() { }//Edit. virtual void Redo() { } virtual void CopyXml() { } @@ -362,6 +363,7 @@ public: virtual void SaveCurrentAsXml() override; virtual void SaveEntireFileAsXml() override; virtual uint SaveCurrentToOpenedFile(bool render = true) override; + virtual void SaveCurrentFileOnShutdown() override; virtual void Undo() override; virtual void Redo() override; virtual void CopyXml() override; diff --git a/Source/Fractorium/FractoriumLibrary.cpp b/Source/Fractorium/FractoriumLibrary.cpp index 41ac650..4be14bc 100644 --- a/Source/Fractorium/FractoriumLibrary.cpp +++ b/Source/Fractorium/FractoriumLibrary.cpp @@ -768,7 +768,7 @@ void FractoriumEmberController::SequenceSaveButtonClicked() for (auto& ember : m_SequenceFile.m_Embers) ApplyXmlSavingTemplate(ember); - if (writer.Save(filename.toStdString().c_str(), m_SequenceFile.m_Embers, 0, true, true)) + if (writer.Save(filename.toStdString().c_str(), m_SequenceFile.m_Embers, 0, true, true, false, false, false)) s->SaveFolder(fileInfo.canonicalPath()); else m_Fractorium->ShowCritical("Save Failed", "Could not save sequence file, try saving to a different folder."); @@ -800,7 +800,7 @@ void FractoriumEmberController::SequenceOpenButtonClicked() { embers.clear(); - if (parser.Parse(filename.toStdString().c_str(), embers) && !embers.empty()) + if (parser.Parse(filename.toStdString().c_str(), embers, true) && !embers.empty()) { for (i = 0; i < embers.size(); i++) if (embers[i].m_Name == "" || embers[i].m_Name == "No name")//Ensure it has a name. diff --git a/Source/Fractorium/FractoriumMenus.cpp b/Source/Fractorium/FractoriumMenus.cpp index 71d5bcc..0dd5631 100644 --- a/Source/Fractorium/FractoriumMenus.cpp +++ b/Source/Fractorium/FractoriumMenus.cpp @@ -77,7 +77,7 @@ void FractoriumEmberController::NewFlock(size_t count) for (size_t i = 0; i < count; i++) { - m_SheepTools->Random(ember, filteredVariationsRef, static_cast(QTIsaac::LockedFrand(-2, 2)), 0, MAX_CL_VARS); + m_SheepTools->Random(ember, filteredVariationsRef, static_cast(QTIsaac::LockedFrand(-2, 2)), 0, 8); ParamsToEmber(ember); ember.m_Index = i; ember.m_Name = m_EmberFile.m_Filename.toStdString() + "_" + ToString(i + 1ULL).toStdString(); @@ -114,6 +114,7 @@ void FractoriumEmberController::NewEmptyFlameInCurrentFile() ParamsToEmber(ember); xform.m_Weight = T(0.25); xform.m_ColorX = m_Rand.Frand01(); + xform.AddVariation(m_VariationList->GetVariationCopy(eVariationId::VAR_LINEAR)); ember.AddXform(xform); ember.m_Palette = *m_PaletteList->GetRandomPalette(); ember.m_Name = EmberFile::DefaultEmberName(m_EmberFile.Size() + 1).toStdString(); @@ -136,7 +137,7 @@ void FractoriumEmberController::NewRandomFlameInCurrentFile() { Ember ember; StopAllPreviewRenderers(); - m_SheepTools->Random(ember, m_FilteredVariations, static_cast(QTIsaac::LockedFrand(-2, 2)), 0, MAX_CL_VARS); + m_SheepTools->Random(ember, m_FilteredVariations, static_cast(QTIsaac::LockedFrand(-2, 2)), 0, 8); ParamsToEmber(ember); ember.m_Name = EmberFile::DefaultEmberName(m_EmberFile.Size() + 1).toStdString(); ember.m_Index = m_EmberFile.Size(); @@ -198,7 +199,7 @@ void FractoriumEmberController::OpenAndPrepFiles(const QStringList& filenames { embers.clear(); - if (parser.Parse(filename.toStdString().c_str(), embers) && !embers.empty()) + if (parser.Parse(filename.toStdString().c_str(), embers, true) && !embers.empty()) { for (i = 0; i < embers.size(); i++) { @@ -235,6 +236,12 @@ void FractoriumEmberController::OpenAndPrepFiles(const QStringList& filenames } else if (emberFile.Size() > 0)//Ensure at least something was read. m_EmberFile = std::move(emberFile);//Move the temp to avoid creating dupes because we no longer need it. + else if (!m_EmberFile.Size()) + { + //Loading failed, so fill it with a dummy. + Ember ember; + m_EmberFile.m_Embers.push_back(ember); + } //Resync indices and names. i = 0; @@ -343,7 +350,7 @@ void FractoriumEmberController::SaveEntireFileAsXml() for (auto& ember : emberFile.m_Embers) ApplyXmlSavingTemplate(ember); - if (writer.Save(filename.toStdString().c_str(), emberFile.m_Embers, 0, true, true)) + if (writer.Save(filename.toStdString().c_str(), emberFile.m_Embers, 0, true, true, false, false, false)) { if (!s->SaveAutoUnique() || m_LastSaveAll == "")//Only save filename on first time through when doing auto unique names. m_LastSaveAll = filename; @@ -357,6 +364,20 @@ void FractoriumEmberController::SaveEntireFileAsXml() void Fractorium::OnActionSaveEntireFileAsXml(bool checked) { m_Controller->SaveEntireFileAsXml(); } +template +void FractoriumEmberController::SaveCurrentFileOnShutdown() +{ + EmberToXml writer; + auto path = GetDefaultUserPath(); + QDir dir(path); + + if (!dir.exists()) + dir.mkpath("."); + + string filename = path.toStdString() + "/lastonshutdown.flame"; + writer.Save(filename, m_EmberFile.m_Embers, 0, true, true, false, false, false); +} + /// /// Show a file save dialog and save what is currently shown in the render window to disk as an image. /// @@ -557,7 +578,7 @@ void FractoriumEmberController::PasteXmlAppend() b.clear(); StopAllPreviewRenderers(); - parser.Parse(reinterpret_cast(const_cast(s.c_str())), "", embers); + parser.Parse(reinterpret_cast(const_cast(s.c_str())), "", embers, true); errors = parser.ErrorReportString(); if (errors != "") @@ -598,7 +619,8 @@ void FractoriumEmberController::PasteXmlOver() size_t i = 0; string s, errors; XmlToEmber parser; - auto backupEmber = m_EmberFile.m_Embers.begin(); + list> embers; + auto backupEmber = *m_EmberFile.m_Embers.begin(); auto codec = QTextCodec::codecForName("UTF-8"); auto b = codec->fromUnicode(QApplication::clipboard()->text()); s.reserve(b.size()); @@ -611,8 +633,7 @@ void FractoriumEmberController::PasteXmlOver() b.clear(); StopAllPreviewRenderers(); - m_EmberFile.m_Embers.clear();//Will invalidate the pointers contained in the EmberTreeWidgetItems, UpdateLibraryTree() will resync. - parser.Parse(reinterpret_cast(const_cast(s.c_str())), "", m_EmberFile.m_Embers); + parser.Parse(reinterpret_cast(const_cast(s.c_str())), "", embers, true); errors = parser.ErrorReportString(); if (errors != "") @@ -620,8 +641,10 @@ void FractoriumEmberController::PasteXmlOver() m_Fractorium->ShowCritical("Paste Error", QString::fromStdString(errors)); } - if (m_EmberFile.Size()) + if (embers.size()) { + m_EmberFile.m_Embers = std::move(embers);//Will invalidate the pointers contained in the EmberTreeWidgetItems, UpdateLibraryTree() will resync. + for (auto it : m_EmberFile.m_Embers) { it.m_Index = i++; @@ -631,16 +654,11 @@ void FractoriumEmberController::PasteXmlOver() if (it.m_Name == "" || it.m_Name == "No name") it.m_Name = ToString(it.m_Index).toStdString(); } - } - else - { - backupEmber->m_Index = 0; - m_EmberFile.m_Embers.push_back(*backupEmber); - } - m_EmberFile.MakeNamesUnique(); - FillLibraryTree(); - SetEmber(0, false); + m_EmberFile.MakeNamesUnique(); + FillLibraryTree(); + SetEmber(0, false); + } } void Fractorium::OnActionPasteXmlOver(bool checked) { m_Controller->PasteXmlOver(); } @@ -856,6 +874,7 @@ void FractoriumEmberController::ClearFlame() if (auto xform = m_Ember.GetXform(0)) { xform->Clear(); + xform->AddVariation(m_VariationList->GetVariationCopy(eVariationId::VAR_LINEAR)); xform->ParentEmber(&m_Ember); } } diff --git a/Source/Fractorium/FractoriumParams.cpp b/Source/Fractorium/FractoriumParams.cpp index 66757b9..b40ff2a 100644 --- a/Source/Fractorium/FractoriumParams.cpp +++ b/Source/Fractorium/FractoriumParams.cpp @@ -64,7 +64,7 @@ void Fractorium::InitParamsUI() //Filter. row = 0; table = ui.FilterTable; - SetupSpinner(table, this, row, 1, m_SpatialFilterWidthSpin, spinHeight, 0.1, 2, 0.1, SIGNAL(valueChanged(double)), SLOT(OnSpatialFilterWidthChanged(double)), true, 1.0, 1.0, 0.1); + SetupSpinner(table, this, row, 1, m_SpatialFilterWidthSpin, spinHeight, 0, 2, 0.1, SIGNAL(valueChanged(double)), SLOT(OnSpatialFilterWidthChanged(double)), true, 1.0, 1.0, 0); m_SpatialFilterWidthSpin->DoubleClickLowVal(0.1); comboVals = SpatialFilterCreator::FilterTypes(); SetupCombo(table, this, row, 1, m_SpatialFilterTypeCombo, comboVals, SIGNAL(currentIndexChanged(const QString&)), SLOT(OnSpatialFilterTypeComboCurrentIndexChanged(const QString&))); @@ -74,10 +74,11 @@ void Fractorium::InitParamsUI() //Iteration. row = 0; table = ui.IterationTable; + auto quality = m_Settings->OpenCL() ? m_Settings->OpenClQuality() : m_Settings->CpuQuality(); SetupSpinner( table, this, row, 1, m_SbsSpin, spinHeight, 1000, 100000, 100, SIGNAL(valueChanged(int)), SLOT(OnSbsChanged(int)), true, DEFAULT_SBS, DEFAULT_SBS, DEFAULT_SBS); - SetupSpinner( table, this, row, 1, m_FuseSpin, spinHeight, 1, 1000, 5, SIGNAL(valueChanged(int)), SLOT(OnFuseChanged(int)), true, 15, 15, 15); - SetupSpinner(table, this, row, 1, m_QualitySpin, spinHeight, 1, dmax, 50, SIGNAL(valueChanged(double)), SLOT(OnQualityChanged(double)), true, 10, 10, 10); - SetupSpinner( table, this, row, 1, m_SupersampleSpin, spinHeight, 1, 4, 1, SIGNAL(valueChanged(int)), SLOT(OnSupersampleChanged(int)), true, 1, 1, 1); + SetupSpinner( table, this, row, 1, m_FuseSpin, spinHeight, 1, 1000, 5, SIGNAL(valueChanged(int)), SLOT(OnFuseChanged(int)), true, 15, 15, 15); + SetupSpinner(table, this, row, 1, m_QualitySpin, spinHeight, 1, dmax, 50, SIGNAL(valueChanged(double)), SLOT(OnQualityChanged(double)), true, quality, 10, 10); + SetupSpinner( table, this, row, 1, m_SupersampleSpin, spinHeight, 1, 4, 1, SIGNAL(valueChanged(int)), SLOT(OnSupersampleChanged(int)), true, 1, 1, 1); //Animation. row = 0; table = ui.AnimationTable; diff --git a/Source/Fractorium/FractoriumRender.cpp b/Source/Fractorium/FractoriumRender.cpp index a54809d..ad24823 100644 --- a/Source/Fractorium/FractoriumRender.cpp +++ b/Source/Fractorium/FractoriumRender.cpp @@ -97,7 +97,7 @@ void FractoriumEmberControllerBase::UpdateRender(eProcessAction action) void FractoriumEmberControllerBase::DeleteRenderer() { Shutdown(); - m_Renderer.reset(); + m_Renderer = make_unique>(); if (GLController()) GLController()->ClearWindow(); @@ -299,6 +299,9 @@ bool FractoriumEmberController::SyncSizes() template bool FractoriumEmberController::Render() { + if (!m_Renderer.get()) + return false; + m_Rendering = true; bool success = true; auto gl = m_Fractorium->ui.GLDisplay; @@ -567,7 +570,7 @@ bool FractoriumEmberController::CreateRenderer(eRendererType renderType, cons if (m_RenderType == eRendererType::OPENCL_RENDERER) { - auto val = 30 * m_Fractorium->m_Settings->Devices().size(); + auto val = m_Fractorium->m_Settings->OpenClQuality() * m_Fractorium->m_Settings->Devices().size(); m_Fractorium->m_QualitySpin->DoubleClickZero(val); m_Fractorium->m_QualitySpin->DoubleClickNonZero(val); @@ -576,11 +579,12 @@ bool FractoriumEmberController::CreateRenderer(eRendererType renderType, cons } else { - m_Fractorium->m_QualitySpin->DoubleClickZero(10); - m_Fractorium->m_QualitySpin->DoubleClickNonZero(10); + auto quality = m_Fractorium->m_Settings->CpuQuality(); + m_Fractorium->m_QualitySpin->DoubleClickZero(quality); + m_Fractorium->m_QualitySpin->DoubleClickNonZero(quality); - if (m_Fractorium->m_QualitySpin->value() > 10) - m_Fractorium->m_QualitySpin->setValue(10); + if (m_Fractorium->m_QualitySpin->value() > quality) + m_Fractorium->m_QualitySpin->setValue(quality); } m_Renderer->Callback(this); diff --git a/Source/Fractorium/FractoriumSettings.cpp b/Source/Fractorium/FractoriumSettings.cpp index 481cede..1e2d871 100644 --- a/Source/Fractorium/FractoriumSettings.cpp +++ b/Source/Fractorium/FractoriumSettings.cpp @@ -57,6 +57,12 @@ void FractoriumSettings::EnsureDefaults() OpenCLSubBatch(std::max(1u, OpenCLSubBatch())); RandomCount(std::max(1u, RandomCount())); + if (CpuQuality() == 0) + CpuQuality(10); + + if (OpenClQuality() == 0) + OpenClQuality(30); + if (FinalScale() > int(eScaleType::SCALE_HEIGHT)) FinalScale(0); @@ -72,7 +78,11 @@ void FractoriumSettings::EnsureDefaults() if (SaveImageExt() == "") SaveImageExt(".png"); - if (FinalExt() != "jpg" && FinalExt() != "png") + if (FinalExt() != "jpg" && FinalExt() != "png" && FinalExt() != "exr" +#ifdef _WIN32 + && FinalExt() != "bmp" +#endif + ) FinalExt("png"); auto s = SaveFolder(); @@ -148,6 +158,15 @@ void FractoriumSettings::OpenCLSubBatch(uint i) { setValue(OPENCLSUBBATCH, uint FractoriumSettings::RandomCount() { return value(RANDOMCOUNT).toUInt(); } void FractoriumSettings::RandomCount(uint i) { setValue(RANDOMCOUNT, i); } +uint FractoriumSettings::CpuQuality() { return value(CPU_QUALITY).toUInt(); } +void FractoriumSettings::CpuQuality(uint i) { setValue(CPU_QUALITY, i); } + +uint FractoriumSettings::OpenClQuality() { return value(OPENCL_QUALITY).toUInt(); } +void FractoriumSettings::OpenClQuality(uint i) { setValue(OPENCL_QUALITY, i); } + +bool FractoriumSettings::LoadLast() { return value(LOAD_LAST).toBool(); } +void FractoriumSettings::LoadLast(bool b) { setValue(LOAD_LAST, b); } + /// /// Sequence generation settings. /// diff --git a/Source/Fractorium/FractoriumSettings.h b/Source/Fractorium/FractoriumSettings.h index 7950451..4b238df 100644 --- a/Source/Fractorium/FractoriumSettings.h +++ b/Source/Fractorium/FractoriumSettings.h @@ -24,6 +24,9 @@ #define CPUSUBBATCH "render/cpusubbatch" #define OPENCLSUBBATCH "render/openclsubbatch" #define RANDOMCOUNT "render/randomcount" +#define CPU_QUALITY "render/cpuquality" +#define OPENCL_QUALITY "render/openclquality" +#define LOAD_LAST "render/loadlastonstart" #define STAGGER "sequence/stagger" #define STAGGERMAX "sequence/staggermax" @@ -153,6 +156,15 @@ public: uint RandomCount(); void RandomCount(uint i); + uint CpuQuality(); + void CpuQuality(uint i); + + uint OpenClQuality(); + void OpenClQuality(uint i); + + bool LoadLast(); + void LoadLast(bool b); + double Stagger(); void Stagger(double i); diff --git a/Source/Fractorium/FractoriumXaos.cpp b/Source/Fractorium/FractoriumXaos.cpp index 53a5faf..a82e338 100644 --- a/Source/Fractorium/FractoriumXaos.cpp +++ b/Source/Fractorium/FractoriumXaos.cpp @@ -32,13 +32,13 @@ void Fractorium::InitXaosUI() template void FractoriumEmberController::FillXaos() { - for (int i = 0, count = int(XformCount()); i < count; i++) + for (int i = 0, count = int(XformCount()); i < count; i++)//Column. { if (auto xform = m_Ember.GetXform(i)) { - for (int j = 0; j < count; j++) + for (int j = 0; j < count; j++)//Row. { - QModelIndex index = m_Fractorium->m_XaosTableModel->index(i, j, QModelIndex()); + QModelIndex index = m_Fractorium->m_XaosTableModel->index(j, i, QModelIndex());//j and i are intentionally swapped here. m_Fractorium->m_XaosTableModel->setData(index, xform->Xaos(j)); } } @@ -57,7 +57,9 @@ void FractoriumEmberController::FillXaos() /// xaos value. /// Resets the rendering process. /// -/// The DoubleSpinBox that triggered this event +/// The index of the xform whose xaos value was changed (column) +/// The index of the to value that was changed for the xform (row) +/// The changed value of the xaos element template void FractoriumEmberController::XaosChanged(int x, int y, double val) { @@ -73,13 +75,13 @@ void Fractorium::OnXaosChanged(double d) if (auto senderSpinBox = qobject_cast(sender())) { auto p = senderSpinBox->property("tableindex").toPoint(); - m_Controller->XaosChanged(p.x(), p.y(), d); + m_Controller->XaosChanged(p.y(), p.x(), d);//Intentionally switched, column is the from xform, row is the to xform. } } void Fractorium::OnXaosTableModelDataChanged(const QModelIndex& indexA, const QModelIndex& indexB) { - m_Controller->XaosChanged(indexA.row(), indexA.column(), indexA.data().toDouble()); + m_Controller->XaosChanged(indexA.column(), indexA.row(), indexA.data().toDouble());//Intentionally switched, column is the from xform, row is the to xform. } /// @@ -190,5 +192,5 @@ void Fractorium::OnXaosColDoubleClicked(int logicalIndex) template class FractoriumEmberController; #ifdef DO_DOUBLE -template class FractoriumEmberController; + template class FractoriumEmberController; #endif diff --git a/Source/Fractorium/FractoriumXforms.cpp b/Source/Fractorium/FractoriumXforms.cpp index b57bf12..26534a7 100644 --- a/Source/Fractorium/FractoriumXforms.cpp +++ b/Source/Fractorium/FractoriumXforms.cpp @@ -104,6 +104,7 @@ void FractoriumEmberController::AddXform() Xform newXform; newXform.m_Weight = 0.25; newXform.m_ColorX = m_Rand.Frand01(); + newXform.AddVariation(m_VariationList->GetVariationCopy(eVariationId::VAR_LINEAR)); m_Ember.AddXform(newXform); int index = int(m_Ember.TotalXformCount(forceFinal) - (forceFinal ? 2 : 1));//Set index to the last item before final. FillXforms(index); @@ -115,7 +116,12 @@ void Fractorium::OnAddXformButtonClicked(bool checked) { m_Controller->AddXform( /// /// Add a new linked xform in the current ember and set it as the current xform. /// Linked means: -/// +/// Add an xform whose xaos values are: +/// From: All xaos values from the current xform are zero when going to any xform but the new one added, which is 1. +/// To: The xaos value coming from the current xform is 1 and the xaos values from all other xforms are 0, when going to the newly added xform. +/// Take different action when a single xform is selected vs. multiple. +/// Single: Copy current xform's xaos values to the new one. +/// Multiple: Set new xform's xaos values to 1, and except the last entry which is 0. /// Called when the add xform button is clicked. /// Resets the rendering process. /// @@ -123,40 +129,71 @@ void Fractorium::OnAddXformButtonClicked(bool checked) { m_Controller->AddXform( template void FractoriumEmberController::AddLinkedXform() { + bool hasAdded = false; bool forceFinal = m_Fractorium->HaveFinal(); + auto selCount = m_Fractorium->SelectedXformCount(false); + + if (!selCount)//If none explicitly selected, use current. + selCount = 1; + + Ember ember = m_Ember; + m_Ember.Reserve(m_Ember.XformCount() + 1);//Doing this ahead of time ensures pointers remain valid. + auto iterCount = 0; UpdateXform([&](Xform* xform) { - size_t i, count = m_Ember.XformCount(); - Xform newXform; - newXform.m_Weight = 0.5; - newXform.m_Opacity = 1; - newXform.m_ColorSpeed = 1; - newXform.m_ColorX = xform->m_ColorX; - //newXform.m_ColorY = xform->m_ColorY; - - //Set all of the new xform's xaos values to the selected xform's xaos values, - //then set the selected xform's xaos values to 0. - for (i = 0; i < count; i++) + //Covers very strange case where final is selected, but initially not considered because final is excluded, + //but after adding the new xform, it thinks its selected index is non-final. + if (iterCount < selCount) { - newXform.SetXaos(i, xform->Xaos(i)); - xform->SetXaos(i, 0); + size_t i, count = m_Ember.XformCount(); + + if (!hasAdded) + { + Xform newXform; + newXform.m_Weight = 0.5; + newXform.m_Opacity = xform->m_Opacity; + newXform.m_ColorSpeed = 0; + newXform.m_ColorX = 0; + //newXform.m_ColorY = xform->m_ColorY; + newXform.AddVariation(m_VariationList->GetVariationCopy(eVariationId::VAR_LINEAR)); + + //Set all of the new xform's xaos values to the selected xform's xaos values, + //then set the selected xform's xaos values to 0. + for (i = 0; i < count; i++) + { + if (selCount == 1) + newXform.SetXaos(i, xform->Xaos(i)); + else + newXform.SetXaos(i, 1); + } + + //Add the new xform and update the total count. + m_Ember.AddXform(newXform); + count = m_Ember.XformCount(); + + //Set the xaos for all xforms pointing to the new one to zero. + //Will set the last element of all linking and non-linking xforms, including the one we just added. + //Linking xforms will have their last xaos element set to 1 below. + for (i = 0; i < count; i++) + if (auto xf = m_Ember.GetXform(i)) + xf->SetXaos(count - 1, 0); + + hasAdded = true; + } + + //Linking xform, so set all xaos elements to 0, except the last. + for (i = 0; i < count - 1; i++) + xform->SetXaos(i, 0); + + xform->SetXaos(count - 1, 1);//Set the xaos value for the linking xform pointing to the new one to one. + xform->m_Opacity = 0;//Clear the opacity of the all linking xform. + iterCount++; } - - //Add the new xform and update the total count. - m_Ember.AddXform(newXform); - count = m_Ember.XformCount(); - - //Set the xaos for all xforms pointing to the new one to zero. - for (i = 0; i < count; i++) - if (auto xf = m_Ember.GetXform(i)) - xf->SetXaos(count - 1, 0); - - xform->SetXaos(count - 1, 1);//Set the xaos value for the previous xform pointing to the new one to one. - xform->m_Opacity = 0;//Clear the opacity of the previous xform. - int index = int(m_Ember.TotalXformCount(forceFinal) - (forceFinal ? 2 : 1));//Set index to the last item before final. - FillXforms(index); - FillXaos(); - }, eXformUpdate::UPDATE_CURRENT); + }, eXformUpdate::UPDATE_SELECTED_EXCEPT_FINAL); + //Now update the GUI. + int index = int(m_Ember.TotalXformCount(forceFinal) - (forceFinal ? 2 : 1));//Set index to the last item before final. + FillXforms(index); + FillXaos(); } void Fractorium::OnAddLinkedXformButtonClicked(bool checked) { m_Controller->AddLinkedXform(); } diff --git a/Source/Fractorium/FractoriumXformsSelect.cpp b/Source/Fractorium/FractoriumXformsSelect.cpp index cbc8174..94d2a79 100644 --- a/Source/Fractorium/FractoriumXformsSelect.cpp +++ b/Source/Fractorium/FractoriumXformsSelect.cpp @@ -38,6 +38,25 @@ bool Fractorium::IsXformSelected(size_t i) return false; } +/// +/// Return the number of xforms selected, optionally counting the final xform. +/// +/// Whether to include the final in the count if selected. +/// The caption string +int Fractorium::SelectedXformCount(bool includeFinal) +{ + int selCount = 0; + ForEachXformCheckbox([&](int index, QCheckBox * cb, bool isFinal) + { + if (cb->isChecked()) + { + if (!isFinal || includeFinal) + selCount++; + } + }); + return selCount; +} + /// /// Clear all of the dynamically created xform checkboxes. /// @@ -81,7 +100,7 @@ QString FractoriumEmberController::MakeXformCaption(size_t i) /// /// Function to perform the specified operation on every dynamically created xform selection checkbox. /// -/// The operation to perform +/// The operation to perform which is a function taking the index of the xform, its checkbox, and a bool specifying whether it's final. void Fractorium::ForEachXformCheckbox(std::function func) { int i = 0; diff --git a/Source/Fractorium/GLWidget.cpp b/Source/Fractorium/GLWidget.cpp index 8b7ef51..a273d6a 100644 --- a/Source/Fractorium/GLWidget.cpp +++ b/Source/Fractorium/GLWidget.cpp @@ -32,13 +32,36 @@ void GLWidget::InitGL() { if (!m_Init) { - int w = m_Fractorium->ui.GLParentScrollArea->width(); - int h = m_Fractorium->ui.GLParentScrollArea->height(); + int w = std::ceil(m_Fractorium->ui.GLParentScrollArea->width() * devicePixelRatioF()); + int h = std::ceil(m_Fractorium->ui.GLParentScrollArea->height() * devicePixelRatioF()); SetDimensions(w, h); - m_Fractorium->m_WidthSpin->setValue(w); - m_Fractorium->m_HeightSpin->setValue(h); - //Start with a flock of random embers. Can't do this until now because the window wasn't maximized yet, so the sizes would have been off. - m_Fractorium->OnActionNewFlock(false); + //Start with either a flock of random embers, or the last flame from the previous run. + //Can't do this until now because the window wasn't maximized yet, so the sizes would have been off. + bool b = m_Fractorium->m_Settings->LoadLast(); + + if (b) + { + auto path = GetDefaultUserPath(); + QDir dir(path); + QString filename = path + "/lastonshutdown.flame"; + + if (dir.exists(filename)) + { + QStringList ql; + ql << filename; + m_Fractorium->m_Controller->OpenAndPrepFiles(ql, false); + } + else + b = false; + } + + if (!b) + { + m_Fractorium->OnActionNewFlock(false); + m_Fractorium->m_WidthSpin->setValue(w); + m_Fractorium->m_HeightSpin->setValue(h); + } + m_Fractorium->m_Controller->DelayedStartRenderTimer(); m_Init = true; } @@ -61,9 +84,14 @@ void GLWidget::DrawQuad() if (m_OutputTexID != 0 && finalImage && !finalImage->empty()) { glBindTexture(GL_TEXTURE_2D, m_OutputTexID);//The texture to draw to. + auto scaledW = std::ceil(width() * devicePixelRatioF()); + auto scaledH = std::ceil(height() * devicePixelRatioF()); //Only draw if the dimensions match exactly. - if (m_TexWidth == width() && m_TexHeight == height() && ((m_TexWidth * m_TexHeight) == GLint(finalImage->size()))) + if (m_TexWidth == m_Fractorium->m_Controller->FinalRasW() && + m_TexHeight == m_Fractorium->m_Controller->FinalRasH() && + ((m_TexWidth * m_TexHeight) == GLint(finalImage->size()))) + //if (m_TexWidth == scaledW && m_TexHeight == scaledH && ((m_TexWidth * m_TexHeight) == GLint(finalImage->size()))) { glMatrixMode(GL_PROJECTION); glPushMatrix(); @@ -337,16 +365,16 @@ void GLEmberController::DrawAffines(bool pre, bool post) if (dragging)//Draw large yellow dot on select or drag. { - m_GL->glPointSize(6.0f); + m_GL->glPointSize(6.0f * m_GL->devicePixelRatioF()); m_GL->glBegin(GL_POINTS); m_GL->glColor4f(1.0f, 1.0f, 0.5f, 1.0f); m_GL->glVertex2f(m_DragHandlePos.x, m_DragHandlePos.y); m_GL->glEnd(); - m_GL->glPointSize(1.0f);//Restore point size. + m_GL->glPointSize(1.0f * m_GL->devicePixelRatioF());//Restore point size. } else if (m_DragState == eDragState::DragSelect) { - m_GL->glLineWidth(2.0f); + m_GL->glLineWidth(2.0f * m_GL->devicePixelRatioF()); m_GL->glBegin(GL_LINES); m_GL->glColor4f(0.0f, 0.0f, 1.0f, 1.0f); m_GL->glVertex2f(m_MouseDownWorldPos.x, m_MouseDownWorldPos.y);//UL->UR @@ -358,16 +386,16 @@ void GLEmberController::DrawAffines(bool pre, bool post) m_GL->glVertex2f(m_MouseWorldPos.x, m_MouseDownWorldPos.y);//UR->LR m_GL->glVertex2f(m_MouseWorldPos.x, m_MouseWorldPos.y); m_GL->glEnd(); - m_GL->glLineWidth(1.0f); + m_GL->glLineWidth(1.0f * m_GL->devicePixelRatioF()); } else if (m_HoverType != eHoverType::HoverNone && m_HoverXform == m_SelectedXform)//Draw large turquoise dot on hover if they are hovering over the selected xform. { - m_GL->glPointSize(6.0f); + m_GL->glPointSize(6.0f * m_GL->devicePixelRatioF()); m_GL->glBegin(GL_POINTS); m_GL->glColor4f(0.5f, 1.0f, 1.0f, 1.0f); m_GL->glVertex2f(m_HoverHandlePos.x, m_HoverHandlePos.y); m_GL->glEnd(); - m_GL->glPointSize(1.0f); + m_GL->glPointSize(1.0f * m_GL->devicePixelRatioF()); } } @@ -435,7 +463,7 @@ void GLWidget::keyReleaseEvent(QKeyEvent* e) template void GLEmberController::MousePress(QMouseEvent* e) { - v3T mouseFlipped(e->x() * m_GL->devicePixelRatio(), m_Viewport[3] - e->y() * m_GL->devicePixelRatio(), 0);//Must flip y because in OpenGL, 0,0 is bottom left, but in windows, it's top left. + v3T mouseFlipped(e->x() * m_GL->devicePixelRatioF(), m_Viewport[3] - e->y() * m_GL->devicePixelRatioF(), 0);//Must flip y because in OpenGL, 0,0 is bottom left, but in windows, it's top left. auto ember = m_FractoriumEmberController->CurrentEmber(); auto renderer = m_FractoriumEmberController->Renderer(); @@ -443,7 +471,7 @@ void GLEmberController::MousePress(QMouseEvent* e) if (!renderer) return; - m_MouseDownPos = glm::ivec2(e->x() * m_GL->devicePixelRatio(), e->y() * m_GL->devicePixelRatio());//Capture the raster coordinates of where the mouse was clicked. + m_MouseDownPos = glm::ivec2(e->x() * m_GL->devicePixelRatioF(), e->y() * m_GL->devicePixelRatioF());//Capture the raster coordinates of where the mouse was clicked. m_MouseWorldPos = WindowToWorld(mouseFlipped, false);//Capture the world cartesian coordinates of where the mouse is. m_BoundsDown.w = renderer->LowerLeftX(false);//Need to capture these because they'll be changing if scaling. m_BoundsDown.x = renderer->LowerLeftY(false); @@ -530,7 +558,7 @@ void GLWidget::mousePressEvent(QMouseEvent* e) template void GLEmberController::MouseRelease(QMouseEvent* e) { - v3T mouseFlipped(e->x() * m_GL->devicePixelRatio(), m_Viewport[3] - e->y() * m_GL->devicePixelRatio(), 0);//Must flip y because in OpenGL, 0,0 is bottom left, but in windows, it's top left. + v3T mouseFlipped(e->x() * m_GL->devicePixelRatioF(), m_Viewport[3] - e->y() * m_GL->devicePixelRatioF(), 0);//Must flip y because in OpenGL, 0,0 is bottom left, but in windows, it's top left. m_MouseWorldPos = WindowToWorld(mouseFlipped, false); if (m_DragState == eDragState::DragDragging && (e->button() & Qt::LeftButton)) @@ -567,8 +595,8 @@ template void GLEmberController::MouseMove(QMouseEvent* e) { bool draw = true; - glm::ivec2 mouse(e->x() * m_GL->devicePixelRatio(), e->y() * m_GL->devicePixelRatio()); - v3T mouseFlipped(e->x() * m_GL->devicePixelRatio(), m_Viewport[3] - e->y() * m_GL->devicePixelRatio(), 0);//Must flip y because in OpenGL, 0,0 is bottom left, but in windows, it's top left. + glm::ivec2 mouse(e->x() * m_GL->devicePixelRatioF(), e->y() * m_GL->devicePixelRatioF()); + v3T mouseFlipped(e->x() * m_GL->devicePixelRatioF(), m_Viewport[3] - e->y() * m_GL->devicePixelRatioF(), 0);//Must flip y because in OpenGL, 0,0 is bottom left, but in windows, it's top left. auto ember = m_FractoriumEmberController->CurrentEmber(); //First check to see if the mouse actually moved. @@ -580,7 +608,7 @@ void GLEmberController::MouseMove(QMouseEvent* e) //Update status bar on main window, regardless of whether anything is being dragged. if (m_Fractorium->m_Controller->RenderTimerRunning()) - m_Fractorium->SetCoordinateStatus(e->x() * m_GL->devicePixelRatio(), e->y() * m_GL->devicePixelRatio(), m_MouseWorldPos.x, m_MouseWorldPos.y); + m_Fractorium->SetCoordinateStatus(e->x() * m_GL->devicePixelRatioF(), e->y() * m_GL->devicePixelRatioF(), m_MouseWorldPos.x, m_MouseWorldPos.y); if (m_SelectedXform && m_DragState == eDragState::DragDragging)//Dragging and affine. { @@ -723,7 +751,9 @@ void GLWidget::wheelEvent(QWheelEvent* e) /// Height in pixels void GLWidget::SetDimensions(int w, int h) { - setFixedSize(w, h); + auto downscaledW = std::ceil(w / devicePixelRatioF()); + auto downscaledH = std::ceil(h / devicePixelRatioF()); + setFixedSize(downscaledW, downscaledH); } /// @@ -736,13 +766,18 @@ void GLWidget::SetDimensions(int w, int h) bool GLWidget::Allocate(bool force) { bool alloc = false; - bool doResize = force || m_TexWidth != width() || m_TexHeight != height(); + //auto scaledW = std::ceil(width() * devicePixelRatioF()); + auto w = m_Fractorium->m_Controller->FinalRasW(); + auto h = m_Fractorium->m_Controller->FinalRasH(); + bool doResize = force || m_TexWidth != w || m_TexHeight != h; bool doIt = doResize || m_OutputTexID == 0; if (doIt) { - m_TexWidth = width(); - m_TexHeight = height(); + //m_TexWidth = scaledW; + //m_TexHeight = scaledH; + m_TexWidth = GLint(w); + m_TexHeight = GLint(h); glEnable(GL_TEXTURE_2D); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); @@ -811,12 +846,12 @@ void GLWidget::SetViewport() template bool GLEmberController::SizesMatch() { + //auto scaledW = std::ceil(m_GL->width() * m_GL->devicePixelRatioF()); + //auto scaledH = std::ceil(m_GL->height() * m_GL->devicePixelRatioF()); auto ember = m_FractoriumEmberController->CurrentEmber(); return (ember && - ember->m_FinalRasW == m_GL->width() && - ember->m_FinalRasH == m_GL->height() && - m_GL->width() == m_GL->m_TexWidth && - m_GL->height() == m_GL->m_TexHeight && + ember->m_FinalRasW == m_GL->m_TexWidth && + ember->m_FinalRasH == m_GL->m_TexHeight && m_GL->m_TexWidth == m_GL->m_ViewWidth && m_GL->m_TexHeight == m_GL->m_ViewHeight); } @@ -826,7 +861,7 @@ bool GLEmberController::SizesMatch() /// void GLWidget::DrawUnitSquare() { - glLineWidth(1.0f); + glLineWidth(1.0f * devicePixelRatioF()); glBegin(GL_LINES); glColor4f(1.0f, 1.0f, 1.0f, 0.25f); glVertex2f(-1, -1); @@ -868,7 +903,7 @@ void GLEmberController::DrawGrid() m_GL->glPushMatrix(); m_GL->glLoadIdentity(); MultMatrix(mat); - m_GL->glLineWidth(1.0f); + m_GL->glLineWidth(1.0f * m_GL->devicePixelRatioF()); m_GL->glBegin(GL_LINES); m_GL->glColor4f(0.5f, 0.5f, 0.5f, alpha); @@ -924,24 +959,24 @@ void GLEmberController::DrawAffine(Xform* xform, bool pre, bool selected) m_GL->glPushMatrix(); m_GL->glLoadIdentity(); MultMatrix(mat); - m_GL->glLineWidth(3.0f);//One 3px wide, colored black, except green on x axis for post affine. + m_GL->glLineWidth(3.0f * m_GL->devicePixelRatioF());//One 3px wide, colored black, except green on x axis for post affine. m_GL->DrawAffineHelper(index, selected, pre, final, true); - m_GL->glLineWidth(1.0f);//Again 1px wide, colored white, to give a white middle with black outline effect. + m_GL->glLineWidth(1.0f * m_GL->devicePixelRatioF());//Again 1px wide, colored white, to give a white middle with black outline effect. m_GL->DrawAffineHelper(index, selected, pre, final, false); - m_GL->glPointSize(5.0f);//Three black points, one in the center and two on the circle. Drawn big 5px first to give a black outline. + m_GL->glPointSize(5.0f * m_GL->devicePixelRatioF());//Three black points, one in the center and two on the circle. Drawn big 5px first to give a black outline. m_GL->glBegin(GL_POINTS); m_GL->glColor4f(0.0f, 0.0f, 0.0f, selected ? 1.0f : 0.5f); m_GL->glVertex2f(0.0f, 0.0f); m_GL->glVertex2f(1.0f, 0.0f); m_GL->glVertex2f(0.0f, 1.0f); m_GL->glEnd(); - m_GL->glLineWidth(2.0f);//Draw lines again for y axis only, without drawing the circle, using the color of the selected xform. + m_GL->glLineWidth(2.0f * m_GL->devicePixelRatioF());//Draw lines again for y axis only, without drawing the circle, using the color of the selected xform. m_GL->glBegin(GL_LINES); m_GL->glColor4f(color.r, color.g, color.b, 1.0f); m_GL->glVertex2f(0.0f, 0.0f); m_GL->glVertex2f(0.0f, 1.0f); m_GL->glEnd(); - m_GL->glPointSize(3.0f);//Draw smaller white points, to give a black outline effect. + m_GL->glPointSize(3.0f * m_GL->devicePixelRatioF());//Draw smaller white points, to give a black outline effect. m_GL->glBegin(GL_POINTS); m_GL->glColor4f(1.0f, 1.0f, 1.0f, selected ? 1.0f : 0.5f); m_GL->glVertex2f(0.0f, 0.0f); diff --git a/Source/Fractorium/Main.cpp b/Source/Fractorium/Main.cpp index 4609fc3..ae8b1e6 100644 --- a/Source/Fractorium/Main.cpp +++ b/Source/Fractorium/Main.cpp @@ -11,6 +11,7 @@ int main(int argc, char* argv[]) { int rv = -1; + QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication a(argc, argv); #ifdef TEST_CL QMessageBox::critical(QApplication::desktop(), "Error", "Fractorium cannot be run in test mode, undefine TEST_CL first."); diff --git a/Source/Fractorium/OptionsDialog.cpp b/Source/Fractorium/OptionsDialog.cpp index 2c9e26a..a554fd3 100644 --- a/Source/Fractorium/OptionsDialog.cpp +++ b/Source/Fractorium/OptionsDialog.cpp @@ -46,6 +46,7 @@ FractoriumOptionsDialog::FractoriumOptionsDialog(QWidget* p, Qt::WindowFlags f) ui.OpenCLCheckBox->setChecked(false); ui.OpenCLCheckBox->setEnabled(false); ui.OpenCLSubBatchSpin->setEnabled(false); + ui.OpenCLQualitySpin->setEnabled(false); ui.OpenCLFilteringDERadioButton->setEnabled(false); ui.OpenCLFilteringLogRadioButton->setEnabled(false); ui.InteraciveGpuFilteringGroupBox->setEnabled(false); @@ -69,8 +70,11 @@ bool FractoriumOptionsDialog::ShowAllXforms() { return ui.ShowAllXformsCheckBox- bool FractoriumOptionsDialog::ToggleType() { return ui.ToggleTypeCheckBox->isChecked(); } bool FractoriumOptionsDialog::Png16Bit() { return ui.Png16BitCheckBox->isChecked(); } bool FractoriumOptionsDialog::AutoUnique() { return ui.AutoUniqueCheckBox->isChecked(); } +bool FractoriumOptionsDialog::LoadLast() { return ui.LoadLastOnStartCheckBox->isChecked(); } uint FractoriumOptionsDialog::ThreadCount() { return ui.ThreadCountSpin->value(); } uint FractoriumOptionsDialog::RandomCount() { return ui.RandomCountSpin->value(); } +uint FractoriumOptionsDialog::CpuQuality() { return ui.CpuQualitySpin->value(); } +uint FractoriumOptionsDialog::OpenClQuality() { return ui.OpenCLQualitySpin->value(); } /// /// The check state of one of the OpenCL devices was changed. @@ -122,6 +126,8 @@ void FractoriumOptionsDialog::OnOpenCLCheckBoxStateChanged(int state) ui.ThreadCountSpin->setEnabled(!checked); ui.CpuSubBatchSpin->setEnabled(!checked); ui.OpenCLSubBatchSpin->setEnabled(checked); + ui.OpenCLQualitySpin->setEnabled(checked); + ui.CpuQualitySpin->setEnabled(!checked); ui.CpuFilteringDERadioButton->setEnabled(!checked); ui.CpuFilteringLogRadioButton->setEnabled(!checked); ui.OpenCLFilteringDERadioButton->setEnabled(checked); @@ -178,6 +184,9 @@ void FractoriumOptionsDialog::GuiToData() m_Settings->Png16Bit(Png16Bit()); m_Settings->ThreadCount(ThreadCount()); m_Settings->RandomCount(RandomCount()); + m_Settings->LoadLast(LoadLast()); + m_Settings->CpuQuality(CpuQuality()); + m_Settings->OpenClQuality(OpenClQuality()); m_Settings->CpuSubBatch(ui.CpuSubBatchSpin->value()); m_Settings->OpenCLSubBatch(ui.OpenCLSubBatchSpin->value()); m_Settings->CpuDEFilter(ui.CpuFilteringDERadioButton->isChecked()); @@ -212,6 +221,9 @@ void FractoriumOptionsDialog::DataToGui() ui.Png16BitCheckBox->setChecked(m_Settings->Png16Bit()); ui.ThreadCountSpin->setValue(m_Settings->ThreadCount()); ui.RandomCountSpin->setValue(m_Settings->RandomCount()); + ui.LoadLastOnStartCheckBox->setChecked(m_Settings->LoadLast()); + ui.CpuQualitySpin->setValue(m_Settings->CpuQuality()); + ui.OpenCLQualitySpin->setValue(m_Settings->OpenClQuality()); ui.CpuSubBatchSpin->setValue(m_Settings->CpuSubBatch()); ui.OpenCLSubBatchSpin->setValue(m_Settings->OpenCLSubBatch()); SettingsToDeviceTable(ui.DeviceTable, devices); diff --git a/Source/Fractorium/OptionsDialog.h b/Source/Fractorium/OptionsDialog.h index de40dff..0dd153f 100644 --- a/Source/Fractorium/OptionsDialog.h +++ b/Source/Fractorium/OptionsDialog.h @@ -47,8 +47,11 @@ private: bool ToggleType(); bool Png16Bit(); bool AutoUnique(); + bool LoadLast(); uint ThreadCount(); uint RandomCount(); + uint CpuQuality(); + uint OpenClQuality(); void DataToGui(); void GuiToData(); diff --git a/Source/Fractorium/OptionsDialog.ui b/Source/Fractorium/OptionsDialog.ui index a70479f..b46c157 100644 --- a/Source/Fractorium/OptionsDialog.ui +++ b/Source/Fractorium/OptionsDialog.ui @@ -7,7 +7,7 @@ 0 0 427 - 487 + 475 @@ -169,6 +169,26 @@ + + + + <html><head/><body><p>Checked: right clicking toggles spin boxes, right button dragging disabled.</p><p>Unchecked: double clicking toggles spin boxes, right button dragging enabled.</p></body></html> + + + Right Click Toggles Spinboxes + + + + + + + <html><head/><body><p>Save each RGBA component as 16-bits when saving Png files.</p><p>This leads to greater color precision for use in high end rendering and display on HDR monitors, however it makes the file size larger.</p></body></html> + + + Save 16-bit Png + + + @@ -257,180 +277,212 @@ - - - - <html><head/><body><p>The number of threads to use with CPU rendering.</p><p>Decrease for more responsive editing, increase for better performance.</p></body></html> - - - Threads - - - 1 - - - 64 - - - - - - - The number of 10,000 iteration chunks ran per thread on the CPU + + + + + + OpenCL Filtering + + + + 6 + + + 3 + + + 4 + + + 5 + + + + + Use log scale filtering for interactive editing using OpenCL. + + + Log Scale + + + true + + + + + + + <html><head/><body><p>Use full density estimation filtering for interactive editing using OpenCL.</p><p>This is slower, but gives better feedback.</p></body></html> + + + Full DE + + + + + + + + + + CPU Filtering + + + + 6 + + + 6 + + + 3 + + + 4 + + + 5 + + + + + Use log scale filtering for interactive editing on the CPU. + + + Log Scale + + + true + + + + + + + <html><head/><body><p>Use full density estimation filtering for interactive editing on the CPU.</p><p>This is slower, but gives better feedback.</p></body></html> + + + Full DE + + + + + + + + + + The number of ~8M iteration chunks ran using OpenCL in interactive mode for each mouse movement - - - CPU Sub Batch - - - 1 - - - 100 - - - - - - - The number of ~8M iteration chunks ran using OpenCL + + + OpenCL Sub Batch + + + 1 + + + 100 + + + + + + + <html><head/><body><p>The default quality to use for the interactive renderer when using OpenCL.</p><p>30 is a good number for this, but you can use a larger value if you have a faster GPU.</p></body></html> + + + OpenCL Quality + + + 1 + + + 99999 + + + 30 + + + + + + + <html><head/><body><p>The default quality to use for the interactive renderer when using the CPU.</p><p>10 is a good number for this, but you can use a larger value if you have a faster system.</p></body></html> + + + CPU Quality + + + 1 + + + 99999 + + + 10 + + + + + + + The number of 10,000 iteration chunks ran per thread on the CPU in interactive mode for each mouse movement - - - OpenCL Sub Batch - - - 1 - - - 100 - - + + + CPU Sub Batch + + + 1 + + + 100 + + + + + + + <html><head/><body><p>The number of random flames to generate on startup.</p><p>These are usually of low quality, so leave the count as 1 unless you are searching for good randoms.</p></body></html> + + + Randoms + + + 1 + + + 99999 + + + + + + + <html><head/><body><p>The number of threads to use with CPU rendering.</p><p>Decrease for more responsive editing, increase for better performance.</p></body></html> + + + Threads + + + 1 + + + 64 + + + + - - - - CPU Filtering - - - - 6 - - - 6 - - - 3 - - - 4 - - - 5 - - - - - Use log scale filtering for interactive editing on the CPU. - - - Log Scale - - - true - - - - - - - <html><head/><body><p>Use full density estimation filtering for interactive editing on the CPU.</p><p>This is slower, but gives better feedback.</p></body></html> - - - Full DE - - - - - - - - - - OpenCL Filtering - - - - 6 - - - 3 - - - 4 - - - 5 - - - - - Use log scale filtering for interactive editing using OpenCL. - - - Log Scale - - - true - - - - - - - <html><head/><body><p>Use full density estimation filtering for interactive editing using OpenCL.</p><p>This is slower, but gives better feedback.</p></body></html> - - - Full DE - - - - - - - - + + - <html><head/><body><p>The number of random flames to generate on startup.</p><p>These are usually of low quality, so leave the count as 1 unless you are searching for good randoms.</p></body></html> - - - Randoms - - - 1 - - - 99999 - - - - - - - <html><head/><body><p>Checked: right clicking toggles spin boxes, right button dragging disabled.</p><p>Unchecked: double clicking toggles spin boxes, right button dragging enabled.</p></body></html> + <html><head/><body><p>Checked: load the flame from the previous run on startup.</p><p>Unchecked: create randoms on startup.</p></body></html> - Right Click Toggles Spinboxes - - - - - - - <html><head/><body><p>Save each RGBA component as 16-bits when saving Png files.</p><p>This leads to greater color precision for use in high end rendering and display on HDR monitors, however it makes the file size larger.</p></body></html> - - - Save 16-bit Png + Load Last on Start @@ -858,10 +910,13 @@ in interactive mode for each mouse movement ContinuousUpdateCheckBox ToggleTypeCheckBox Png16BitCheckBox - RandomCountSpin + LoadLastOnStartCheckBox ThreadCountSpin CpuSubBatchSpin + RandomCountSpin + OpenCLQualitySpin OpenCLSubBatchSpin + CpuQualitySpin CpuFilteringLogRadioButton CpuFilteringDERadioButton OpenCLFilteringLogRadioButton diff --git a/openexr.cmd b/openexr.cmd index 86abea7..3cb209f 100644 --- a/openexr.cmd +++ b/openexr.cmd @@ -15,7 +15,7 @@ if not exist ".\output" mkdir .\output cd IlmBase -cmake -G "Visual Studio 14 2015 Win64"^ +cmake -G "Visual Studio 15 2017 Win64"^ -DCMAKE_PREFIX_PATH="%current%\output"^ -DCMAKE_INSTALL_PREFIX="%current%\output"^ .\ @@ -24,7 +24,7 @@ cmake --build . --target install --config Release -- /maxcpucount:8 cd ..\OpenEXR -cmake -G "Visual Studio 14 2015 Win64"^ +cmake -G "Visual Studio 15 2017 Win64"^ -DCMAKE_PREFIX_PATH="%current%\output"^ -DCMAKE_INSTALL_PREFIX="%current%\output"^ -DILMBASE_PACKAGE_PREFIX="%current%\output" ^