Tweaked textures presets

This commit is contained in:
Michaël Lemaire 2013-10-03 23:27:37 +02:00
parent 7ea28826bb
commit 81a27b1b39
3 changed files with 30 additions and 15 deletions

View file

@ -43,9 +43,10 @@ MainTexturesForm::MainTexturesForm(QWidget *parent) : QWidget(parent), ui(new Ui
preview_cumul->setTextures(textures); preview_cumul->setTextures(textures);
form_helper->addPreview(ui->preview_cumul, preview_cumul); form_helper->addPreview(ui->preview_cumul, preview_cumul);
form_helper->addPreset(tr("Complex terrain"));
form_helper->addPreset(tr("Rocks with grass")); form_helper->addPreset(tr("Rocks with grass"));
form_helper->addPreset(tr("Snow covered mountains")); form_helper->addPreset(tr("Snow covered mountains"));
form_helper->addPreset(tr("Arid canyons")); //form_helper->addPreset(tr("Arid canyons"));
form_helper->setPresetButton(ui->button_preset); form_helper->setPresetButton(ui->button_preset);
connect(form_helper, SIGNAL(presetSelected(int)), this, SLOT(selectPreset(int))); connect(form_helper, SIGNAL(presetSelected(int)), this, SLOT(selectPreset(int)));

View file

@ -22,6 +22,7 @@ typedef enum
typedef enum typedef enum
{ {
TEXTURES_LAYER_PRESET_MUD,
TEXTURES_LAYER_PRESET_ROCK, TEXTURES_LAYER_PRESET_ROCK,
TEXTURES_LAYER_PRESET_GRASS, TEXTURES_LAYER_PRESET_GRASS,
TEXTURES_LAYER_PRESET_SAND, TEXTURES_LAYER_PRESET_SAND,

View file

@ -5,43 +5,47 @@ void texturesAutoPreset(TexturesDefinition* definition, TexturesPreset preset)
TexturesLayerDefinition* layer; TexturesLayerDefinition* layer;
layersClear(definition->layers); layersClear(definition->layers);
layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL));
texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_MUD);
layersSetName(definition->layers, 0, "Mud");
if (preset == TEXTURES_PRESET_FULL) if (preset == TEXTURES_PRESET_FULL)
{ {
layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL)); layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL));
texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_ROCK); texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_ROCK);
layersSetName(definition->layers, 0, "Ground"); layersSetName(definition->layers, 1, "Ground");
layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL)); layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL));
texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_GRASS); texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_GRASS);
layersSetName(definition->layers, 1, "Grass"); layersSetName(definition->layers, 2, "Grass");
layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL)); layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL));
texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_SAND); texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_SAND);
layersSetName(definition->layers, 2, "Sand"); layersSetName(definition->layers, 3, "Sand");
layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL)); layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL));
texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_SNOW); texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_SNOW);
layersSetName(definition->layers, 3, "Snow"); layersSetName(definition->layers, 4, "Snow");
} }
else if (preset == TEXTURES_PRESET_IRELAND) else if (preset == TEXTURES_PRESET_IRELAND)
{ {
layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL)); layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL));
texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_ROCK); texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_ROCK);
layersSetName(definition->layers, 0, "Ground"); layersSetName(definition->layers, 1, "Ground");
layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL)); layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL));
texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_GRASS); texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_GRASS);
layersSetName(definition->layers, 1, "Grass"); layersSetName(definition->layers, 2, "Grass");
} }
else if (preset == TEXTURES_PRESET_ALPS) else if (preset == TEXTURES_PRESET_ALPS)
{ {
layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL)); layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL));
texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_ROCK); texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_ROCK);
layersSetName(definition->layers, 0, "Ground"); layersSetName(definition->layers, 1, "Ground");
layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL)); layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL));
texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_SNOW); texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_SNOW);
layersSetName(definition->layers, 1, "Snow"); layersSetName(definition->layers, 2, "Snow");
} }
else if (preset == TEXTURES_PRESET_CANYON) else if (preset == TEXTURES_PRESET_CANYON)
{ {
@ -57,8 +61,17 @@ void texturesLayerAutoPreset(TexturesLayerDefinition* definition, TexturesLayerP
zoneClear(definition->terrain_zone); zoneClear(definition->terrain_zone);
switch (preset) switch (preset)
{ {
case TEXTURES_LAYER_PRESET_MUD:
definition->displacement_height = 0.05;
definition->displacement_scaling = 3.0;
definition->displacement_offset = 0.0;
definition->material.base = colorToHSL(colorFromValues(0.4, 0.38, 0.35, 1.0));
definition->material.reflection = 0.003;
definition->material.shininess = 4.0;
break;
case TEXTURES_LAYER_PRESET_ROCK: case TEXTURES_LAYER_PRESET_ROCK:
zoneAddHeightRangeQuick(definition->terrain_zone, 1.0, 0.5, 0.55, 1.0, 1.0);
definition->displacement_height = 0.3; definition->displacement_height = 0.3;
definition->displacement_scaling = 2.0; definition->displacement_scaling = 2.0;
definition->displacement_offset = 0.0; definition->displacement_offset = 0.0;
@ -77,10 +90,10 @@ void texturesLayerAutoPreset(TexturesLayerDefinition* definition, TexturesLayerP
definition->material.shininess = 4.0; definition->material.shininess = 4.0;
break; break;
case TEXTURES_LAYER_PRESET_SAND: case TEXTURES_LAYER_PRESET_SAND:
zoneAddHeightRangeQuick(definition->terrain_zone, 1.0, 0.48, 0.49, 0.505, 0.51); zoneAddHeightRangeQuick(definition->terrain_zone, 1.0, 0.498, 0.502, 0.505, 0.51);
zoneAddSlopeRangeQuick(definition->terrain_zone, 1.0, 0.0, 0.0, 0.1, 0.3); zoneAddSlopeRangeQuick(definition->terrain_zone, 1.0, 0.0, 0.0, 0.7, 0.1);
definition->displacement_height = 0.0; definition->displacement_height = 0.02;
definition->displacement_scaling = 1.0; definition->displacement_scaling = 5.0;
definition->displacement_offset = 0.0; definition->displacement_offset = 0.0;
definition->material.base = colorToHSL(colorFromValues(0.93, 0.9, 0.8, 1.0)); definition->material.base = colorToHSL(colorFromValues(0.93, 0.9, 0.8, 1.0));
definition->material.reflection = 0.008; definition->material.reflection = 0.008;
@ -89,7 +102,7 @@ void texturesLayerAutoPreset(TexturesLayerDefinition* definition, TexturesLayerP
case TEXTURES_LAYER_PRESET_SNOW: case TEXTURES_LAYER_PRESET_SNOW:
zoneAddHeightRangeQuick(definition->terrain_zone, 1.0, 0.77, 0.85, 1.0, 1.0); zoneAddHeightRangeQuick(definition->terrain_zone, 1.0, 0.77, 0.85, 1.0, 1.0);
zoneAddSlopeRangeQuick(definition->terrain_zone, 1.0, 0.0, 0.0, 0.2, 1.0); zoneAddSlopeRangeQuick(definition->terrain_zone, 1.0, 0.0, 0.0, 0.2, 1.0);
definition->displacement_height = 0.0; definition->displacement_height = 0.1;
definition->displacement_scaling = 1.0; definition->displacement_scaling = 1.0;
definition->displacement_offset = 0.0; definition->displacement_offset = 0.0;
definition->material.base = colorToHSL(colorFromValues(1.0, 1.0, 1.0, 1.0)); definition->material.base = colorToHSL(colorFromValues(1.0, 1.0, 1.0, 1.0));