--User changes

-Add new Blur Cuve field which controls how blurring increases when moving from the center out.

--Bug fixes
 -Undo Y axis flipping from previous commit, it never worked and is not worth the effort.

--Code changes
 -The new field is a member of Ember and is called m_BlurCurve, and the corresponding xml field is called "blur_curve".
This commit is contained in:
Person
2020-01-18 22:29:08 -08:00
parent 8e6ba922af
commit 5f08e54bd4
20 changed files with 141 additions and 54 deletions

View File

@ -995,6 +995,7 @@ void Fractorium::SetTabOrders()
w = SetTabOrder(this, w, m_PitchSpin);
w = SetTabOrder(this, w, m_YawSpin);
w = SetTabOrder(this, w, m_DepthBlurSpin);
w = SetTabOrder(this, w, m_BlurCurveSpin);
w = SetTabOrder(this, w, m_SpatialFilterWidthSpin);//Flame filter.
w = SetTabOrder(this, w, m_SpatialFilterTypeCombo);
w = SetTabOrder(this, w, m_DEFilterMinRadiusSpin);

View File

@ -230,6 +230,7 @@ public slots:
void OnPitchChanged(double d);
void OnYawChanged(double d);
void OnDepthBlurChanged(double d);
void OnBlurCurveChanged(double d);
void OnSpatialFilterWidthChanged(double d);//Filter.
void OnSpatialFilterTypeComboCurrentIndexChanged(const QString& text);
void OnTemporalFilterWidthChanged(double d);
@ -487,6 +488,7 @@ private:
DoubleSpinBox* m_PitchSpin;
DoubleSpinBox* m_YawSpin;
DoubleSpinBox* m_DepthBlurSpin;
DoubleSpinBox* m_BlurCurveSpin;
DoubleSpinBox* m_SpatialFilterWidthSpin;//Filter.
StealthComboBox* m_SpatialFilterTypeCombo;
DoubleSpinBox* m_TemporalFilterWidthSpin;

View File

@ -713,13 +713,13 @@
<property name="minimumSize">
<size>
<width>0</width>
<height>266</height>
<height>288</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>266</height>
<height>288</height>
</size>
</property>
<property name="focusPolicy">
@ -866,6 +866,11 @@
<string>Depth Blur</string>
</property>
</row>
<row>
<property name="text">
<string>Blur Curve</string>
</property>
</row>
<column>
<property name="text">
<string>Field</string>
@ -1032,6 +1037,19 @@
<string>0</string>
</property>
</item>
<item row="12" column="0">
<property name="text">
<string>Blur Curve (3D)</string>
</property>
<property name="toolTip">
<string>Curve parameter to adjust how blurry points are as they move away from 0,0. Use 0 to make bluriness uniform.</string>
</property>
</item>
<item row="12" column="1">
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="9" column="0">
@ -3194,7 +3212,7 @@
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Duplicate selected xforms.&lt;/p&gt;&lt;p&gt;If xaos is present in the flame, the new xforms will be added with existing xaos preserved, else they'll just be added normally.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Duplicate selected xforms.&lt;/p&gt;&lt;p&gt;If xaos is present in the flame, the duplicated xforms will be added with existing xaos preserved, else they'll just be added normally.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>

View File

@ -165,6 +165,7 @@ public:
virtual void PitchChanged(double d) { }
virtual void YawChanged(double d) { }
virtual void DepthBlurChanged(double d) { }
virtual void BlurCurveChanged(double d) { }
virtual void SpatialFilterWidthChanged(double d) { }
virtual void SpatialFilterTypeChanged(const QString& text) { }
virtual void TemporalFilterWidthChanged(double d) { }
@ -453,6 +454,7 @@ public:
virtual void PitchChanged(double d) override;
virtual void YawChanged(double d) override;
virtual void DepthBlurChanged(double d) override;
virtual void BlurCurveChanged(double d) override;
virtual void SpatialFilterWidthChanged(double d) override;
virtual void SpatialFilterTypeChanged(const QString& text) override;
virtual void TemporalFilterWidthChanged(double d) override;

View File

@ -188,10 +188,10 @@ void Fractorium::UpdateHistogramBounds()
if (auto r = m_Controller->Renderer())
{
ul.sprintf("UL: %3.3f, %3.3f", r->LowerLeftX(), m_Settings->YAxisUp() ? r->UpperRightY() : r->LowerLeftY());//These bounds include gutter padding.
ur.sprintf("UR: %3.3f, %3.3f", r->UpperRightX(), m_Settings->YAxisUp() ? r->UpperRightY() : r->LowerLeftY());
lr.sprintf("LR: %3.3f, %3.3f", r->UpperRightX(), m_Settings->YAxisUp() ? r->LowerLeftY() : r->UpperRightY());
ll.sprintf("LL: %3.3f, %3.3f", r->LowerLeftX(), m_Settings->YAxisUp() ? r->LowerLeftY() : r->UpperRightY());
ul.sprintf("UL: %3.3f, %3.3f", r->LowerLeftX(), r->UpperRightY());//These bounds include gutter padding.
ur.sprintf("UR: %3.3f, %3.3f", r->UpperRightX(), r->UpperRightY());
lr.sprintf("LR: %3.3f, %3.3f", r->UpperRightX(), r->LowerLeftY());
ll.sprintf("LL: %3.3f, %3.3f", r->LowerLeftX(), r->LowerLeftY());
wh.sprintf("W x H: %4u x %4u", r->SuperRasW(), r->SuperRasH());
g.sprintf("%u", (uint)r->GutterWidth());
ui.InfoBoundsLabelUL->setText(ul);

View File

@ -59,11 +59,12 @@ void Fractorium::InitParamsUI()
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_ScaleSpin, spinHeight, 10, dmax, 20, SIGNAL(valueChanged(double)), SLOT(OnScaleChanged(double)), true, 240, 240, 240);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_ZoomSpin, spinHeight, 0, 25, 0.2, SIGNAL(valueChanged(double)), SLOT(OnZoomChanged(double)), true, 0, 0, 0);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_RotateSpin, spinHeight, -180, 180, 10, SIGNAL(valueChanged(double)), SLOT(OnRotateChanged(double)), true, 0, 0, 0);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_ZPosSpin, spinHeight, -1000, 1000, 1, SIGNAL(valueChanged(double)), SLOT(OnZPosChanged(double)), true, 0, 1, 0);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_ZPosSpin, spinHeight, -1000, 1000, 0.1, SIGNAL(valueChanged(double)), SLOT(OnZPosChanged(double)), true, 0, 1, 0);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_PerspectiveSpin, spinHeight, -500, 500, 0.01, SIGNAL(valueChanged(double)), SLOT(OnPerspectiveChanged(double)), true, 0, 1, 0);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_PitchSpin, spinHeight, -dmax, dmax, 1, SIGNAL(valueChanged(double)), SLOT(OnPitchChanged(double)), true, 0, 45, 0);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_YawSpin, spinHeight, -dmax, dmax, 1, SIGNAL(valueChanged(double)), SLOT(OnYawChanged(double)), true, 0, 45, 0);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_DepthBlurSpin, spinHeight, -dmax, dmax, 0.01, SIGNAL(valueChanged(double)), SLOT(OnDepthBlurChanged(double)), true, 0, 1, 0);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_BlurCurveSpin, spinHeight, 0, dmax, 0.1, SIGNAL(valueChanged(double)), SLOT(OnBlurCurveChanged(double)), true, 0, 1, 0);
m_WidthSpin->m_DoubleClickNonZeroEvent = [&](SpinBox * sb, int val)
{
m_Controller->ResizeAndScale(val, m_HeightSpin->DoubleClickNonZero(), eScaleType::SCALE_WIDTH);
@ -467,6 +468,15 @@ template <typename T> void FractoriumEmberController<T>::DepthBlurChanged(double
}
void Fractorium::OnDepthBlurChanged(double d) { m_Controller->DepthBlurChanged(d); }
template <typename T> void FractoriumEmberController<T>::BlurCurveChanged(double d)
{
UpdateAll([&](Ember<T>& ember, bool isMain)
{
ember.m_BlurCurve = d;
}, true, eProcessAction::FULL_RENDER, m_Fractorium->ApplyAll());
}
void Fractorium::OnBlurCurveChanged(double d) { m_Controller->BlurCurveChanged(d); }
/// <summary>
/// Filter.
/// </summary>
@ -797,6 +807,7 @@ void FractoriumEmberController<T>::FillParamTablesAndPalette()
m_Fractorium->m_PitchSpin->SetValueStealth(m_Ember.m_CamPitch * RAD_2_DEG_T);
m_Fractorium->m_YawSpin->SetValueStealth(m_Ember.m_CamYaw * RAD_2_DEG_T);
m_Fractorium->m_DepthBlurSpin->SetValueStealth(m_Ember.m_CamDepthBlur);
m_Fractorium->m_BlurCurveSpin->SetValueStealth(m_Ember.m_BlurCurve);
m_Fractorium->m_SpatialFilterWidthSpin->SetValueStealth(m_Ember.m_SpatialFilterRadius);//Filter.
m_Fractorium->m_SpatialFilterTypeCombo->SetCurrentIndexStealth(int(m_Ember.m_SpatialFilterType));
m_Fractorium->m_TemporalFilterWidthSpin->SetValueStealth(m_Ember.m_TemporalFilterWidth);
@ -871,6 +882,7 @@ void FractoriumEmberController<T>::ParamsToEmberPrivate(Ember<U>& ember, bool im
ember.m_CamPitch = m_Fractorium->m_PitchSpin->value() * DEG_2_RAD_T;
ember.m_CamYaw = m_Fractorium->m_YawSpin->value() * DEG_2_RAD_T;
ember.m_CamDepthBlur = m_Fractorium->m_DepthBlurSpin->value();
ember.m_BlurCurve = m_Fractorium->m_BlurCurveSpin->value();
ember.m_SubBatchSize = m_Fractorium->m_SbsSpin->value();
ember.m_FuseCount = m_Fractorium->m_FuseSpin->value();
ember.m_RandPointRange = m_Fractorium->m_RandRangeSpin->value();

View File

@ -208,7 +208,7 @@ void Fractorium::OnAddLinkedXformButtonClicked(bool checked) { m_Controller->Add
/// <summary>
/// Duplicate the specified xforms in the current ember, and set the last one as the current xform.
/// If xaos is present in the ember, the new xforms will be added with xaos preserved, else they'll just be added normally.
/// If xaos is present in the ember, the duplicated xforms will be added with xaos preserved, else they'll just be added normally.
/// Called when the duplicate xform button is clicked.
/// Resets the rendering process.
/// </summary>

View File

@ -549,12 +549,7 @@ void GLWidget::paintGL()
#else
m_Program->bind();
m_ProjMatrix.setToIdentity();
if (!controller->Renderer()->YAxisUp())
m_ProjMatrix.ortho(-unitX, unitX, unitY, -unitY, -1, 1);//Projection matrix: OpenGL camera is always centered, just move the ember internally inside the renderer.
else
m_ProjMatrix.ortho(-unitX, unitX, -unitY, unitY, -1, 1);
m_ProjMatrix.ortho(-unitX, unitX, -unitY, unitY, -1, 1);//Projection matrix: OpenGL camera is always centered, just move the ember internally inside the renderer.
m_ModelViewMatrix.setToIdentity();
//this->DrawUnitSquare();
controller->GLController()->DrawAffines(pre, post);