Add settings for ambient brightness on RenderablePlanet

This commit is contained in:
Alexander Bock
2018-02-19 09:42:31 -05:00
parent 315b125172
commit f0e459d05e
3 changed files with 27 additions and 4 deletions

View File

@@ -109,6 +109,12 @@ namespace {
"meridian has changed through the New Horizons mission and this requires this "
"shift."
};
static const openspace::properties::Property::PropertyInfo AmbientBrightnessInfo = {
"AmbientBrightness",
"Ambient Brightness",
"This value determines the ambient brightness of the dark side of the planet."
};
} // namespace
namespace openspace {
@@ -160,6 +166,12 @@ documentation::Documentation RenderablePlanetProjection::Documentation() {
new BoolVerifier,
Optional::Yes,
MeridianShiftInfo.description
},
{
AmbientBrightnessInfo.identifier,
new DoubleVerifier,
Optional::Yes,
AmbientBrightnessInfo.description
}
}
};
@@ -179,6 +191,7 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary&
, _heightMapTexture(nullptr)
, _heightExaggeration(HeightExaggerationInfo, 1.f, 0.f, 1e6f, 1.f, 3.f)
, _meridianShift(MeridianShiftInfo, false)
, _ambientBrightness(AmbientBrightnessInfo, 0.075f, 0.f, 1.f)
, _capture(false)
{
documentation::testSpecificationAndThrow(
@@ -309,6 +322,7 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary&
addProperty(_heightExaggeration);
addProperty(_meridianShift);
addProperty(_ambientBrightness);
}
RenderablePlanetProjection::~RenderablePlanetProjection() {}
@@ -331,6 +345,9 @@ void RenderablePlanetProjection::initializeGL() {
"_heightExaggeration"
);
_mainUniformCache.meridianShift = _programObject->uniformLocation("_meridianShift");
_mainUniformCache.ambientBrightness = _programObject->uniformLocation(
"_ambientBrightness"
);
_mainUniformCache.projectionFading = _programObject->uniformLocation(
"_projectionFading"
);
@@ -600,6 +617,7 @@ void RenderablePlanetProjection::render(const RenderData& data, RendererTasks&)
);
_programObject->setUniform(_mainUniformCache.heightExaggeration, _heightExaggeration);
_programObject->setUniform(_mainUniformCache.meridianShift, _meridianShift);
_programObject->setUniform(_mainUniformCache.ambientBrightness, _ambientBrightness);
_programObject->setUniform(
_mainUniformCache.projectionFading,
_projectionComponent.projectionFading()
@@ -645,6 +663,9 @@ void RenderablePlanetProjection::update(const UpdateData& data) {
_mainUniformCache.meridianShift = _programObject->uniformLocation(
"_meridianShift"
);
_mainUniformCache.ambientBrightness = _programObject->uniformLocation(
"_ambientBrightness"
);
_mainUniformCache.projectionFading = _programObject->uniformLocation(
"_projectionFading"
);