mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-01 17:20:09 -06:00
clean up, more codegen for volume renderable, moved heliosphere folder and reference frames
This commit is contained in:
@@ -8,35 +8,17 @@ local densityDirectory = asset.syncedResource({
|
||||
Version = 1
|
||||
})
|
||||
|
||||
--local mirrorVolumeMatrix = {
|
||||
--1.0, 0.0, 0.0,
|
||||
--0.0, 1.0, 0.0,
|
||||
--0.0, 0.0, 1.0
|
||||
|
||||
|
||||
-- -1.0, 0.0, 0.0,
|
||||
-- 0.0, 1.0, 0.0,
|
||||
-- 0.0, 0.0, -1.0
|
||||
|
||||
--0.0, 1.0, 0.0,
|
||||
--1.0, 0.0, 0.0,
|
||||
--0.0, 0.0, 1.0
|
||||
--}
|
||||
|
||||
local sunRadius = 6.957E8
|
||||
|
||||
local densityVolume = {
|
||||
Identifier = "MAS_MHD_density",
|
||||
-- wrong Parent = sunTransforms.SolarSystemBarycenter.Identifier,
|
||||
-- right
|
||||
Identifier = "MAS_MHD_density",
|
||||
Parent = sunTransforms.SunIAU.Identifier,
|
||||
-- wrong Parent = transforms.HNMReferenceFrame.Identifier,
|
||||
Renderable = {
|
||||
Type = "RenderableTimeVaryingVolume",
|
||||
StepSize = 0.004,
|
||||
--Enabled = false,
|
||||
Opacity = 0.3,
|
||||
TransferFunction = asset.localResource("transferfunctions/mas_mhd_r_squared.txt"), --test1
|
||||
TransferFunction = asset.localResource("transferfunctions/mas_mhd_r_squared.txt"),
|
||||
SourceDirectory = densityDirectory,
|
||||
--LowerValueBound = 0,
|
||||
--UpperValueBound = 1,
|
||||
@@ -53,13 +35,10 @@ local densityVolume = {
|
||||
},
|
||||
Rotation = {
|
||||
--Type = "StaticRotation", --LuaRotation
|
||||
--Rotation = mirrorVolumeMatrix
|
||||
Type = "FixedRotation",
|
||||
XAxis = {-1.0, 0.0, 0.0},
|
||||
YAxis = {0.0, 1.0, 0.0},
|
||||
ZAxis = {0.0, 0.0, -1.0}
|
||||
|
||||
--Script = asset.localResource("kernels/carringtonRotation.lua")
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
@@ -74,7 +53,7 @@ asset.meta = {
|
||||
Name = "Predictive Science Inc. Volume Rendering Bastille Day",
|
||||
Version = "1.0",
|
||||
Description = " Volumetric rendering for the bastille day CME event ",
|
||||
Author = "OpenSpace team",
|
||||
Author = "CCMC, OpenSpace team",
|
||||
URL = "https://dx.doi.org/10.3847/1538-4357/aab36d",
|
||||
License = ""
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
local assetHelper = asset.require('util/asset_helper')
|
||||
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
|
||||
local heliosphereTransforms = asset.require('scene/solarsystem/sun/transforms_heliosphere')
|
||||
|
||||
|
||||
local transferFunctions = asset.localResource("transferfunctions")
|
||||
@@ -18,7 +18,7 @@ local sunRadius = 6.957E8
|
||||
-- Fieldlies from binaries
|
||||
local fieldlines = {
|
||||
Identifier = "MAS_MHD_Fieldlines",
|
||||
Parent = sunTransforms.HNMReferenceFrame.Identifier,
|
||||
Parent = heliosphereTransforms.HNMReferenceFrame.Identifier,
|
||||
--wrong Parent = sunTransforms.SunIAU.Identifier,
|
||||
Renderable = {
|
||||
Type = "RenderableFieldlinesSequence",
|
||||
@@ -1,21 +1,12 @@
|
||||
local assetHelper = asset.require('util/asset_helper')
|
||||
--local transforms = asset.require('./transforms')
|
||||
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
|
||||
local heliosphereTransforms = asset.require('scene/solarsystem/sun/transforms_heliosphere')
|
||||
|
||||
local transferFunctions = asset.localResource("transferfunctions")
|
||||
local fluxnodeColorTable = transferFunctions .. "/flux_nodes.txt"
|
||||
local fluxnodeColorTableCMR = transferFunctions .. "/CMR.txt"
|
||||
local fluxnodeColorTableEarth = transferFunctions .. "/flux_nodes_grey_scale.txt"
|
||||
local fluxnodeColorTableFlow = transferFunctions .. "/flux_nodes_flow.txt"
|
||||
--local fluxnodeColorTableIlluminance = transferFunctions .. "/CMR_illuminance.txt"
|
||||
--local fluxnodeColorTableIlluminance2 = transferFunctions .. "/CMR_illuminance2.txt"
|
||||
|
||||
--[[local fluxnodesDirectory = asset.syncedResource({
|
||||
Name = "Bastille Day Flux nodes",
|
||||
Type = "HttpSynchronization",
|
||||
Identifier = "bastille_day_streamnodes",
|
||||
Version = 10
|
||||
})--]]
|
||||
local fluxnodesBinaries = asset.syncedResource({
|
||||
Name = "Bastille day Flux nodes binaries",
|
||||
Type = "HttpSynchronization",
|
||||
@@ -26,30 +17,22 @@ local fluxnodesBinaries = asset.syncedResource({
|
||||
-- Fluxnodes from binaries
|
||||
local Fluxnodes = {
|
||||
Identifier = "MAS_MHD_FluxNodes",
|
||||
Parent = sunTransforms.HNMReferenceFrame.Identifier,
|
||||
--Parent = sunTransforms.SunIAU.Identifier,
|
||||
--Parent = sunTransforms.SolarSystemBarycenter.Identifier,
|
||||
--transforms.asset, referens to suntransforms.solarsystemBarycenter.identifier
|
||||
Parent = heliosphereTransforms.HNMReferenceFrame.Identifier,
|
||||
|
||||
Renderable = {
|
||||
Type = "RenderableFluxNodes",
|
||||
--SourceFolder = fluxnodesDirectory,
|
||||
BinarySourceFolder = fluxnodesBinaries,
|
||||
-- LineWidth = 1.0;
|
||||
-- AlphaBlendlingEnabled = false,
|
||||
-- InputFileType = "json",
|
||||
ColorTablePaths = { -- keep order
|
||||
fluxnodeColorTable,
|
||||
fluxnodeColorTableCMR,
|
||||
fluxnodeColorTableEarth,
|
||||
fluxnodeColorTableFlow,
|
||||
--fluxnodeColorTableIlluminance,
|
||||
--fluxnodeColorTableIlluminance2,
|
||||
SourceFolder = fluxnodesBinaries,
|
||||
ColorTablePaths = {
|
||||
Standard = fluxnodeColorTable,
|
||||
CMR = fluxnodeColorTableCMR,
|
||||
Earth = fluxnodeColorTableEarth,
|
||||
Flow = fluxnodeColorTableFlow,
|
||||
},
|
||||
|
||||
LoadAtRuntime = true,
|
||||
ScaleToMeters = 1.0,
|
||||
SecondsBefore = 24*60*60,
|
||||
SecondsAfter = 24*60*60,
|
||||
--SimulationModel = "mas",
|
||||
Enabled = false
|
||||
},
|
||||
GUI = {
|
||||
@@ -81,7 +64,6 @@ local Fluxnodes = {
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { Fluxnodes })
|
||||
|
||||
|
||||
asset.meta = {
|
||||
Name = "Predictive Science Inc. Flux nodes Bastille Day",
|
||||
Version = "1.0",
|
||||
@@ -1,6 +1,6 @@
|
||||
asset.require("spice/base")
|
||||
local assetHelper = asset.require("util/asset_helper")
|
||||
local transforms = asset.require('scene/solarsystem/sun/transforms')
|
||||
local transforms = asset.require('scene/solarsystem/sun/transforms_heliosphere')
|
||||
--15 cmr emin01, 16 cmr emin03
|
||||
local TexturesPathEquitorial = asset.syncedResource({
|
||||
Type = "HttpSynchronization",
|
||||
@@ -1,5 +1,5 @@
|
||||
local assetHelper = asset.require('util/asset_helper')
|
||||
local transforms = asset.require('../transforms')
|
||||
local transforms = asset.require('../../planets/earth/transforms_magnetosphere')
|
||||
|
||||
--local fieldlinesDirectory = "C:/Users/elono/Documents/OpenSpace/data/earthMagnetoSphere"
|
||||
local fieldlinesDirectory = asset.syncedResource({
|
||||
@@ -9,8 +9,6 @@ local fieldlinesDirectory = asset.syncedResource({
|
||||
Version = 1
|
||||
})
|
||||
|
||||
local earthRadius = 6378137
|
||||
|
||||
-- Fieldlies from binaries
|
||||
local earthMagnetosphere = {
|
||||
Identifier = "Earths_Magnetosphere",
|
||||
@@ -20,19 +18,12 @@ local earthMagnetosphere = {
|
||||
Type = "RenderableFieldlinesSequence",
|
||||
SourceFolder = fieldlinesDirectory,
|
||||
-- FlowEnabled = false,
|
||||
LineWidth = 2.0,
|
||||
LineWidth = 3.0,
|
||||
AlphaBlendlingEnabled = false,
|
||||
InputFileType = "osfls", -- openspace Field lines Sequence
|
||||
--ColorTablePaths = {
|
||||
-- masDensityColorTable,
|
||||
-- masVelocityColorTable,
|
||||
--},
|
||||
--ColorTableMinMax = {
|
||||
-- { 0, 1000000 },
|
||||
-- { 100, 2000 }
|
||||
--},
|
||||
MaskingEnabled = true,
|
||||
MaskingRanges = {{0.0, 0.0}}, -- this seem to map it to an int =0 which correspond to the topology=closed (fieldlines)
|
||||
|
||||
--maskingEnabled = true,
|
||||
--MaskingRanges = {0.0, 0.0}, -- this seem to map it to an int =0 which correspond to the topology=closed (fieldlines)
|
||||
LoadAtRuntime = true,
|
||||
ScaleToMeters = 1.0,
|
||||
SecondsBefore = 24*60*60*365*100,
|
||||
@@ -43,15 +34,9 @@ local earthMagnetosphere = {
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
Path = "/Solar System/Planets/Earth/Magnetosphere",
|
||||
Path = "/Solar System/Planets/Earth",
|
||||
Name = "Magnetosphere"
|
||||
},
|
||||
--Transform = {
|
||||
-- Scale = {
|
||||
-- Type = "StaticScale",
|
||||
-- Scale = earthRadius
|
||||
-- }
|
||||
--}
|
||||
}
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { earthMagnetosphere })
|
||||
@@ -60,7 +45,7 @@ asset.meta = {
|
||||
Name = "",
|
||||
Version = "1.0",
|
||||
Description = " Magnetic fieldlines for the bastille day CME event ",
|
||||
Author = "OpenSpace team",
|
||||
Author = "CCMC",
|
||||
URL = "",
|
||||
License = ""
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
local assetHelper = asset.require('util/asset_helper')
|
||||
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
|
||||
local transforms = asset.require('scene/solarsystem/planets/earth/transforms')
|
||||
|
||||
local transferFunctions = asset.localResource("../../../sun/heliosphere/bastille_day/transferfunctions")
|
||||
local masVelocityColorTable = transferFunctions .. "/velocity_fieldlines.txt"
|
||||
local masDensityColorTable = transferFunctions .. "/density_fieldlines.txt"
|
||||
|
||||
local fieldlinesDirectory = 'D:/data/2000_01_01_event/cdf'
|
||||
local seedPointDirectory = 'D:/data/2000_01_01_event/seedpoints'
|
||||
|
||||
local earthRadius = 6378137
|
||||
|
||||
-- Fieldlies from binaries
|
||||
local fieldlines = {
|
||||
Identifier = "Earth_BATSRUS_Fieldlines",
|
||||
Parent = transforms.GSMReferenceFrame.Identifier,
|
||||
Renderable = {
|
||||
Type = "RenderableFieldlinesSequence",
|
||||
SourceFolder = fieldlinesDirectory,
|
||||
SeedPointDirectory = seedPointDirectory,
|
||||
TracingVariable = 'b',
|
||||
--OutputFolder = "C:/Users/eolsson/Documents/openspace/data/20000101/osfls/",
|
||||
|
||||
-- FlowEnabled = false,
|
||||
-- LineWidth = 1.0;
|
||||
AlphaBlendlingEnabled = false,
|
||||
--InputFileType = "osfls",
|
||||
InputFileType = "CDF",
|
||||
|
||||
ColorTablePaths = {
|
||||
masDensityColorTable,
|
||||
masVelocityColorTable,
|
||||
},
|
||||
ColorTableRanges = {
|
||||
{ 0, 10 },
|
||||
{ 100, 2000 }
|
||||
},
|
||||
ExtraVariables = {
|
||||
"rho",
|
||||
"p",
|
||||
"T"
|
||||
},
|
||||
ManualTimeOffset = -14400.0,
|
||||
ScaleToMeters = 1.0,
|
||||
SecondsBefore = 24*60*60,
|
||||
SecondsAfter = 24*60*60,
|
||||
SimulationModel = "batsrus",
|
||||
Color = {
|
||||
Uniform = {1.0, 0.0, 0.5, 1}
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
Path = "/Solar System/Planets/Earth/Magnetosphere",
|
||||
Name = "Fieldlines 2000-01-01"
|
||||
},
|
||||
Transform = {
|
||||
Scale = {
|
||||
Type = "StaticScale",
|
||||
Scale = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { fieldlines })
|
||||
|
||||
asset.meta = {
|
||||
Name = "CDF fieldlines files Bastille Day",
|
||||
Version = "1.0",
|
||||
Description = " Magnetic fieldlines",
|
||||
Author = "OpenSpace team",
|
||||
URL = "",
|
||||
License = ""
|
||||
}
|
||||
@@ -2,8 +2,6 @@ local assetHelper = asset.require('util/asset_helper')
|
||||
local transforms = asset.require('scene/solarsystem/sun/transforms')
|
||||
asset.require("spice/base")
|
||||
|
||||
local GSMKernel = asset.localResource("./kernels/GSM.ti")
|
||||
|
||||
local EarthBarycenter = {
|
||||
Identifier = "EarthBarycenter",
|
||||
Parent = transforms.SolarSystemBarycenter.Identifier,
|
||||
@@ -73,30 +71,11 @@ local EarthIAU = {
|
||||
}
|
||||
}
|
||||
|
||||
local GSMReferenceFrame = {
|
||||
Identifier = "GSMReferenceFrame",
|
||||
Parent = EarthCenter.Identifier,
|
||||
Transform = {
|
||||
Rotation = {
|
||||
Type = "SpiceRotation",
|
||||
SourceFrame = "GSM", --Geocentric Solar Magnetospheric
|
||||
DestinationFrame = "GALACTIC",
|
||||
Kernels = GSMKernel
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
Name = "GSM Reference Frame",
|
||||
Path = "/Solar System/Planets/Earth",
|
||||
Hidden = true
|
||||
}
|
||||
}
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, {
|
||||
EarthBarycenter,
|
||||
EarthCenter,
|
||||
EarthInertial,
|
||||
EarthIAU,
|
||||
GSMReferenceFrame
|
||||
})
|
||||
|
||||
|
||||
@@ -104,9 +83,9 @@ asset.meta = {
|
||||
Name = "Earth Transforms",
|
||||
Version = "1.0",
|
||||
Description = [[ Earth transforms: Earth Barycenter, Earth Center, Earth Inertial,
|
||||
Earth IAU, GSMReferenceFrame. A scene graph node is created for each transform.]],
|
||||
Earth IAU. A scene graph node is created for each transform.]],
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license",
|
||||
Identifiers = {"EarthBarycenter", "EarthCenter", "EarthInertial", "EarthIAU", "GSMReferenceFrame"}
|
||||
Identifiers = {"EarthBarycenter", "EarthCenter", "EarthInertial", "EarthIAU"}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
local assetHelper = asset.require('util/asset_helper')
|
||||
local transforms = asset.require('scene/solarsystem/planets/earth/transforms')
|
||||
asset.require("spice/base")
|
||||
|
||||
local GSMKernel = asset.localResource("./kernels/GSM.ti")
|
||||
|
||||
local GSMReferenceFrame = {
|
||||
Identifier = "GSMReferenceFrame",
|
||||
Parent = transforms.EarthCenter.Identifier,
|
||||
Transform = {
|
||||
Rotation = {
|
||||
Type = "SpiceRotation",
|
||||
SourceFrame = "GSM", --Geocentric Solar Magnetospheric
|
||||
DestinationFrame = "GALACTIC",
|
||||
Kernels = GSMKernel
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
Name = "GSM Reference Frame",
|
||||
Path = "/Solar System/Planets/Earth",
|
||||
Hidden = true
|
||||
}
|
||||
}
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { GSMReferenceFrame })
|
||||
|
||||
asset.meta = {
|
||||
Name = "Earth magnetosphere transforms",
|
||||
Version = "1.0",
|
||||
Description = [[ Earth transforms: GSMReferenceFrame. Geocentric Solar Magnetospheric]],
|
||||
Author = "CCMC",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license",
|
||||
Identifiers = {"GSMReferenceFrame"}
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
local assetHelper = asset.require('util/asset_helper')
|
||||
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
|
||||
local transforms = asset.require('scene/solarsystem/planets/earth/transforms')
|
||||
|
||||
local transferFunctions = asset.localResource("transferfunctions")
|
||||
local masVelocityColorTable = transferFunctions .. "/velocity_fieldlines.txt"
|
||||
local masDensityColorTable = transferFunctions .. "/density_fieldlines.txt"
|
||||
|
||||
local fieldlinesDirectory = 'D:/data/bastille_day/mas-filedlines/MAS_BastilleDay_mhd_field_lines/BastilleDay/mhd_field_lines/JSON'
|
||||
|
||||
|
||||
local sunRadius = 6.957E8
|
||||
|
||||
-- Fieldlies from binaries
|
||||
local fieldlines = {
|
||||
Identifier = "MAS_MHD_Fieldlines",
|
||||
Parent = sunTransforms.HNMReferenceFrame.Identifier,
|
||||
-- wrong Parent = sunTransforms.SunIAU.Identifier,
|
||||
Renderable = {
|
||||
Type = "RenderableFieldlinesSequence",
|
||||
SourceFolder = fieldlinesDirectory,
|
||||
-- FlowEnabled = false,
|
||||
-- LineWidth = 1.0;
|
||||
AlphaBlendlingEnabled = false,
|
||||
InputFileType = "json",
|
||||
|
||||
ColorTablePaths = {
|
||||
masDensityColorTable,
|
||||
masVelocityColorTable,
|
||||
},
|
||||
ColorTableMinMax = {
|
||||
{ 0, 1000000 },
|
||||
{ 100, 2000 }
|
||||
},
|
||||
LoadAtRuntime = true,
|
||||
ScaleToMeters = 1.0,
|
||||
SecondsBefore = 24*60*60,
|
||||
SecondsAfter = 24*60*60,
|
||||
SimulationModel = "enlil",
|
||||
Color = {
|
||||
Uniform = {1.0, 0.0, 0.5, 1}
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
Path = "/Solar System/Heliosphere",
|
||||
Name = "MAS Fieldlines"
|
||||
},
|
||||
Transform = {
|
||||
Scale = {
|
||||
Type = "StaticScale",
|
||||
Scale = sunRadius
|
||||
},
|
||||
--[[ Rotation = {
|
||||
--This is a rotation matrix to go from Carrington longitude referens frame to HEEQ180
|
||||
--which is what the renderables paretn transforms.HNMReferenceFrame.Identifier is
|
||||
--refering to. At the referens time, MAS_seq = 0, 2000-07-14T08:33:37.105 the Carrington
|
||||
--longitude was 309.3 degrees.
|
||||
--Difference from HEEQ => 360-309.3=50.7
|
||||
--(or 0-309.3 = -309.3 However this leads to the same rotation matrix in the end)
|
||||
--Since OpenSpace supports HEEQ180 and not HEEQ, 180 was added or subtracted
|
||||
-- => a1 = -129.3 and a2 = 230.7
|
||||
--Rotation matrix: (cos a, -sin a, 0)(sin a, cos a, 0)(0, 0, 1) leads to the result.
|
||||
Type = "FixedRotation",
|
||||
XAxis = {-0.63338087262755016203262119192353, -0.77384020972650618518999944537717, 0.0},
|
||||
YAxis = {0.77384020972650618518999944537717, -0.63338087262755016203262119192353, 0.0},
|
||||
ZAxis = {0.0, 0.0, 1.0}
|
||||
}
|
||||
]]--
|
||||
}
|
||||
}
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { fieldlines })
|
||||
|
||||
asset.meta = {
|
||||
Name = "Json fieldlines files Bastille Day",
|
||||
Version = "1.0",
|
||||
Description = " Magnetic fieldlines for the bastille day CME event ",
|
||||
Author = "OpenSpace team",
|
||||
URL = "",
|
||||
License = ""
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
local TexturesPath = asset.syncedResource({
|
||||
Type = "HttpSynchronization",
|
||||
Name = "cutplanes_textures",
|
||||
Identifier = "cutplanes_textures",
|
||||
Version = 2
|
||||
})
|
||||
|
||||
asset.export("TexturesPath", TexturesPath)
|
||||
@@ -1,8 +0,0 @@
|
||||
local TexturesPath = asset.syncedResource({
|
||||
Type = "HttpSynchronization",
|
||||
Name = "cutplanes_textures",
|
||||
Identifier = "cutplanes_textures",
|
||||
Version = 7
|
||||
})
|
||||
|
||||
asset.export("TexturesPath", TexturesPath)
|
||||
@@ -1,8 +0,0 @@
|
||||
local TexturesPath = asset.syncedResource({
|
||||
Type = "HttpSynchronization",
|
||||
Name = "cutplanes_textures",
|
||||
Identifier = "cutplanes_textures",
|
||||
Version = 10
|
||||
})
|
||||
|
||||
asset.export("TexturesPath", TexturesPath)
|
||||
@@ -1,8 +0,0 @@
|
||||
local TexturesPath = asset.syncedResource({
|
||||
Type = "HttpSynchronization",
|
||||
Name = "cutplanes_textures",
|
||||
Identifier = "cutplanes_textures",
|
||||
Version = 9
|
||||
})
|
||||
|
||||
asset.export("TexturesPath", TexturesPath)
|
||||
@@ -1,8 +0,0 @@
|
||||
local TexturesPath = asset.syncedResource({
|
||||
Type = "HttpSynchronization",
|
||||
Name = "cutplanes_textures",
|
||||
Identifier = "cutplanes_textures",
|
||||
Version = 8
|
||||
})
|
||||
|
||||
asset.export("TexturesPath", TexturesPath)
|
||||
@@ -1,93 +0,0 @@
|
||||
asset.info = {
|
||||
Name = "Predictive Science Inc. Stream nodes Bastille Days",
|
||||
Version = "1.0",
|
||||
Description = " Stream nodes for the bastille day CME events ",
|
||||
Author = "Christian Adamsson, Emilie Ho",
|
||||
URL = "https://dx.doi.org/10.3847/1538-4357/aab36d",
|
||||
License = ""
|
||||
}
|
||||
|
||||
asset.require("spice/base")
|
||||
local assetHelper = asset.require("util/asset_helper")
|
||||
-- local textures = asset.require('./cutplanes_textures_sphere').TexturesPath
|
||||
-- local textures_venussphere = asset.require('./cutplanes_textures_sphere_venus').TexturesPath
|
||||
-- local textures_mercurysphere = asset.require('./cutplanes_textures_sphere_mercury').TexturesPath
|
||||
-- local textures_coronasphere = asset.require('./cutplanes_textures_sphere_corona').TexturesPath
|
||||
local transforms = asset.require("./transforms")
|
||||
local default_opacity = 0.99
|
||||
--textureversion 1 has purple for low flux, 2 has transparent. 3 for new, 4 for emin01 -2 - 4, 5 for emin01 -2 -4.5, 6 for emin03 cmr -2 -4.5. 7 with -2 - 4 cmr emin03. 8 emin01 transparent, 9 emin03 transparent
|
||||
local textureversion = 1
|
||||
|
||||
local TexturesPathEarth = asset.syncedResource({
|
||||
Type = "HttpSynchronization",
|
||||
Name = "sphereslice_earth_textures",
|
||||
Identifier = "sphereslice_earth_textures",
|
||||
Version = textureversion
|
||||
})
|
||||
local TexturesPathMercury = asset.syncedResource({
|
||||
Type = "HttpSynchronization",
|
||||
Name = "sphereslice_mercury_textures",
|
||||
Identifier = "sphereslice_mercury_textures",
|
||||
Version = textureversion
|
||||
})
|
||||
local TexturesPathVenus = asset.syncedResource({
|
||||
Type = "HttpSynchronization",
|
||||
Name = "sphereslice_venus_textures",
|
||||
Identifier = "sphereslice_venus_textures",
|
||||
Version = textureversion
|
||||
})
|
||||
|
||||
local Cutplane_sphere_earth = {
|
||||
Identifier = "Cutplane_sphere",
|
||||
Parent = transforms.SunIAU.Identifier,
|
||||
Renderable = {
|
||||
Type = "RenderableTimeVaryingSphere",
|
||||
Size = 1.571*10^11,
|
||||
Enabled = false,
|
||||
Texture = TexturesPathEarth,
|
||||
--BlendMode = "Additive",
|
||||
Opacity = default_opacity,
|
||||
Segments = 132
|
||||
},
|
||||
GUI = {
|
||||
Name = "Sphere Slice Earth",
|
||||
Path = "/Solar System/Heliosphere"
|
||||
},
|
||||
};
|
||||
local Cutplane_sphere_venus = {
|
||||
Identifier = "Cutplane_sphere_venus",
|
||||
Parent = transforms.SunIAU.Identifier,
|
||||
Renderable = {
|
||||
Type = "RenderableTimeVaryingSphere",
|
||||
Size = 107710467 * 10^3,
|
||||
Enabled = false,
|
||||
Texture = TexturesPathVenus,
|
||||
--BlendMode = "Additive",
|
||||
Opacity = default_opacity,
|
||||
Segments = 132
|
||||
},
|
||||
GUI = {
|
||||
Name = "Sphere Slice Venus",
|
||||
Path = "/Solar System/Heliosphere"
|
||||
},
|
||||
};
|
||||
local Cutplane_sphere_mercury = {
|
||||
Identifier = "Cutplane_sphere_mercury",
|
||||
Parent = transforms.SunIAU.Identifier,
|
||||
Renderable = {
|
||||
Type = "RenderableTimeVaryingSphere",
|
||||
Size = 56847190 * 10^3,
|
||||
Enabled = false,
|
||||
Texture = TexturesPathMercury,
|
||||
--BlendMode = "Additive",
|
||||
Opacity = default_opacity,
|
||||
Segments = 132
|
||||
},
|
||||
GUI = {
|
||||
Name = "Sphere Slice Mercury",
|
||||
Path = "/Solar System/Heliosphere"
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { Cutplane_sphere_earth, Cutplane_sphere_venus, Cutplane_sphere_mercury})
|
||||
@@ -1,8 +0,0 @@
|
||||
local TexturesPath = asset.syncedResource({
|
||||
Type = "HttpSynchronization",
|
||||
Name = "Streamnodes textures",
|
||||
Identifier = "streamnodes_legend",
|
||||
Version = 4
|
||||
})
|
||||
|
||||
asset.export("TexturesPath", TexturesPath)
|
||||
@@ -1,45 +0,0 @@
|
||||
local assetHelper = asset.require('util/asset_helper')
|
||||
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
|
||||
local earthTransforms = asset.require('scene/solarsystem/planets/earth/transforms')
|
||||
|
||||
local HNMKernel = asset.localResource("../../kernels/HNM.tf")
|
||||
local GSMKernel = asset.localResource("../../kernels/GSM.ti")
|
||||
|
||||
local HNMReferenceFrame = {
|
||||
Identifier = "HNMReferenceFrame",
|
||||
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
|
||||
Transform = {
|
||||
Rotation = {
|
||||
Type = "SpiceRotation",
|
||||
SourceFrame = "HEEQ180",
|
||||
DestinationFrame = "GALACTIC",
|
||||
Kernels = HNMKernel
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
Name = "HNM Reference Frame",
|
||||
Path = "/Solar System/Sun",
|
||||
Hidden = true
|
||||
}
|
||||
}
|
||||
|
||||
local GSMReferenceFrame = {
|
||||
Identifier = "GSMReferenceFrame",
|
||||
Parent = earthTransforms.EarthBarycenter.Identifier,
|
||||
Transform = {
|
||||
Rotation = {
|
||||
Type = "SpiceRotation",
|
||||
SourceFrame = "GSM", --Geocentric Solar Magnetospheric
|
||||
DestinationFrame = "GALACTIC",
|
||||
Kernels = GSMKernel
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
Name = "GSM Reference Frame",
|
||||
Path = "/Solar System/Planets/Earth",
|
||||
Hidden = true
|
||||
}
|
||||
}
|
||||
|
||||
local objects = { HNMReferenceFrame, GSMReferenceFrame }
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, objects)
|
||||
@@ -1,9 +1,6 @@
|
||||
local assetHelper = asset.require("util/asset_helper")
|
||||
--local earthTransforms = asset.require('scene/solarsystem/planets/earth/transforms')
|
||||
asset.require("spice/base")
|
||||
|
||||
local HNMKernel = asset.localResource("./kernels/HNM.tf")
|
||||
|
||||
-- Barycenter of the solar system, expressed in the Galactic frame
|
||||
local SolarSystemBarycenter = {
|
||||
Identifier = "SolarSystemBarycenter",
|
||||
@@ -68,33 +65,16 @@ local SunECLIPJ2000 = {
|
||||
}
|
||||
}
|
||||
|
||||
local HNMReferenceFrame = {
|
||||
Identifier = "HNMReferenceFrame",
|
||||
Parent = SolarSystemBarycenter.Identifier,
|
||||
Transform = {
|
||||
Rotation = {
|
||||
Type = "SpiceRotation",
|
||||
SourceFrame = "HEEQ180",
|
||||
DestinationFrame = "GALACTIC",
|
||||
Kernels = HNMKernel
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
Name = "HNM Reference Frame",
|
||||
Path = "/Solar System/Sun",
|
||||
Hidden = true
|
||||
}
|
||||
}
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { SolarSystemBarycenter, SunIAU, SunECLIPJ2000, HNMReferenceFrame })
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { SolarSystemBarycenter, SunIAU, SunECLIPJ2000 })
|
||||
|
||||
|
||||
asset.meta = {
|
||||
Name = "Sun Transforms",
|
||||
Version = "1.0",
|
||||
Description = [[ Sun transforms: Solar System Barycenter, SUN IAU, SUN J2000 and HNM]],
|
||||
Description = [[ Sun transforms: Solar System Barycenter, SUN IAU and
|
||||
SUN J2000]],
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license",
|
||||
Identifiers = {"SolarSystemBarycenter", "SunIAU", "SunECLIPJ2000", "HNMReferenceFrame"}
|
||||
Identifiers = {"SolarSystemBarycenter", "SunIAU", "SunECLIPJ2000"}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
local assetHelper = asset.require("util/asset_helper")
|
||||
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
|
||||
asset.require("spice/base")
|
||||
local HNMKernel = asset.localResource("./kernels/HNM.tf")
|
||||
|
||||
local HNMReferenceFrame = {
|
||||
Identifier = "HNMReferenceFrame",
|
||||
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
|
||||
Transform = {
|
||||
Rotation = {
|
||||
Type = "SpiceRotation",
|
||||
SourceFrame = "HEEQ180",
|
||||
DestinationFrame = "GALACTIC",
|
||||
Kernels = HNMKernel
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
Name = "HNM Reference Frame",
|
||||
Path = "/Solar System/Sun",
|
||||
Hidden = true
|
||||
}
|
||||
}
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { HNMReferenceFrame })
|
||||
|
||||
|
||||
asset.meta = {
|
||||
Name = "Sun Transform, HNM",
|
||||
Version = "1.0",
|
||||
Description = [[ Sun transform: HNM]],
|
||||
Author = "CCMC",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license",
|
||||
Identifiers = {"HNMReferenceFrame"}
|
||||
}
|
||||
@@ -1,19 +1,19 @@
|
||||
{
|
||||
"assets": [
|
||||
"base",
|
||||
"util/default_dashboard",
|
||||
"dashboard/default_dashboard",
|
||||
"scene/solarsystem/sun/sun_textures",
|
||||
"scene/solarsystem/sun/EUV_layer",
|
||||
"scene/solarsystem/sun/heliosphere/bastille_day/bastille_day_sun_textures",
|
||||
"scene/solarsystem/sun/heliosphere/bastille_day/density_volume",
|
||||
"scene/solarsystem/sun/heliosphere/bastille_day/fieldlines",
|
||||
"scene/solarsystem/sun/heliosphere/bastille_day/focuspoint",
|
||||
"scene/solarsystem/sun/heliosphere/bastille_day/lightindicator",
|
||||
"scene/solarsystem/sun/heliosphere/bastille_day/magnetogram",
|
||||
"scene/solarsystem/sun/heliosphere/bastille_day/magnetogram_textures",
|
||||
"scene/solarsystem/sun/heliosphere/bastille_day/fluxnodes",
|
||||
"scene/solarsystem/sun/heliosphere/bastille_day/fluxnodescutplane",
|
||||
"scene/solarsystem/sun/heliosphere/bastille_day/fluxnodeslegend",
|
||||
"scene/solarsystem/heliosphere/bastille_day/bastille_day_sun_textures",
|
||||
"scene/solarsystem/heliosphere/bastille_day/density_volume",
|
||||
"scene/solarsystem/heliosphere/bastille_day/fieldlines",
|
||||
"scene/solarsystem/heliosphere/bastille_day/focuspoint",
|
||||
"scene/solarsystem/heliosphere/bastille_day/lightindicator",
|
||||
"scene/solarsystem/heliosphere/bastille_day/magnetogram",
|
||||
"scene/solarsystem/heliosphere/bastille_day/magnetogram_textures",
|
||||
"scene/solarsystem/heliosphere/bastille_day/fluxnodes",
|
||||
"scene/solarsystem/heliosphere/bastille_day/fluxnodescutplane",
|
||||
"scene/solarsystem/heliosphere/bastille_day/fluxnodeslegend",
|
||||
"scene/solarsystem/planets/earth/earth",
|
||||
"scene/solarsystem/planets/earth/magnetosphere",
|
||||
"scene/solarsystem/planets/earth/satellites/satellites",
|
||||
@@ -225,14 +225,6 @@
|
||||
"name": "Starts from 10:03, delta time 15 min/ second",
|
||||
"script": "openspace.scriptScheduler.clear();openspace.time.setDeltaTime(900);openspace.time.setTime('2000-JUL-14 10:03:00.00');StarttimescriptSlowLoop = \"openspace.time.setTime('2000 JUL 14 10:03:00')\";openspace.scriptScheduler.loadScheduledScript('2000 JUL 14 12:00:00', StarttimescriptSlowLoop);"
|
||||
},
|
||||
{
|
||||
"documentation": "Fast loop: Starts from 10:03 and sets delta time to 15 min/ second (900 seconds/ second)",
|
||||
"gui_path": "/CCMC/Nodes",
|
||||
"is_local": false,
|
||||
"key": "SHIFT+V",
|
||||
"name": "Starts from 10:03, delta time 15 min/ second",
|
||||
"script": "openspace.scriptScheduler.clear();openspace.time.setDeltaTime(900);openspace.time.setTime('2000-JUL-14 10:03:00.00');StarttimescriptSlowLoop = \"openspace.time.setTime('2000 JUL 14 10:03:00')\";openspace.scriptScheduler.loadScheduledScript('2000 JUL 14 12:00:00', StarttimescriptSlowLoop);"
|
||||
},
|
||||
{
|
||||
"documentation": "Turn on sun glare, reset field line line width, change layer on the Sun to Orange",
|
||||
"gui_path": "/CCMC/Nodes",
|
||||
@@ -259,10 +251,10 @@
|
||||
"ISS"
|
||||
],
|
||||
"meta": {
|
||||
"author": "OpenSpace Team",
|
||||
"description": "Default OpenSpace Profile. Adds Earth satellites not contained in other profiles.",
|
||||
"author": "CCMC",
|
||||
"description": "This profile is showing the Coronal mass ejection of the bastille day 2000-07-14. The profile is data heavy and will require a powerful GPU.",
|
||||
"license": "MIT License",
|
||||
"name": "Default",
|
||||
"name": "Bastille day",
|
||||
"url": "https://www.openspaceproject.com",
|
||||
"version": "1.0"
|
||||
},
|
||||
|
||||
@@ -59,14 +59,14 @@ namespace {
|
||||
constexpr int8_t CurrentCacheVersion = 2;
|
||||
|
||||
//streamColor, nodeSize, nodeSizeLargerFlux, thresholdFlux,
|
||||
constexpr const std::array<const char*, 27> UniformNames = {
|
||||
constexpr const std::array<const char*, 26> UniformNames = {
|
||||
"streamColor", "nodeSize", "nodeSizeLargerFlux", "thresholdFlux", "colorMode",
|
||||
"filterLower", "filterUpper", "scalingMode", "colorTableRange", "domainLimZ",
|
||||
"nodeSkip", "nodeSkipDefault", "nodeSkipEarth", "nodeSkipMethod",
|
||||
"nodeSkipFluxThreshold", "nodeSkipRadiusThreshold", "fluxColorAlpha",
|
||||
"fluxColorAlphaIlluminance", "earthPos", "distanceThreshold",
|
||||
"enhanceMethod", "flowColor", "usingParticles",
|
||||
"usingInterestingStreams","particleSize", "particleSpacing", "particleSpeed"
|
||||
"particleSize", "particleSpacing", "particleSpeed"
|
||||
};
|
||||
constexpr const std::array<const char*, 14> UniformNames2 = {
|
||||
"time", "flowColoring", "maxNodeDistanceSize", "usingCameraPerspective",
|
||||
@@ -336,9 +336,16 @@ namespace {
|
||||
|
||||
struct [[codegen::Dictionary(RenderableFluxNodes)]] Parameters {
|
||||
// path to source folder with the 3 binary files in it
|
||||
std::string binarySourceFolder;
|
||||
std::string sourceFolder;
|
||||
//
|
||||
struct TransferFunctions {
|
||||
std::string standard;
|
||||
std::string flow;
|
||||
std::string earth;
|
||||
std::string cmr [[codegen::key("CMR")]];
|
||||
};
|
||||
// [[codegen::verbatim(ColorTablePathInfo.description)]]
|
||||
std::optional<std::vector<std::string>> colorTablePaths;
|
||||
TransferFunctions colorTablePaths;
|
||||
// [[codegen::verbatim(LineWidthInfo.description)]]
|
||||
//float lineWidth;
|
||||
// [[codegen::verbatim(GoesEnergyBinsInfo.description)]]
|
||||
@@ -435,20 +442,18 @@ RenderableFluxNodes::RenderableFluxNodes(const ghoul::Dictionary& dictionary)
|
||||
|
||||
const Parameters p = codegen::bake<Parameters>(dictionary);
|
||||
|
||||
_transferFunction =
|
||||
std::make_unique<TransferFunction>(p.colorTablePaths.standard);
|
||||
_transferFunctionCMR =
|
||||
std::make_unique<TransferFunction>(p.colorTablePaths.cmr);
|
||||
_transferFunctionEarth =
|
||||
std::make_unique<TransferFunction>(p.colorTablePaths.earth);
|
||||
_transferFunctionFlow =
|
||||
std::make_unique<TransferFunction>(p.colorTablePaths.flow);
|
||||
|
||||
_pColorTablePath = p.colorTablePaths.standard;
|
||||
|
||||
if (p.colorTablePaths.has_value()) {
|
||||
_colorTablePaths = p.colorTablePaths.value_or(_colorTablePaths);
|
||||
_transferFunction = std::make_unique<TransferFunction>(_colorTablePaths[0]);
|
||||
_transferFunctionCMR =
|
||||
std::make_unique<TransferFunction>(absPath(_colorTablePaths[1]).string());
|
||||
_transferFunctionEarth =
|
||||
std::make_unique<TransferFunction>(absPath(_colorTablePaths[2]).string());
|
||||
_transferFunctionFlow =
|
||||
std::make_unique<TransferFunction>(absPath(_colorTablePaths[3]).string());
|
||||
}
|
||||
_pColorTablePath = _colorTablePaths[0];
|
||||
|
||||
_binarySourceFolderPath = p.binarySourceFolder;
|
||||
_binarySourceFolderPath = p.sourceFolder;
|
||||
if (std::filesystem::is_directory(_binarySourceFolderPath)) {
|
||||
// Extract all file paths from the provided folder
|
||||
_binarySourceFiles.clear();
|
||||
@@ -507,7 +512,7 @@ RenderableFluxNodes::RenderableFluxNodes(const ghoul::Dictionary& dictionary)
|
||||
_pGoesEnergyBins.setValue(p.energyBin.value());
|
||||
}
|
||||
else { // default int 1 == Emin03 == MeV>100
|
||||
LWARNING("Assuming default value 1, meaning Emin03");
|
||||
LINFO("Assuming default value 1, meaning Emin03");
|
||||
_pGoesEnergyBins.setValue(1);
|
||||
}
|
||||
}
|
||||
@@ -555,7 +560,6 @@ void RenderableFluxNodes::definePropertyCallbackFunctions() {
|
||||
|
||||
_pColorTablePath.onChange([this] {
|
||||
_transferFunction->setPath(_pColorTablePath);
|
||||
_colorTablePaths[0] = _pColorTablePath;
|
||||
});
|
||||
|
||||
_pGoesEnergyBins.onChange([this] {
|
||||
@@ -889,8 +893,6 @@ void RenderableFluxNodes::render(const RenderData& data, RendererTasks&) {
|
||||
_shaderProgram->setUniform(_uniformCache.enhanceMethod, _pEnhancemethod);
|
||||
_shaderProgram->setUniform(_uniformCache.flowColor, _pFlowColor);
|
||||
_shaderProgram->setUniform(_uniformCache.usingParticles, _pFlowEnabled);
|
||||
_shaderProgram->setUniform(_uniformCache.usingInterestingStreams,
|
||||
_pInterestingStreamsEnabled);
|
||||
_shaderProgram->setUniform(_uniformCache.particleSize, _pFlowParticleSize);
|
||||
_shaderProgram->setUniform(_uniformCache.particleSpacing, _pFlowParticleSpacing);
|
||||
_shaderProgram->setUniform(_uniformCache.particleSpeed, _pFlowSpeed);
|
||||
|
||||
@@ -92,7 +92,7 @@ private:
|
||||
nodeSkipDefault, nodeSkipEarth, nodeSkipMethod, nodeSkipFluxThreshold,
|
||||
nodeSkipRadiusThreshold, fluxColorAlpha, fluxColorAlphaIlluminance, earthPos,
|
||||
distanceThreshold, enhanceMethod, flowColor, usingParticles,
|
||||
usingInterestingStreams, particleSize, particleSpacing, particleSpeed)
|
||||
particleSize, particleSpacing, particleSpeed)
|
||||
_uniformCache;
|
||||
UniformCache(time, flowColoring, maxNodeDistanceSize, usingCameraPerspective,
|
||||
drawCircles, drawHollow, useGaussian, usingRadiusPerspective,
|
||||
@@ -138,8 +138,6 @@ private:
|
||||
std::unique_ptr<TransferFunction> _transferFunctionFlow;
|
||||
|
||||
// ------------------------------------ VECTORS ----------------------------------- //
|
||||
// Paths to color tables. One for each 'ColorFlux'
|
||||
std::vector<std::string> _colorTablePaths;
|
||||
// Contains the _triggerTimes for all streams in the sequence
|
||||
std::vector<double> _startTimes;
|
||||
// Contains vertexPositions
|
||||
|
||||
@@ -75,17 +75,10 @@ uniform float distanceThreshold;
|
||||
uniform int enhanceMethod;
|
||||
uniform double time;
|
||||
|
||||
//uniform float interestingStreams[4];
|
||||
|
||||
// Speicific uniforms for cameraperspective
|
||||
//uniform float scaleFactor;
|
||||
//uniform float minNodeDistanceSize;
|
||||
uniform float maxNodeDistanceSize;
|
||||
uniform float nodeDistanceThreshold;
|
||||
|
||||
//uniform mat4 cameraViewProjectionMatrix;
|
||||
//uniform dmat4 modelMatrix;
|
||||
|
||||
uniform vec3 cameraPos;
|
||||
//uniform vec2 screenSize;
|
||||
uniform bool usingCameraPerspective;
|
||||
@@ -95,21 +88,18 @@ uniform float perspectiveDistanceFactor;
|
||||
uniform float maxNodeSize;
|
||||
uniform float minNodeSize;
|
||||
uniform bool usingPulse;
|
||||
|
||||
// Inputs
|
||||
// Should be provided in meters
|
||||
// Should be provided in meters VaPosition
|
||||
layout(location = 0) in vec3 in_position;
|
||||
|
||||
// The extra value used to color lines. Location must correspond to _VA_COLOR in
|
||||
// renderablefieldlinessequence.h
|
||||
// The extra value used to color lines. Location must correspond to VaColor in
|
||||
// renderablefluxnodes.h
|
||||
layout(location = 1) in float fluxValue;
|
||||
|
||||
// The extra value used to mask out parts of lines. Location must correspond to
|
||||
// _VA_MASKING in renderablefieldlinessequence.h
|
||||
layout(location = 2)
|
||||
in float rValue;
|
||||
|
||||
//layout(location = 5)
|
||||
//in vec2 arrow;
|
||||
// VaFiltering in renderablefluxnodes.h
|
||||
layout(location = 2) in float rValue;
|
||||
|
||||
// These should correspond to the enum 'ColorMode' in renderablefluxnodes.cpp
|
||||
const int colorByFluxValue = 0;
|
||||
@@ -138,7 +128,6 @@ varying out float camera_IsCloseEnough;
|
||||
varying out float vs_closeToEarth;
|
||||
varying out double vs_time;
|
||||
varying out vec3 vs_camerapos;
|
||||
//out vec4 vs_gPosition;
|
||||
|
||||
vec4 getTransferFunctionColor(sampler1D InColorTable) {
|
||||
// Remap the color scalar to a [0,1] range
|
||||
@@ -203,8 +192,7 @@ return false;
|
||||
//function for showing nodes different depending on distance to earth
|
||||
void DecidehowtoshowClosetoEarth(){
|
||||
// SizeScaling
|
||||
if(enhanceMethod == sizeScaling){
|
||||
// vec4 fluxColor = getTransferFunctionColor(colorTable);
|
||||
if(enhanceMethod == sizeScaling || enhanceMethod == illuminance){
|
||||
vec4 fluxColor = getTransferFunctionColor(colorTableCMR);
|
||||
vs_color = vec4(fluxColor.xyz, fluxColor.a);
|
||||
}
|
||||
@@ -224,11 +212,6 @@ void DecidehowtoshowClosetoEarth(){
|
||||
}
|
||||
gl_PointSize = tempR2 * tempR2 * tempR2 * gl_PointSize * 5;
|
||||
}
|
||||
// Illuminance
|
||||
if(enhanceMethod == illuminance){
|
||||
vec4 fluxColor1 = getTransferFunctionColor(colorTableCMR);
|
||||
vs_color = vec4(fluxColor1.xyz, fluxColor1.a);
|
||||
}
|
||||
}
|
||||
|
||||
void CheckdistanceMethod() {
|
||||
@@ -238,15 +221,13 @@ void CheckdistanceMethod() {
|
||||
|
||||
vs_closeToEarth = 0;
|
||||
|
||||
//if(distancevec < maxdist){
|
||||
if(distancevec < AUtoMeter * distanceThreshold && usingPulse){
|
||||
vs_closeToEarth = 1;
|
||||
gl_PointSize = gl_PointSize * 5;
|
||||
vec4 fluxColor = getTransferFunctionColor(colorTable);
|
||||
vs_color = vec4(fluxColor.xyz, fluxColorAlpha);
|
||||
//vs_color = vec4(streamColor.xyz, fluxColorAlpha); // HÄR
|
||||
}
|
||||
//}
|
||||
if(distancevec < AUtoMeter * distanceThreshold && usingPulse){
|
||||
vs_closeToEarth = 1;
|
||||
gl_PointSize = gl_PointSize * 5;
|
||||
vec4 fluxColor = getTransferFunctionColor(colorTable);
|
||||
vs_color = vec4(fluxColor.xyz, fluxColorAlpha);
|
||||
}
|
||||
|
||||
if(enhanceMethod == colorTables || enhanceMethod == sizeAndColor){
|
||||
vec4 fluxColor2 = getTransferFunctionColor(colorTableEarth);
|
||||
vs_color = vec4(fluxColor2.xyz, fluxColorAlpha);
|
||||
@@ -381,5 +362,5 @@ void main() {
|
||||
|
||||
gl_Position = vec4(positionClipSpace.xy, 0, positionClipSpace.w);
|
||||
vs_depth = gl_Position.w;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -50,11 +50,6 @@
|
||||
namespace {
|
||||
constexpr const char* _loggerCat = "RenderableTimeVaryingVolume";
|
||||
|
||||
const char* KeyStepSize = "StepSize";
|
||||
const char* KeyGridType = "GridType";
|
||||
const char* KeyOpacity = "Opacity";
|
||||
const char* KeyTransferFunction = "TransferFunction";
|
||||
|
||||
const float SecondsInOneDay = 60 * 60 * 24;
|
||||
constexpr const float VolumeMaxOpacity = 500;
|
||||
|
||||
@@ -151,6 +146,9 @@ namespace {
|
||||
|
||||
std::optional<float> opacity;
|
||||
|
||||
std::optional<double> stepSize;
|
||||
|
||||
std::optional<std::string> gridType;
|
||||
|
||||
std::optional<ghoul::Dictionary> clipPlanes;
|
||||
};
|
||||
@@ -197,13 +195,10 @@ RenderableTimeVaryingVolume::RenderableTimeVaryingVolume(
|
||||
});
|
||||
_gridType = static_cast<int>(volume::VolumeGridType::Cartesian);
|
||||
|
||||
if (dictionary.hasValue<double>(KeyStepSize)) {
|
||||
_stepSize = static_cast<float>(dictionary.value<double>(KeyStepSize));
|
||||
}
|
||||
_stepSize = p.stepSize.value_or(_stepSize);
|
||||
|
||||
if (dictionary.hasValue<double>(KeyOpacity)) {
|
||||
_opacity = static_cast<float>(dictionary.value<double>(KeyOpacity)
|
||||
* VolumeMaxOpacity);
|
||||
if (p.opacity.has_value()) {
|
||||
_opacity = *p.opacity * VolumeMaxOpacity;
|
||||
}
|
||||
|
||||
_secondsBefore = p.secondsBefore.value_or(_secondsBefore);
|
||||
@@ -214,10 +209,8 @@ RenderableTimeVaryingVolume::RenderableTimeVaryingVolume(
|
||||
_clipPlanes->setIdentifier("clipPlanes");
|
||||
_clipPlanes->setGuiName("Clip Planes");
|
||||
|
||||
if (dictionary.hasValue<std::string>(KeyGridType)) {
|
||||
VolumeGridType gridType = volume::parseGridType(
|
||||
dictionary.value<std::string>(KeyGridType)
|
||||
);
|
||||
if (p.gridType.has_value()) {
|
||||
VolumeGridType gridType = volume::parseGridType(*p.gridType);
|
||||
_gridType = static_cast<std::underlying_type_t<VolumeGridType>>(gridType);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user