Merge pull request #2040 from OpenSpace/issue/1994

interaction sphere and brightness/opacity fixes. (Closes #1994)
This commit is contained in:
ElonOlsson
2022-04-22 09:53:16 -04:00
committed by GitHub
9 changed files with 33 additions and 14 deletions

View File

@@ -1,5 +1,6 @@
local propertyHelper = asset.require("util/property_helper")
local sunTransforms = asset.require("scene/solarsystem/sun/transforms")
local sunAsset = asset.require("scene/solarsystem/sun/sun")
local densityDirectory = asset.syncedResource({
Name = "Bastille Day MAS Density",
@@ -12,6 +13,9 @@ local sunRadius = 6.957E8
local densityVolume = {
Identifier = "MAS-MHD-Density-bastille-day-2000",
-- TODO Elon: 21 April 2022. Interaction sphere should not depend on the transform scale.
-- InteractionSphere = sunAsset.Sun.Renderable.Radii[1] * 1.05,
InteractionSphere = 1/695700000,
Parent = sunTransforms.SunIAU.Identifier,
Transform = {
Scale = {

View File

@@ -15,6 +15,9 @@ local sunRadius = 6.957E8
local fieldlines = {
Identifier = "MAS-MHD-Fieldlines-bastille-day-2000",
Parent = heliosphereTransforms.HEEQ180ReferenceFrame.Identifier,
-- TODO Elon: 21 April 2022. Interaction sphere should not depend on the transform scale.
-- InteractionSphere = sunAsset.Sun.Renderable.Radii[1] * 1.05,
InteractionSphere = 1/695700000,
Transform = {
Scale = {
Type = "StaticScale",

View File

@@ -13,6 +13,9 @@ local fluxNodesBinaries = asset.syncedResource({
local fluxNodes = {
Identifier = "MAS-MHD-FluxNodes-bastille-day-2000",
Parent = heliosphereTransforms.HEEQ180ReferenceFrame.Identifier,
-- TODO Elon: 21 April 2022. Interaction sphere should not depend on the transform scale.
-- InteractionSphere = sunAsset.Sun.Renderable.Radii[1] * 1.05,
InteractionSphere = 695700000.0,
Transform = {
Rotation = rot.CarringtonLongitudeToHEEQ180Rotation
},

View File

@@ -19,6 +19,9 @@ local TexturesPathMeridial = asset.syncedResource({
local EquatorialCutplane = {
Identifier = "EquatorialCutplane-bastille-day-2000",
Parent = transforms.HEEQ180ReferenceFrame.Identifier,
-- TODO Elon: 21 April 2022. Interaction sphere should not depend on the transform scale.
-- InteractionSphere = sunAsset.Sun.Renderable.Radii[1] * 1.05,
InteractionSphere = 695700000.0,
Transform = {
Rotation = rot.CarringtonLongitudeToHEEQ180Rotation
},
@@ -41,6 +44,9 @@ local EquatorialCutplane = {
local MeridialCutplane = {
Identifier = "MeridialCutplane-bastille-day-2000",
Parent = transforms.HEEQ180ReferenceFrame.Identifier,
-- TODO Elon: 21 April 2022. Interaction sphere should not depend on the transform scale.
-- InteractionSphere = sunAsset.Sun.Renderable.Radii[1] * 1.05,
InteractionSphere = 695700000,
Transform = {
Rotation = {
Type = "StaticRotation",

View File

@@ -5,6 +5,9 @@ local travelSpeedIndicator = {
Identifier = "TravelSpeedIndicator-2000",
--SunIAU adds an extra rotation. Using barycenter, then offsetting to SunIAU
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
-- TODO Elon: 21 April 2022. Interaction sphere should not depend on the transform scale.
-- InteractionSphere = sunAsset.Sun.Renderable.Radii[1] * 1.05,
InteractionSphere = 695700000.0,
Transform = {
Translation = {
Type = "SpiceTranslation",

View File

@@ -1,5 +1,6 @@
local transforms = asset.require("./transforms_magnetosphere")
local transferFunction = asset.localResource("./CMR-illuminance2.txt")
local earthAsset = asset.require("scene/solarsystem/planets/earth/earth")
local fieldlinesDirectory = asset.syncedResource({
Name = "Magnetosphere 2012 event",
@@ -11,6 +12,8 @@ local fieldlinesDirectory = asset.syncedResource({
local earthMagnetosphere = {
Identifier = "EarthMagnetosphere",
Parent = transforms.GSMReferenceFrame.Identifier,
-- Grabs a value from earths ellipsoid. 1.05 just to make it somewhat bigger than earth
InteractionSphere = earthAsset.Earth.Renderable.Radii[1] * 1.05,
Renderable = {
Type = "RenderableFieldlinesSequence",
SourceFolder = fieldlinesDirectory,
@@ -39,11 +42,11 @@ local earthMagnetosphere = {
asset.onInitialize(function()
openspace.addSceneGraphNode(earthMagnetosphere)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(earthMagnetosphere)
end)
asset.export(earthMagnetosphere)

View File

@@ -1,8 +1,6 @@
local transforms = asset.require("scene/solarsystem/sun/transforms")
asset.require("spice/base")
local EarthBarycenter = {
Identifier = "EarthBarycenter",
Parent = transforms.SolarSystemBarycenter.Identifier,
@@ -78,21 +76,19 @@ asset.onInitialize(function()
openspace.addSceneGraphNode(EarthInertial)
openspace.addSceneGraphNode(EarthIAU)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(EarthIAU)
openspace.removeSceneGraphNode(EarthInertial)
openspace.removeSceneGraphNode(EarthCenter)
openspace.removeSceneGraphNode(EarthBarycenter)
end)
asset.export(EarthBarycenter)
asset.export(EarthCenter)
asset.export(EarthInertial)
asset.export(EarthIAU)
asset.meta = {
Name = "Earth Transforms",
Version = "1.1",

View File

@@ -12,6 +12,9 @@ local textureSourcePath = asset.syncedResource({
local EUVLayer = {
Identifier = "EUV-Layer-bastille-day-2000",
Parent = transforms.SunIAU.Identifier,
-- TODO Elon: 21 April 2022. Interaction sphere should not depend on the transform scale.
-- InteractionSphere = sunAsset.Sun.Renderable.Radii[1] * 1.05,
InteractionSphere = 696000000,
Renderable = {
Type = "RenderableTimeVaryingSphere",
Size = 6.96E8, -- Slightly bigger than the sun renderable,

View File

@@ -106,7 +106,7 @@ namespace {
constexpr openspace::properties::Property::PropertyInfo BrightnessInfo = {
"Brightness",
"Brightness",
"The volumes general brightness."
"The volume renderer's general brightness."
};
constexpr openspace::properties::Property::PropertyInfo rNormalizationInfo = {
@@ -163,7 +163,7 @@ RenderableTimeVaryingVolume::RenderableTimeVaryingVolume(
: Renderable(dictionary)
, _gridType(GridTypeInfo, properties::OptionProperty::DisplayType::Dropdown)
, _stepSize(StepSizeInfo, 0.02f, 0.001f, 0.1f)
, _brightness(BrightnessInfo, 0.1f, 0.f, 1.f)
, _brightness(BrightnessInfo, 0.33f, 0.f, 1.f)
, _rNormalization(rNormalizationInfo, 0.f, 0.f, 2.f)
, _rUpperBound(rUpperBoundInfo, 1.f, 0.f, 2.f)
, _secondsBefore(SecondsBeforeInfo, 0.f, 0.01f, SecondsInOneDay)
@@ -193,10 +193,7 @@ RenderableTimeVaryingVolume::RenderableTimeVaryingVolume(
_stepSize = p.stepSize.value_or(_stepSize);
if (p.brightness.has_value()) {
_brightness = *p.brightness;
}
_brightness = p.brightness.value_or(_brightness);
_secondsBefore = p.secondsBefore.value_or(_secondsBefore);
_secondsAfter = p.secondsAfter;
@@ -211,6 +208,7 @@ RenderableTimeVaryingVolume::RenderableTimeVaryingVolume(
}
addProperty(_brightness);
addProperty(_opacity);
}
RenderableTimeVaryingVolume::~RenderableTimeVaryingVolume() {}