mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-02-01 10:30:08 -05:00
--User changes
-Allow the user to resume a finished render in the final render dialog with a higher quality. This only applies to rendering a single image with no strips. -Make clear xaos apply to all when Apply All is checked.
This commit is contained in:
parent
5a26ed5044
commit
74fea61ad2
@ -647,7 +647,9 @@ static bool StripsRender(RendererBase* renderer, Ember<T>& ember, vector<v4F>& f
|
|||||||
ember.m_Quality /= strips;
|
ember.m_Quality /= strips;
|
||||||
ember.m_FinalRasH = realHeight;
|
ember.m_FinalRasH = realHeight;
|
||||||
ember.m_CenterY = centerY;
|
ember.m_CenterY = centerY;
|
||||||
renderer->SetEmber(ember);//Further processing will require the dimensions to match the original ember, so re-assign.
|
|
||||||
|
if (strips > 1)
|
||||||
|
renderer->SetEmber(ember);//Further processing will require the dimensions to match the original ember, so re-assign.
|
||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
allStripsFinished(ember);
|
allStripsFinished(ember);
|
||||||
|
@ -163,6 +163,27 @@ FractoriumFinalRenderDialog::FractoriumFinalRenderDialog(QWidget* p, Qt::WindowF
|
|||||||
m_SupersampleSpin->setValue(m_Settings->FinalSupersample());
|
m_SupersampleSpin->setValue(m_Settings->FinalSupersample());
|
||||||
m_StripsSpin->setValue(int(m_Settings->FinalStrips()));
|
m_StripsSpin->setValue(int(m_Settings->FinalStrips()));
|
||||||
Scale(eScaleType(m_Settings->FinalScale()));
|
Scale(eScaleType(m_Settings->FinalScale()));
|
||||||
|
auto menu = new QMenu(this);
|
||||||
|
auto add10 = new QAction("Add 10% quality", this); add10->setProperty("tag", QVariant(0.10));
|
||||||
|
auto add25 = new QAction("Add 25% quality", this); add25->setProperty("tag", QVariant(0.25));
|
||||||
|
auto add50 = new QAction("Add 50% quality", this); add50->setProperty("tag", QVariant(0.50));
|
||||||
|
auto add100 = new QAction("Add 100% quality", this); add100->setProperty("tag", QVariant(1.0));
|
||||||
|
auto add200 = new QAction("Add 200% quality", this); add200->setProperty("tag", QVariant(2.0));
|
||||||
|
menu->addAction(add10);
|
||||||
|
menu->addAction(add25);
|
||||||
|
menu->addAction(add50);
|
||||||
|
menu->addAction(add100);
|
||||||
|
menu->addAction(add200);
|
||||||
|
ui.FinalRenderBumpQualityStartButton->setMenu(menu);
|
||||||
|
ui.FinalRenderBumpQualityStartButton->setProperty("tag", add25->property("tag"));
|
||||||
|
ui.FinalRenderBumpQualityStartButton->setText(add25->text());
|
||||||
|
ui.FinalRenderBumpQualityStartButton->setEnabled(false);
|
||||||
|
connect(ui.FinalRenderBumpQualityStartButton, SIGNAL(clicked()), this, SLOT(OnQualityBumpClicked()));
|
||||||
|
connect(add10, SIGNAL(triggered()), this, SLOT(OnQualityBumpClicked()));
|
||||||
|
connect(add25, SIGNAL(triggered()), this, SLOT(OnQualityBumpClicked()));
|
||||||
|
connect(add50, SIGNAL(triggered()), this, SLOT(OnQualityBumpClicked()));
|
||||||
|
connect(add100, SIGNAL(triggered()), this, SLOT(OnQualityBumpClicked()));
|
||||||
|
connect(add200, SIGNAL(triggered()), this, SLOT(OnQualityBumpClicked()));
|
||||||
int index = 0;
|
int index = 0;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
@ -225,6 +246,7 @@ FractoriumFinalRenderDialog::FractoriumFinalRenderDialog(QWidget* p, Qt::WindowF
|
|||||||
w = SetTabOrder(this, w, m_PrefixEdit);
|
w = SetTabOrder(this, w, m_PrefixEdit);
|
||||||
w = SetTabOrder(this, w, m_SuffixEdit);
|
w = SetTabOrder(this, w, m_SuffixEdit);
|
||||||
w = SetTabOrder(this, w, ui.FinalRenderTextOutput);
|
w = SetTabOrder(this, w, ui.FinalRenderTextOutput);
|
||||||
|
w = SetTabOrder(this, w, ui.FinalRenderBumpQualityStartButton);
|
||||||
w = SetTabOrder(this, w, ui.FinalRenderStartButton);
|
w = SetTabOrder(this, w, ui.FinalRenderStartButton);
|
||||||
w = SetTabOrder(this, w, ui.FinalRenderPauseButton);
|
w = SetTabOrder(this, w, ui.FinalRenderPauseButton);
|
||||||
w = SetTabOrder(this, w, ui.FinalRenderStopButton);
|
w = SetTabOrder(this, w, ui.FinalRenderStopButton);
|
||||||
@ -435,6 +457,7 @@ void FractoriumFinalRenderDialog::OnDoAllCheckBoxStateChanged(int state)
|
|||||||
ui.FinalRenderDoSequenceCheckBox->setChecked(false);
|
ui.FinalRenderDoSequenceCheckBox->setChecked(false);
|
||||||
|
|
||||||
ui.FinalRenderDoSequenceCheckBox->setEnabled(ui.FinalRenderDoAllCheckBox->isChecked());
|
ui.FinalRenderDoSequenceCheckBox->setEnabled(ui.FinalRenderDoAllCheckBox->isChecked());
|
||||||
|
ui.FinalRenderBumpQualityStartButton->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -475,6 +498,8 @@ void FractoriumFinalRenderDialog::OnApplyAllCheckBoxStateChanged(int state)
|
|||||||
{
|
{
|
||||||
if (state && m_Controller.get())
|
if (state && m_Controller.get())
|
||||||
m_Controller->SyncGuiToEmbers();
|
m_Controller->SyncGuiToEmbers();
|
||||||
|
|
||||||
|
ui.FinalRenderBumpQualityStartButton->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -725,6 +750,32 @@ void FractoriumFinalRenderDialog::OnSuffixChanged(const QString& s)
|
|||||||
Path(m_Controller->ComposePath(m_Controller->Name()));
|
Path(m_Controller->ComposePath(m_Controller->Name()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Increase the quality of the last render and start rendering again.
|
||||||
|
/// Note this is only when rendering a single image with no strips.
|
||||||
|
/// </summary>
|
||||||
|
void FractoriumFinalRenderDialog::OnQualityBumpClicked()
|
||||||
|
{
|
||||||
|
auto act = qobject_cast<QAction*>(sender());
|
||||||
|
auto tbtn = qobject_cast<QToolButton*>(sender());
|
||||||
|
|
||||||
|
if (tbtn)
|
||||||
|
{
|
||||||
|
if (m_Controller.get())
|
||||||
|
{
|
||||||
|
double d = tbtn->property("tag").toDouble();
|
||||||
|
m_QualitySpin->SetValueStealth(std::ceil(Quality() + (Quality() * d)));
|
||||||
|
m_Controller->BumpQualityRender(d);
|
||||||
|
tbtn->setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (act)
|
||||||
|
{
|
||||||
|
ui.FinalRenderBumpQualityStartButton->setText(act->text());
|
||||||
|
ui.FinalRenderBumpQualityStartButton->setProperty("tag", act->property("tag"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Start the render process.
|
/// Start the render process.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -947,6 +998,7 @@ bool FractoriumFinalRenderDialog::SetMemory()
|
|||||||
else
|
else
|
||||||
ui.FinalRenderTextOutput->clear();
|
ui.FinalRenderTextOutput->clear();
|
||||||
|
|
||||||
|
ui.FinalRenderBumpQualityStartButton->setEnabled(false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,6 +111,7 @@ public slots:
|
|||||||
void OnExtIndexChanged(int d);
|
void OnExtIndexChanged(int d);
|
||||||
void OnPrefixChanged(const QString& s);
|
void OnPrefixChanged(const QString& s);
|
||||||
void OnSuffixChanged(const QString& s);
|
void OnSuffixChanged(const QString& s);
|
||||||
|
void OnQualityBumpClicked();
|
||||||
void OnRenderClicked(bool checked);
|
void OnRenderClicked(bool checked);
|
||||||
void OnPauseClicked(bool checked);
|
void OnPauseClicked(bool checked);
|
||||||
void OnCancelRenderClicked(bool checked);
|
void OnCancelRenderClicked(bool checked);
|
||||||
|
@ -1192,6 +1192,25 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="FinalRenderBumpQualityStartButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Add Quality</string>
|
||||||
|
</property>
|
||||||
|
<property name="popupMode">
|
||||||
|
<enum>QToolButton::MenuButtonPopup</enum>
|
||||||
|
</property>
|
||||||
|
<property name="toolButtonStyle">
|
||||||
|
<enum>Qt::ToolButtonTextOnly</enum>
|
||||||
|
</property>
|
||||||
|
<property name="autoRaise">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="arrowType">
|
||||||
|
<enum>Qt::NoArrow</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="FinalRenderStartButton">
|
<widget class="QPushButton" name="FinalRenderStartButton">
|
||||||
<property name="focusPolicy">
|
<property name="focusPolicy">
|
||||||
|
@ -292,9 +292,10 @@ FinalRenderEmberController<T>::FinalRenderEmberController(FractoriumFinalRenderD
|
|||||||
}
|
}
|
||||||
else if (m_Renderer.get())//Render a single image.
|
else if (m_Renderer.get())//Render a single image.
|
||||||
{
|
{
|
||||||
|
bool isBump = m_IsQualityBump && m_GuiState.m_Strips == 1;//Should never get called with m_IsQualityBump otherwise, but check one last time to be safe.
|
||||||
m_ImageCount = 1;
|
m_ImageCount = 1;
|
||||||
m_Ember->m_TemporalSamples = 1;
|
m_Ember->m_TemporalSamples = 1;
|
||||||
m_Renderer->SetEmber(*m_Ember);
|
m_Renderer->SetEmber(*m_Ember, isBump ? eProcessAction::KEEP_ITERATING : eProcessAction::FULL_RENDER);
|
||||||
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();
|
||||||
Memset(m_FinalImage);
|
Memset(m_FinalImage);
|
||||||
@ -416,6 +417,35 @@ bool FinalRenderEmberController<T>::Render()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Increase the quality of the last render and start rendering again.
|
||||||
|
/// Note this is only when rendering a single image with no strips.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="d">The amount to increase the quality by, expressed as a decimal percentage. Eg: 0.5 means to increase by 50%.</param>
|
||||||
|
/// <returns>True if nothing went wrong, else false.</returns>
|
||||||
|
template <typename T>
|
||||||
|
bool FinalRenderEmberController<T>::BumpQualityRender(double d)
|
||||||
|
{
|
||||||
|
m_Ember->m_Quality += std::ceil(m_Ember->m_Quality * d);
|
||||||
|
m_Renderer->SetEmber(*m_Ember, eProcessAction::KEEP_ITERATING, true);
|
||||||
|
QString filename = m_FinalRenderDialog->Path();
|
||||||
|
|
||||||
|
if (filename == "")
|
||||||
|
{
|
||||||
|
m_Fractorium->ShowCritical("File Error", "Please enter a valid path and filename for the output.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_IsQualityBump = true;
|
||||||
|
auto iterCount = m_Renderer->TotalIterCount(1);
|
||||||
|
m_FinalRenderDialog->ui.FinalRenderParamsTable->item(m_FinalRenderDialog->m_ItersCellIndex, 1)->setText(ToString<qulonglong>(iterCount));
|
||||||
|
m_FinalRenderDialog->ui.FinalRenderTextOutput->setText("Preparing all parameters.\n");
|
||||||
|
m_Result = QtConcurrent::run(m_FinalRenderFunc);
|
||||||
|
m_Settings->sync();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stop rendering and initialize a new renderer, using the specified type and the options on the final render dialog.
|
/// Stop rendering and initialize a new renderer, using the specified type and the options on the final render dialog.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -803,6 +833,7 @@ template<typename T>
|
|||||||
void FinalRenderEmberController<T>::HandleFinishedProgress()
|
void FinalRenderEmberController<T>::HandleFinishedProgress()
|
||||||
{
|
{
|
||||||
auto finishedCountCached = m_FinishedImageCount.load();//Make sure to use the same value throughout this function even if the atomic is changing.
|
auto finishedCountCached = m_FinishedImageCount.load();//Make sure to use the same value throughout this function even if the atomic is changing.
|
||||||
|
bool doAll = m_GuiState.m_DoAll && m_EmberFile.Size() > 1;
|
||||||
|
|
||||||
if (m_FinishedImageCount.load() != m_ImageCount)
|
if (m_FinishedImageCount.load() != m_ImageCount)
|
||||||
ResetProgress(false);
|
ResetProgress(false);
|
||||||
@ -811,6 +842,7 @@ void FinalRenderEmberController<T>::HandleFinishedProgress()
|
|||||||
|
|
||||||
QMetaObject::invokeMethod(m_FinalRenderDialog->ui.FinalRenderTotalProgress, "setValue", Qt::QueuedConnection, Q_ARG(int, int((float(finishedCountCached) / float(m_ImageCount)) * 100)));
|
QMetaObject::invokeMethod(m_FinalRenderDialog->ui.FinalRenderTotalProgress, "setValue", Qt::QueuedConnection, Q_ARG(int, int((float(finishedCountCached) / float(m_ImageCount)) * 100)));
|
||||||
QMetaObject::invokeMethod(m_FinalRenderDialog->ui.FinalRenderImageCountLabel, "setText", Qt::QueuedConnection, Q_ARG(const QString&, ToString<qulonglong>(finishedCountCached) + " / " + ToString<qulonglong>(m_ImageCount)));
|
QMetaObject::invokeMethod(m_FinalRenderDialog->ui.FinalRenderImageCountLabel, "setText", Qt::QueuedConnection, Q_ARG(const QString&, ToString<qulonglong>(finishedCountCached) + " / " + ToString<qulonglong>(m_ImageCount)));
|
||||||
|
QMetaObject::invokeMethod(m_FinalRenderDialog->ui.FinalRenderBumpQualityStartButton, "setEnabled", Qt::QueuedConnection, Q_ARG(bool, !doAll && m_Renderer.get() && m_GuiState.m_Strips == 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -69,6 +69,7 @@ public:
|
|||||||
virtual tuple<size_t, size_t, size_t> SyncAndComputeMemory() { return tuple<size_t, size_t, size_t>(0, 0, 0); }
|
virtual tuple<size_t, size_t, size_t> SyncAndComputeMemory() { return tuple<size_t, size_t, size_t>(0, 0, 0); }
|
||||||
virtual double OriginalAspect() { return 1; }
|
virtual double OriginalAspect() { return 1; }
|
||||||
virtual QString ComposePath(const QString& name) { return ""; }
|
virtual QString ComposePath(const QString& name) { return ""; }
|
||||||
|
virtual bool BumpQualityRender(double d) { return false; }
|
||||||
virtual void CancelRender() { }
|
virtual void CancelRender() { }
|
||||||
virtual QString CheckMemory(const tuple<size_t, size_t, size_t>& p) { return ""; }
|
virtual QString CheckMemory(const tuple<size_t, size_t, size_t>& p) { return ""; }
|
||||||
|
|
||||||
@ -78,6 +79,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool m_Run = false;
|
bool m_Run = false;
|
||||||
|
bool m_IsQualityBump = false;
|
||||||
size_t m_ImageCount = 0;
|
size_t m_ImageCount = 0;
|
||||||
std::atomic<size_t> m_FinishedImageCount;
|
std::atomic<size_t> m_FinishedImageCount;
|
||||||
|
|
||||||
@ -114,6 +116,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
virtual void SetEmber(size_t index, bool verbatim) override;
|
virtual void SetEmber(size_t index, bool verbatim) override;
|
||||||
virtual bool Render() override;
|
virtual bool Render() override;
|
||||||
|
virtual bool BumpQualityRender(double d) override;
|
||||||
virtual bool CreateRenderer(eRendererType renderType, const vector<pair<size_t, size_t>>& devices, bool updatePreviews, bool shared = true) override;
|
virtual bool CreateRenderer(eRendererType renderType, const vector<pair<size_t, size_t>>& devices, bool updatePreviews, bool shared = true) override;
|
||||||
virtual int ProgressFunc(Ember<T>& ember, void* foo, double fraction, int stage, double etaMs) override;
|
virtual int ProgressFunc(Ember<T>& ember, void* foo, double fraction, int stage, double etaMs) override;
|
||||||
virtual size_t Index() const override { return m_Ember->m_Index; }
|
virtual size_t Index() const override { return m_Ember->m_Index; }
|
||||||
|
@ -613,14 +613,13 @@ void Fractorium::SetPaletteFileComboIndex(const string& filename)
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
void FractoriumEmberController<T>::ClearColorCurves(int i)
|
void FractoriumEmberController<T>::ClearColorCurves(int i)
|
||||||
{
|
{
|
||||||
Update([&]
|
UpdateAll([&](Ember<T>& ember, bool isMain)
|
||||||
{
|
{
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
m_Ember.m_Curves.Init();
|
ember.m_Curves.Init();
|
||||||
else
|
else
|
||||||
m_Ember.m_Curves.Init(i);
|
ember.m_Curves.Init(i);
|
||||||
|
}, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY, m_Fractorium->ApplyAll());
|
||||||
}, true, m_Renderer->EarlyClip() ? eProcessAction::FILTER_AND_ACCUM : eProcessAction::ACCUM_ONLY);
|
|
||||||
FillCurvesControl();
|
FillCurvesControl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,7 +206,10 @@ void Fractorium::FillXaosTable()
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
void FractoriumEmberController<T>::ClearXaos()
|
void FractoriumEmberController<T>::ClearXaos()
|
||||||
{
|
{
|
||||||
Update([&] { m_Ember.ClearXaos(); });
|
UpdateAll([&](Ember<T>& ember, bool isMain)
|
||||||
|
{
|
||||||
|
ember.ClearXaos();
|
||||||
|
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
|
||||||
FillXaos();
|
FillXaos();
|
||||||
FillAppliedXaos();
|
FillAppliedXaos();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user