paysages: Small changes

git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@372 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
This commit is contained in:
Michaël Lemaire 2012-07-03 16:26:13 +00:00 committed by ThunderK
parent b80c703f36
commit bce5dfbd8f
3 changed files with 7 additions and 5 deletions

1
TODO
View file

@ -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.

View file

@ -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();
}

View file

@ -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)));