Skip to content

Commit

Permalink
updating hybrid color (finished for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
mclarekin committed Dec 5, 2017
1 parent 465547f commit 609d08f
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 87 deletions.
123 changes: 65 additions & 58 deletions mandelbulber2/qt/material_editor.ui
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-409</y>
<y>0</y>
<width>756</width>
<height>2071</height>
<height>2076</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
Expand Down Expand Up @@ -1329,10 +1329,38 @@ direction vector:</string>
<property name="spacing">
<number>2</number>
</property>
<item row="16" column="0">
<item row="21" column="2">
<widget class="MyDoubleSpinBox" name="spinbox_fractal_coloring_ii_add_scale">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="prefix">
<string/>
</property>
<property name="suffix">
<string/>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="maximum">
<double>99999.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item row="21" column="0">
<widget class="QLabel" name="label_34">
<property name="text">
<string>aux.i scale</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;add i * i * scale&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -1429,13 +1457,13 @@ direction vector:</string>
<string/>
</property>
<property name="decimals">
<number>3</number>
<number>2</number>
</property>
<property name="minimum">
<double>-999.999000000000024</double>
<double>-10000.000000000000000</double>
</property>
<property name="maximum">
<double>999.999000000000024</double>
<double>10000.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
Expand Down Expand Up @@ -1615,34 +1643,6 @@ direction vector:</string>
</property>
</widget>
</item>
<item row="16" column="2">
<widget class="MyDoubleSpinBox" name="spinbox_fractal_coloring_xyz_bias_scaleI">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="prefix">
<string/>
</property>
<property name="suffix">
<string/>
</property>
<property name="decimals">
<number>6</number>
</property>
<property name="minimum">
<double>-9999.999900000000707</double>
</property>
<property name="maximum">
<double>9999.999900000000707</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item row="19" column="1">
<widget class="QSlider" name="slider_fractal_coloring_old_hybrid_weight">
<property name="sizePolicy">
Expand All @@ -1655,29 +1655,7 @@ direction vector:</string>
<number>0</number>
</property>
<property name="maximum">
<number>1000000</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="16" column="1">
<widget class="QSlider" name="slider_fractal_coloring_xyz_bias_scaleI">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimum">
<number>-100000000</number>
</property>
<property name="maximum">
<number>100000000</number>
<number>10000000</number>
</property>
<property name="singleStep">
<number>1</number>
Expand Down Expand Up @@ -1744,6 +1722,35 @@ direction vector:</string>
</property>
</widget>
</item>
<item row="21" column="1">
<widget class="QSlider" name="slider_fractal_coloring_ii_add_scale">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>10000000</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="20" column="0" colspan="3">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>
Expand Down
44 changes: 19 additions & 25 deletions mandelbulber2/src/compute_fractal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,8 @@ void Compute(const cNineFractals &fractals, const sFractalIn &in, sFractalOut *o
{
CVector3 xyzAxis = fabs(CVector3( z.x, z.y, z.z)) * in.fractalColoring.xyz000;

xyzValue = (xyzAxis.x + xyzAxis.y + xyzAxis.z);
xyzValue *= in.fractalColoring.xyzBiasScaleI / (extendedAux.i); // now = i + 1
xyzValue = (xyzAxis.x + xyzAxis.y + xyzAxis.z) * 1000.0;
//xyzValue += in.fractalColoring.xyzBiasScaleI * (extendedAux.i * extendedAux.i); // now = i + 1
}
addValue += xyzValue; // addValue accumulates outputs

Expand All @@ -501,37 +501,31 @@ void Compute(const cNineFractals &fractals, const sFractalIn &in, sFractalOut *o
double auxColorValue100 = auxColorValue * 100; // limited at 100,000
double radDE5000 = radDE * 5000; // limited at 100,000
// double radIe13 = r / 1e13;

//


// old hybrid
double oldHybridValue = 0.0;
oldHybridValue = (minR1000 + auxColorValue100 + radDE5000); // old hybrid code

out->colorIndex = oldHybridValue;

double inputAbox2 = 0.0;
if (in.fractalColoring.extraColorEnabledFalse)
{
out->colorIndex =

// minimumR orbit trap
(minR1000 * in.fractalColoring.orbitTrapWeight) // orbit trap only
// (minimumR * 1000 * extendedAux.minRFactor) // orbit trap only

// aux.color
+ auxColorValue100 * in.fractalColoring.auxColorWeight// aux.color
// + iterColor100 * extendedAux.foldFactor// aux.color

+ addValue // all extra inputs

+ extendedAux.colorHybrid // transf_hybrid_color inputs

+ oldHybridValue * in.fractalColoring.oldHybridWeight; // weight

//+ r * extendedAux.radiusFactor / 1e13// radius // this may be replaced
//+ extendedAux.DE * extendedAux.scaleFactor / 1e15 // this may be replaced
//+ extendedAux.temp1Factor // inputs for "fractal specific" color modes
}
inputAbox2 =
minR1000 * in.fractalColoring.orbitTrapWeight // orbit trap only
+ auxColorValue100 * in.fractalColoring.auxColorWeight// aux.color
+ addValue // all extra inputs
+ extendedAux.colorHybrid // transf_hybrid_color inputs
+ oldHybridValue * in.fractalColoring.oldHybridWeight; // old hybrid
inputAbox2 += in.fractalColoring.iiAddScale * (extendedAux.i * extendedAux.i); // now = i + 1

//+ r * extendedAux.radiusFactor / 1e13// radius // this may be replaced
//+ extendedAux.DE * extendedAux.scaleFactor / 1e15 // this may be replaced
//+ extendedAux.temp1Factor // inputs for "fractal specific" color modes
}
out->colorIndex = oldHybridValue;
if (in.fractalColoring.extraColorEnabledFalse)
out->colorIndex = inputAbox2;
}
else
{
Expand Down
3 changes: 2 additions & 1 deletion mandelbulber2/src/fractal_coloring.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ struct sFractalColoring
bool oldHybridEnabledFalse;
double initialMiniumuR;
CVector3 xyz000;

double orbitTrapWeight;
double auxColorWeight;
double xyzBiasScaleI;
double iiAddScale;
double oldHybridWeight;


Expand Down
2 changes: 1 addition & 1 deletion mandelbulber2/src/initparameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ void InitMaterialParams(int materialId, cParameterContainer *par)
morphNone, paramStandard);
par->addParam(cMaterial::Name("fractal_coloring_aux_color_weight", materialId), 0.0, 0.0, 1e20,
morphNone, paramStandard);
par->addParam(cMaterial::Name("fractal_coloring_xyz_bias_scaleI", materialId), 1.0, 0.0, 1e20,
par->addParam(cMaterial::Name("fractal_coloring_ii_add_scale", materialId), 0.0, 1e-20, 1e20,
morphNone, paramStandard);
par->addParam(cMaterial::Name("fractal_coloring_old_hybrid_weight", materialId), 0.0, 0.0, 1e20,
morphNone, paramStandard);
Expand Down
4 changes: 2 additions & 2 deletions mandelbulber2/src/material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ void cMaterial::setParameters(int _id, const cParameterContainer *materialParam,
materialParam->Get<double>(Name("fractal_coloring_orbit_trap_weight", id));
fractalColoring.auxColorWeight =
materialParam->Get<double>(Name("fractal_coloring_aux_color_weight", id));
fractalColoring.xyzBiasScaleI =
materialParam->Get<double>(Name("fractal_coloring_xyz_bias_scaleI", id));
fractalColoring.iiAddScale =
materialParam->Get<double>(Name("fractal_coloring_ii_add_scale", id));
fractalColoring.oldHybridWeight =
materialParam->Get<double>(Name("fractal_coloring_old_hybrid_weight", id));
fractalColoring.xyz000 =
Expand Down

0 comments on commit 609d08f

Please sign in to comment.