mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-23 12:40:01 -06:00
* Physically-based star rendering. * New Tully Pic Galaxies speck file w/o Milky Way * Removed PSC from stars rendering. * Avoiding extra calculations during shading. * Removed bug in billboard maximum size code. * New method to get the current viewport resolution. Used e.g. when rendering stereo side-by-side configuration. * Same as stereo stars. * Improved configuration. * Stars camera orientation. * Separated changes in billboards. * Adde min size control. * Setting minimum size. * Changed eye position. Changed data array nome inside shaders to a more accurate representation of the data. * Billboards reflecting actual stars sizes. * Scaling stars size based on luminosity, Abs Mag and size. * Rendering to a texture instead of fragment calculation for each star. * Added default parameters, new configurations and updated parameters. * Updated speck file handling to reflect a more general specification. * Added apparent magnitude from the speck files. * Set correct star values values for Apogee and Galah * Changed position from vec4 to vec3 to save GPU memory.
102 lines
3.6 KiB
Plaintext
102 lines
3.6 KiB
Plaintext
local assetHelper = asset.require('util/asset_helper')
|
|
local sceneHelper = asset.require('util/scene_helper')
|
|
local propertyHelper = asset.require('util/property_helper')
|
|
|
|
-- Specifying which other assets should be loaded in this scene
|
|
asset.require('spice/base')
|
|
assetHelper.requestAll(asset, 'scene/solarsystem/sun')
|
|
asset.require('scene/solarsystem/planets')
|
|
asset.require('scene/solarsystem/planets/mars/moons/phobos')
|
|
asset.require('scene/solarsystem/planets/mars/moons/deimos')
|
|
asset.require('scene/solarsystem/dwarf_planets/pluto/system')
|
|
assetHelper.requestAll(asset, 'scene/digitaluniverse')
|
|
|
|
-- Load default key bindings applicable to most scenes
|
|
asset.require('util/default_keybindings')
|
|
asset.require('util/default_dashboard')
|
|
asset.require('util/default_joystick')
|
|
|
|
asset.require('util/webgui')
|
|
|
|
asset.request('customization/globebrowsing')
|
|
|
|
-- Keybindings that are specific for this scene
|
|
local Keybindings = {
|
|
{
|
|
Key = "b",
|
|
Name = "Toggle background",
|
|
Command = propertyHelper.invert('Scene.MilkyWay.Renderable.Enabled') ..
|
|
propertyHelper.invert('Scene.Stars.Renderable.Enabled'),
|
|
Documentation = "Toggle background (Stars and Milkyway).",
|
|
GuiPath = "/Rendering",
|
|
Local = false
|
|
},
|
|
{
|
|
Key = "g",
|
|
Name = "Toggle background/shading",
|
|
Command = propertyHelper.invert('Scene.MilkyWay.Renderable.Enabled') ..
|
|
propertyHelper.invert('Scene.Stars.Renderable.Enabled') ..
|
|
propertyHelper.invert('Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Enabled') ..
|
|
propertyHelper.invert('Scene.EarthAtmosphere.Renderable.Enabled') ..
|
|
propertyHelper.invert('Scene.MarsAtmosphere.Renderable.Enabled') ..
|
|
propertyHelper.invert('Scene.Earth.Renderable.Layers.WaterMasks.MODIS_Water_Mask.Enabled') ..
|
|
propertyHelper.invert('Scene.Moon.Renderable.Enabled') ..
|
|
propertyHelper.invert('Scene.Sun.Renderable.Enabled'),
|
|
Documentation = "Toogles background and shading mode on the Earth and Mars alongside visibility of the Moon and the Sun",
|
|
GuiPath = "/Rendering",
|
|
Local = false
|
|
},
|
|
{
|
|
Key = "h",
|
|
Name="Hide Trails",
|
|
Command = "openspace.setPropertyValue('Scene.*Trail.Renderable.Enabled', false)",
|
|
Documentation = "Disables visibility of the trails",
|
|
GuiPath = "/Rendering",
|
|
Local = false
|
|
},
|
|
}
|
|
|
|
local earthAsset = asset.require('scene/solarsystem/planets/earth/earth')
|
|
|
|
assetHelper.registerInterestingNodes(asset, {
|
|
"Earth", "Mars", "Moon", "Sun"
|
|
})
|
|
|
|
asset.onInitialize(function ()
|
|
local now = openspace.time.currentWallTime()
|
|
-- Jump back one day to show a complete planet
|
|
openspace.time.setTime(openspace.time.advancedTime(now, "-1d"))
|
|
|
|
sceneHelper.bindKeys(Keybindings)
|
|
|
|
openspace.setDefaultGuiSorting()
|
|
|
|
openspace.globebrowsing.loadWMSServersFromFile(
|
|
openspace.absPath("${DATA}/globebrowsing_servers.lua")
|
|
)
|
|
|
|
openspace.addVirtualProperty(
|
|
"BoolProperty",
|
|
"Show Trails",
|
|
"Scene.*Trail.Renderable.Enabled",
|
|
"Disable or enable all trails of the scene at the same time",
|
|
true,
|
|
nil,
|
|
nil
|
|
)
|
|
|
|
openspace.navigation.setCameraState({
|
|
Anchor = earthAsset.Earth.Identifier,
|
|
Position = { 0, 0, 0 },
|
|
Rotation = { 0.758797, 0.221490, -0.605693, -0.091135 },
|
|
})
|
|
|
|
openspace.globebrowsing.goToGeo(58.5877, 16.1924, 20000000)
|
|
end)
|
|
|
|
asset.onDeinitialize(function ()
|
|
sceneHelper.unbindKeys(Keybindings)
|
|
|
|
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
|
|
end)
|