added new webgui to dsn.scene, new z buffer clculations in shader files

This commit is contained in:
Lovisa Hassler
2018-11-07 18:33:30 -05:00
parent 5ad383412c
commit 2cf1dc3670
4 changed files with 28 additions and 27 deletions
+21 -18
View File
@@ -27,45 +27,47 @@ asset.require('util/default_keybindings')
asset.require('util/default_dashboard')
asset.require('util/default_joystick')
asset.require('util/webgui')
local Keybindings = {
{
Key = "s",
Command = propertyHelper.invert('Scene.Earth.RenderableGlobe.Layers.NightLayers.Earth at Night 2012.Enabled') ..
propertyHelper.invert('Scene.Earth.RenderableGlobe.PerformShading') ..
propertyHelper.invert('Scene.Earth.RenderableGlobe.Atmosphere') ..
propertyHelper.invert('Scene.Earth.RenderableGlobe.Layers.WaterMasks.MODIS_Water_Mask.Enabled'),
Command = propertyHelper.invert('Scene.Earth.Renderable.Layers.NightLayers.Earth at Night 2012.Enabled') ..
propertyHelper.invert('Scene.Earth.Renderable.PerformShading') ..
propertyHelper.invert('Scene.Earth.Renderable.Atmosphere') ..
propertyHelper.invert('Scene.Earth.Renderable.Layers.WaterMasks.MODIS_Water_Mask.Enabled'),
Documentation = "Toggle night texture, shading, atmosphere, and water for Earth.",
Local = false
},
{
Key = "g",
Command = propertyHelper.invert('Scene.MilkyWay.renderable.Enabled') ..
propertyHelper.invert('Scene.Stars.renderable.Enabled') ..
propertyHelper.invert('Scene.Earth.RenderableGlobe.Layers.NightLayers.Earth_at_Night_2012.Enabled') ..
propertyHelper.invert('Scene.EarthAtmosphere.renderable.Enabled') ..
propertyHelper.invert('Scene.MarsAtmosphere.renderable.Enabled') ..
propertyHelper.invert('Scene.Earth.RenderableGlobe.Layers.WaterMasks.MODIS_Water_Mask.Enabled') ..
propertyHelper.invert('Scene.Moon.RenderableGlobe.Enabled') ..
propertyHelper.invert('Scene.Sun.renderable.Enabled'),
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",
Local = false
},
{
Key = "h",
Command = "openspace.setPropertyValue('Scene.*Trail.renderable.Enabled', true)",
Command = "openspace.setPropertyValue('Scene.*Trail.Renderable.Enabled', true)",
Documentation = "Enables visibility of the trails",
Local = false
},
{
Key = "j",
Command = "openspace.setPropertyValue('Scene.*Trail.renderable.Enabled', false)",
Command = "openspace.setPropertyValue('Scene.*Trail.Renderable.Enabled', false)",
Documentation = "Disables visibility of the trails",
Local = false
},
{
Key = "e",
Command = propertyHelper.invert('Scene.EquatorialSphere.renderable.Enabled'),
Command = propertyHelper.invert('Scene.EquatorialSphere.Renderable.Enabled'),
Documentation = "Disables visibility of the equatorial sphere",
Local = false
},
@@ -83,7 +85,7 @@ asset.onInitialize(function ()
openspace.setDefaultGuiSorting()
openspace.setPropertyValue('Scene.*Trail.renderable.Enabled', false)
openspace.setPropertyValue('Scene.*Trail.Renderable.Enabled', false)
openspace.globebrowsing.loadWMSServersFromFile(
openspace.absPath("${DATA}/globebrowsing_servers.lua")
@@ -96,7 +98,7 @@ asset.onInitialize(function ()
openspace.addVirtualProperty(
"BoolProperty",
"Show Trails",
"Scene.*Trail.renderable.Enabled",
"Scene.*Trail.Renderable.Enabled",
"Disable or enable all trails of the scene at the same time",
true,
nil,
@@ -113,10 +115,11 @@ asset.onInitialize(function ()
end)
asset.onDeinitialize(function ()
sceneHelper.unbindKeys(Keybindings)
openspace.removeVirtualProperty("Scene.*Trail.renderable.Enabled")
openspace.removeVirtualProperty("Scene.*Trail.Renderable.Enabled")
openspace.removeInterestingNodes({
"VGR1", "VGR2", "Earth", "DSS63", "DSS14", "DSS43"
@@ -4,8 +4,6 @@ local earthAsset = asset.require('scene/solarsystem/planets/earth/earth')
--Communicationline data
local dataFolder = openspace.absPath("../../../sync/http/dsn_data/1/json")
--openspace.absPath("${DATA}/globebrowsing_servers.lua")
local CommunicationLine = {
Identifier = "Communication_Lines",
Renderable = {
@@ -19,7 +17,6 @@ local CommunicationLine = {
MadridColor = {1.0, 0.0, 0.0},
GoldstoneColor = {0.0, 0.0, 1.0},
CanberraColor = {0.0, 1.0, 0.0}
},
GUI = {
Name = "CommunicationLine",
@@ -23,6 +23,7 @@
****************************************************************************************/
#include "fragment.glsl"
#include "floatoperations.glsl"
in vec4 vs_positionScreenSpace;
in vec4 vs_gPosition;
@@ -30,14 +31,14 @@ in vec4 vs_color;
Fragment getFragment() {
Fragment frag;
frag.color = vec4(vs_color); // opacity 1.0
frag.color = vec4(vs_color);
frag.depth = vs_positionScreenSpace.w;
//frag.blend = BLEND_MODE_ADDITIVE;
frag.gPosition = vs_gPosition;
// There is no normal here
frag.gNormal = vec4(0.0, 0.0, -1.0, 1.0);
// For rendering inside earth atmosphere we need to set a normal for our line
frag.gNormal = vec4(0.0, 0.0, 1.0, 0.0);
return frag;
}
@@ -24,8 +24,6 @@
#version __CONTEXT__
#include "PowerScaling/powerScaling_vs.hglsl"
layout(location = 0) in vec3 in_point_position;
layout(location = 1) in vec4 in_color;
@@ -48,7 +46,9 @@ void main() {
vs_gPosition = vec4(modelViewSpacecraft * dvec4(in_point_position, 1));
}
vs_positionScreenSpace = z_normalization(projectionTransform * vs_gPosition);
vs_positionScreenSpace = projectionTransform * vs_gPosition;
gl_Position = vs_positionScreenSpace;
// Set z to 0 to disable near and far plane
gl_Position.z = 0.f;
vs_color = in_color;
}