--Bug fixes

-Fix bug where contrast was too sensitive.

--Code changes
 -Get it building in VS 2022.
This commit is contained in:
Person 2023-03-08 11:31:33 -07:00
parent 64d4470b12
commit a4bfffaa3f
3 changed files with 34 additions and 39 deletions

View File

@ -161,20 +161,20 @@
<Component Id="libxml2.dll" Guid="bb3aa687-7a3d-4d16-a27c-28529b472754"> <Component Id="libxml2.dll" Guid="bb3aa687-7a3d-4d16-a27c-28529b472754">
<File Id="libxml2.dll" Source="$(var.SolutionDir)..\..\..\Bin\$(var.Platform)\Release\libxml2.dll" KeyPath="yes" Checksum="yes" ProcessorArchitecture="x64" ReadOnly="yes"/> <File Id="libxml2.dll" Source="$(var.SolutionDir)..\..\..\Bin\$(var.Platform)\Release\libxml2.dll" KeyPath="yes" Checksum="yes" ProcessorArchitecture="x64" ReadOnly="yes"/>
</Component> </Component>
<Component Id="msvcp140.dll" Guid="8f1ffde7-c1bd-45fb-8bc8-26dde552eafd"> <Component Id="msvcp140.dll" Guid="8f1ffde7-c1bd-45fb-8bc8-26dde552eafd">
<File Id="msvcp140.dll" Source="$(var.DevEnvDir)..\..\VC\Redist\MSVC\14.29.30133\x64\Microsoft.VC142.CRT\msvcp140.dll" KeyPath="yes" Checksum="yes" ReadOnly="yes"/> <File Id="msvcp140.dll" Source="$(var.DevEnvDir)..\..\VC\Redist\MSVC\14.34.31931\x64\Microsoft.VC143.CRT\msvcp140.dll" KeyPath="yes" Checksum="yes" ReadOnly="yes"/>
</Component> </Component>
<Component Id="vcruntime140.dll" Guid="50c9bc27-c547-4a03-9f6c-cd416f449dd8"> <Component Id="vcruntime140.dll" Guid="50c9bc27-c547-4a03-9f6c-cd416f449dd8">
<File Id="vcruntime140.dll" Source="$(var.DevEnvDir)..\..\VC\Redist\MSVC\14.29.30133\x64\Microsoft.VC142.CRT\vcruntime140.dll" KeyPath="yes" Checksum="yes" ReadOnly="yes"/> <File Id="vcruntime140.dll" Source="$(var.DevEnvDir)..\..\VC\Redist\MSVC\14.34.31931\x64\Microsoft.VC143.CRT\vcruntime140.dll" KeyPath="yes" Checksum="yes" ReadOnly="yes"/>
</Component> </Component>
<Component Id="vcruntime140_1.dll" Guid="a02507f8-326b-45b2-b734-e5091921559f"> <Component Id="vcruntime140_1.dll" Guid="a02507f8-326b-45b2-b734-e5091921559f">
<File Id="vcruntime140_1.dll" Source="$(var.DevEnvDir)..\..\VC\Redist\MSVC\14.29.30133\x64\Microsoft.VC142.CRT\vcruntime140_1.dll" KeyPath="yes" Checksum="yes" ReadOnly="yes"/> <File Id="vcruntime140_1.dll" Source="$(var.DevEnvDir)..\..\VC\Redist\MSVC\14.34.31931\x64\Microsoft.VC143.CRT\vcruntime140_1.dll" KeyPath="yes" Checksum="yes" ReadOnly="yes"/>
</Component> </Component>
<Component Id="vccorlib140.dll" Guid="affe33e7-1e64-4bb0-a062-2b56f77459b4"> <Component Id="vccorlib140.dll" Guid="affe33e7-1e64-4bb0-a062-2b56f77459b4">
<File Id="vccorlib140.dll" Source="$(var.DevEnvDir)..\..\VC\Redist\MSVC\14.29.30133\x64\Microsoft.VC142.CRT\vccorlib140.dll" KeyPath="yes" Checksum="yes" ReadOnly="yes"/> <File Id="vccorlib140.dll" Source="$(var.DevEnvDir)..\..\VC\Redist\MSVC\14.34.31931\x64\Microsoft.VC143.CRT\vccorlib140.dll" KeyPath="yes" Checksum="yes" ReadOnly="yes"/>
</Component> </Component>
<Component Id="concrt140.dll" Guid="7fb716a1-1b4f-42fb-89c7-4d216ebd6e2e"> <Component Id="concrt140.dll" Guid="7fb716a1-1b4f-42fb-89c7-4d216ebd6e2e">
<File Id="concrt140.dll" Source="$(var.DevEnvDir)..\..\VC\Redist\MSVC\14.29.30133\x64\Microsoft.VC142.CRT\concrt140.dll" KeyPath="yes" Checksum="yes" ReadOnly="yes"/> <File Id="concrt140.dll" Source="$(var.DevEnvDir)..\..\VC\Redist\MSVC\14.34.31931\x64\Microsoft.VC143.CRT\concrt140.dll" KeyPath="yes" Checksum="yes" ReadOnly="yes"/>
</Component> </Component>
<Component Id="flam3palettes.xml" Guid="d3adb0bb-14ef-4923-99d9-a5784b7ef04e"> <Component Id="flam3palettes.xml" Guid="d3adb0bb-14ef-4923-99d9-a5784b7ef04e">
<File Id="flam3palettes.xml" Source="$(var.SolutionDir)..\..\..\Data\flam3-palettes.xml" KeyPath="yes" Checksum="yes" ReadOnly="yes"/> <File Id="flam3palettes.xml" Source="$(var.SolutionDir)..\..\..\Data\flam3-palettes.xml" KeyPath="yes" Checksum="yes" ReadOnly="yes"/>

View File

@ -100,36 +100,33 @@ void FinalRenderEmberControllerBase::Output(const QString& s)
/// <param name="stripForProgress">Used to report progress when strips.</param> /// <param name="stripForProgress">Used to report progress when strips.</param>
/// <returns>True if rendering succeeded.</returns> /// <returns>True if rendering succeeded.</returns>
template<typename T> template<typename T>
bool FinalRenderEmberController<T>::RenderSingleEmber(Ember<T>& ember, bool fullRender, size_t &stripForProgress) bool FinalRenderEmberController<T>::RenderSingleEmber(Ember<T>& ember, bool fullRender, size_t& stripForProgress)
{ {
if (!m_Renderer.get()) { if (!m_Renderer.get())
{
return false; return false;
} }
ember.m_TemporalSamples = 1;//No temporal sampling. ember.m_TemporalSamples = 1;//No temporal sampling.
m_Renderer->SetEmber(ember, fullRender ? eProcessAction::FULL_RENDER : eProcessAction::KEEP_ITERATING, /* updatePointer */ true); m_Renderer->SetEmber(ember, fullRender ? eProcessAction::FULL_RENDER : eProcessAction::KEEP_ITERATING, /* updatePointer */ true);
m_Renderer->PrepFinalAccumVector(m_FinalImage);//Must manually call this first because it could be erroneously made smaller due to strips if called inside Renderer::Run(). m_Renderer->PrepFinalAccumVector(m_FinalImage);//Must manually call this first because it could be erroneously made smaller due to strips if called inside Renderer::Run().
m_Stats.Clear(); m_Stats.Clear();
m_RenderTimer.Tic();//Toc() is called in RenderComplete(). m_RenderTimer.Tic();//Toc() is called in RenderComplete().
StripsRender<T>(m_Renderer.get(), ember, m_FinalImage, 0, m_GuiState.m_Strips, m_GuiState.m_YAxisUp, StripsRender<T>(m_Renderer.get(), ember, m_FinalImage, 0, m_GuiState.m_Strips, m_GuiState.m_YAxisUp,
[&](size_t strip) { stripForProgress = strip; },//Pre strip. [&](size_t strip) { stripForProgress = strip; },//Pre strip.
[&](size_t strip) { m_Stats += m_Renderer->Stats(); },//Post strip. [&](size_t strip) { m_Stats += m_Renderer->Stats(); },//Post strip.
[&](size_t strip)//Error. [&](size_t strip)//Error.
{ {
Output("Rendering failed.\n"); Output("Rendering failed.\n");
m_Fractorium->ErrorReportToQTextEdit(m_Renderer->ErrorReport(), m_FinalRenderDialog->ui.FinalRenderTextOutput, false);//Internally calls invoke. m_Fractorium->ErrorReportToQTextEdit(m_Renderer->ErrorReport(), m_FinalRenderDialog->ui.FinalRenderTextOutput, false);//Internally calls invoke.
}, },
[&](Ember<T>& finalEmber) [&](Ember<T>& finalEmber)
{ {
m_FinishedImageCount.fetch_add(1); m_FinishedImageCount.fetch_add(1);
SaveCurrentRender(finalEmber); SaveCurrentRender(finalEmber);
RenderComplete(finalEmber); RenderComplete(finalEmber);
HandleFinishedProgress(); HandleFinishedProgress();
});//Final strip. });//Final strip.
return true; return true;
} }
@ -143,7 +140,8 @@ bool FinalRenderEmberController<T>::RenderSingleEmber(Ember<T>& ember, bool full
template<typename T> template<typename T>
bool FinalRenderEmberController<T>::RenderSingleEmberFromSeries(std::atomic<size_t>* atomfTime, size_t index) bool FinalRenderEmberController<T>::RenderSingleEmberFromSeries(std::atomic<size_t>* atomfTime, size_t index)
{ {
if (m_Renderers.size() <= index) { if (m_Renderers.size() <= index)
{
return false; return false;
} }
@ -248,9 +246,9 @@ FinalRenderEmberController<T>::FinalRenderEmberController(FractoriumFinalRenderD
SyncGuiToRenderer(); SyncGuiToRenderer();
m_GuiState.m_Strips = VerifyStrips(m_Ember->m_FinalRasH, m_GuiState.m_Strips, m_GuiState.m_Strips = VerifyStrips(m_Ember->m_FinalRasH, m_GuiState.m_Strips,
[&](const string & s) { Output(QString::fromStdString(s)); }, //Greater than height. [&](const string& s) { Output(QString::fromStdString(s)); }, //Greater than height.
[&](const string & s) { Output(QString::fromStdString(s)); }, //Mod height != 0. [&](const string& s) { Output(QString::fromStdString(s)); }, //Mod height != 0.
[&](const string & s) { Output(QString::fromStdString(s) + "\n"); }); //Final strips value to be set. [&](const string& s) { Output(QString::fromStdString(s) + "\n"); }); //Final strips value to be set.
} }
//The rendering process is different between doing a single image, and doing multiple. //The rendering process is different between doing a single image, and doing multiple.
@ -291,16 +289,15 @@ FinalRenderEmberController<T>::FinalRenderEmberController(FractoriumFinalRenderD
//even when using double precision, which most cards at the time of this writing already exceed. //even when using double precision, which most cards at the time of this writing already exceed.
m_GuiState.m_Strips = 1; m_GuiState.m_Strips = 1;
CopyCont(embers, m_EmberFile.m_Embers); CopyCont(embers, m_EmberFile.m_Embers);
std::atomic<size_t> atomfTime(0); std::atomic<size_t> atomfTime(0);
vector<std::thread> threadVec; vector<std::thread> threadVec;
threadVec.reserve(m_Renderers.size()); threadVec.reserve(m_Renderers.size());
for (size_t r = 0; r < m_Renderers.size(); r++) for (size_t r = 0; r < m_Renderers.size(); r++)
{ {
//All will share a pointer to the original vector to conserve memory with large files. Ok because the vec doesn't get modified. //All will share a pointer to the original vector to conserve memory with large files. Ok because the vec doesn't get modified.
m_Renderers[r]->SetExternalEmbersPointer(&embers); m_Renderers[r]->SetExternalEmbersPointer(&embers);
threadVec.push_back(std::thread(&RenderSingleEmberFromSeries, this, &atomfTime, r)); threadVec.push_back(std::thread(&FinalRenderEmberController<T>::RenderSingleEmberFromSeries, this, &atomfTime, r));
} }
Join(threadVec); Join(threadVec);
@ -326,11 +323,9 @@ FinalRenderEmberController<T>::FinalRenderEmberController(FractoriumFinalRenderD
else if (m_Renderer.get())//Render a single image. else if (m_Renderer.get())//Render a single image.
{ {
Output(ComposePath(QString::fromStdString(m_Ember->m_Name))); Output(ComposePath(QString::fromStdString(m_Ember->m_Name)));
m_ImageCount = 1; m_ImageCount = 1;
m_Ember->m_TemporalSamples = 1; m_Ember->m_TemporalSamples = 1;
m_Fractorium->m_Controller->ParamsToEmber(*m_Ember, true);//Update color and filter params from the main window controls, which only affect the filter and/or final accumulation stage. m_Fractorium->m_Controller->ParamsToEmber(*m_Ember, true);//Update color and filter params from the main window controls, which only affect the filter and/or final accumulation stage.
RenderSingleEmber(*m_Ember, /* fullRender= */ !isBump, currentStripForProgress); RenderSingleEmber(*m_Ember, /* fullRender= */ !isBump, currentStripForProgress);
} }
else else
@ -716,7 +711,7 @@ tuple<size_t, size_t, size_t> FinalRenderEmberController<T>::SyncAndComputeMemor
if (m_Renderer.get()) if (m_Renderer.get())
{ {
strips = VerifyStrips(m_Ember->m_FinalRasH, m_FinalRenderDialog->Strips(), strips = VerifyStrips(m_Ember->m_FinalRasH, m_FinalRenderDialog->Strips(),
[&](const string & s) {}, [&](const string & s) {}, [&](const string & s) {}); [&](const string& s) {}, [&](const string& s) {}, [&](const string& s) {});
m_Renderer->SetEmber(*m_Ember, eProcessAction::FULL_RENDER, true); m_Renderer->SetEmber(*m_Ember, eProcessAction::FULL_RENDER, true);
m_FinalPreviewRenderer->Render(UINT_MAX, UINT_MAX); m_FinalPreviewRenderer->Render(UINT_MAX, UINT_MAX);
p = m_Renderer->MemoryRequired(strips, true, m_FinalRenderDialog->DoSequence()); p = m_Renderer->MemoryRequired(strips, true, m_FinalRenderDialog->DoSequence());
@ -1164,7 +1159,7 @@ void FinalRenderPreviewRenderer<T>::PreviewRenderFunc(uint start, uint end)
m_PreviewRenderer.SetEmber(m_PreviewEmber, eProcessAction::FULL_RENDER, true); m_PreviewRenderer.SetEmber(m_PreviewEmber, eProcessAction::FULL_RENDER, true);
m_PreviewRenderer.PrepFinalAccumVector(m_PreviewFinalImage);//Must manually call this first because it could be erroneously made smaller due to strips if called inside Renderer::Run(). m_PreviewRenderer.PrepFinalAccumVector(m_PreviewFinalImage);//Must manually call this first because it could be erroneously made smaller due to strips if called inside Renderer::Run().
auto strips = VerifyStrips(m_PreviewEmber.m_FinalRasH, d->Strips(), auto strips = VerifyStrips(m_PreviewEmber.m_FinalRasH, d->Strips(),
[&](const string & s) {}, [&](const string & s) {}, [&](const string & s) {}); [&](const string& s) {}, [&](const string& s) {}, [&](const string& s) {});
StripsRender<T>(&m_PreviewRenderer, m_PreviewEmber, m_PreviewFinalImage, 0, strips, d->YAxisUp(), StripsRender<T>(&m_PreviewRenderer, m_PreviewEmber, m_PreviewFinalImage, 0, strips, d->YAxisUp(),
[&](size_t strip) {},//Pre strip. [&](size_t strip) {},//Pre strip.
[&](size_t strip) {},//Post strip. [&](size_t strip) {},//Post strip.

View File

@ -144,7 +144,7 @@ void FractoriumEmberController<T>::ApplyPaletteToEmber()
const uint freq = m_Fractorium->m_PaletteFrequencySpin->value(); const uint freq = m_Fractorium->m_PaletteFrequencySpin->value();
const auto sat = m_Fractorium->m_PaletteSaturationSpin->value() / 100.0; const auto sat = m_Fractorium->m_PaletteSaturationSpin->value() / 100.0;
const auto brightness = m_Fractorium->m_PaletteBrightnessSpin->value() / 255.0; const auto brightness = m_Fractorium->m_PaletteBrightnessSpin->value() / 255.0;
const auto contrast = m_Fractorium->m_PaletteContrastSpin->value() > 0 ? m_Fractorium->m_PaletteContrastSpin->value() * 2.0 : m_Fractorium->m_PaletteContrastSpin->value() / 100.0; const auto contrast = double(m_Fractorium->m_PaletteContrastSpin->value() > 0 ? m_Fractorium->m_PaletteContrastSpin->value() * 2.0 : m_Fractorium->m_PaletteContrastSpin->value()) / 100.0;
const auto hue = m_Fractorium->m_PaletteHueSpin->value() / 360.0; const auto hue = m_Fractorium->m_PaletteHueSpin->value() / 360.0;
//Use the temp palette as the base and apply the adjustments gotten from the GUI and save the result in the ember palette. //Use the temp palette as the base and apply the adjustments gotten from the GUI and save the result in the ember palette.
m_TempPalette.MakeAdjustedPalette(m_Ember.m_Palette, m_Fractorium->m_PreviewPaletteRotation, hue, sat, brightness, contrast, blur, freq); m_TempPalette.MakeAdjustedPalette(m_Ember.m_Palette, m_Fractorium->m_PreviewPaletteRotation, hue, sat, brightness, contrast, blur, freq);