diff --git a/src/interface/desktop/formclouds.cpp b/src/interface/desktop/formclouds.cpp index 627041e..9601fcb 100644 --- a/src/interface/desktop/formclouds.cpp +++ b/src/interface/desktop/formclouds.cpp @@ -27,8 +27,20 @@ FormClouds::FormClouds(QWidget *parent): addPreview(_previewColor, tr("Appearance")); _previewColor->setRenderer(_previewColorRenderer); - addInputEnum(tr("Clouds model"), (int*)&_layer->type, QStringList() << tr("Cirrus") << tr("Cumulus") << tr("Stratocumulus") << tr("Stratus")); - addInputDouble(tr("Lower altitude"), &_layer->altitude, 0.0, 1.0, 0.01, 0.1); + QStringList cloud_models; + cloud_models << tr("Stratus") + << tr("Nimbo-stratus") + << tr("Cumulus") + << tr("Strato-cumulus") + << tr("Alto-cumulus") + << tr("Alto-stratus") + << tr("Cumulo-nimbus") + << tr("Cirro-cumulus") + << tr("Cirro-stratus") + << tr("Cirrus"); + + addInputEnum(tr("Clouds model"), (int*)&_layer->type, cloud_models); + addInputDouble(tr("Altitude"), &_layer->altitude, 0.0, 1.0, 0.01, 0.1); addInputDouble(tr("Scaling"), &_layer->scaling, 0.0, 1.0, 0.01, 0.1); addInputDouble(tr("Coverage"), &_layer->coverage, 0.0, 1.0, 0.01, 0.1); diff --git a/src/render/software/CloudsRenderer.cpp b/src/render/software/CloudsRenderer.cpp index 04273d1..e9e7bec 100644 --- a/src/render/software/CloudsRenderer.cpp +++ b/src/render/software/CloudsRenderer.cpp @@ -134,5 +134,23 @@ Color CloudsRenderer::getColor(const Vector3 &eye, const Vector3 &location, cons bool CloudsRenderer::alterLight(LightDefinition* light, const Vector3 &eye, const Vector3 &location) { - return false; + CloudsDefinition* definition = parent->getScenery()->getClouds(); + + int n = definition->count(); + if (n < 1) + { + return false; + } + + /* TODO Iter layers in sorted order */ + bool altered = false; + for (int i = 0; i < n; i++) + { + BaseCloudLayerRenderer* layer_renderer = getLayerRenderer(i); + BaseCloudsModel* layer_model = getLayerModel(i); + + altered = altered || layer_renderer->alterLight(layer_model, light, eye, location); + } + + return altered; }