diff --git a/data/assets/customization/volumes.asset b/data/assets/customization/volumes.asset index 3276f3f393..c83a5ea4af 100644 --- a/data/assets/customization/volumes.asset +++ b/data/assets/customization/volumes.asset @@ -8,13 +8,16 @@ local MilkyWayVolumeGalaxy = { Parent = transforms.SolarSystemBarycenter.Identifier, Renderable = { Type = "RenderableGalaxy", - StepSize = 0.01, + StepSize = 0.015, + AbsorptionMultiply = 100, + EmissionMultiply = 500, + Translation = {0.17, 0, 0}, Volume = { Type = "Volume", Filename = "${BASE}/../OpenSpaceData/Milkyway/MilkyWayRGBAVolume1024x1024x128.raw", Dimensions = {1024, 1024, 128}, Size = {9.2E21, 9.2E21, 1.15E21} - }, + } }, GUI = { Path = "/Milky Way" diff --git a/modules/galaxy/rendering/renderablegalaxy.cpp b/modules/galaxy/rendering/renderablegalaxy.cpp index a4c9657e3f..c78074ea61 100644 --- a/modules/galaxy/rendering/renderablegalaxy.cpp +++ b/modules/galaxy/rendering/renderablegalaxy.cpp @@ -103,12 +103,12 @@ namespace openspace { RenderableGalaxy::RenderableGalaxy(const ghoul::Dictionary& dictionary) : Renderable(dictionary) - , _stepSize(StepSizeInfo, 0.012f, 0.0005f, 0.05f) + , _stepSize(StepSizeInfo, 0.01f, 0.0005f, 0.05f, 0.001f) , _absorptionMultiply(AbsorptionMultiplyInfo, 50.f, 0.0f, 500.0f) , _emissionMultiply(EmissionMultiplyInfo, 1500.f, 0.0f, 3000.0f) //, _pointStepSize(PointStepSizeInfo, 0.01f, 0.01f, 0.1f) //, _enabledPointsRatio(EnabledPointsRatioInfo, 0.2f, 0.f, 1.f) - , _translation(TranslationInfo, glm::vec3(0.f), glm::vec3(0.f), glm::vec3(10.f)) + , _translation(TranslationInfo, glm::vec3(0.f), glm::vec3(0.f), glm::vec3(1.f)) , _rotation(RotationInfo, glm::vec3(0.f), glm::vec3(0.f), glm::vec3(6.28f)) { dictionary.getValue("StepSize", _stepSize); @@ -117,6 +117,26 @@ namespace openspace { dictionary.getValue("Translation", _translation); dictionary.getValue("Rotation", _rotation); + if (dictionary.hasKeyAndValue(StepSizeInfo.identifier)) { + _stepSize = static_cast(dictionary.value(StepSizeInfo.identifier)); + } + + if (dictionary.hasKeyAndValue(AbsorptionMultiplyInfo.identifier)) { + _absorptionMultiply = static_cast(dictionary.value(AbsorptionMultiplyInfo.identifier)); + } + + if (dictionary.hasKeyAndValue(EmissionMultiplyInfo.identifier)) { + _emissionMultiply = static_cast(dictionary.value(EmissionMultiplyInfo.identifier)); + } + + if (dictionary.hasKeyAndValue(TranslationInfo.identifier)) { + _translation = dictionary.value(TranslationInfo.identifier); + } + + if (dictionary.hasKeyAndValue(RotationInfo.identifier)) { + _rotation = dictionary.value(RotationInfo.identifier); + } + if (!dictionary.hasKeyAndValue("Volume")) { LERROR("No volume dictionary specified."); } @@ -315,7 +335,7 @@ void RenderableGalaxy::update(const UpdateData& data) { glm::mat4 volumeTransform = glm::scale(transform, _volumeSize); _pointTransform = glm::scale(transform, _pointScaling); - const glm::vec4 translation = glm::vec4(_translation.value(), 0.0); + const glm::vec4 translation = glm::vec4(_translation.value()*_volumeSize, 0.0); // Todo: handle floating point overflow, to actually support translation.