Tweaked textures presets
This commit is contained in:
parent
7ea28826bb
commit
81a27b1b39
3 changed files with 30 additions and 15 deletions
|
@ -43,9 +43,10 @@ MainTexturesForm::MainTexturesForm(QWidget *parent) : QWidget(parent), ui(new Ui
|
|||
preview_cumul->setTextures(textures);
|
||||
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("Snow covered mountains"));
|
||||
form_helper->addPreset(tr("Arid canyons"));
|
||||
//form_helper->addPreset(tr("Arid canyons"));
|
||||
form_helper->setPresetButton(ui->button_preset);
|
||||
connect(form_helper, SIGNAL(presetSelected(int)), this, SLOT(selectPreset(int)));
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ typedef enum
|
|||
|
||||
typedef enum
|
||||
{
|
||||
TEXTURES_LAYER_PRESET_MUD,
|
||||
TEXTURES_LAYER_PRESET_ROCK,
|
||||
TEXTURES_LAYER_PRESET_GRASS,
|
||||
TEXTURES_LAYER_PRESET_SAND,
|
||||
|
|
|
@ -5,43 +5,47 @@ void texturesAutoPreset(TexturesDefinition* definition, TexturesPreset preset)
|
|||
TexturesLayerDefinition* layer;
|
||||
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)
|
||||
{
|
||||
layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL));
|
||||
texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_ROCK);
|
||||
layersSetName(definition->layers, 0, "Ground");
|
||||
layersSetName(definition->layers, 1, "Ground");
|
||||
|
||||
layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL));
|
||||
texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_GRASS);
|
||||
layersSetName(definition->layers, 1, "Grass");
|
||||
layersSetName(definition->layers, 2, "Grass");
|
||||
|
||||
layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL));
|
||||
texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_SAND);
|
||||
layersSetName(definition->layers, 2, "Sand");
|
||||
layersSetName(definition->layers, 3, "Sand");
|
||||
|
||||
layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL));
|
||||
texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_SNOW);
|
||||
layersSetName(definition->layers, 3, "Snow");
|
||||
layersSetName(definition->layers, 4, "Snow");
|
||||
}
|
||||
else if (preset == TEXTURES_PRESET_IRELAND)
|
||||
{
|
||||
layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL));
|
||||
texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_ROCK);
|
||||
layersSetName(definition->layers, 0, "Ground");
|
||||
layersSetName(definition->layers, 1, "Ground");
|
||||
|
||||
layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL));
|
||||
texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_GRASS);
|
||||
layersSetName(definition->layers, 1, "Grass");
|
||||
layersSetName(definition->layers, 2, "Grass");
|
||||
}
|
||||
else if (preset == TEXTURES_PRESET_ALPS)
|
||||
{
|
||||
layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL));
|
||||
texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_ROCK);
|
||||
layersSetName(definition->layers, 0, "Ground");
|
||||
layersSetName(definition->layers, 1, "Ground");
|
||||
|
||||
layer = layersGetLayer(definition->layers, layersAddLayer(definition->layers, NULL));
|
||||
texturesLayerAutoPreset(layer, TEXTURES_LAYER_PRESET_SNOW);
|
||||
layersSetName(definition->layers, 1, "Snow");
|
||||
layersSetName(definition->layers, 2, "Snow");
|
||||
}
|
||||
else if (preset == TEXTURES_PRESET_CANYON)
|
||||
{
|
||||
|
@ -57,8 +61,17 @@ void texturesLayerAutoPreset(TexturesLayerDefinition* definition, TexturesLayerP
|
|||
zoneClear(definition->terrain_zone);
|
||||
|
||||
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:
|
||||
zoneAddHeightRangeQuick(definition->terrain_zone, 1.0, 0.5, 0.55, 1.0, 1.0);
|
||||
definition->displacement_height = 0.3;
|
||||
definition->displacement_scaling = 2.0;
|
||||
definition->displacement_offset = 0.0;
|
||||
|
@ -77,10 +90,10 @@ void texturesLayerAutoPreset(TexturesLayerDefinition* definition, TexturesLayerP
|
|||
definition->material.shininess = 4.0;
|
||||
break;
|
||||
case TEXTURES_LAYER_PRESET_SAND:
|
||||
zoneAddHeightRangeQuick(definition->terrain_zone, 1.0, 0.48, 0.49, 0.505, 0.51);
|
||||
zoneAddSlopeRangeQuick(definition->terrain_zone, 1.0, 0.0, 0.0, 0.1, 0.3);
|
||||
definition->displacement_height = 0.0;
|
||||
definition->displacement_scaling = 1.0;
|
||||
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.7, 0.1);
|
||||
definition->displacement_height = 0.02;
|
||||
definition->displacement_scaling = 5.0;
|
||||
definition->displacement_offset = 0.0;
|
||||
definition->material.base = colorToHSL(colorFromValues(0.93, 0.9, 0.8, 1.0));
|
||||
definition->material.reflection = 0.008;
|
||||
|
@ -89,7 +102,7 @@ void texturesLayerAutoPreset(TexturesLayerDefinition* definition, TexturesLayerP
|
|||
case TEXTURES_LAYER_PRESET_SNOW:
|
||||
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);
|
||||
definition->displacement_height = 0.0;
|
||||
definition->displacement_height = 0.1;
|
||||
definition->displacement_scaling = 1.0;
|
||||
definition->displacement_offset = 0.0;
|
||||
definition->material.base = colorToHSL(colorFromValues(1.0, 1.0, 1.0, 1.0));
|
||||
|
|
Loading…
Reference in a new issue