diff --git a/TODO b/TODO index e2fbca3..924e0ab 100644 --- a/TODO +++ b/TODO @@ -6,7 +6,6 @@ Technology Preview 2 : - InputInt doesn't honor small_step. - Keep skydome lights in cache for a render. - Add buttons to restore "auto" default values in tabs and dialogs. -- Interface for textures thickness, slope_range and thickness_transparency (and correct slider ranges). - Add "hardness to light" and shadow control ("minimum lighting") to material. - Add layer sorting/naming. - Add logarithmic sliders for some float values. diff --git a/gui_qt/formtextures.cpp b/gui_qt/formtextures.cpp index 1df5a48..ed0c9cd 100644 --- a/gui_qt/formtextures.cpp +++ b/gui_qt/formtextures.cpp @@ -136,11 +136,14 @@ FormTextures::FormTextures(QWidget *parent): addPreview(previewColor, tr("Lighted sample")); addInputNoise(tr("Surface noise"), _layer.bump_noise); - addInputDouble(tr("Surface noise height"), &_layer.bump_height, 0.0, 0.5, 0.001, 0.05); - addInputDouble(tr("Surface noise scaling"), &_layer.bump_scaling, 0.01, 1.0, 0.01, 0.1); + addInputDouble(tr("Surface noise height"), &_layer.bump_height, 0.0, 0.1, 0.001, 0.01); + addInputDouble(tr("Surface noise scaling"), &_layer.bump_scaling, 0.001, 0.1, 0.001, 0.01); addInputMaterial(tr("Material"), &_layer.material); addInputCurve(tr("Coverage by altitude"), _supp.height_curve, -20.0, 20.0, 0.0, 1.0, tr("Terrain altitude"), tr("Texture coverage")); addInputCurve(tr("Coverage by slope"), _supp.slope_curve, 0.0, 5.0, 0.0, 1.0, tr("Terrain slope"), tr("Texture coverage")); + addInputDouble(tr("Amplitude for slope coverage"), &_layer.slope_range, 0.001, 0.1, 0.001, 0.01); + addInputDouble(tr("Layer thickness"), &_layer.thickness, 0.0, 0.1, 0.001, 0.01); + addInputDouble(tr("Transparency thickness"), &_layer.thickness_transparency, 0.0, 0.1, 0.001, 0.01); revertConfig(); } diff --git a/gui_qt/inputcurve.cpp b/gui_qt/inputcurve.cpp index 8c48ef0..6058cda 100644 --- a/gui_qt/inputcurve.cpp +++ b/gui_qt/inputcurve.cpp @@ -35,8 +35,8 @@ public: painter.setPen(QColor(0, 0, 0)); position = _xmin + (_xmax - _xmin) * (double)x / (double)(width - 1); value = (curveGetValue(_curve, position) - _ymin) * (_ymax - _ymin); - prev_value = curveGetValue(_curve, position - 1.0 / (double)(width - 1)); - next_value = curveGetValue(_curve, position + 1.0 / (double)(width - 1)); + prev_value = (curveGetValue(_curve, position - (_xmax - _xmin) / (double)(width - 1)) - _ymin) * (_ymax - _ymin); + next_value = (curveGetValue(_curve, position + (_xmax - _xmin) / (double)(width - 1)) - _ymin) * (_ymax - _ymin); painter.drawLine(x, height - 1 - (int)((value + (prev_value - value) / 2.0) * (double)(height - 1)), x, height - 1 - (int)((value + (next_value - value) / 2.0) * (double)(height - 1))); painter.drawPoint(x, height - 1 - (int)(value * (double)(height - 1)));