diff --git a/config/single_two_win.xml b/config/single_two_win.xml index 2f7f49efc6..48b50d2a0f 100644 --- a/config/single_two_win.xml +++ b/config/single_two_win.xml @@ -13,7 +13,7 @@ - + diff --git a/data/scene/atmosphereearth/atmosphereearth.data b/data/scene/atmosphereearth/atmosphereearth.data deleted file mode 100644 index e168d4c8be..0000000000 --- a/data/scene/atmosphereearth/atmosphereearth.data +++ /dev/null @@ -1,5 +0,0 @@ -return { - FileRequest = { - { Identifier = "earth_textures", Destination = "textures", Version = 2 } - }, -} diff --git a/data/scene/atmosphereearth/atmosphereearth.mod b/data/scene/atmosphereearth/atmosphereearth.mod deleted file mode 100644 index fd7116b122..0000000000 --- a/data/scene/atmosphereearth/atmosphereearth.mod +++ /dev/null @@ -1,161 +0,0 @@ -return { - -- Earth barycenter module - { - Name = "EarthBarycenter", - Parent = "SolarSystemBarycenter", - Static = true, - Transform = { - Translation = { - Type = "Spice", - Body = "EARTH BARYCENTER", - Observer = "SUN", - Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp" - }, - } - }, - -- Earth module - { - Name = "Earth", - Parent = "EarthBarycenter", - Renderable = { - Type = "RenderablePlanet", - Frame = "IAU_EARTH", - Body = "EARTH", - Geometry = { - Type = "SimpleSphere", - Radius = { 6.371, 6 }, - Segments = 100 - }, - Shadow_Group = { - Source1 = { - Name = "Sun", - -- All radius in meters - Radius = 696.3E6 - }, - --Source2 = { Name = "Monolith", Radius = 0.01E6 }, - Caster1 = { - Name = "Moon", - -- All radius in meters - Radius = 1.737E6 - }, - --Caster2 = { Name = "Independency Day Ship", Radius = 0 } - }, - ColorTexture = "textures/earth_bluemarble.jpg", - NightTexture = "textures/earth_night.jpg", - Textures = { - Type = "simple", - --Height = "textures/earth_bluemarble_height.jpg", - -- Depth = "textures/earth_depth.png", - Reflectance = "textures/earth_reflectance.png", - Clouds = "textures/earth_clouds.jpg" - }, - Atmosphere = { - -- Atmosphere radius in Km - AtmoshereRadius = 6420, - --AtmoshereRadius = 6390, - --PlanetRadius = 6371, - PlanetRadius = 6360, - PlanetAverageGroundReflectance = 0.1, - Rayleigh = { - Coefficients = { - -- Wavelengths are given in 10^-9m - Wavelengths = {680, 550, 440}, - -- Reflection coefficients are given in km^-1 - Scattering = {5.8e-3, 1.35e-2, 3.31e-2}, - -- In Rayleigh scattering, the coefficients of absorption and scattering are the same. - }, - -- Thichkness of atmosphere if its density were uniform, in Km - H_R = 8.0, - }, - -- Default - Mie = { - Coefficients = { - -- Reflection coefficients are given in km^-1 - Scattering = {4e-3, 4e-3, 4e-3}, - --Scattering = {2e-5, 2e-5, 2e-5}, - -- Extinction coefficients are a fraction of the Scattering coefficients - Extinction = {4e-3/0.9, 4e-3/0.9, 4e-3/0.9} - -- Height scale (atmosphere thickness for constant density) in Km - }, - H_M = 1.2, - -- Mie Phase Function Value (G e [-1.0, 1.0]. If G = 1.0, Mie phase function = Rayleigh Phase Function) - G = 1.0, - }, - -- Clear Sky - -- Mie = { - -- Coefficients = { - -- Scattering = {20e-3, 20e-3, 20e-3}, - -- Extinction = 1.0/0.9, - -- } - -- H_M = 1.2, - -- G = 0.76, - -- }, - -- Cloudy - -- Mie = { - -- Coefficients = { - -- Scattering = {3e-3, 3e-3, 3e-3}, - -- Extinction = 1.0/0.9, - -- } - -- H_M = 3.0, - -- G = 0.65, - -- }, - } - } - }, - -- EarthTrail module - { - Name = "EarthTrail", - Parent = "SolarSystemBarycenter", - Renderable = { - Type = "RenderableTrailOrbit", - Translation = { - Type = "SpiceTranslation", - Target = "EARTH", - Observer = "SUN" - }, - Color = { 0.5, 0.8, 1.0 }, - -- StartTime = "2016 JUN 01 12:00:00.000", - -- EndTime = "2017 JAN 01 12:00:00.000", - -- SampleInterval = 3600 - Period = 365.242, - Resolution = 1000 - }, - GuiName = "/Solar/EarthTrail" - }, - { - Name = "EarthMarker", - Parent = "Earth", - Renderable = { - Type = "RenderablePlane", - Size = 3.0E11.0, - Origin = "Center", - Billboard = true, - Texture = "textures/marker.png", - BlendMode = "Additive" - }, - Ephemeris = { - Type = "Static", - Position = {0, 0, 0, 5} - } - } - -- Plane - -- { - -- Name = "EarthPlane", - -- Parent = "Earth", - -- Renderable = { - -- Type = "RenderablePlane", - -- Billboard = true, - -- Size = 6.371E6, - -- Texture = "textures/graph.jpg", - -- Atmosphere = { - -- Type = "Nishita", -- for example, values missing etc etc - -- MieFactor = 1.0, - -- MieColor = {1.0, 1.0, 1.0} - -- } - -- }, - -- Ephemeris = { - -- Type = "Static", - -- Position = { 6.371*2, 0, 0, 6}, - -- }, - -- } -} diff --git a/data/scene/default.scene b/data/scene/default.scene index c68ee2cd9b..824d2d3f7c 100644 --- a/data/scene/default.scene +++ b/data/scene/default.scene @@ -91,10 +91,18 @@ function postInitialization() openspace.setPropertyValueSingle("Earth.RenderableGlobe.Debug.LevelByProjectedAreaElseDistance", false) + openspace.setPropertyValue("Earth.RenderableGlobe.Atmosphere", false) + + openspace.setPropertyValue("Earth.RenderableGlobe.PerformShading", false) + + openspace.setPropertyValue("Earth.RenderableGlobe.Layers.NightLayers.Earth at Night 2012.Settings.Multiplier", 1.0); + openspace.globebrowsing.goToGeo(58.5877, 16.1924, 20000000) openspace.printInfo("Done setting default values") + openspace.setPropertyValue("RenderEngine.AaSamples", 4) + -- Add local patches described at the top of this file for obj, list in pairs(vrt_folders) do for _, dir in pairs(list) do @@ -130,7 +138,8 @@ return { "saturn", "uranus", "neptune", - -- "satellites", + + --"satellites", "grids", "digitaluniverse", diff --git a/data/scene/digitaluniverse/abell/abell.mod b/data/scene/digitaluniverse/abell/abell.mod index 8cab971966..2c74a4d67f 100644 --- a/data/scene/digitaluniverse/abell/abell.mod +++ b/data/scene/digitaluniverse/abell/abell.mod @@ -15,8 +15,15 @@ return { TextColor = { 0.0, 0.8, 0.0, 1.0 }, TextSize = 22, TextMinSize = 10.0, - Unit = "Mpc" + Unit = "Mpc", + TransformationMatrix = { + -0.7357425748, 0.67726129641, 0.0, 0.0, + -0.074553778365, -0.080991471307, 0.9939225904, 0.0, + 0.67314530211, 0.73127116582, 0.11008126223, 0.0, + 0.0, 0.0, 0.0, 1.0 + }, }, + --[[ Transform = { Rotation = { Type = "StaticRotation", @@ -27,6 +34,7 @@ return { } } }, + ]]-- GuiPath = "/Universe/Galaxies" } } diff --git a/data/scene/digitaluniverse/backgroundradiation/backgroundradiation.mod b/data/scene/digitaluniverse/backgroundradiation/backgroundradiation.mod index 482b1f4a6e..d6a75440a7 100644 --- a/data/scene/digitaluniverse/backgroundradiation/backgroundradiation.mod +++ b/data/scene/digitaluniverse/backgroundradiation/backgroundradiation.mod @@ -10,7 +10,8 @@ return { Segments = 80, Alpha = 0.5, Texture = "textures/wmap_ilc_7yr_v4_200uK_RGB_sos.png", - Orientation = "Inside/Outside" + Orientation = "Inside/Outside", + FadeInThreshould = 8E26 }, GuiPath = "/Universe/Cosmic Microwave Background" }, @@ -24,7 +25,8 @@ return { Segments = 80, Alpha = 0.5, Texture = "textures/COBErect.png", - Orientation = "Inside/Outside" + Orientation = "Inside/Outside", + FadeInThreshould = 8E26 }, GuiPath = "/Universe/Cosmic Microwave Background" }, @@ -33,12 +35,13 @@ return { Parent = "Root", Renderable = { Type = "RenderableSphere", - Enabled = false, + Enabled = true, Size = 3975.41417036064E23, Segments = 80, Alpha = 0.5, Texture = "textures/cmb4k.jpg", Orientation = "Inside/Outside", + FadeInThreshould = 8E26 }, GuiPath = "/Universe/Cosmic Microwave Background" }, diff --git a/data/scene/digitaluniverse/constellations/constellations.mod b/data/scene/digitaluniverse/constellations/constellations.mod index 0beb479c0c..50be49e450 100644 --- a/data/scene/digitaluniverse/constellations/constellations.mod +++ b/data/scene/digitaluniverse/constellations/constellations.mod @@ -12,8 +12,9 @@ return { File = "speck/constellationsEXGAL.speck", LabelFile = "speck/constellationsEXGAL.label", TextColor = { 0.8, 0.8, 0.8, 1.0 }, - TextSize = 15.5, - TextMinSize = 8.0, + TextSize = 20.0, + TextMinSize = 20.0, + TextMaxSize = 30.0, MeshColor = { { 0.6, 0.4, 0.4 }, { 0.8, 0.0, 0.0 }, { 0.0, 0.3, 0.8 } }, Unit = "Mpc", }, @@ -32,7 +33,8 @@ return { LabelFile = "speck/constellations.label", TextColor = { 0.8, 0.8, 0.8, 1.0 }, TextSize = 15.5, - TextMinSize = 8.0, + TextMinSize = 10.0, + TextMaxSize = 30.0, MeshColor = { { 0.6, 0.4, 0.4 }, { 0.8, 0.0, 0.0 }, { 0.0, 0.3, 0.8 } }, Unit = "pc", }, diff --git a/data/scene/digitaluniverse/grids/grids.mod b/data/scene/digitaluniverse/grids/grids.mod index de3ce0111f..4264786407 100644 --- a/data/scene/digitaluniverse/grids/grids.mod +++ b/data/scene/digitaluniverse/grids/grids.mod @@ -1,6 +1,6 @@ return { { - Name = "Ecliptic Grid Labels", + Name = "Ecliptic Sphere Labels", Parent = "Root", Renderable = { Type = "RenderableBillboardsCloud", @@ -12,22 +12,18 @@ return { TextColor = {0.5, 0.5, 0.5, 1.0}, TextSize = 15.4, TextMinSize = 5.0, + TransformationMatrix = { + -0.05487554, 0.4941095, -0.8676661 , 0.0, + -0.9938214 , -0.1109906, -0.0003515167, 0.0, + -0.09647644, 0.8622859, 0.4971472 , 0.0, + 0.0 , 0.0 , 0.0 , 1.0 + }, Unit = "pc", }, - Transform = { - Rotation = { - Type = "StaticRotation", - Rotation = { - -0.05487554, 0.4941095, -0.8676661, - -0.9938214 , -0.1109906, -0.0003515167, - -0.09647644, 0.8622859, 0.4971472 - } - } - }, GuiPath = "/Other/Grids" }, { - Name = "Equatorial Grid Labels", + Name = "Equatorial Sphere Labels", Parent = "Root", Renderable = { Type = "RenderableBillboardsCloud", @@ -39,13 +35,19 @@ return { TextColor = {0.5, 0.5, 0.5, 1.0}, TextSize = 15.3, TextMinSize = 5.0, + TransformationMatrix = { + -0.05487554, 0.4941095, -0.8676661, 0.0, + -0.8734371 , -0.4448296, -0.1980764, 0.0, + -0.483835 , 0.7469823, 0.4559838, 0.0, + 0.0 , 0.0 , 0.0 , 1.0 + }, Unit = "pc", }, GuiPath = "/Other/Grids" }, - -- Galactic Grid Labels + -- Galactic Sphere Labels { - Name = "Galactic Grid Labels", + Name = "Galactic Sphere Labels", Parent = "Root", Renderable = { Type = "RenderableBillboardsCloud", diff --git a/data/scene/digitaluniverse/milkyway/milkyway.mod b/data/scene/digitaluniverse/milkyway/milkyway.mod new file mode 100644 index 0000000000..7fa923a2ba --- /dev/null +++ b/data/scene/digitaluniverse/milkyway/milkyway.mod @@ -0,0 +1,24 @@ +return { + -- MilkyWay Galaxy (Texture) + { + Name = "Milky Way Galaxy Image", + Parent = "Root", + Renderable = { + Type = "RenderablePlanesCloud", + Enabled = true, + Color = { 1.0, 1.0, 1.0 }, + Transparency = 0.90, + ScaleFactor = 2.8, + File = "speck/galaxy.speck", + TexturePath = "textures", + Luminosity = "size", + ScaleLuminosity = 1.0, + -- Fade in value in the same unit as "Unit" + FadeInThreshould = 119441, + FadeInDistances = {1400.0, 119441.0}, + PlaneMinSize = 5.0, + Unit = "pc", + }, + GuiPath = "/Universe/Galaxies" + } +} diff --git a/data/scene/digitaluniverse/quasars/quasars.mod b/data/scene/digitaluniverse/quasars/quasars.mod index 664810f3e3..2abda4f5e7 100644 --- a/data/scene/digitaluniverse/quasars/quasars.mod +++ b/data/scene/digitaluniverse/quasars/quasars.mod @@ -5,13 +5,17 @@ return { Parent = "Root", Renderable = { Type = "RenderableBillboardsCloud", - Enabled = false, + Enabled = true, Color = { 1.0, 0.4, 0.2 }, Transparency = 1.0, File = "speck/quasars.speck", Texture = "textures/point3.png", Unit = "Mpc", - ScaleFactor = 537.31 + ScaleFactor = 537.31, + -- Fade in value in the same unit as "Unit" + FadeInDistances = {300.0, 1000.0}, + BillboardMaxSize = 50.0, + BillboardMinSize = 0.0, }, GuiPath = "/Universe/Quasars" } diff --git a/data/scene/digitaluniverse/sloandss/sloandss.mod b/data/scene/digitaluniverse/sloandss/sloandss.mod index 2eae94af43..79cc7dc877 100644 --- a/data/scene/digitaluniverse/sloandss/sloandss.mod +++ b/data/scene/digitaluniverse/sloandss/sloandss.mod @@ -5,7 +5,7 @@ return { Parent = "Root", Renderable = { Type = "RenderableBillboardsCloud", - Enabled = false, + Enabled = true, Color = { 0.8, 0.8, 1.0 }, Transparency = 1.0, ScaleFactor = 507.88, @@ -14,7 +14,14 @@ return { ColorOption = {"redshift", "prox5Mpc"}, ColorRange = { { 0.0, 0.075 }, { 1.0, 50.0 } }, Texture = "textures/point3.png", - Unit = "Mpc" + -- Fade in value in the same unit as "Unit" + FadeInDistances = {45.0, 90.0}, + Unit = "Mpc", + BillboardMaxSize = 50.0, + BillboardMinSize = 0.0, + TextSize = 14.8, + TextMinSize = 10.0, + TextMaxSize = 50.0, }, GuiPath = "/Universe/Galaxies" } diff --git a/data/scene/digitaluniverse/tully/tully.data b/data/scene/digitaluniverse/tully/tully.data index 705b46f71d..e4700802a6 100644 --- a/data/scene/digitaluniverse/tully/tully.data +++ b/data/scene/digitaluniverse/tully/tully.data @@ -1,6 +1,6 @@ return { FileRequest = { - { Identifier = "digitaluniverse_tully_speck", Destination = "speck", Version = 1 }, + { Identifier = "digitaluniverse_tully_speck", Destination = "speck", Version = 1}, { Identifier = "digitaluniverse_tully_textures", Destination = "textures", Version = 1 } } } diff --git a/data/scene/digitaluniverse/tully/tully.mod b/data/scene/digitaluniverse/tully/tully.mod index a64d7080e6..7e2ba52fd2 100644 --- a/data/scene/digitaluniverse/tully/tully.mod +++ b/data/scene/digitaluniverse/tully/tully.mod @@ -5,7 +5,7 @@ return { Parent = "Root", Renderable = { Type = "RenderableBillboardsCloud", - Enabled = false, + Enabled = true, Color = { 1.0, 0.4, 0.2 }, Transparency = 0.99, ScaleFactor = 502.77, @@ -18,17 +18,18 @@ return { TextColor = { 0.7, 0.7, 0.7, 1.0 }, TextSize = 20.50, TextMinSize = 16.0, - Unit = "Mpc" - }, - Transform = { - Rotation = { - Type = "StaticRotation", - Rotation = { - -0.7357425748, 0.67726129641, 0.0, - -0.074553778365, -0.080991471307, 0.9939225904, - 0.67314530211, 0.73127116582, 0.11008126223 - } - } + TransformationMatrix = { + -0.7357425748, 0.67726129641, 0.0, 0.0, + -0.074553778365, -0.080991471307, 0.9939225904, 0.0, + 0.67314530211, 0.73127116582, 0.11008126223, 0.0, + 0.0, 0.0, 0.0, 1.0 + }, + -- Fade in value in the same unit as "Unit" + FadeInDistances = {0.05, 1.0}, + Unit = "Mpc", + -- Max size in pixels + BillboardMaxSize = 50.0, + BillboardMinSize = 0.0, }, GuiPath = "/Universe/Galaxies" }, @@ -39,26 +40,25 @@ return { Parent = "Root", Renderable = { Type = "RenderablePlanesCloud", - Enabled = false, + Enabled = true, Color = { 1.0, 1.0, 1.0 }, Transparency = 0.99, - ScaleFactor = 27.39, + ScaleFactor = 1.0, File = "speck/tully.speck", TexturePath = "textures", Luminosity = "diamkpc", ScaleLuminosity = 0.001, + TransformationMatrix = { + -0.7357425748, 0.67726129641, 0.0, 0.0, + -0.074553778365, -0.080991471307, 0.9939225904, 0.0, + 0.67314530211, 0.73127116582, 0.11008126223, 0.0, + 0.0, 0.0, 0.0, 1.0 + }, + -- Fade in value in the same unit as "Unit" + FadeInDistances = {0.05, 0.1}, + PlaneMinSize = 5.0, Unit = "Mpc", - }, - Transform = { - Rotation = { - Type = "StaticRotation", - Rotation = { - -0.7357425748, 0.67726129641, 0.0, - -0.074553778365, -0.080991471307, 0.9939225904, - 0.67314530211, 0.73127116582, 0.11008126223 - } - } - }, + }, GuiPath = "/Universe/Galaxies" } } diff --git a/data/scene/earth/earth.mod b/data/scene/earth/earth.mod index b81fe35ee2..66b868268b 100644 --- a/data/scene/earth/earth.mod +++ b/data/scene/earth/earth.mod @@ -1,4 +1,6 @@ -earthEllipsoid = {6378137.0, 6378137.0, 6356752.314245} -- Earth's radii +--earthEllipsoid = {6378137.0, 6378137.0, 6356752.314245} -- Earth's radii +earthEllipsoid = {6378137.0, 6378137.0, 6378137.0} -- Earth's radii + return { -- Earth barycenter module { @@ -27,6 +29,98 @@ return { }, GuiPath = "/Solar System/Planets/Earth" }, + -- Earth Atmosphere + { + Name = "EarthAtmosphere", + Parent = "Earth", + Renderable = { + Type = "RenderableAtmosphere", + Atmosphere = { + -- Atmosphere radius in Km + AtmosphereRadius = 6447.0, + PlanetRadius = 6377.0, + PlanetAverageGroundReflectance = 0.1, + GroundRadianceEmittion = 0.6, + Rayleigh = { + Coefficients = { + -- Wavelengths are given in 10^-9m + Wavelengths = {680, 550, 440}, + -- Reflection coefficients are given in km^-1 + Scattering = {5.8E-3, 13.5E-3, 33.1E-3}, + -- In Rayleigh scattering, the coefficients of absorption and scattering are the same. + }, + -- Thichkness of atmosphere if its density were uniform, in Km + H_R = 8.0, + }, + --[[ + Ozone = { + Coefficients = { + -- Extinction coefficients + Extinction = {3.426, 8.298, 0.356} + }, + H_O = 8.0, + }, + ]] + -- Default + Mie = { + Coefficients = { + -- Reflection coefficients are given in km^-1 + Scattering = {4.0e-3, 4.0e-3, 4.0e-3}, + -- Extinction coefficients are a fraction of the Mie coefficients + Extinction = {4.0e-3/0.9, 4.0e-3/0.9, 4.0e-3/0.9} + }, + -- Height scale (atmosphere thickness for constant density) in Km + H_M = 1.2, + -- Mie Phase Function Value (G e [-1.0, 1.0]. If G = 1.0, Mie phase function = Rayleigh Phase Function) + G = 0.85 + }, + -- Clear Sky + -- Mie = { + -- Coefficients = { + -- Scattering = {20e-3, 20e-3, 20e-3}, + -- Extinction = 1.0/0.9, + -- } + -- H_M = 1.2, + -- G = 0.76, + -- }, + -- Cloudy + -- Mie = { + -- Coefficients = { + -- Scattering = {3e-3, 3e-3, 3e-3}, + -- Extinction = 1.0/0.9, + -- } + -- H_M = 3.0, + -- G = 0.65, + -- }, + Image = { + ToneMapping = jToneMapping, + Exposure = 0.4, + Background = 1.8, + Gamma = 1.85, + }, + Debug = { + -- PreCalculatedTextureScale is a float from 1.0 to N, with N > 0.0 and N in Naturals (i.e., 1, 2, 3, 4, 5....) + PreCalculatedTextureScale = 1.0, + SaveCalculatedTextures = false, + }, + }, + ShadowGroup = { + Source1 = { + Name = "Sun", + -- All radius in meters + Radius = 696.3E6, + }, + --Source2 = { Name = "Monolith", Radius = 0.01E6, }, + Caster1 = { + Name = "Moon", + -- All radius in meters + Radius = 1.737E6, + }, + --Caster2 = { Name = "Independency Day Ship", Radius = 0.0, } + }, + }, + GuiPath = "/Solar System/Planets/Earth" + }, -- EarthTrail module { Name = "EarthTrail", diff --git a/data/scene/grids/grids.mod b/data/scene/grids/grids.mod index 29371f6fe2..c1423fb513 100644 --- a/data/scene/grids/grids.mod +++ b/data/scene/grids/grids.mod @@ -1,7 +1,7 @@ return { -- SphericalGrid module { - Name = "Ecliptic Grid", + Name = "Ecliptic Sphere", Parent = "Root", Renderable = { Type = "RenderableSphericalGrid", @@ -17,7 +17,7 @@ return { GuiPath = "/Other/Grids" }, { - Name = "Equatorial Grid", + Name = "Equatorial Sphere", Parent = "Root", Renderable = { Type = "RenderableSphericalGrid", @@ -33,7 +33,7 @@ return { GuiPath = "/Other/Grids" }, { - Name = "Galactic Grid", + Name = "Galactic Sphere", Parent = "SolarSystem", Renderable = { Type = "RenderableSphericalGrid", diff --git a/data/scene/mars/mars.mod b/data/scene/mars/mars.mod index ff687494e3..37dd566334 100644 --- a/data/scene/mars/mars.mod +++ b/data/scene/mars/mars.mod @@ -1,4 +1,5 @@ -local marsEllipsoid = {3396190.0, 3396190.0, 3376200.0} +--local marsEllipsoid = {3396190.0, 3396190.0, 3376200.0} +local marsEllipsoid = {3396190.0, 3396190.0, 3396190.0} return { -- Barycenter module @@ -34,7 +35,7 @@ return { ColorLayers = { { Name = "MOC WA AMNH Color", - FilePath = "map_service_configs/Utah/Mars_Color.xml", + FilePath = "map_datasets/mars_COL_v006_mars2000_rgb.vrt", Enabled = true }, { @@ -143,6 +144,62 @@ return { GuiPath = "/Solar System/Planets/Mars" }, + -- Mars Atmosphere + { + Name = "MarsAtmosphere", + Parent = "Mars", + Renderable = { + Type = "RenderableAtmosphere", + Atmosphere = { + -- Atmosphere radius in Km + AtmosphereRadius = 3463.17495, + --PlanetRadius = 3396.19, + --PlanetRadius = 3393.0, + PlanetRadius = 3386.190, + PlanetAverageGroundReflectance = 0.1, + GroundRadianceEmittion = 0.37, + Rayleigh = { + Coefficients = { + -- Wavelengths are given in 10^-9m + Wavelengths = {680, 550, 440}, + -- Reflection coefficients are given in km^-1 + Scattering = {19.918E-3, 13.57E-3, 5.75E-3}, + -- In Rayleigh scattering, the coefficients of + -- absorption and scattering are the same. + }, + -- Thichkness of atmosphere if its density were uniform, in Km + H_R = 10.43979, + }, + -- Default + Mie = { + Coefficients = { + -- Reflection coefficients are given in km^-1 + Scattering = {53.61771e-3, 53.61771e-3, 53.61771e-3}, + -- Extinction coefficients are a fraction of the Scattering coefficients + Extinction = {53.61771e-3/0.98979, 53.61771e-3/0.98979, 53.61771e-3/0.98979} + }, + -- Mie Height scale (atmosphere thickness for constant density) in Km + H_M = 3.09526, + -- Mie Phase Function Value (G e [-1.0, 1.0]. + -- If G = 1.0, Mie phase function = Rayleigh Phase Function) + G = 0.85, + }, + Image = { + ToneMapping = jToneMapping, + Exposure = 0.4, + Background = 1.8, + Gamma = 1.85, + }, + Debug = { + -- PreCalculatedTextureScale is a float from 1.0 to N, with N > 0.0 and N in Naturals (i.e., 1, 2, 3, 4, 5....) + PreCalculatedTextureScale = 1.0, + SaveCalculatedTextures = false, + }, + }, + }, + GuiPath = "/Solar System/Planets/Mars" + }, + -- Trail module { Name = "MarsTrail", diff --git a/data/scene/milkyway/digitaluniverse/digitaluniverse.mod b/data/scene/milkyway/digitaluniverse/digitaluniverse.mod index 70ffc8c5e0..debbcdfa69 100644 --- a/data/scene/milkyway/digitaluniverse/digitaluniverse.mod +++ b/data/scene/milkyway/digitaluniverse/digitaluniverse.mod @@ -9,7 +9,7 @@ return { Alpha = 0.4, Texture = "textures/DarkUniverse_mellinger_4k.jpg", Orientation = "Inside/Outside", - FadeOutThreshould = 0.01 + FadeOutThreshould = 0.25 }, GuiPath = "/Milky Way/Milky Way" } diff --git a/data/scene/moon/moon.mod b/data/scene/moon/moon.mod index 61f0ec2cf7..35a34d8fcd 100644 --- a/data/scene/moon/moon.mod +++ b/data/scene/moon/moon.mod @@ -56,7 +56,17 @@ return { Settings = { Multiplier = 0.5 }, } } - } + }, + ShadowGroup = { + Source1 = { + Name = "Sun", + Radius = 696.3E6, + }, + Caster1 = { + Name = "Earth", + Radius = 6.371E6, + }, + }, }, GuiPath = "/Solar System/Planets/Earth/Moon" }, diff --git a/data/scene/satellites/tle/geo.txt b/data/scene/satellites/tle/geo.txt index 131d1a11aa..f5c33579cb 100644 --- a/data/scene/satellites/tle/geo.txt +++ b/data/scene/satellites/tle/geo.txt @@ -1,1332 +1,2666 @@ -TDRS 3 -1 19548U 88091B 17157.86807803 -.00000309 00000-0 00000-0 0 9997 -2 19548 14.4416 8.0727 0035139 315.3143 182.2791 1.00277792 92347 -SKYNET 4C -1 20776U 90079A 17157.24407692 .00000117 00000-0 00000-0 0 9991 -2 20776 13.8245 16.2209 0003137 48.2774 311.7180 1.00276680 97853 -TDRS 5 -1 21639U 91054B 17157.76236800 .00000078 00000-0 00000-0 0 9998 -2 21639 14.3705 21.5279 0024207 350.4285 350.3256 1.00280423 94648 -TDRS 6 -1 22314U 93003B 17157.86825340 -.00000301 00000-0 00000-0 0 9999 -2 22314 13.8980 24.4494 0003763 305.2309 192.4426 1.00268641 89385 -ASTRA 1D -1 23331U 94070A 17157.42011801 -.00000298 00000-0 00000-0 0 9990 -2 23331 7.5473 49.3635 0000659 296.5264 4.6759 1.00104533 83216 -BRASILSAT B2 -1 23536U 95016A 17157.69941272 -.00000285 00000-0 00000-0 0 9997 -2 23536 7.1712 51.2584 0002332 20.9281 6.8855 1.00271709 81251 -AMSC 1 -1 23553U 95019A 17156.69144898 -.00000124 00000-0 00000-0 0 9999 -2 23553 10.0698 39.9829 0003984 11.9967 347.9227 1.00271961 81090 -TDRS 7 -1 23613U 95035B 17157.60700767 -.00000209 00000-0 00000-0 0 9993 -2 23613 14.9710 15.2291 0030718 2.0194 181.2233 1.00269402 80185 -ECHOSTAR 1 -1 23754U 95073A 17157.49163003 -.00000246 00000-0 00000-0 0 9995 -2 23754 0.7924 90.2435 0002974 350.0571 274.5284 1.00272032 78375 -INMARSAT 3-F1 -1 23839U 96020A 17157.85035990 .00000002 00000-0 00000-0 0 9994 -2 23839 3.9663 67.5573 0005447 7.0278 191.4687 1.00272109 77250 -ASTRA 1F -1 23842U 96021A 17157.91317255 .00000135 00000-0 00000-0 0 9990 -2 23842 0.0562 314.1346 0004059 128.6019 185.7968 1.00272030 19280 -MSAT M1 -1 23846U 96022A 17156.72760441 -.00000092 00000-0 00000-0 0 9995 -2 23846 7.7361 48.8942 0005104 25.5910 334.2903 1.00272898 77348 -INMARSAT 3-F2 -1 24307U 96053A 17157.49688167 -.00000129 00000-0 00000-0 0 9992 -2 24307 2.6068 77.7716 0005484 340.3412 0.3761 1.00272172 75958 -AMC-1 (GE-1) -1 24315U 96054A 17156.88615406 .00000052 00000-0 00000-0 0 9994 -2 24315 1.5468 85.1195 0003085 352.0953 7.1338 1.00272423 13257 -AFRICASAT-2 (MEASAT-2) -1 24653U 96063B 17157.54179772 -.00000234 00000-0 00000-0 0 9997 -2 24653 7.4699 49.7796 0006474 178.0401 10.3776 1.00272601 75398 -INMARSAT 3-F3 -1 24674U 96070A 17157.76269751 .00000032 00000-0 00000-0 0 9994 -2 24674 3.4130 71.8223 0005433 3.1247 273.0973 1.00274605 74907 -AMC-2 (GE-2) -1 24713U 97002A 17157.30467139 -.00000217 00000-0 00000-0 0 9990 -2 24713 4.3187 66.0034 0005466 6.7557 206.9821 1.00273283 25250 -INTELSAT 26 (IS-26) -1 24732U 97007A 17157.92907338 -.00000004 00000-0 00000-0 0 9998 -2 24732 7.4468 50.1090 0005481 8.4977 235.6218 1.00274085 39676 -GALAXY 25 (G-25) -1 24812U 97026A 17156.55276483 -.00000169 00000-0 00000-0 0 9998 -2 24812 0.0263 331.2615 0003489 101.7437 287.0330 1.00270031 73285 -ABS-3 -1 24901U 97042A 17157.82985428 -.00000197 00000-0 00000-0 0 9993 -2 24901 4.8711 63.3290 0006867 355.5837 220.6103 1.00271955 72480 -INTELSAT 5 (IS-5) -1 24916U 97046A 17157.05344110 -.00000149 00000-0 00000-0 0 9992 -2 24916 3.5265 71.1570 0003183 356.4821 3.1426 1.00272346 72550 -AMC-3 (GE-3) -1 24936U 97050A 17157.39970170 -.00000264 00000-0 00000-0 0 9995 -2 24936 0.3597 92.2509 0003074 345.4247 249.2166 1.00272581 19365 -NSS-5 -1 24957U 97053A 17157.76527155 .00000103 00000-0 00000-0 0 9994 -2 24957 3.8209 69.3592 0003661 358.6132 153.3551 1.00271660 72116 -ECHOSTAR 3 -1 25004U 97059A 17157.68394641 -.00000287 00000-0 00000-0 0 9991 -2 25004 2.1365 80.3085 0001609 11.9974 347.3946 1.00272496 71994 -JCSAT-1B -1 25067U 97075A 17157.65122240 -.00000213 00000-0 00000-0 0 9998 -2 25067 5.5436 58.9740 0002484 352.1285 228.5799 1.00272836 71483 -ASTRA 1G -1 25071U 97076A 17157.76538498 .00000102 00000-0 00000-0 0 9998 -2 25071 2.3038 78.4519 0003655 354.3072 149.2269 1.00273075 71499 -BRASILSAT B3 -1 25152U 98006A 17156.65845583 -.00000290 00000-0 00000-0 0 9994 -2 25152 4.0090 68.4273 0002828 3.0590 356.6200 1.00273130 10445 -INMARSAT 3-F5 -1 25153U 98006B 17157.25743942 -.00000293 00000-0 00000-0 0 9991 -2 25153 2.5563 74.2286 0005365 0.4178 218.8480 1.00268538 70828 -NSS-806 -1 25239U 98014A 17157.57688493 -.00000283 00000-0 00000-0 0 9998 -2 25239 0.0704 41.6431 0004502 32.6989 341.0322 1.00272485 14235 -CHINASAT 5A (ZX 5A) -1 25354U 98033A 17157.64465316 -.00000358 00000-0 00000-0 0 9995 -2 25354 1.2212 87.1786 0001287 274.3863 251.2674 1.00268487 74179 -THOR III -1 25358U 98035A 17156.46990006 -.00000052 00000-0 00000-0 0 9990 -2 25358 5.4063 59.1747 0001643 6.5467 353.2248 1.00271491 69779 -INTELSAT 805 (IS-805) -1 25371U 98037A 17157.58191515 -.00000035 00000-0 00000-0 0 9990 -2 25371 0.0103 314.0624 0003659 127.6349 191.9694 1.00272663 69482 -ASTRA 2A -1 25462U 98050A 17157.88659128 -.00000363 00000-0 00000-0 0 9992 -2 25462 0.0759 256.1314 0002007 177.7985 254.2102 1.00268909 13282 -AFRISTAR -1 25515U 98063A 17157.75189699 .00000119 00000-0 00000-0 0 9990 -2 25515 3.2821 69.7456 0003679 5.8761 111.3929 1.00270803 68062 -JCSAT-4A -1 25630U 99006A 17157.82921876 -.00000331 00000-0 00000-0 0 9992 -2 25630 2.2754 80.0941 0000925 328.3183 270.6482 1.00579415 66939 -SKYNET 4E -1 25639U 99009B 17157.80109448 .00000014 00000-0 00000-0 0 9992 -2 25639 10.1255 28.6832 0002187 51.5487 109.5193 1.00270428 66956 -ASIASAT 3S -1 25657U 99013A 17157.61576939 -.00000242 00000-0 00000-0 0 9993 -2 25657 2.4890 78.2975 0003096 342.3571 202.2375 1.00269091 66754 -NIMIQ 1 -1 25740U 99027A 17157.39957437 -.00000203 00000-0 00000-0 0 9999 -2 25740 0.0106 324.8530 0006101 92.4300 255.0543 1.00273030 66134 -ASTRA 1H -1 25785U 99033A 17157.97189061 .00000133 00000-0 00000-0 0 9990 -2 25785 3.8060 69.5124 0002962 358.6213 220.7807 1.00270882 18351 -TELKOM 1 -1 25880U 99042A 17157.87353010 -.00000349 00000-0 00000-0 0 9992 -2 25880 0.0476 125.4053 0001661 348.3920 204.1525 1.00275014 65320 -ABS-7 -1 25894U 99046A 17157.75623596 -.00000367 00000-0 00000-0 0 9997 -2 25894 0.0142 11.5448 0002770 67.3211 204.8136 1.00266504 64071 -ABS-6 -1 25924U 99053A 17156.85154310 -.00000126 00000-0 00000-0 0 9995 -2 25924 0.0384 323.6013 0002447 117.1377 279.2886 1.00273349 64811 -TELSTAR 12 (ORION 2) -1 25949U 99059A 17157.76511053 -.00000066 00000-0 00000-0 0 9993 -2 25949 0.9151 88.8354 0003209 346.3667 346.3914 1.00272197 64461 -AMC-4 (GE-4) -1 25954U 99060A 17156.48039619 -.00000280 00000-0 00000-0 0 9990 -2 25954 0.0442 284.7377 0002671 157.0802 278.2116 1.00270511 10661 -GALAXY 11 (G-11) -1 26038U 99071A 17157.91317255 .00000133 00000-0 00000-0 0 9996 -2 26038 0.0088 145.9068 0000374 257.2525 225.9702 1.00272198 64043 -HISPASAT 1C -1 26071U 00007A 17157.52223545 .00000048 00000-0 00000-0 0 9994 -2 26071 0.5428 89.4925 0002589 72.6119 170.7654 0.99201181 14572 -SUPERBIRD-B2 -1 26095U 00012A 17157.67454814 -.00000097 00000-0 00000-0 0 9992 -2 26095 0.3791 94.5663 0003041 339.8576 225.6408 1.00271692 63369 -ASIASTAR -1 26107U 00016A 17157.86893387 -.00000337 00000-0 00000-0 0 9990 -2 26107 1.6532 81.9634 0004341 354.1170 237.1785 1.00269745 62868 -EUTELSAT 16C -1 26243U 00019A 17157.75174454 .00000086 00000-0 00000-0 0 9999 -2 26243 4.2466 66.3709 0002418 11.9963 102.0901 1.00273976 62686 -EUTELSAT 80A -1 26369U 00028A 17157.85005696 .00000026 00000-0 00000-0 0 9994 -2 26369 0.9945 85.2151 0005047 330.7769 212.9123 1.00032976 62374 -TDRS 8 -1 26388U 00034A 17157.19884633 -.00000238 00000-0 00000-0 0 9991 -2 26388 7.4759 55.9283 0003614 246.3223 113.4765 1.00270515 62106 -ECHOSTAR 6 -1 26402U 00038A 17157.54494727 -.00000154 00000-0 00000-0 0 9999 -2 26402 4.1671 67.1693 0003849 10.8801 277.0633 1.00272694 61847 -INTELSAT 9 (IS-9) -1 26451U 00043A 17157.57202302 -.00000265 00000-0 00000-0 0 9991 -2 26451 3.5142 71.3824 0003799 350.3295 358.0679 1.00365439 11073 -BRASILSAT B4 -1 26469U 00046A 17156.78370957 -.00000176 00000-0 00000-0 0 9998 -2 26469 1.6370 85.2597 0003484 349.2296 10.0438 1.00271930 61899 -NILESAT 102 -1 26470U 00046B 17157.54216150 -.00000064 00000-0 00000-0 0 9995 -2 26470 1.6601 83.7061 0003857 345.8061 13.7579 1.00272468 12139 -ASTRA 2B -1 26494U 00054A 17157.68035657 .00000067 00000-0 00000-0 0 9998 -2 26494 2.1910 79.0928 0002631 287.8567 148.5516 1.00093376 13823 -AMC-7 (GE-7) -1 26495U 00054B 17157.66591004 .00000083 00000-0 00000-0 0 9998 -2 26495 0.0425 70.3004 0000575 293.2921 356.4085 1.00272353 61199 -NSS-11 (AAP-1) -1 26554U 00059A 17157.75422963 -.00000349 00000-0 00000-0 0 9992 -2 26554 0.0206 311.3634 0002835 132.7724 190.9234 1.00270805 8242 -N-SAT-110 (JCSAT-110) -1 26559U 00060A 17157.96923611 -.00000355 00000-0 00000-0 0 9995 -2 26559 0.0511 101.0793 0001551 336.4429 277.0289 1.00272458 8215 -AMC-6 (GE-6) -1 26580U 00067A 17157.36854942 -.00000206 00000-0 00000-0 0 9995 -2 26580 0.0431 293.8127 0000377 175.2322 198.9257 1.00016707 60911 -INTELSAT 12 (IS-12) -1 26590U 00068A 17157.75722942 .00000132 00000-0 00000-0 0 9991 -2 26590 0.4642 93.2981 0002778 18.8500 100.8023 1.00273874 18654 -INTELSAT 1R (IS-1R) -1 26608U 00072A 17157.82344980 -.00000051 00000-0 00000-0 0 9997 -2 26608 0.2962 92.8891 0001314 76.9935 193.6059 1.00082695 60592 -ANIK F1 -1 26624U 00076A 17157.58929326 -.00000078 00000-0 00000-0 0 9994 -2 26624 0.0073 330.8252 0002626 129.0283 260.1762 1.00268795 60666 -ASTRA 2D -1 26638U 00081A 17157.31978469 .00000042 00000-0 00000-0 0 9998 -2 26638 3.6306 70.1028 0001749 3.1681 356.4654 1.00270542 19849 -AMC-8 (GE-8) -1 26639U 00081B 17157.50931538 .00000099 00000-0 00000-0 0 9998 -2 26639 0.0155 1.7174 0003007 70.9878 226.7467 1.00273654 60208 -SKYNET 4F -1 26695U 01005B 17156.48174351 -.00000258 00000-0 00000-0 0 9993 -2 26695 8.8865 36.7282 0002854 21.9931 334.8059 1.00273913 59807 -EUTELSAT 33C -1 26719U 01011A 17157.91808519 .00000151 00000-0 00000-0 0 9997 -2 26719 0.0657 14.7416 0004077 45.4654 198.8809 1.00272805 59488 -INTELSAT 10 (IS-10) -1 26766U 01019A 17157.91226983 .00000122 00000-0 00000-0 0 9994 -2 26766 1.4974 85.2555 0002810 328.5020 217.6481 1.00273208 12572 -INTELSAT 901 (IS-901) -1 26824U 01024A 17157.56229900 -.00000146 00000-0 00000-0 0 9995 -2 26824 0.0314 72.5832 0002605 339.3795 27.6129 1.00271212 58636 -ASTRA 2C -1 26853U 01025A 17157.85283747 .00000042 00000-0 00000-0 0 9993 -2 26853 0.3795 91.4600 0003533 340.7739 190.5107 1.00273957 11994 -ARTEMIS -1 26863U 01029A 17157.90349637 -.00000377 00000-0 00000-0 0 9997 -2 26863 12.7220 33.1765 0002052 60.8791 249.7556 1.00272583 11082 -INTELSAT 902 (IS-902) -1 26900U 01039A 17157.85096675 .00000028 00000-0 00000-0 0 9997 -2 26900 0.0262 33.6893 0003013 55.7823 174.2913 1.00273188 57658 -EUTELSAT 12 WEST B -1 26927U 01042A 17157.91924353 -.00000104 00000-0 00000-0 0 9996 -2 26927 0.0391 7.2969 0005667 56.4965 150.1242 1.00273270 57451 -DIRECTV 4S -1 26985U 01052A 17157.53742727 -.00000117 00000-0 00000-0 0 9996 -2 26985 0.0233 331.2984 0002305 112.5189 263.5725 1.00269707 56932 -INSAT-3C -1 27298U 02002A 17157.89595112 -.00000262 00000-0 00000-0 0 9994 -2 27298 0.6042 91.6269 0002103 228.4690 351.4248 1.00270722 56348 -ECHOSTAR 7 -1 27378U 02006A 17157.50735625 -.00000005 00000-0 00000-0 0 9995 -2 27378 0.0111 338.1778 0001931 118.0619 222.7119 1.00271538 55998 -INTELSAT 904 (IS-904) -1 27380U 02007A 17157.75723111 .00000132 00000-0 00000-0 0 9993 -2 27380 0.0571 120.8959 0002880 308.6601 143.4987 1.00272687 18706 -TDRS 9 -1 27389U 02011A 17157.72953012 -.00000105 00000-0 00000-0 0 9990 -2 27389 5.2291 79.2046 0017938 252.8065 173.8674 1.00272866 57374 -JCSAT 2A -1 27399U 02015A 17157.82602378 -.00000311 00000-0 00000-0 0 9991 -2 27399 0.4587 92.8420 0001099 40.3381 195.6030 1.00268306 55559 -ASTRA 3A -1 27400U 02015B 17156.61468224 -.00000288 00000-0 00000-0 0 9993 -2 27400 3.7937 68.8431 0003222 15.9485 343.7218 1.00274601 55655 -INTELSAT 903 (IS-903) -1 27403U 02016A 17157.57202302 -.00000243 00000-0 00000-0 0 9997 -2 27403 0.0148 323.3270 0003052 105.3474 357.9124 1.00273140 12603 -NSS-7 -1 27414U 02019A 17156.57859080 -.00000163 00000-0 00000-0 0 9993 -2 27414 1.8718 83.1197 0002435 355.0749 4.2885 1.00272047 55494 -DIRECTV 5 (TEMPO 1) -1 27426U 02023A 17156.59985321 -.00000063 00000-0 00000-0 0 9990 -2 27426 0.0250 327.0495 0003596 106.1164 286.8736 1.00269966 55236 -INTELSAT 905 (IS-905) -1 27438U 02027A 17157.56716090 -.00000189 00000-0 00000-0 0 9999 -2 27438 0.0156 297.3086 0003061 119.7567 17.7793 1.00272874 54890 -EXPRESS-A4 -1 27441U 02029A 17157.83061253 -.00000254 00000-0 00000-0 0 9992 -2 27441 6.0451 56.5744 0004021 51.2124 231.9396 1.00266835 54901 -GALAXY 3C (G-3C) -1 27445U 02030A 17155.56072771 -.00000160 00000-0 00000-0 0 9999 -2 27445 0.0146 313.9998 0002083 317.0344 88.9393 1.00268666 13494 -EUTELSAT 5 WEST A -1 27460U 02035A 17157.30598495 -.00000048 00000-0 00000-0 0 9996 -2 27460 0.0407 354.0164 0005408 77.7738 288.2692 1.00271976 54561 -N-STAR C -1 27461U 02035B 17157.67386207 -.00000317 00000-0 00000-0 0 9992 -2 27461 4.6131 64.8577 0004203 348.0196 220.9577 1.00269035 54595 -EUTELSAT 36 WEST A -1 27508U 02040A 17157.39182088 -.00000249 00000-0 00000-0 0 9994 -2 27508 0.0671 16.5719 0004714 27.6473 315.8189 1.00274510 54130 -METEOSAT-8 (MSG-1) -1 27509U 02040B 17157.91560703 .00000134 00000-0 00000-0 0 9999 -2 27509 4.8249 58.4007 0000781 321.3004 247.0559 1.00282771 54194 -INTELSAT 906 (IS-906) -1 27513U 02041A 17157.85051046 .00000010 00000-0 00000-0 0 9996 -2 27513 0.0167 304.9366 0002695 145.8257 175.0220 1.00272562 53975 -KODAMA (DRTS) -1 27516U 02042B 17157.92791715 -.00000245 00000-0 00000-0 0 9993 -2 27516 5.0249 62.1271 0003126 12.9916 245.2045 1.00267568 12844 -KALPANA-1 (METSAT 1) -1 27525U 02043A 17157.24074489 -.00000087 00000-0 00000-0 0 9995 -2 27525 6.3332 55.3089 0012521 233.7089 125.9805 1.00272053 53999 -HISPASAT 1D -1 27528U 02044A 17157.86991012 -.00000220 00000-0 00000-0 0 9996 -2 27528 0.0259 332.1791 0004154 85.5483 120.9071 1.00272546 9753 -TDRS 10 -1 27566U 02055A 17156.93899134 .00000071 00000-0 00000-0 0 9992 -2 27566 5.0166 58.4666 0007385 248.0779 111.5909 1.00270185 53166 -NSS-6 -1 27603U 02057A 17156.77498163 -.00000277 00000-0 00000-0 0 9994 -2 27603 0.0473 102.4211 0001387 313.2719 212.6914 1.00271799 53021 -NIMIQ 2 -1 27632U 02062A 17156.69497149 -.00000288 00000-0 00000-0 0 9998 -2 27632 1.9736 82.0863 0001443 250.4056 108.9664 1.00268898 11131 -INTELSAT 907 (IS-907) -1 27683U 03007A 17157.36824828 -.00000207 00000-0 00000-0 0 9998 -2 27683 0.0167 299.5781 0002888 136.1041 284.3503 1.00272710 52377 -GALAXY 12 (G-12) -1 27715U 03013B 17157.47798205 .00000054 00000-0 00000-0 0 9991 -2 27715 0.0187 320.3459 0001910 124.4962 213.2990 1.00273091 19071 -ASIASAT 4 -1 27718U 03014A 17154.76078257 -.00000373 00000-0 00000-0 0 9997 -2 27718 0.0554 107.4671 0000332 120.2394 60.6607 1.00269696 51826 -HELLAS-SAT 2 -1 27811U 03020A 17157.95948205 .00000148 00000-0 00000-0 0 9990 -2 27811 0.0173 15.2568 0004017 55.5793 209.0975 1.00271046 9793 -AMC-9 (GE-12) -1 27820U 03024A 17157.36854942 -.00000221 00000-0 00000-0 0 9996 -2 27820 0.0149 345.1473 0002670 86.0434 233.4626 1.00271443 51310 -THURAYA-2 -1 27825U 03026A 17157.77479958 .00000124 00000-0 00000-0 0 9999 -2 27825 4.9108 29.1082 0004667 32.3379 156.8443 1.00274495 51289 -OPTUS C1 -1 27831U 03028B 17157.64800564 -.00000152 00000-0 00000-0 0 9997 -2 27831 0.0147 142.7331 0003679 312.2794 189.5222 1.00269917 51256 -ECHOSTAR 12 (RAINBOW 1) -1 27852U 03033A 17157.85925034 -.00000286 00000-0 00000-0 0 9997 -2 27852 0.0153 320.1155 0002459 153.4265 30.0486 1.00271393 50921 -GALAXY 23 (G-23) -1 27854U 03034A 17157.55834939 .00000009 00000-0 00000-0 0 9992 -2 27854 0.0078 50.3401 0002591 20.5670 264.2678 1.00266961 55470 -EUTELSAT 33A -1 27948U 03043A 17157.91808519 .00000148 00000-0 00000-0 0 9995 -2 27948 2.3530 78.3719 0002192 246.4604 292.0221 1.00272390 12410 -GALAXY 13 (HORIZONS-1) -1 27954U 03044A 17157.49490420 .00000044 00000-0 00000-0 0 9999 -2 27954 0.0095 68.2889 0001794 34.0552 203.9008 1.00269771 50093 -ZHONGXING-20 -1 28082U 03052A 17157.86442207 -.00000331 00000-0 00000-0 0 9992 -2 28082 3.4896 71.3775 0002820 340.2019 258.3647 1.00271326 49698 -YAMAL 202 -1 28089U 03053A 17156.89999981 .00000113 00000-0 00000-0 0 9995 -2 28089 0.0645 108.1958 0003615 299.6727 219.6142 1.00274795 49602 -EXPRESS-AM22 (SESAT 2) -1 28134U 03060A 17157.82012833 -.00000142 00000-0 00000-0 0 9993 -2 28134 0.4310 91.3126 0000677 12.5441 166.9011 1.00271968 49211 -AMC-10 (GE-10) -1 28154U 04003A 17157.68986111 .00000083 00000-0 00000-0 0 9999 -2 28154 0.0102 324.5364 0002911 113.5854 290.5135 1.00274282 48870 -ABS-4 (MOBISAT-1) -1 28184U 04007A 17157.85283747 .00000037 00000-0 00000-0 0 9999 -2 28184 0.0179 315.6427 0001657 131.2375 176.5646 1.00271252 19275 -EUTELSAT 7A -1 28187U 04008A 17157.64713779 .00000044 00000-0 00000-0 0 9991 -2 28187 0.0661 14.8212 0004472 83.1599 37.2438 1.00275037 48320 -DIRECTV 7S -1 28238U 04016A 17157.55819626 -.00000004 00000-0 00000-0 0 9992 -2 28238 0.0157 340.2692 0003146 93.8117 262.9614 1.00273727 47995 -AMC-11 (GE-11) -1 28252U 04017A 17157.57680061 .00000064 00000-0 00000-0 0 9995 -2 28252 0.0180 353.1619 0002945 81.1891 257.4684 1.00274073 47636 -INTELSAT 10-02 -1 28358U 04022A 17157.83869049 -.00000015 00000-0 00000-0 0 9999 -2 28358 0.0120 356.1950 0000295 58.0826 142.0919 1.00269757 47582 -APSTAR 5 (TELSTAR 18) -1 28364U 04024A 17157.83092135 -.00000298 00000-0 00000-0 0 9995 -2 28364 0.0030 6.5684 0003143 80.0270 245.9630 1.00271874 47487 -ANIK F2 -1 28378U 04027A 17157.51971437 -.00000055 00000-0 00000-0 0 9990 -2 28378 0.0287 34.3513 0000292 66.2633 230.5249 1.00273695 47284 -AMAZONAS 1 -1 28393U 04031A 17157.57202302 -.00000251 00000-0 00000-0 0 9994 -2 28393 1.7315 83.7697 0004323 359.8041 341.2300 1.00271596 47001 -AMC-15 -1 28446U 04041A 17157.35743792 -.00000094 00000-0 00000-0 0 9998 -2 28446 0.0306 43.6946 0002577 24.0323 210.8459 1.00270854 46323 -AMC-16 -1 28472U 04048A 17157.39961249 -.00000211 00000-0 00000-0 0 9998 -2 28472 0.0300 46.8859 0002736 27.0149 239.9535 1.00272492 45742 -NSS-10 (AMC-12) -1 28526U 05003A 17157.57202302 -.00000255 00000-0 00000-0 0 9996 -2 28526 0.0171 331.5816 0002986 103.2954 348.7724 1.00271963 20118 -XTAR-EUR -1 28542U 05005A 17156.21444778 .00000143 00000-0 00000-0 0 9996 -2 28542 0.0436 105.4196 0002521 319.0050 295.6000 1.00270784 45101 -XM-3 (RHYTHM) -1 28626U 05008A 17157.39961249 -.00000210 00000-0 00000-0 0 9995 -2 28626 0.0068 215.5294 0000192 171.9039 286.3071 1.00266636 44993 -INMARSAT 4-F1 -1 28628U 05009A 17156.92660775 -.00000269 00000-0 00000-0 0 9990 -2 28628 2.8757 11.8827 0003527 65.6031 294.1247 1.00272126 44606 -APSTAR 6 -1 28638U 05012A 17157.83122773 -.00000322 00000-0 00000-0 0 9997 -2 28638 0.0306 58.4940 0002057 17.2640 252.9201 1.00272736 69343 -SPACEWAY 1 -1 28644U 05015A 17157.53283144 -.00000106 00000-0 00000-0 0 9994 -2 28644 0.0476 154.0547 0000531 193.5024 356.4599 1.00266303 44440 -DIRECTV 8 -1 28659U 05019A 17156.57419940 -.00000123 00000-0 00000-0 0 9991 -2 28659 0.0097 10.0881 0003284 61.1747 288.7721 1.00272405 44070 -GALAXY 28 (G-28) -1 28702U 05022A 17156.36348095 -.00000193 00000-0 00000-0 0 9990 -2 28702 0.0123 38.9577 0002187 345.0013 271.8678 1.00272171 43748 -EXPRESS-AM3 -1 28707U 05023A 17157.96047541 -.00000326 00000-0 00000-0 0 9993 -2 28707 0.0067 246.6538 0000998 196.3073 261.3603 1.00271254 43783 -THAICOM 4 -1 28786U 05028A 17157.76759243 -.00000367 00000-0 00000-0 0 9997 -2 28786 0.0135 354.6117 0002419 79.0491 217.5158 1.00271590 43264 -GALAXY 14 (G-14) -1 28790U 05030A 17157.55541164 .00000032 00000-0 00000-0 0 9991 -2 28790 0.0190 327.0194 0002682 102.3421 260.7443 1.00273905 43230 -ANIK F1R -1 28868U 05036A 17157.61521618 -.00000079 00000-0 00000-0 0 9994 -2 28868 0.0535 80.6010 0003176 336.5033 312.2768 1.00272802 13445 -GALAXY 15 (G-15) -1 28884U 05041A 17157.62737733 .00000074 00000-0 00000-0 0 9990 -2 28884 0.0095 323.7164 0001455 110.0613 274.2944 1.00274202 42555 -SYRACUSE 3A -1 28885U 05041B 17157.91226983 .00000125 00000-0 00000-0 0 9990 -2 28885 0.0123 47.9590 0003052 34.9277 188.0114 1.00271206 42698 -INMARSAT 4-F2 -1 28899U 05044A 17157.14672115 .00000004 00000-0 00000-0 0 9991 -2 28899 2.5707 11.7812 0002835 68.5546 291.1256 1.00271873 42451 -TELKOM 2 -1 28902U 05046A 17157.64800564 -.00000143 00000-0 00000-0 0 9999 -2 28902 0.0827 108.2191 0002043 326.9180 210.4049 1.00271196 42171 -SPACEWAY 2 -1 28903U 05046B 17157.53940951 -.00000132 00000-0 00000-0 0 9991 -2 28903 0.0462 140.7429 0000754 280.0859 289.4343 1.00279699 42429 -INSAT-4A -1 28911U 05049A 17157.06201003 -.00000171 00000-0 00000-0 0 9992 -2 28911 0.0380 105.4216 0001734 235.8286 18.7432 1.00272070 42024 -METEOSAT-9 (MSG-2) -1 28912U 05049B 17157.96248359 .00000057 00000-0 00000-0 0 9999 -2 28912 2.1848 71.0339 0000745 329.3322 211.1678 1.00265631 41971 -EUTELSAT 172A (GE-23) -1 28924U 05052A 17157.82344980 -.00000010 00000-0 00000-0 0 9998 -2 28924 0.0640 4.2410 0006025 69.7644 289.8344 1.00272333 19286 -ECHOSTAR 10 -1 28935U 06003A 17157.52223405 -.00000060 00000-0 00000-0 0 9997 -2 28935 0.0128 334.6690 0001561 122.9496 235.2838 1.00272215 41441 -HIMAWARI-7 (MTSAT-2) -1 28937U 06004A 17157.83045837 -.00000248 00000-0 00000-0 0 9993 -2 28937 0.0441 108.7166 0003613 332.5543 258.1068 1.00268894 41415 -SPAINSAT -1 28945U 06007A 17157.37511961 -.00000221 00000-0 00000-0 0 9991 -2 28945 0.0293 238.9210 0003133 211.3907 269.7246 1.00272988 41167 -EUTELSAT HOT BIRD 13E -1 28946U 06007B 17157.25603244 .00000082 00000-0 00000-0 0 9999 -2 28946 0.0016 224.9414 0004732 246.4182 248.6911 1.00274880 41238 -JCSAT-5A -1 29045U 06010A 17157.64299369 -.00000333 00000-0 00000-0 0 9996 -2 29045 0.0169 331.4853 0001801 104.7579 182.5102 1.00271734 40714 -ASTRA 1KR -1 29055U 06012A 17157.85991851 .00000115 00000-0 00000-0 0 9994 -2 29055 0.0465 282.5731 0001283 185.5859 116.0417 1.00270907 12662 -GOES 13 -1 29155U 06018A 17157.49990045 -.00000253 00000-0 00000-0 0 9999 -2 29155 0.1971 273.2915 0005903 163.6851 283.0905 1.00263260 10321 -EUTELSAT 113 WEST A -1 29162U 06020A 17156.60780462 -.00000044 00000-0 00000-0 0 9990 -2 29162 0.0229 128.7916 0002707 304.2820 286.9552 1.00271454 40391 -THAICOM 5 -1 29163U 06020B 17157.93664823 -.00000125 00000-0 00000-0 0 9990 -2 29163 0.0397 277.1662 0002921 155.9102 238.1599 1.00271082 40439 -GALAXY 16 (G-16) -1 29236U 06023A 17157.39925420 -.00000132 00000-0 00000-0 0 9995 -2 29236 0.0415 123.1487 0002843 321.6184 214.9466 1.00272656 40197 -EUTELSAT HOT BIRD 13B -1 29270U 06032A 17157.67673214 .00000083 00000-0 00000-0 0 9999 -2 29270 0.0640 13.7956 0004892 38.2230 99.8869 1.00275274 14264 -JCSAT-3A -1 29272U 06033A 17157.90924543 -.00000349 00000-0 00000-0 0 9998 -2 29272 0.0158 340.2173 0002301 69.5341 301.0817 1.00271640 14671 -SYRACUSE 3B -1 29273U 06033B 17157.79424205 -.00000048 00000-0 00000-0 0 9992 -2 29273 0.0116 334.5227 0004493 82.6200 118.9653 1.00273722 39657 -KOREASAT 5 (MUGUNGWHA 5) -1 29349U 06034A 17157.88670208 -.00000362 00000-0 00000-0 0 9992 -2 29349 0.0198 52.2408 0001592 61.2599 214.2556 1.00271627 8253 -ZHONGXING-22A -1 29398U 06038A 17156.94851480 -.00000327 00000-0 00000-0 0 9990 -2 29398 5.7706 57.8311 0001241 149.2261 130.6660 1.00268293 39337 -DIRECTV 9S -1 29494U 06043A 17157.53742660 -.00000118 00000-0 00000-0 0 9996 -2 29494 0.0144 345.2743 0003696 90.6367 271.5991 1.00270006 18337 -OPTUS D1 -1 29495U 06043B 17157.76302275 -.00000115 00000-0 00000-0 0 9993 -2 29495 0.0171 16.4417 0003644 55.5225 258.0832 1.00272516 39053 -XM-4 (BLUES) -1 29520U 06049A 17157.57626399 -.00000028 00000-0 00000-0 0 9996 -2 29520 0.0294 135.2494 0000467 280.6183 291.5103 1.00277015 38924 -BADR-4 -1 29526U 06051A 17157.97290778 .00000140 00000-0 00000-0 0 9991 -2 29526 0.0475 335.9603 0003641 58.1927 237.6604 1.00269975 18249 -FENGYUN 2D -1 29640U 06053A 17157.72187311 -.00000366 00000-0 10000-3 0 9996 -2 29640 4.4356 64.4357 0005259 316.6810 257.5736 1.00280861 38495 -WILDBLUE-1 -1 29643U 06054A 17157.51971192 -.00000054 00000-0 00000-0 0 9995 -2 29643 0.0427 124.0490 0001177 301.0075 265.9807 1.00271293 38475 -AMC-18 -1 29644U 06054B 17156.34682649 -.00000097 00000-0 00000-0 0 9999 -2 29644 0.0212 48.5605 0002690 21.6517 203.6505 1.00271544 38476 -MEASAT-3 -1 29648U 06056A 17157.77607686 -.00000246 00000-0 00000-0 0 9997 -2 29648 0.0544 134.4165 0003237 323.0236 168.8382 1.00272457 17408 -INSAT-4B -1 30793U 07007A 17157.78369844 -.00000262 00000-0 00000-0 0 9997 -2 30793 0.0520 278.1197 0008119 159.1606 193.7065 1.00270878 9141 -SKYNET 5A -1 30794U 07007B 17157.86214683 -.00000276 00000-0 00000-0 0 9992 -2 30794 0.0669 9.2549 0003424 69.8600 221.9497 1.00271597 37586 -ANIK F3 -1 31102U 07009A 17157.55819626 -.00000006 00000-0 00000-0 0 9993 -2 31102 0.0221 62.7142 0002439 5.1715 269.5064 1.00273137 13496 -ASTRA 1L -1 31306U 07016A 17157.85991851 .00000115 00000-0 00000-0 0 9991 -2 31306 0.0620 310.2522 0001942 67.5327 206.4174 1.00270848 36973 -GALAXY 17 (G-17) -1 31307U 07016B 17157.75267660 -.00000178 00000-0 00000-0 0 9995 -2 31307 0.0199 19.2854 0003333 52.0696 3.9542 1.00271618 36899 -ZHONGXING-6B -1 31800U 07031A 17157.60290969 -.00000367 00000-0 00000-0 0 9992 -2 31800 0.0230 52.6434 0002613 19.1105 156.0270 1.00270162 36405 -DIRECTV 10 -1 31862U 07032A 17156.57961764 -.00000110 00000-0 00000-0 0 9990 -2 31862 0.0171 229.8134 0000365 192.5210 297.6683 1.00272418 12553 -SPACEWAY 3 -1 32018U 07036A 17157.39936093 -.00000157 00000-0 00000-0 0 9997 -2 32018 0.0105 85.9695 0000327 288.7294 289.1154 1.00273225 36052 -BSAT-3A -1 32019U 07036B 17156.98760919 -.00000357 00000-0 00000-0 0 9996 -2 32019 0.0533 228.9851 0001387 295.7273 195.2915 1.00273708 17432 -INSAT-4CR -1 32050U 07037A 17157.91226983 .00000121 00000-0 00000-0 0 9992 -2 32050 0.0621 273.6058 0003315 164.6304 193.5538 1.00268840 18336 -OPTUS D2 -1 32252U 07044A 17157.83029597 -.00000187 00000-0 00000-0 0 9990 -2 32252 0.0170 311.7706 0003786 123.2105 271.3583 1.00272406 35376 -INTELSAT 11 (IS-11) -1 32253U 07044B 17157.42131497 -.00000274 00000-0 00000-0 0 9996 -2 32253 0.0215 79.4921 0001089 18.7092 265.5013 1.00269309 35462 -STAR ONE C1 -1 32293U 07056A 17156.47486952 -.00000284 00000-0 00000-0 0 9997 -2 32293 0.0179 339.0598 0002792 94.1440 286.8268 1.00271095 35033 -SKYNET 5B -1 32294U 07056B 17157.78452358 .00000137 00000-0 00000-0 0 9992 -2 32294 0.0666 355.6274 0003416 80.4168 126.8368 1.00271896 35155 -ASTRA 4A (SIRIUS 4) -1 32299U 07057A 17157.79354764 .00000028 00000-0 00000-0 0 9990 -2 32299 0.0158 4.3499 0003071 61.6161 119.9002 1.00271361 18644 -HORIZONS-2 -1 32388U 07063B 17157.82951910 -.00000187 00000-0 00000-0 0 9993 -2 32388 0.0098 359.5424 0003256 74.6363 204.7150 1.00271755 34790 -THURAYA-3 -1 32404U 08001A 17157.85732615 -.00000309 00000-0 00000-0 0 9993 -2 32404 4.0606 353.6630 0004915 73.1219 235.8036 1.00271427 34456 -EXPRESS-AM33 -1 32478U 08003A 17157.75390184 -.00000285 00000-0 00000-0 0 9999 -2 32478 0.0086 238.5799 0001616 270.5402 114.1081 1.00270725 34543 -THOR 5 -1 32487U 08006A 17157.83869049 -.00000013 00000-0 00000-0 0 9991 -2 32487 0.0156 281.8742 0002857 150.3466 124.4036 1.00274295 34240 -KIZUNA (WINDS) -1 32500U 08007A 17157.89696484 -.00000263 00000-0 00000-0 0 9992 -2 32500 0.8125 90.3689 0002920 345.1458 285.8835 1.00271207 33832 -AMC-14 -1 32708U 08011A 17156.91785617 .00000083 00000-0 00000-0 0 9995 -2 32708 19.0978 63.0141 0041500 358.6629 181.1967 1.00270864 35021 -DIRECTV 11 -1 32729U 08013A 17157.25083755 -.00000131 00000-0 00000-0 0 9997 -2 32729 0.0372 153.5491 0000269 220.5677 231.8543 1.00272501 12547 -ICO G1 -1 32763U 08016A 17157.46018359 -.00000179 00000-0 00000-0 0 9991 -2 32763 3.8428 354.8787 0003081 84.0600 248.9372 1.00271214 33391 -VINASAT-1 -1 32767U 08018A 17156.92650029 -.00000335 00000-0 00000-0 0 9997 -2 32767 0.0204 41.0751 0001934 39.4019 279.5445 1.00272775 33557 -STAR ONE C2 -1 32768U 08018B 17156.48870814 -.00000272 00000-0 00000-0 0 9995 -2 32768 0.0671 122.9474 0002024 346.7193 250.3540 1.00274515 33473 -TIANLIAN 1-01 -1 32779U 08019A 17157.82023682 -.00000144 00000-0 10000-3 0 9992 -2 32779 2.7809 76.1983 0032662 234.4128 320.1133 1.00274328 33403 -AMOS-3 -1 32794U 08022A 17157.83869049 -.00000039 00000-0 00000-0 0 9998 -2 32794 0.0154 261.8990 0001577 150.5664 140.7638 1.00272098 49314 -GALAXY 18 (G-18) -1 32951U 08024A 17156.63537712 .00000018 00000-0 00000-0 0 9997 -2 32951 0.0151 336.3800 0002935 102.9117 280.7413 1.00270821 33015 -CHINASAT 9 (ZX 9) -1 33051U 08028A 17155.32934455 -.00000258 00000-0 00000-0 0 9990 -2 33051 0.0161 341.0801 0003689 86.6287 35.9581 1.00268589 32928 -SKYNET 5C -1 33055U 08030A 17157.56229900 -.00000144 00000-0 00000-0 0 9991 -2 33055 0.0609 351.9781 0004718 100.8819 346.9248 1.00271510 32833 -TURKSAT 3A -1 33056U 08030B 17157.91500177 .00000142 00000-0 00000-0 0 9996 -2 33056 0.0566 91.3709 0005689 343.1426 192.3863 1.00274806 19297 -INTELSAT 25 (IS-25) -1 33153U 08034A 17157.37932809 -.00000229 00000-0 00000-0 0 9996 -2 33153 0.0166 338.1349 0002961 79.1305 302.7632 1.00269297 32570 -BADR-6 -1 33154U 08034B 17157.66748696 .00000140 00000-0 00000-0 0 9999 -2 33154 0.0743 51.2760 0005921 15.3876 94.8981 1.00275158 32698 -ECHOSTAR 11 -1 33207U 08035A 17156.59952255 -.00000064 00000-0 00000-0 0 9994 -2 33207 0.0528 99.8600 0003197 341.5030 278.6723 1.00272504 32584 -SUPERBIRD-C2 -1 33274U 08038A 17157.83045837 -.00000256 00000-0 00000-0 0 9991 -2 33274 0.0130 310.3152 0001601 133.2629 254.7403 1.00270812 72661 -AMC-21 -1 33275U 08038B 17157.55541164 .00000031 00000-0 00000-0 0 9995 -2 33275 0.0173 2.9638 0002983 87.0691 240.1617 1.00273272 32396 -INMARSAT 4-F3 -1 33278U 08039A 17157.58629861 -.00000145 00000-0 00000-0 0 9990 -2 33278 3.0222 1.3769 0002696 75.6386 291.2543 1.00271476 32209 -NIMIQ 4 -1 33373U 08044A 17157.36854942 -.00000225 00000-0 00000-0 0 9997 -2 33373 0.0106 46.0570 0002274 25.7256 233.8662 1.00271139 31909 -GALAXY 19 (G-19) -1 33376U 08045A 17156.56351010 -.00000146 00000-0 00000-0 0 9992 -2 33376 0.0189 310.2271 0003369 124.8513 284.9581 1.00271945 31766 -VENESAT-1 -1 33414U 08055A 17157.59285705 -.00000242 00000-0 00000-0 0 9994 -2 33414 0.0085 204.2447 0001484 265.7345 280.6349 1.00273402 31489 -ASTRA 1M -1 33436U 08057A 17156.96996942 .00000114 00000-0 00000-0 0 9999 -2 33436 0.0138 294.8713 0004901 170.0549 158.0159 1.00274166 31401 -CIEL-2 -1 33453U 08063A 17157.47798289 .00000053 00000-0 00000-0 0 9998 -2 33453 0.0098 325.2717 0003163 97.7131 235.3074 1.00272818 31091 -EUTELSAT HOT BIRD 13C -1 33459U 08065A 17157.25613886 .00000082 00000-0 00000-0 0 9993 -2 33459 0.0576 46.8414 0006473 34.2156 279.0166 1.00275065 14318 -EUTELSAT 48D -1 33460U 08065B 17157.14927659 .00000118 00000-0 00000-0 0 9999 -2 33460 0.0760 54.4942 0002013 19.4905 282.6043 1.00274429 31045 -FENGYUN 2E -1 33463U 08066A 17157.75360454 -.00000198 00000-0 00000-0 0 9993 -2 33463 2.1632 66.9548 0003261 212.3566 333.3623 1.00259862 31022 -EXPRESS-AM44 -1 33595U 09007A 17157.91924353 -.00000093 00000-0 00000-0 0 9991 -2 33595 0.0070 222.3990 0001170 247.4182 105.6063 1.00271553 30499 -NSS-9 -1 33749U 09008A 17157.76339559 .00000067 00000-0 00000-0 0 9994 -2 33749 0.0174 351.2485 0002402 76.2173 285.7820 1.00272814 30451 -EUTELSAT 33E -1 33750U 09008B 17157.91762347 .00000152 00000-0 00000-0 0 9993 -2 33750 0.0257 9.3758 0002718 102.9611 146.5826 1.00272786 30394 -TELSTAR 11N -1 34111U 09009A 17157.57202302 -.00000255 00000-0 00000-0 0 9993 -2 34111 0.0025 13.2728 0002760 51.7493 358.5206 1.00272628 30354 -EUTELSAT 10A -1 34710U 09016A 17157.96249140 .00000064 00000-0 00000-0 0 9997 -2 34710 0.0633 3.3505 0004813 70.8917 177.7955 1.00271293 8197 -SES-7 (PROTOSTAR 2) -1 34941U 09027A 17157.49923914 -.00000350 00000-0 00000-0 0 9990 -2 34941 0.0488 80.0440 0001143 201.2986 261.7544 1.00272726 29553 -MEASAT-3A -1 35362U 09032A 17157.03850047 -.00000248 00000-0 00000-0 0 9996 -2 35362 0.0448 227.8773 0001048 273.5393 218.5906 1.00272701 29178 -GOES 14 -1 35491U 09033A 17156.58341343 -.00000101 00000-0 00000-0 0 9991 -2 35491 0.2454 102.7014 0004603 117.0014 140.2619 1.00270799 29088 -SIRIUS FM-5 -1 35493U 09034A 17157.39958199 -.00000205 00000-0 00000-0 0 9992 -2 35493 0.0100 316.6200 0001231 61.8476 294.2336 1.00271929 28903 -TERRESTAR-1 -1 35496U 09035A 17156.55817255 -.00000066 00000-0 00000-0 0 9995 -2 35496 2.9032 344.2414 0002757 94.4467 265.4160 1.00271910 29109 -ASIASAT 5 -1 35696U 09042A 17157.89006208 -.00000312 00000-0 00000-0 0 9995 -2 35696 0.0352 100.7177 0001776 295.7994 279.8860 1.00273901 28609 -JCSAT-RA (JCSAT-12) -1 35755U 09044A 17156.93761316 -.00000352 00000-0 00000-0 0 9999 -2 35755 0.0661 62.5615 0001582 7.4265 290.0286 1.00272601 28551 -OPTUS D3 -1 35756U 09044B 17157.54201878 -.00000151 00000-0 00000-0 0 9997 -2 35756 0.0273 351.7635 0004121 60.9845 193.5266 1.00274675 28565 -PALAPA D -1 35812U 09046A 17156.97914051 -.00000365 00000-0 00000-0 0 9999 -2 35812 0.0136 18.9745 0002748 87.3136 253.7419 1.00272895 28616 -NIMIQ 5 -1 35873U 09050A 17157.36854942 -.00000262 00000-0 00000-0 0 9993 -2 35873 0.0172 14.4735 0002299 59.0155 241.4463 1.00271352 28295 -AMAZONAS 2 -1 35942U 09054A 17157.85448323 -.00000286 00000-0 00000-0 0 9996 -2 35942 0.0276 90.9532 0004533 11.8293 39.2946 1.00270624 28136 -COMSATBW-1 -1 35943U 09054B 17157.85096675 .00000020 00000-0 00000-0 0 9991 -2 35943 0.0503 88.9976 0002552 343.7982 191.9970 1.00271497 28244 -NSS-12 -1 36032U 09058A 17157.13414867 .00000065 00000-0 00000-0 0 9992 -2 36032 0.0414 65.0318 0002355 10.3984 284.5958 1.00272655 27882 -THOR 6 -1 36033U 09058B 17157.83869049 -.00000014 00000-0 00000-0 0 9991 -2 36033 0.0452 132.8724 0002159 307.5934 116.0491 1.00273364 27976 -INTELSAT 14 (IS-14) -1 36097U 09064A 17157.41670870 -.00000278 00000-0 00000-0 0 9996 -2 36097 0.0148 325.1446 0002797 106.8970 287.9895 1.00272855 27637 -EUTELSAT 36B -1 36101U 09065A 17157.91762347 .00000151 00000-0 00000-0 0 9998 -2 36101 0.0632 1.4658 0004225 73.3033 186.9720 1.00271862 27661 -INTELSAT 15 (IS-15) -1 36106U 09067A 17157.82951986 -.00000190 00000-0 00000-0 0 9998 -2 36106 0.0098 1.9457 0002487 70.1153 207.1345 1.00272292 8240 -DIRECTV 12 -1 36131U 09075A 17156.72800127 -.00000109 00000-0 00000-0 0 9993 -2 36131 0.0275 159.6681 0000566 199.0592 54.8869 1.00270150 27317 -BEIDOU G1 -1 36287U 10001A 17157.89712527 -.00000288 00000-0 00000-0 0 9999 -2 36287 1.4884 359.4741 0002313 160.5357 198.5265 1.00272476 27107 -RADUGA-1M 2 -1 36358U 10002A 17156.06102971 -.00000193 00000-0 00000-0 0 9998 -2 36358 0.0197 278.0107 0002278 180.8803 261.7570 1.00273357 26932 -SDO -1 36395U 10005A 17154.53430946 -.00000039 00000-0 00000-0 0 9997 -2 36395 28.7501 140.6633 0000222 100.1228 102.0693 1.00272472 26930 -INTELSAT 16 (IS-16) -1 36397U 10006A 17157.39494062 -.00000290 00000-0 00000-0 0 9995 -2 36397 0.0100 319.2844 0001807 116.2508 263.5401 1.00272891 26662 -GOES 15 -1 36411U 10008A 17157.66643394 .00000085 00000-0 00000-0 0 9999 -2 36411 0.1816 104.1057 0001663 47.8919 208.0117 1.00264667 26611 -ECHOSTAR 14 -1 36499U 10010A 17157.55819626 -.00000004 00000-0 00000-0 0 9991 -2 36499 0.0147 313.2379 0002913 120.6589 263.3049 1.00272444 26468 -SES-1 -1 36516U 10016A 17157.53742503 -.00000119 00000-0 00000-0 0 9991 -2 36516 0.0219 30.5483 0002873 37.3979 279.6608 1.00272382 25983 -ASTRA 3B -1 36581U 10021A 17157.75195799 .00000133 00000-0 00000-0 0 9997 -2 36581 0.0391 331.8898 0002753 112.5158 105.1380 1.00273632 25816 -COMSATBW-2 -1 36582U 10021B 17157.96011799 .00000085 00000-0 00000-0 0 9994 -2 36582 0.0552 288.8943 0002570 161.1769 164.3284 1.00276949 25918 -BEIDOU G3 -1 36590U 10024A 17157.17118737 -.00000362 00000-0 00000-0 0 9998 -2 36590 1.3400 21.0961 0005900 326.7456 79.1070 1.00268923 25719 -BADR-5 -1 36592U 10025A 17157.71285259 .00000140 00000-0 00000-0 0 9998 -2 36592 0.0149 268.1660 0003147 207.7859 61.9736 1.00275049 25831 -COMS 1 -1 36744U 10032A 17157.77345323 -.00000349 00000-0 00000-0 0 9992 -2 36744 0.0223 54.6123 0001126 17.2407 230.1570 1.00272611 18024 -ARABSAT-5A -1 36745U 10032B 17157.91808519 .00000149 00000-0 00000-0 0 9997 -2 36745 0.0516 7.4356 0002774 71.0605 178.0009 1.00270875 25588 -ECHOSTAR 15 -1 36792U 10034A 17157.93114624 -.00000285 00000-0 00000-0 0 9992 -2 36792 0.0163 326.6210 0002811 120.7234 81.7356 1.00274228 25317 -NILESAT 201 -1 36830U 10037A 17157.91924353 -.00000061 00000-0 00000-0 0 9996 -2 36830 0.0557 147.5290 0006449 289.2971 142.6059 1.00272093 25309 -RASCOM-QAF 1R -1 36831U 10037B 17157.28397349 .00000013 00000-0 00000-0 0 9992 -2 36831 0.0241 4.5323 0004147 67.0781 288.4347 1.00269772 25245 -CHINASAT 6A (ZX 6A) -1 37150U 10042A 17156.38172375 -.00000362 00000-0 00000-0 0 9991 -2 37150 0.0303 76.0858 0002117 105.5893 334.7872 1.00270274 24823 -QZS-1 (MICHIBIKI) -1 37158U 10045A 17157.90776417 -.00000101 00000-0 00000-0 0 9999 -2 37158 40.8420 159.4727 0752934 270.2097 289.7799 1.00282324 24689 -XM-5 -1 37185U 10053A 17157.39960486 -.00000210 00000-0 00000-0 0 9993 -2 37185 0.0159 321.5041 0001950 37.8879 314.2652 1.00273149 24370 -BSAT-3B -1 37207U 10056B 17157.73216803 -.00000355 00000-0 00000-0 0 9996 -2 37207 0.0458 328.4181 0002832 38.4537 261.9045 1.00271999 19195 -BEIDOU G4 -1 37210U 10057A 17157.76302275 -.00000117 00000-0 00000-0 0 9999 -2 37210 0.7140 41.5129 0002592 174.3277 114.1286 1.00273985 24226 -SKYTERRA 1 -1 37218U 10061A 17157.49089657 -.00000124 00000-0 00000-0 0 9996 -2 37218 3.2345 330.5505 0003926 156.4352 203.5108 1.00273487 24161 -ZHONGXING-20A -1 37234U 10064A 17157.83107270 -.00000342 00000-0 00000-0 0 9999 -2 37234 0.0497 252.4998 0003318 154.1537 277.9389 1.00267000 23962 -HYLAS 1 -1 37237U 10065A 17157.38521387 -.00000239 00000-0 00000-0 0 9997 -2 37237 0.0389 40.1805 0001814 38.8492 281.1460 1.00270886 23942 -INTELSAT 17 (IS-17) -1 37238U 10065B 17157.89278181 -.00000006 00000-0 00000-0 0 9997 -2 37238 0.0101 291.2063 0002311 147.7385 203.9456 1.00272275 20368 -EUTELSAT KA-SAT 9A -1 37258U 10069A 17157.26711220 .00000057 00000-0 00000-0 0 9995 -2 37258 0.0333 291.8546 0002476 175.7444 252.4284 1.00278754 10981 -HISPASAT 1E -1 37264U 10070A 17157.65195397 -.00000220 00000-0 00000-0 0 9991 -2 37264 0.0706 110.0648 0004979 347.7622 2.1245 1.00271641 20128 -KOREASAT 6 -1 37265U 10070B 17157.93007414 -.00000366 00000-0 00000-0 0 9996 -2 37265 0.0092 309.0212 0002028 105.8293 291.4938 1.00270400 23716 -BEIDOU IGSO 3 -1 37384U 11013A 17157.95024447 -.00000219 00000-0 10000-3 0 9994 -2 37384 57.8138 73.0428 0026511 210.5075 74.5458 1.00264335 22616 -INTELSAT NEW DAWN -1 37392U 11016A 17157.91808519 .00000151 00000-0 00000-0 0 9992 -2 37392 0.0124 310.0296 0000824 63.2254 245.5350 1.00271368 20239 -YAHSAT 1A -1 37393U 11016B 17157.57855374 .00000096 00000-0 00000-0 0 9994 -2 37393 0.0088 304.6116 0002219 144.9465 66.3902 1.00271269 22492 -TELSTAR 14R -1 37602U 11021A 17157.95317137 -.00000284 00000-0 00000-0 0 9995 -2 37602 0.0172 352.7963 0001552 49.4524 133.4413 1.00272534 22799 -GSAT-8 -1 37605U 11022A 17157.85329606 .00000080 00000-0 00000-0 0 9995 -2 37605 0.0441 274.3293 0003400 45.0355 298.2936 1.00273271 20151 -ST-2 -1 37606U 11022B 17157.45981177 -.00000217 00000-0 00000-0 0 9992 -2 37606 0.0397 114.8699 0001056 289.8834 103.8397 1.00271415 22203 -CHINASAT 10 (ZX 10) -1 37677U 11026A 17157.96923471 -.00000356 00000-0 00000-0 0 9997 -2 37677 0.0638 276.1553 0002479 222.3704 216.4311 1.00268996 21901 -TIANLIAN 1-02 -1 37737U 11032A 17157.76269751 .00000024 00000-0 00000-0 0 9994 -2 37737 2.5713 77.5385 0004133 224.3807 44.7881 1.00275324 21659 -GSAT-12 -1 37746U 11034A 17157.90983847 -.00000169 00000-0 00000-0 0 9992 -2 37746 0.0175 312.6345 0007942 142.4166 210.9774 1.00271473 10424 -SES-3 -1 37748U 11035A 17157.53283324 -.00000106 00000-0 00000-0 0 9998 -2 37748 0.0233 312.0806 0002815 86.6892 305.1847 1.00269738 21629 -KAZSAT-2 -1 37749U 11035B 17157.54021977 -.00000202 00000-0 00000-0 0 9991 -2 37749 0.0336 243.8747 0001402 224.8646 67.3812 1.00269450 21500 -ASTRA 1N -1 37775U 11041A 17156.64834056 .00000113 00000-0 00000-0 0 9997 -2 37775 0.0509 21.2424 0005680 34.8032 90.8175 1.00275052 11463 -BSAT-3C (JCSAT-110R) -1 37776U 11041B 17157.96923750 -.00000355 00000-0 00000-0 0 9993 -2 37776 0.0173 339.7994 0000221 150.8905 223.7644 1.00270349 17439 -PAKSAT-1R -1 37779U 11042A 17157.91606583 .00000150 00000-0 00000-0 0 9996 -2 37779 0.0561 124.7736 0003650 295.9957 202.4185 1.00274039 21413 -CHINASAT 1A (ZX 1A) -1 37804U 11047A 17156.11357760 -.00000347 00000-0 00000-0 0 9990 -2 37804 0.0612 100.8674 0000325 277.4419 46.1710 1.00270138 21007 -COSMOS 2473 -1 37806U 11048A 17156.33223026 -.00000116 00000-0 00000-0 0 9998 -2 37806 0.0617 100.9188 0004391 357.4588 261.6708 1.00272552 20998 -SES-2 -1 37809U 11049A 17157.39955912 -.00000201 00000-0 00000-0 0 9990 -2 37809 0.0142 329.0445 0002694 87.8130 254.9818 1.00272084 20947 -ARABSAT-5C -1 37810U 11049B 17157.85991851 .00000119 00000-0 00000-0 0 9992 -2 37810 0.0615 358.9626 0002970 80.4993 145.5734 1.00273302 20844 -EUTELSAT 7 WEST A -1 37816U 11051A 17157.31235323 -.00000066 00000-0 00000-0 0 9999 -2 37816 0.0591 3.6728 0004397 139.9932 216.3640 1.00271238 20904 -QUETZSAT 1 -1 37826U 11054A 17157.59285705 -.00000246 00000-0 00000-0 0 9992 -2 37826 0.0168 345.0766 0003228 96.2390 310.2983 1.00272494 16853 -INTELSAT 18 (IS-18) -1 37834U 11056A 17157.76221866 .00000048 00000-0 00000-0 0 9999 -2 37834 0.0183 358.4864 0002192 77.2725 273.9864 1.00273099 20878 -EUTELSAT 16A -1 37836U 11057A 17157.75177503 .00000100 00000-0 00000-0 0 9998 -2 37836 0.0640 358.7853 0004559 80.3391 102.8677 1.00273992 20720 -VIASAT-1 -1 37843U 11059A 17157.55657872 -.00000028 00000-0 00000-0 0 9998 -2 37843 0.0236 332.0258 0002788 98.6617 269.7295 1.00270478 21207 -ASIASAT 7 -1 37933U 11069A 17157.96397713 -.00000338 00000-0 00000-0 0 9993 -2 37933 0.0339 90.0623 0001623 314.3435 303.6651 1.00269996 11791 -LUCH 5A -1 37951U 11074B 17157.76286118 -.00000048 00000-0 00000-0 0 9991 -2 37951 1.5593 181.5961 0002924 232.2936 283.0553 1.00269984 20125 -NIGCOMSAT 1R -1 38014U 11077A 17157.73438644 .00000140 00000-0 00000-0 0 9997 -2 38014 0.0313 230.4947 0000634 180.2270 151.4601 1.00273119 19964 -FENGYUN 2F -1 38049U 12002A 17157.96468103 -.00000362 00000-0 00000-0 0 9999 -2 38049 1.6969 78.1971 0003839 190.7806 85.9216 1.00278696 19824 -SES-4 -1 38087U 12007A 17157.11470229 -.00000174 00000-0 00000-0 0 9996 -2 38087 0.0170 356.7705 0002200 91.8215 185.4172 1.00271589 19202 -BEIDOU G5 -1 38091U 12008A 17157.85253652 .00000051 00000-0 00000-0 0 9995 -2 38091 2.2012 56.2652 0002344 222.1259 342.6549 1.00271392 19415 -INTELSAT 22 (IS-22) -1 38098U 12011A 17157.09228884 -.00000065 00000-0 00000-0 0 9997 -2 38098 0.0185 354.8786 0001888 85.1505 279.9922 1.00273219 18772 -APSTAR 7 -1 38107U 12013A 17157.96725832 -.00000106 00000-0 00000-0 0 9997 -2 38107 0.0373 65.1972 0002380 6.2732 248.8047 1.00272749 19103 -YAHSAT 1B -1 38245U 12016A 17157.50535265 .00000121 00000-0 00000-0 0 9998 -2 38245 0.0196 306.8057 0001866 128.0132 49.8106 1.00274079 18857 -JCSAT-13 -1 38331U 12023A 17156.94850367 -.00000363 00000-0 00000-0 0 9991 -2 38331 0.0110 308.1395 0002132 120.4353 291.4477 1.00272159 18467 -VINASAT-2 -1 38332U 12023B 17157.91601519 -.00000333 00000-0 00000-0 0 9990 -2 38332 0.0132 25.7857 0001991 60.3401 270.9879 1.00271910 13596 -NIMIQ 6 -1 38342U 12026A 17157.54443457 -.00000178 00000-0 00000-0 0 9995 -2 38342 0.0105 358.5601 0002789 64.2544 297.2147 1.00272560 18539 -CHINASAT 2A (ZX 2A) -1 38352U 12028A 17157.85699163 -.00000297 00000-0 00000-0 0 9991 -2 38352 0.0494 237.5227 0003466 135.8783 288.8087 1.00268939 18572 -INTELSAT 19 (IS-19) -1 38356U 12030A 17156.83216273 -.00000063 00000-0 00000-0 0 9993 -2 38356 0.0168 354.6506 0002633 79.7464 285.6317 1.00272104 17403 -ECHOSTAR 17 -1 38551U 12035A 17157.58873433 -.00000080 00000-0 00000-0 0 9994 -2 38551 0.0233 332.4519 0001981 103.0033 284.5667 1.00270136 18016 -METEOSAT-10 (MSG-3) -1 38552U 12035B 17157.29126091 -.00000010 00000-0 00000-0 0 9997 -2 38552 0.8697 351.3752 0002086 124.9845 243.6636 1.00265605 17823 -SES-5 -1 38652U 12036A 17157.75152347 .00000029 00000-0 00000-0 0 9992 -2 38652 0.0395 274.3756 0002074 160.0925 96.3891 1.00272923 18004 -TIANLIAN 1-03 -1 38730U 12040A 17157.26256946 .00000068 00000-0 00000-0 0 9993 -2 38730 0.1236 269.7366 0003508 194.5925 255.7104 1.00276653 17928 -INTELSAT 20 (IS-20) -1 38740U 12043A 17157.10209497 -.00000031 00000-0 00000-0 0 9990 -2 38740 0.0074 355.5859 0000369 257.1739 107.2361 1.00270572 17706 -HYLAS 2 -1 38741U 12043B 17157.20607275 .00000148 00000-0 00000-0 0 9996 -2 38741 0.0225 332.1395 0002536 109.3849 278.5043 1.00270614 17705 -INTELSAT 21 (IS-21) -1 38749U 12045A 17156.45544027 -.00000292 00000-0 00000-0 0 9998 -2 38749 0.0207 327.2182 0002224 103.5571 289.2487 1.00269618 17471 -ASTRA 2F -1 38778U 12051A 17157.21388270 .00000144 00000-0 00000-0 0 9993 -2 38778 0.0550 223.5384 0001024 294.3720 202.0940 1.00274747 17227 -GSAT-10 -1 38779U 12051B 17157.06200223 -.00000172 00000-0 00000-0 0 9990 -2 38779 0.0600 108.0287 0003098 319.0622 292.9417 1.00272826 17225 -INTELSAT 23 (IS-23) -1 38867U 12057A 17157.43886168 -.00000290 00000-0 00000-0 0 9994 -2 38867 0.0168 327.2962 0001873 101.8709 290.8530 1.00269890 17049 -BEIDOU G6 -1 38953U 12059A 17157.96657905 -.00000180 00000-0 10000-3 0 9997 -2 38953 1.6354 80.0230 0003232 164.6746 82.8829 1.00271201 16981 -LUCH 5B -1 38977U 12061A 17157.68524606 -.00000137 00000-0 00000-0 0 9994 -2 38977 3.5243 74.5915 0003594 334.5503 76.4936 1.00270463 17116 -YAMAL 300K -1 38978U 12061B 17157.76339559 .00000067 00000-0 00000-0 0 9996 -2 38978 0.0077 269.8177 0001550 295.7230 147.5796 1.00272474 16564 -STAR ONE C3 -1 38991U 12062A 17157.71332171 -.00000253 00000-0 00000-0 0 9998 -2 38991 0.0734 91.7888 0001666 340.8503 4.4402 1.00270979 16702 -EUTELSAT 21B -1 38992U 12062B 17157.23219512 .00000124 00000-0 00000-0 0 9995 -2 38992 0.0675 19.6007 0002324 63.2598 277.1661 1.00274141 16791 -ECHOSTAR 16 -1 39008U 12065A 17157.46241711 -.00000287 00000-0 00000-0 0 9999 -2 39008 0.0183 335.1454 0002154 98.7759 286.1030 1.00272183 16748 -CHINASAT 12 (ZX 12) -1 39017U 12067A 17157.45137810 -.00000212 00000-0 00000-0 0 9992 -2 39017 0.0380 80.8874 0003130 347.3808 76.7743 1.00271328 16441 -EUTELSAT 70B -1 39020U 12069A 17157.09675105 -.00000050 00000-0 00000-0 0 9992 -2 39020 0.0642 23.6083 0002690 84.5928 251.8281 1.00271618 16441 -YAMAL 402 -1 39022U 12070A 17156.83195538 .00000079 00000-0 10000-3 0 9998 -2 39022 0.0026 350.1820 0002673 86.6284 172.0224 1.00273066 16524 -SKYNET 5D -1 39034U 12075A 17157.95131024 .00000095 00000-0 00000-0 0 9994 -2 39034 0.0732 340.9460 0003806 99.6409 210.1949 1.00274362 16102 -MEXSAT 3 -1 39035U 12075B 17156.61273742 -.00000033 00000-0 00000-0 0 9994 -2 39035 0.0056 236.9808 0001770 202.6099 280.4292 1.00271446 16102 -TDRS 11 -1 39070U 13004A 17157.67865594 .00000085 00000-0 00000-0 0 9991 -2 39070 5.4081 328.6812 0008105 303.3057 56.5753 1.00265821 13633 -AMAZONAS 3 -1 39078U 13006A 17156.46368881 -.00000290 00000-0 00000-0 0 9993 -2 39078 0.0058 178.2682 0001754 277.6277 264.1241 1.00269298 11819 -AZERSPACE 1 -1 39079U 13006B 17156.16738929 .00000124 00000-0 00000-0 0 9990 -2 39079 0.0450 109.2747 0002427 335.6506 275.1008 1.00273612 15733 -EUTELSAT 117 WEST A -1 39122U 13012A 17156.61823271 -.00000020 00000-0 00000-0 0 9997 -2 39122 0.0301 334.3523 0002356 95.1526 290.5205 1.00270899 15386 -ANIK G1 -1 39127U 13014A 17157.58925234 -.00000079 00000-0 00000-0 0 9997 -2 39127 0.0122 300.7710 0001022 91.0215 328.2144 1.00272314 15190 -CHINASAT 11 (ZX 11) -1 39157U 13020A 17157.88521376 -.00000296 00000-0 00000-0 0 9990 -2 39157 0.0216 297.5545 0002161 19.5915 355.0250 1.00272870 15084 -EUTELSAT 7B -1 39163U 13022A 17157.27263000 .00000043 00000-0 00000-0 0 9998 -2 39163 0.0500 34.9279 0004218 2.0841 323.0174 1.00274777 14935 -SES-6 -1 39172U 13026A 17157.86072084 -.00000265 00000-0 00000-0 0 9994 -2 39172 0.0343 44.6534 0002271 33.2374 86.9252 1.00272899 14661 -IRNSS-1A -1 39199U 13034A 17157.45833099 .00000110 00000-0 00000-0 0 9996 -2 39199 28.8033 115.2188 0018966 189.2548 170.6083 1.00273932 14579 -ALPHASAT -1 39215U 13038A 17157.30226941 .00000131 00000-0 00000-0 0 9998 -2 39215 1.6886 29.2099 0002635 31.5775 327.7603 1.00270357 10987 -INSAT-3D -1 39216U 13038B 17157.06441889 -.00000163 00000-0 00000-0 0 9998 -2 39216 0.0121 6.4352 0000691 34.8253 318.7445 1.00271459 14239 -EUTELSAT 25B -1 39233U 13044A 17157.22143286 .00000137 00000-0 00000-0 0 9992 -2 39233 0.0521 26.6700 0001824 46.4596 286.8905 1.00271878 13578 -GSAT-7 -1 39234U 13044B 17157.08691953 -.00000084 00000-0 00000-0 0 9998 -2 39234 0.0182 263.6715 0000935 51.5189 44.8019 1.00273002 12284 -AMOS-4 -1 39237U 13045A 17157.11192798 .00000001 00000-0 00000-0 0 9997 -2 39237 0.0546 115.1014 0000970 303.3385 301.5694 1.00273651 13899 -ASTRA 2E -1 39285U 13056A 17157.21313460 .00000144 00000-0 00000-0 0 9992 -2 39285 0.0570 13.9752 0002212 49.4873 296.5603 1.00271660 13402 -SIRIUS FM-6 -1 39360U 13058A 17156.61640136 -.00000024 00000-0 00000-0 0 9992 -2 39360 0.0064 1.2561 0001302 214.3345 144.3998 1.00270910 13277 -RADUGA-1M 3 -1 39375U 13062A 17153.54222145 -.00000055 00000-0 00000-0 0 9992 -2 39375 0.0111 85.9904 0003557 1.3292 69.0907 1.00272620 13021 -SES-8 -1 39460U 13071A 17157.02889498 -.00000276 00000-0 00000-0 0 9999 -2 39460 0.0261 285.7228 0003217 152.2287 282.0846 1.00271753 11454 -INMARSAT 5-F1 -1 39476U 13073A 17157.78416375 .00000023 00000-0 00000-0 0 9990 -2 39476 0.0226 348.4229 0000042 157.5437 94.3041 1.00271057 12862 -TKSAT-1 (TUPAC KATARI) -1 39481U 13075A 17157.39955912 -.00000199 00000-0 00000-0 0 9995 -2 39481 0.0262 80.8028 0002650 325.1093 265.7352 1.00268861 12778 -EXPRESS-AM5 -1 39487U 13077A 17157.08737148 -.00000286 00000-0 00000-0 0 9995 -2 39487 0.0183 225.9272 0001087 152.4247 47.8212 1.00272613 13308 -GSAT-14 -1 39498U 14001A 17157.08704643 -.00000083 00000-0 00000-0 0 9994 -2 39498 0.0121 359.3211 0005096 75.5744 285.1609 1.00269350 12386 -THAICOM 6 -1 39500U 14002A 17157.93664877 -.00000125 00000-0 00000-0 0 9994 -2 39500 0.0699 124.7999 0003423 337.4406 209.0050 1.00271102 12387 -TDRS 12 -1 39504U 14004A 17157.33909738 -.00000280 00000-0 00000-0 0 9994 -2 39504 5.9899 336.1128 0000870 62.9722 296.9805 1.00276997 11215 -ABS-2 -1 39508U 14006A 17157.08454168 -.00000092 00000-0 00000-0 0 9995 -2 39508 0.0260 25.0067 0002927 56.4361 278.5904 1.00271774 12254 -ATHENA-FIDUS -1 39509U 14006B 17157.18733805 .00000148 00000-0 00000-0 0 9996 -2 39509 0.0240 56.4962 0001464 32.4149 271.1056 1.00273442 12002 -TURKSAT 4A -1 39522U 14007A 17157.17566243 .00000140 00000-0 00000-0 0 9993 -2 39522 0.0407 278.7972 0000805 116.4412 324.7670 1.00270948 11932 -EXPRESS-AT1 -1 39612U 14010A 17157.99154439 .00000074 00000-0 00000-0 0 9993 -2 39612 0.0243 210.4438 0000568 272.7509 185.3502 1.00273705 11983 -EXPRESS-AT2 -1 39613U 14010B 17157.08877310 -.00000288 00000-0 00000-0 0 9992 -2 39613 0.0210 217.2465 0000533 238.6254 330.6118 1.00270915 11813 -AMAZONAS 4A -1 39616U 14011A 17157.46096683 -.00000287 00000-0 00000-0 0 9993 -2 39616 0.0867 79.0306 0005518 343.3597 297.6664 1.00273138 11801 -ASTRA 5B -1 39617U 14011B 17157.91823566 .00000151 00000-0 00000-0 0 9991 -2 39617 0.0442 321.6428 0003825 122.9841 172.8998 1.00272907 11610 -IRNSS-1B -1 39635U 14017A 17156.95952933 .00000048 00000-0 00000-0 0 9996 -2 39635 29.1089 295.0821 0021490 179.1997 180.7604 1.00275528 11528 -LUCH 5V -1 39727U 14023A 17157.96502630 -.00000273 00000-0 00000-0 0 9993 -2 39727 2.7255 299.0335 0002078 147.0891 251.5913 1.00273263529465 -KAZSAT-3 -1 39728U 14023B 17157.12992527 .00000054 00000-0 00000-0 0 9996 -2 39728 0.0095 359.2657 0000563 147.0049 213.7329 1.00271437 9383 -EUTELSAT 3B -1 39773U 14030A 17157.94471205 .00000016 00000-0 00000-0 0 9997 -2 39773 0.0590 5.2305 0002365 82.6403 150.8644 1.00273880 11019 -ASIASAT 8 -1 40107U 14046A 17157.30284274 -.00000039 00000-0 00000-0 0 9991 -2 40107 0.0156 316.3110 0002166 118.5885 285.1248 1.00271407 69098 -ASIASAT 6 -1 40141U 14052A 17157.93766262 -.00000366 00000-0 00000-0 0 9990 -2 40141 0.0178 58.3054 0000886 3.9150 290.7769 1.00271863 9998 -OPTUS 10 -1 40146U 14054A 17156.83773548 -.00000081 00000-0 00000-0 0 9994 -2 40146 0.0340 82.9484 0001623 350.1925 286.8765 1.00271044 10053 -MEASAT-3B -1 40147U 14054B 17157.03852819 -.00000248 00000-0 00000-0 0 9992 -2 40147 0.0238 357.1097 0002084 48.7697 314.1376 1.00269730 10103 -LUCH (OLYMP) -1 40258U 14058A 17157.78938271 .00000063 00000-0 00000-0 0 9992 -2 40258 0.0460 143.2667 0000810 265.0279 141.1304 1.00271236 9870 -HIMAWARI-8 -1 40267U 14060A 17156.90236236 -.00000282 00000-0 00000-0 0 9994 -2 40267 0.0119 325.0622 0001214 124.4028 270.5486 1.00271594 9797 -IRNSS-1C -1 40269U 14061A 17157.75544524 -.00000164 00000-0 00000-0 0 9992 -2 40269 3.0397 249.9431 0018690 6.2154 354.2400 1.00272682 9756 -INTELSAT 30 (IS-30) -1 40271U 14062A 17156.40832028 -.00000159 00000-0 00000-0 0 9990 -2 40271 0.0114 8.1186 0001576 102.5867 195.2506 1.00272785 9687 -ARSAT 1 -1 40272U 14062B 17157.39970265 -.00000265 00000-0 00000-0 0 9994 -2 40272 0.0314 136.5216 0001345 294.2969 256.2682 1.00272031 9818 -EXPRESS-AM6 -1 40277U 14064A 17157.95131343 .00000094 00000-0 00000-0 0 9998 -2 40277 0.0134 313.3619 0001000 156.2831 181.3635 1.00271307 8526 -GSAT-16 -1 40332U 14078A 17157.13958014 .00000078 00000-0 00000-0 0 9999 -2 40332 0.0783 272.6390 0007957 162.2825 285.1671 1.00272671 9190 -DIRECTV 14 -1 40333U 14078B 17157.53940927 -.00000130 00000-0 00000-0 0 9998 -2 40333 0.0193 291.3592 0001426 68.8528 349.8871 1.00274125 9178 -YAMAL 401 -1 40345U 14082A 17152.86438141 -.00000245 00000-0 00000-0 0 9994 -2 40345 0.0664 103.2093 0000168 299.4691 248.9586 1.00269334 9297 -ASTRA 2G -1 40364U 14089A 17157.21405344 .00000144 00000-0 00000-0 0 9992 -2 40364 0.0364 31.6860 0005116 29.5303 298.8354 1.00272096 8904 -FENGYUN 2G -1 40367U 14090A 17157.97017683 -.00000331 00000-0 00000-0 0 9994 -2 40367 0.4550 257.2998 0003702 327.1910 124.6866 1.00261694 8979 -INMARSAT 5-F2 -1 40384U 15005A 17157.57688493 -.00000290 00000-0 00000-0 0 9993 -2 40384 0.0216 336.1453 0000002 138.6792 293.0412 1.00270180 8618 -ABS-3A -1 40424U 15010A 17156.30270265 -.00000034 00000-0 00000-0 0 9994 -2 40424 0.0166 334.1046 0001967 21.5779 4.3158 1.00270458 8336 -EUTELSAT 115 WEST B -1 40425U 15010B 17156.61293761 -.00000032 00000-0 00000-0 0 9993 -2 40425 0.0060 158.5821 0000506 154.2196 47.1932 1.00268158 8366 -EXPRESS-AM7 -1 40505U 15012A 17157.74217898 .00000146 00000-0 00000-0 0 9991 -2 40505 0.0070 32.4634 0002254 29.6477 140.4119 1.00274561 8298 -IRNSS-1D -1 40547U 15018A 17157.79985935 -.00000331 00000-0 00000-0 0 9999 -2 40547 29.0945 295.1992 0021169 178.4207 181.5447 1.00273872 7935 -BEIDOU I1-S -1 40549U 15019A 17157.96031042 -.00000167 00000-0 00000-0 0 9999 -2 40549 54.4117 333.8858 0040189 185.8887 173.9188 1.00295772 8010 -THOR 7 -1 40613U 15022A 17157.29387069 -.00000014 00000-0 00000-0 0 9995 -2 40613 0.0055 16.7658 0002798 58.2999 284.9653 1.00269452 7763 -TURKMENALEM52E/MONACOSAT -1 40617U 15023A 17157.14794716 .00000097 00000-0 00000-0 0 9995 -2 40617 0.0108 344.4284 0002771 86.6968 288.9050 1.00274348 7770 -DIRECTV 15 -1 40663U 15026A 17156.57931752 -.00000110 00000-0 00000-0 0 9995 -2 40663 0.0400 105.4351 0000308 356.6694 257.8980 1.00270125 7468 -SKY MEXICO-1 -1 40664U 15026B 17156.51304984 -.00000241 00000-0 00000-0 0 9996 -2 40664 0.0192 334.0846 0002191 94.4621 291.4767 1.00269981 7460 -METEOSAT-11 (MSG-4) -1 40732U 15034A 17156.97556449 -.00000031 00000-0 00000-0 0 9993 -2 40732 1.8409 241.7802 0000480 251.7722 108.9386 1.00266938 6974 -STAR ONE C4 -1 40733U 15034B 17156.48870247 -.00000272 00000-0 00000-0 0 9992 -2 40733 0.0645 72.8856 0002561 335.6664 311.4689 1.00273409 6966 -INTELSAT 34 (IS-34) -1 40874U 15039A 17157.44569474 -.00000290 00000-0 00000-0 0 9997 -2 40874 0.0253 324.4014 0000673 42.2274 353.3721 1.00270149 6611 -EUTELSAT 8 WEST B -1 40875U 15039B 17157.31420641 -.00000071 00000-0 00000-0 0 9993 -2 40875 0.0669 345.0647 0002924 77.3120 297.6536 1.00272288 6625 -GSAT-6 -1 40880U 15041A 17157.06177879 -.00000171 00000-0 00000-0 0 9997 -2 40880 0.0248 283.2072 0005968 358.2972 78.4282 1.00271204 6581 -INMARSAT 5-F3 -1 40882U 15042A 17156.79441291 .00000043 00000-0 00000-0 0 9998 -2 40882 0.0217 333.5493 0000755 130.8034 255.6557 1.00268467 6498 -TJS-1 -1 40892U 15046A 17157.67437281 -.00000160 00000-0 00000-0 0 9996 -2 40892 0.0390 94.0423 0001961 297.6627 261.4249 1.00274282 6487 -EXPRESS-AM8 -1 40895U 15048A 17156.34083615 -.00000119 00000-0 00000-0 0 9996 -2 40895 0.0188 221.4276 0000582 228.7531 272.4900 1.00273368 6305 -BEIDOU I2-S -1 40938U 15053A 17157.91354792 -.00000167 00000-0 00000-0 0 9994 -2 40938 54.2196 296.7873 0047087 172.5226 207.7175 1.00295744 6306 -SKY MUSTER (NBN1A) -1 40940U 15054A 17156.90352899 -.00000286 00000-0 00000-0 0 9994 -2 40940 0.0244 321.8934 0002086 107.5619 290.5671 1.00269508 6225 -ARSAT 2 -1 40941U 15054B 17156.51913242 -.00000232 00000-0 00000-0 0 9998 -2 40941 0.0430 126.2431 0001678 307.5160 286.2584 1.00272441 6259 -MORELOS 3 -1 40946U 15056A 17156.52375644 -.00000058 00000-0 00000-0 0 9990 -2 40946 6.4382 329.6573 0001266 194.3751 165.5754 1.00273198 6211 -APSTAR 9 -1 40982U 15059A 17156.89859662 -.00000273 00000-0 00000-0 0 9999 -2 40982 0.0437 132.3717 0000361 252.7207 334.9088 1.00271279 6097 -TURKSAT 4B -1 40984U 15060A 17157.15358557 .00000109 00000-0 00000-0 0 9997 -2 40984 0.0129 13.5932 0002306 57.1606 289.2712 1.00271214 6047 -CHINASAT 2C (ZX 2C) -1 41021U 15063A 17157.96519169 -.00000328 00000-0 00000-0 0 9994 -2 41021 0.0135 187.6740 0002205 206.8564 311.9405 1.00272905 5949 -GSAT-15 -1 41028U 15065A 17157.03303586 -.00000264 00000-0 00000-0 0 9994 -2 41028 0.0814 274.8255 0003106 130.7632 314.4368 1.00272144 5785 -BADR-7 (ARABSAT-6B) -1 41029U 15065B 17157.21998263 .00000139 00000-0 00000-0 0 9997 -2 41029 0.0441 258.8634 0002007 329.0067 132.1129 1.00271737 5685 -LAOSAT 1 -1 41034U 15067A 17156.93622780 -.00000350 00000-0 00000-0 0 9997 -2 41034 0.0174 12.3004 0001327 146.2409 201.4638 1.00267265 5801 -TELSTAR 12V -1 41036U 15068A 17157.33359668 -.00000124 00000-0 00000-0 0 9996 -2 41036 0.0227 64.3782 0002247 3.4888 292.1572 1.00272340 5555 -CHINASAT 1C (ZX 1C) -1 41103U 15073A 17157.98537590 -.00000155 00000-0 00000-0 0 9994 -2 41103 0.0095 189.8426 0002402 127.5052 14.4726 1.00273936 5609 -ELEKTRO-L 2 -1 41105U 15074A 17157.96725832 -.00000102 00000-0 00000-0 0 9995 -2 41105 0.0738 190.6773 0001945 246.5160 242.6717 1.00272238 5455 -COSMOS 2513 -1 41121U 15075A 17157.45624638 -.00000143 00000-0 00000-0 0 9995 -2 41121 0.0997 101.1679 0001968 48.3364 350.0262 1.00270866 5534 -EXPRESS-AMU1 -1 41191U 15082A 17157.91591514 .00000151 00000-0 00000-0 0 9995 -2 41191 0.0024 331.7311 0002025 93.7745 195.8078 1.00271621 5448 -GAOFEN 4 -1 41194U 15083A 17157.96397770 -.00000339 00000-0 00000-0 0 9991 -2 41194 0.0802 99.3310 0003190 117.4378 131.5242 1.00269785 5427 -BELINTERSAT-1 -1 41238U 16001A 17156.89909698 .00000100 00000-0 10000-3 0 9999 -2 41238 0.0412 131.9830 0001783 301.3605 196.3216 1.00272261 5193 -IRNSS-1E -1 41241U 16003A 17151.92699686 -.00000279 00000-0 00000-0 0 9991 -2 41241 28.7592 114.9659 0019172 183.8467 36.2942 1.00270514 5077 -INTELSAT 29E (IS-29E) -1 41308U 16004A 17157.43055619 -.00000287 00000-0 00000-0 0 9999 -2 41308 0.0402 124.8072 0002054 314.9781 280.2382 1.00272516 5118 -EUTELSAT 9B -1 41310U 16005A 17157.26699015 .00000057 00000-0 00000-0 0 9992 -2 41310 0.0496 126.1871 0001739 220.0825 13.7258 1.00274685 5054 -SES-9 -1 41380U 16013A 17156.99199875 -.00000352 00000-0 00000-0 0 9995 -2 41380 0.0171 323.9761 0001871 110.6916 285.3528 1.00272955 4681 -EUTELSAT 65 WEST A -1 41382U 16014A 17156.47536617 -.00000284 00000-0 00000-0 0 9994 -2 41382 0.0464 4.2061 0001803 67.6657 288.1467 1.00273478 4491 -IRNSS-1F -1 41384U 16015A 17156.94054837 .00000154 00000-0 00000-0 0 9993 -2 41384 4.1802 265.3994 0022688 181.7070 178.5192 1.00276072 4625 -BEIDOU IGSO 6 -1 41434U 16021A 17157.65734022 -.00000177 00000-0 10000-3 0 9996 -2 41434 55.5278 72.5149 0026618 183.6472 331.4539 1.00272722 4423 -IRNSS-1G -1 41469U 16027A 17157.67271219 -.00000337 00000-0 00000-0 0 9990 -2 41469 4.2514 266.7228 0000811 126.7626 233.4852 1.00276255 4138 -JCSAT 2B -1 41471U 16028A 17156.86540709 -.00000172 00000-0 00000-0 0 9994 -2 41471 0.0206 344.0388 0001744 97.0403 278.9406 1.00271311 4046 -THAICOM 8 -1 41552U 16031A 17156.07731655 -.00000130 00000-0 00000-0 0 9997 -2 41552 0.0755 54.9061 0004450 354.2584 310.8724 1.00271674 3708 -INTELSAT 31 (IS-31) -1 41581U 16035A 17156.55797754 -.00000158 00000-0 00000-0 0 9998 -2 41581 0.0263 266.5979 0001050 350.7469 102.6424 1.00272562 3621 -BEIDOU G7 -1 41586U 16037A 17157.77149967 -.00000255 00000-0 00000-0 0 9995 -2 41586 1.2548 317.4376 0001449 263.9468 96.1170 1.00267179 3733 -ABS-2A (MONGOLSAT-1) -1 41588U 16038A 17157.08504291 -.00000090 00000-0 00000-0 0 9994 -2 41588 0.0175 352.9121 0002063 11.1873 355.9023 1.00271473 3652 -EUTELSAT 117 WEST B -1 41589U 16038B 17156.61871427 -.00000019 00000-0 00000-0 0 9992 -2 41589 0.0011 150.6444 0000191 117.9652 91.3882 1.00273023 3638 -BRISAT -1 41591U 16039A 17156.87509979 -.00000203 00000-0 00000-0 0 9999 -2 41591 0.0197 323.0587 0002303 109.2375 287.7287 1.00271878 3561 -ECHOSTAR 18 -1 41592U 16039B 17156.46482146 -.00000290 00000-0 00000-0 0 9997 -2 41592 0.0186 349.3730 0002661 75.4375 295.2171 1.00272715 3558 -TIANTONG-1 1 -1 41725U 16048A 17157.96535390 -.00000323 00000-0 00000-0 0 9998 -2 41725 4.6001 325.3222 0003197 61.0390 318.1514 1.00268250 3213 -JCSAT-16 -1 41729U 16050A 17156.84308590 -.00000099 00000-0 00000-0 0 9991 -2 41729 0.0182 4.5057 0001977 77.2034 278.3128 1.00270643 3001 -INTELSAT 36 (IS-36) -1 41747U 16053A 17157.10224625 -.00000031 00000-0 00000-0 0 9996 -2 41747 0.0351 68.1148 0003188 305.6980 346.1959 1.00271935 2921 -INTELSAT 33E (IS-33E) -1 41748U 16053B 17157.12580693 .00000042 00000-0 00000-0 0 9990 -2 41748 0.0280 53.2312 0001987 42.9356 263.8558 1.00273968 3158 -INSAT-3DR -1 41752U 16054A 17157.08690279 -.00000083 00000-0 00000-0 0 9999 -2 41752 0.0492 273.0204 0005898 5.9511 80.9615 1.00272237 2752 -GSAT-18 -1 41793U 16060A 17157.08728701 -.00000083 00000-0 00000-0 0 9993 -2 41793 0.0522 125.5807 0008392 321.2972 273.2183 1.00272754 2478 -SKY MUSTER 2 -1 41794U 16060B 17156.89088062 -.00000251 00000-0 00000-0 0 9998 -2 41794 0.0159 317.9919 0001850 114.8702 287.1579 1.00271100 2461 -HIMAWARI-9 -1 41836U 16064A 17156.90204452 -.00000281 00000-0 00000-0 0 9997 -2 41836 0.0132 44.4867 0001500 36.3302 279.1996 1.00273071 2125 -SHIJIAN-17 (SJ-17) -1 41838U 16065A 17157.62437860 -.00000315 00000-0 00000-0 0 9999 -2 41838 0.1537 86.2147 0001778 18.5593 154.3135 1.00090507 2167 -GOES 16 -1 41866U 16071A 17156.54258151 -.00000188 00000-0 00000-0 0 9999 -2 41866 0.0014 287.1718 0000772 114.4348 318.3993 1.00261476 2035 -TIANLIAN 1-04 -1 41869U 16072A 17157.90505278 -.00000111 00000-0 00000-0 0 9995 -2 41869 2.6784 289.9420 0007110 146.7236 221.6497 1.00272396 2259 -FENGYUN 4A -1 41882U 16077A 17157.97017885 -.00000334 00000-0 00000-0 0 9991 -2 41882 0.0320 250.4568 0009426 195.4519 263.5833 1.00269626 1918 -ECHOSTAR 19 -1 41893U 16079A 17156.56377543 -.00000146 00000-0 00000-0 0 9990 -2 41893 0.0231 328.6797 0001923 102.3709 288.9703 1.00273918 1663 -STAR ONE D1 -1 41904U 16082B 17156.52745717 -.00000218 00000-0 00000-0 0 9995 -2 41904 0.0372 91.4069 0002354 350.9388 277.6800 1.00271924 1716 -TJS-2 -1 41911U 17001A 17157.96319302 -.00000345 00000-0 00000-0 0 9992 -2 41911 0.6987 279.6145 0001076 207.3678 222.8143 1.00267197 1667 -HISPASAT 36W-1 -1 41942U 17006A 17156.39406066 -.00000251 00000-0 00000-0 0 9997 -2 41942 0.0574 107.7778 0001097 335.2546 276.9788 1.00272717 1454 -TELKOM 3S -1 41944U 17007A 17156.96517789 -.00000369 00000-0 00000-0 0 9998 -2 41944 0.0196 325.4121 0002604 119.1288 275.4888 1.00269877 1070 -INTELSAT 32E (IS-32E) -1 41945U 17007B 17157.41157112 -.00000274 00000-0 00000-0 0 9995 -2 41945 0.0179 8.1546 0000641 349.1981 2.6473 1.00270850 1176 -ECHOSTAR 23 -1 42070U 17014A 17157.41643175 -.00000278 00000-0 00000-0 0 9996 -2 42070 0.0216 331.8718 0002115 103.7733 284.3784 1.00270214 887 -SES-10 -1 42432U 17017A 17157.47759086 -.00000277 00000-0 00000-0 0 9995 -2 42432 0.0328 338.8066 0002019 110.1376 271.0789 1.00269446 719 -CHINASAT 16 (SJ-13) -1 42662U 17018A 17156.98568600 -.00000359 00000-0 00000-0 0 9997 -2 42662 0.1082 97.0396 0003514 129.1950 133.7356 1.00271270 667 -KOREASAT 7 -1 42691U 17023A 17157.60290750 -.00000367 00000-0 00000-0 0 9992 -2 42691 0.0077 349.1222 0000873 76.8932 162.0996 1.00270811 377 -SGDC -1 42692U 17023B 17157.42566131 -.00000256 00000-0 00000-0 0 9999 -2 42692 0.0526 44.5619 0000855 34.5487 254.8001 1.00271224 375 -GSAT-9 -1 42695U 17024A 17156.71022076 -.00000294 00000-0 00000-0 0 9991 -2 42695 0.0413 178.9945 0003863 260.0872 168.2197 1.00273618 354 \ No newline at end of file +TDRS 3 +<<<<<<< HEAD +1 19548U 88091B 17197.91949784 -.00000306 00000-0 00000-0 0 9999 +2 19548 14.4436 7.6579 0033408 310.4930 245.2928 1.00280674 92745 +SKYNET 4C +1 20776U 90079A 17196.13681019 .00000123 00000-0 00000-0 0 9996 +2 20776 13.8390 15.8266 0002591 111.3153 248.7560 1.00275390 98240 +TDRS 5 +1 21639U 91054B 17197.67852201 .00000079 00000-0 00000-0 0 9992 +2 21639 14.3935 21.1007 0022812 351.0595 359.1093 1.00274287 95041 +TDRS 6 +1 22314U 93003B 17197.91968292 -.00000300 00000-0 00000-0 0 9992 +2 22314 13.9253 24.0411 0002207 305.7200 250.3017 1.00278513 89784 +ASTRA 1D +1 23331U 94070A 17197.47101194 -.00000273 00000-0 00000-0 0 9997 +2 23331 7.6054 49.0747 0003320 61.2146 281.2220 1.00269933 83613 +BRASILSAT B2 +1 23536U 95016A 17194.52198703 -.00000282 00000-0 00000-0 0 9990 +2 23536 7.2220 50.9741 0002084 70.5771 289.9506 1.00272706 81622 +AMSC 1 +1 23553U 95019A 17196.58168445 -.00000120 00000-0 00000-0 0 9991 +2 23553 10.1173 39.6297 0002850 67.7461 292.3324 1.00272433 81506 +TDRS 7 +1 23613U 95035B 17197.95233036 -.00000208 00000-0 00000-0 0 9994 +2 23613 14.9845 14.7988 0028862 5.1670 342.6395 1.00272055 80585 +ECHOSTAR 1 +1 23754U 95073A 17197.72896483 -.00000246 00000-0 00000-0 0 9990 +2 23754 0.8735 90.1212 0003051 49.4971 340.3063 1.00271766 78783 +INMARSAT 3-F1 +1 23839U 96020A 17197.79979837 .00000001 00000-0 00000-0 0 9997 +2 23839 4.0393 67.3860 0005831 44.2302 175.5962 1.00272027 77659 +ASTRA 1F +1 23842U 96021A 17197.80862991 .00000134 00000-0 00000-0 0 9993 +2 23842 0.0413 334.0395 0003566 153.8942 142.2736 1.00271273 19680 +MSAT M1 +1 23846U 96022A 17196.61819590 -.00000089 00000-0 00000-0 0 9993 +2 23846 7.7933 48.5988 0004783 65.8644 294.2231 1.00272282 77765 +INMARSAT 3-F2 +1 24307U 96053A 17197.44420898 -.00000130 00000-0 00000-0 0 9998 +2 24307 2.6854 77.6044 0004656 18.3200 342.9546 1.00272301 76334 +AMC-1 (GE-1) +1 24315U 96054A 17196.77766934 .00000055 00000-0 00000-0 0 9992 +2 24315 1.6261 84.9885 0002878 44.0372 315.5881 1.00271020 76355 +AFRICASAT-2 (MEASAT-2) +1 24653U 96063B 17197.27933531 -.00000233 00000-0 00000-0 0 9991 +2 24653 7.5277 49.4937 0007625 169.9727 323.3892 1.00273516 75790 +INMARSAT 3-F3 +1 24674U 96070A 17197.60809846 .00000031 00000-0 00000-0 0 9995 +2 24674 3.4884 71.6483 0004885 41.3033 218.6931 1.00274053 75307 +AMC-2 (GE-2) +1 24713U 97002A 17197.56507652 -.00000217 00000-0 00000-0 0 9997 +2 24713 4.3884 65.8005 0005103 49.4148 297.9365 1.00270153 74910 +INTELSAT 26 (IS-26) +1 24732U 97007A 17197.91993771 -.00000018 00000-0 00000-0 0 9992 +2 24732 7.5047 49.8196 0003014 43.5785 238.4892 1.00271643 40071 +GALAXY 25 (G-25) +1 24812U 97026A 17197.44081479 -.00000166 00000-0 00000-0 0 9997 +2 24812 0.0035 5.8589 0003448 105.9819 248.1939 1.00271099 73694 +ABS-3 +1 24901U 97042A 17197.82132632 -.00000198 00000-0 00000-0 0 9999 +2 24901 4.9412 63.1117 0005400 33.7096 219.0400 1.00270736 72869 +INTELSAT 5 (IS-5) +1 24916U 97046A 17196.94467265 -.00000148 00000-0 00000-0 0 9999 +2 24916 3.6016 70.9776 0002817 40.6633 319.2722 1.00271195 72951 +AMC-3 (GE-3) +1 24936U 97050A 17197.62893302 -.00000263 00000-0 00000-0 0 9995 +2 24936 0.4404 92.3122 0002785 33.5924 323.1348 1.00269548 19767 +NSS-5 +1 24957U 97053A 17197.40847535 .00000102 00000-0 00000-0 0 9995 +2 24957 3.8929 69.1715 0003298 43.3744 19.4575 1.00274566 72513 +ECHOSTAR 3 +1 25004U 97059A 17196.60058672 -.00000227 00000-0 00000-0 0 9991 +2 25004 2.2122 80.1804 0003407 21.5167 338.2526 0.99815965 72470 +JCSAT-1B +1 25067U 97075A 17189.45053541 -.00000212 00000-0 00000-0 0 9997 +2 25067 5.5972 58.7834 0001664 58.2025 121.7489 1.00270121 71806 +ASTRA 1G +1 25071U 97076A 17197.90188164 .00000101 00000-0 00000-0 0 9998 +2 25071 2.3814 78.3321 0003147 38.7960 193.5461 1.00271735 71897 +BRASILSAT B3 +1 25152U 98006A 17196.54948744 -.00000288 00000-0 00000-0 0 9996 +2 25152 4.0786 68.2047 0003000 42.8417 317.1266 1.00273510 10846 +INMARSAT 3-F5 +1 25153U 98006B 17197.33905841 -.00000292 00000-0 00000-0 0 9991 +2 25153 2.6317 74.1700 0004389 46.3728 241.8550 1.00268075 71226 +NSS-806 +1 25239U 98014A 17197.76157035 -.00000283 00000-0 00000-0 0 9996 +2 25239 0.0862 313.7659 0004293 163.4811 44.1876 1.00269849 14649 +CHINASAT 5A (ZX 5A) +1 25354U 98033A 17197.95198072 -.00000359 00000-0 00000-0 0 9996 +2 25354 1.3045 87.0435 0000998 51.8379 264.3620 1.00271390 74579 +THOR III +1 25358U 98035A 17197.35800895 -.00000049 00000-0 00000-0 0 9995 +2 25358 5.4734 58.9363 0001796 51.4554 308.5595 1.00271481 70184 +INTELSAT 805 (IS-805) +1 25371U 98037A 17197.81342675 -.00000035 00000-0 00000-0 0 9995 +2 25371 0.0734 92.9935 0002937 30.1056 273.5694 1.00272477 69907 +ASTRA 2A +1 25462U 98050A 17197.70189486 -.00000363 00000-0 00000-0 0 9992 +2 25462 0.0153 224.3537 0002131 252.5319 184.0202 1.00265906 69078 +AFRISTAR +1 25515U 98063A 17197.86716012 .00000118 00000-0 00000-0 0 9990 +2 25515 3.3566 69.6520 0003769 45.4260 152.9579 1.00270839 68469 +JCSAT-4A +1 25630U 99006A 17197.74774816 -.00000208 00000-0 00000-0 0 9990 +2 25630 2.3527 79.9202 0004583 43.5232 230.5055 1.00271713 67336 +SKYNET 4E +1 25639U 99009B 17197.80764655 .00000015 00000-0 00000-0 0 9994 +2 25639 10.1585 28.3730 0002648 92.3799 110.7455 1.00271843 18737 +ASIASAT 3S +1 25657U 99013A 17197.27553010 -.00000242 00000-0 00000-0 0 9994 +2 25657 2.5668 78.0671 0003172 17.6694 83.7820 1.00269739 67153 +NIMIQ 1 +1 25740U 99027A 17197.73382674 -.00000203 00000-0 00000-0 0 9996 +2 25740 0.0180 320.6937 0004518 133.7929 17.9159 1.00270941 66548 +ASTRA 1H +1 25785U 99033A 17197.90531278 .00000131 00000-0 00000-0 0 9996 +2 25785 3.8794 69.3273 0002557 43.9981 190.9967 1.00269492 18758 +TELKOM 1 +1 25880U 99042A 17197.95014576 -.00000350 00000-0 00000-0 0 9998 +2 25880 0.0713 105.4769 0001937 18.7169 260.8544 1.00272859 65723 +ABS-7 +1 25894U 99046A 17197.94509521 -.00000367 00000-0 00000-0 0 9993 +2 25894 0.0159 63.6733 0002522 68.2412 259.3815 1.00266333 64464 +ABS-6 +1 25924U 99053A 17196.74235267 -.00000124 00000-0 00000-0 0 9996 +2 25924 0.0347 306.0512 0002588 168.1782 245.7957 1.00270171 65202 +TELSTAR 12 (ORION 2) +1 25949U 99059A 17197.57479852 -.00000067 00000-0 00000-0 0 9997 +2 25949 0.9949 88.7588 0002962 32.9226 270.6411 1.00271798 64869 +AMC-4 (GE-4) +1 25954U 99060A 17197.46954263 -.00000020 00000-0 00000-0 0 9996 +2 25954 0.0167 82.3276 0000150 336.7766 300.8950 0.99686739 64825 +GALAXY 11 (G-11) +1 26038U 99071A 17197.80864515 .00000132 00000-0 00000-0 0 9993 +2 26038 0.0367 111.8651 0000256 340.2509 178.7294 1.00271878 64446 +HISPASAT 1C +1 26071U 00007A 17197.86299234 -.00000066 00000-0 00000-0 0 9994 +2 26071 0.6247 89.7173 0004807 88.6316 161.9153 0.99200285 14975 +SUPERBIRD-B2 +1 26095U 00012A 17197.87652413 -.00000098 00000-0 00000-0 0 9994 +2 26095 0.4627 94.2051 0002999 20.7606 297.4156 1.00271740 63773 +ASIASTAR +1 26107U 00016A 17197.85810028 -.00000338 00000-0 00000-0 0 9995 +2 26107 1.7318 81.8991 0004092 35.3583 231.5332 1.00269613 63495 +EUTELSAT 16C +1 26243U 00019A 17197.86716012 .00000084 00000-0 00000-0 0 9995 +2 26243 4.3197 66.1683 0002552 53.7233 141.6275 1.00273378 63129 +EUTELSAT 80A +1 26369U 00028A 17197.81434896 .00000140 00000-0 00000-0 0 9999 +2 26369 1.0741 85.3667 0003538 21.2796 155.2524 1.00047071 62778 +TDRS 8 +1 26388U 00034A 17197.08945964 -.00000237 00000-0 00000-0 0 9997 +2 26388 7.5399 55.5913 0002355 220.6520 139.3531 1.00275891 62503 +ECHOSTAR 6 +1 26402U 00038A 17197.63868792 -.00000154 00000-0 00000-0 0 9990 +2 26402 4.2381 66.9642 0003363 53.1461 308.2740 1.00271425 62286 +INTELSAT 9 (IS-9) +1 26451U 00043A 17197.85652387 -.00000222 00000-0 00000-0 0 9991 +2 26451 3.5884 71.1927 0002806 47.0702 95.4273 1.00273733 11481 +BRASILSAT B4 +1 26469U 00046A 17196.67494113 -.00000173 00000-0 00000-0 0 9998 +2 26469 1.7114 85.0453 0002725 34.1827 325.4584 1.00270780 62294 +NILESAT 102 +1 26470U 00046B 17197.87688212 -.00000064 00000-0 00000-0 0 9997 +2 26470 1.7398 83.5905 0003871 51.6479 108.3681 1.00271712 12539 +ASTRA 2B +1 26494U 00054A 17197.82997358 -.00000117 00000-0 00000-0 0 9990 +2 26494 2.2690 78.9817 0001636 121.5062 23.3482 1.00100868 14224 +AMC-7 (GE-7) +1 26495U 00054B 17197.55653795 .00000084 00000-0 00000-0 0 9997 +2 26495 0.0369 50.6996 0000393 74.7082 234.5958 1.00269862 61595 +NSS-11 (AAP-1) +1 26554U 00059A 17197.95014576 -.00000350 00000-0 00000-0 0 9997 +2 26554 0.0553 279.2999 0002437 201.3739 264.5423 1.00268369 8644 +N-SAT-110 (JCSAT-110) +1 26559U 00060A 17197.85810028 -.00000356 00000-0 00000-0 0 9995 +2 26559 0.0181 82.2351 0001216 358.9130 272.7019 1.00271869 61457 +AMC-6 (GE-6) +1 26580U 00067A 17197.37059819 -.00000220 00000-0 00000-0 0 9996 +2 26580 0.0100 29.2477 0002480 100.7028 214.8567 1.00273085 61306 +INTELSAT 12 (IS-12) +1 26590U 00068A 17197.80864515 .00000131 00000-0 00000-0 0 9993 +2 26590 0.5455 93.0696 0002634 71.5144 106.3340 1.00272592 19053 +INTELSAT 1R (IS-1R) +1 26608U 00072A 17197.81342675 -.00000034 00000-0 00000-0 0 9990 +2 26608 0.3771 92.9904 0000551 263.4213 40.4131 1.00271569 8650 +ANIK F1 +1 26624U 00076A 17197.48005118 -.00000078 00000-0 00000-0 0 9991 +2 26624 0.0217 142.3485 0002892 349.2937 228.3805 1.00271788 10460 +ASTRA 2D +1 26638U 00081A 17197.21103841 .00000043 00000-0 00000-0 0 9996 +2 26638 3.7051 69.9368 0001705 41.1609 318.7736 1.00270821 20242 +AMC-8 (GE-8) +1 26639U 00081B 17197.58934793 .00000100 00000-0 00000-0 0 9999 +2 26639 0.0237 336.1022 0002293 131.6834 259.9731 1.00273743 60615 +SKYNET 4F +1 26695U 01005B 17196.88101491 -.00000253 00000-0 00000-0 0 9991 +2 26695 8.9291 36.4336 0002853 76.1591 104.5125 1.00272959 60213 +EUTELSAT 33C +1 26719U 01011A 17197.81434896 .00000151 00000-0 00000-0 0 9993 +2 26719 0.0620 12.3668 0002976 100.5862 148.1120 1.00271041 59880 +INTELSAT 10 (IS-10) +1 26766U 01019A 17197.90203236 .00000120 00000-0 00000-0 0 9991 +2 26766 1.5771 85.1166 0002011 7.2853 214.7382 1.00270513 12971 +INTELSAT 901 (IS-901) +1 26824U 01024A 17197.85340934 -.00000146 00000-0 00000-0 0 9992 +2 26824 0.0256 299.2687 0002773 178.0617 106.7643 1.00270920 59034 +ASTRA 2C +1 26853U 01025A 17197.79979837 .00000041 00000-0 00000-0 0 9991 +2 26853 0.4602 91.6428 0003327 26.3656 165.0246 1.00272492 12397 +ARTEMIS +1 26863U 01029A 17196.93309905 -.00000375 00000-0 00000-0 0 9995 +2 26863 12.7593 32.7684 0001580 121.4073 238.6850 1.00277080 59737 +INTELSAT 902 (IS-902) +1 26900U 01039A 17197.79979837 .00000028 00000-0 00000-0 0 9994 +2 26900 0.0391 79.3427 0002902 54.1456 151.2222 1.00273102 58107 +EUTELSAT 12 WEST B +1 26927U 01042A 17197.91576260 -.00000105 00000-0 00000-0 0 9991 +2 26927 0.0444 28.6876 0004476 78.0212 145.3905 1.00271561 57853 +DIRECTV 4S +1 26985U 01052A 17197.73869182 -.00000117 00000-0 00000-0 0 9997 +2 26985 0.0171 47.6878 0001647 78.2649 333.5380 1.00269256 57339 +INSAT-3C +1 27298U 02002A 17197.86299234 -.00000262 00000-0 00000-0 0 9991 +2 27298 0.6850 91.5087 0002418 143.0864 104.3256 1.00266944 56745 +ECHOSTAR 7 +1 27378U 02006A 17197.57962573 -.00000004 00000-0 00000-0 0 9999 +2 27378 0.0396 288.4507 0001184 172.0352 283.9473 1.00270669 17976 +INTELSAT 904 (IS-904) +1 27380U 02007A 17197.20001501 .00000132 00000-0 00000-0 0 9999 +2 27380 0.0191 106.9630 0002648 18.1708 286.1829 1.00272441 19099 +TDRS 9 +1 27389U 02011A 17197.91576260 -.00000106 00000-0 00000-0 0 9992 +2 27389 5.3088 78.7202 0016022 249.4496 284.4595 1.00272642 57788 +JCSAT 2A +1 27399U 02015A 17197.80188215 -.00000312 00000-0 00000-0 0 9993 +2 27399 0.5395 92.6738 0002087 73.5822 193.2358 1.00267794 56236 +ASTRA 3A +1 27400U 02015B 17196.50584076 -.00000285 00000-0 00000-0 0 9996 +2 27400 3.8654 68.6617 0002876 62.2935 297.6724 1.00275155 56043 +INTELSAT 903 (IS-903) +1 27403U 02016A 17197.39910345 -.00000243 00000-0 00000-0 0 9994 +2 27403 0.0216 47.7237 0002681 89.1367 266.7286 1.00268444 13008 +NSS-7 +1 27414U 02019A 17197.46714096 -.00000161 00000-0 00000-0 0 9991 +2 27414 1.9541 82.9477 0002637 29.1270 330.5754 1.00272455 55908 +DIRECTV 5 (TEMPO 1) +1 27426U 02023A 17197.48787267 -.00000060 00000-0 00000-0 0 9999 +2 27426 0.0484 265.9075 0003464 223.8216 230.2994 1.00272888 55661 +INTELSAT 905 (IS-905) +1 27438U 02027A 17197.89212559 -.00000189 00000-0 00000-0 0 9990 +2 27438 0.0404 230.0405 0002471 239.0416 122.4960 1.00272377 18717 +EXPRESS-A4 +1 27441U 02029A 17197.88484734 -.00000253 00000-0 00000-0 0 9993 +2 27441 6.1110 56.3372 0006158 78.9085 263.5132 1.00277940 55307 +GALAXY 3C (G-3C) +1 27445U 02030A 17197.44596568 -.00000155 00000-0 00000-0 0 9991 +2 27445 0.0212 320.5446 0001687 2.5362 36.9053 1.00269622 13911 +EUTELSAT 5 WEST A +1 27460U 02035A 17197.19675525 -.00000046 00000-0 00000-0 0 9995 +2 27460 0.0474 339.7059 0004905 134.3965 245.9471 1.00271666 54966 +N-STAR C +1 27461U 02035B 17197.69618764 -.00000317 00000-0 00000-0 0 9994 +2 27461 4.6852 64.6489 0004363 19.3827 237.2960 1.00269781 54990 +EUTELSAT 36 WEST A +1 27508U 02040A 17197.28289578 -.00000250 00000-0 00000-0 0 9990 +2 27508 0.0648 358.8053 0003112 58.5319 302.6909 1.00265400 54536 +METEOSAT-8 (MSG-1) +1 27509U 02040B 17197.69676295 .00000133 00000-0 00000-0 0 9991 +2 27509 4.8893 58.2504 0001644 182.7517 346.1056 1.00280662 54590 +INTELSAT 906 (IS-906) +1 27513U 02041A 17197.79979837 .00000010 00000-0 00000-0 0 9990 +2 27513 0.0076 57.2747 0002911 67.9436 161.6647 1.00272772 54371 +KODAMA (DRTS) +1 27516U 02042B 17197.62896541 -.00000246 00000-0 00000-0 0 9998 +2 27516 5.0931 61.9098 0001921 71.1349 118.7549 1.00270415 54387 +KALPANA-1 (METSAT 1) +1 27525U 02043A 17196.13410844 -.00000084 00000-0 00000-0 0 9992 +2 27525 6.3943 55.0606 0012196 228.8457 131.0699 1.00269003 54363 +HISPASAT 1D +1 27528U 02044A 17197.85652387 -.00000221 00000-0 00000-0 0 9999 +2 27528 0.0550 299.9284 0002691 169.2111 104.0906 1.00272456 10152 +TDRS 10 +1 27566U 02055A 17196.82974542 .00000073 00000-0 00000-0 0 9993 +2 27566 5.0826 58.2973 0005619 239.4035 120.5405 1.00267131 53567 +NSS-6 +1 27603U 02057A 17197.86299234 -.00000275 00000-0 00000-0 0 9995 +2 27603 0.0155 33.2888 0001302 126.0228 181.2621 1.00270669 53437 +NIMIQ 2 +1 27632U 02062A 17196.58616915 -.00000285 00000-0 00000-0 0 9991 +2 27632 2.0511 81.9327 0002025 152.5559 207.1728 1.00269537 11532 +INTELSAT 907 (IS-907) +1 27683U 03007A 17196.26174880 -.00000205 00000-0 00000-0 0 9994 +2 27683 0.0147 85.3880 0002962 49.2360 225.3981 1.00272561 52770 +GALAXY 12 (G-12) +1 27715U 03013B 17197.58452053 .00000055 00000-0 00000-0 0 9996 +2 27715 0.0522 259.9113 0001967 239.8098 236.2989 1.00272003 19470 +ASIASAT 4 +1 27718U 03014A 17197.85323738 -.00000365 00000-0 00000-0 0 9992 +2 27718 0.0206 277.4697 0000534 276.1070 170.5595 1.00271098 52267 +HELLAS-SAT 2 +1 27811U 03020A 17197.80848507 .00000148 00000-0 00000-0 0 9992 +2 27811 0.0567 219.3578 0003707 275.6331 129.9230 1.00268672 10197 +AMC-9 (GE-12) +1 27820U 03024A 17197.73382674 -.00000185 00000-0 00000-0 0 9998 +2 27820 0.0369 69.7392 0040286 330.7202 70.1131 1.00211408 51671 +THURAYA-2 +1 27825U 03026A 17197.80462832 .00000124 00000-0 00000-0 0 9990 +2 27825 4.9410 29.2326 0004739 82.1771 157.0703 1.00273345 51685 +OPTUS C1 +1 27831U 03028B 17197.88294493 -.00000152 00000-0 00000-0 0 9995 +2 27831 0.0510 149.4472 0003912 342.5982 276.7184 1.00271160 20395 +ECHOSTAR 12 (RAINBOW 1) +1 27852U 03033A 17197.47118299 -.00000286 00000-0 00000-0 0 9996 +2 27852 0.0348 292.5756 0001371 217.9478 252.3950 1.00270001 51314 +GALAXY 23 (G-23) +1 27854U 03034A 17197.57962573 .00000009 00000-0 00000-0 0 9994 +2 27854 0.0118 61.3583 0002923 53.1326 267.7654 1.00272271 55885 +EUTELSAT 33A +1 27948U 03043A 17197.80827163 .00000146 00000-0 00000-0 0 9991 +2 27948 2.4283 78.2361 0002369 234.1579 304.2372 1.00271107 12811 +GALAXY 13 (HORIZONS-1) +1 27954U 03044A 17197.40254370 .00000044 00000-0 00000-0 0 9996 +2 27954 0.0095 42.9951 0001419 76.9952 192.3295 1.00269320 50498 +ZHONGXING-20 +1 28082U 03052A 17197.94492280 -.00000332 00000-0 00000-0 0 9992 +2 28082 3.5614 71.1807 0001877 76.9971 230.2048 1.00274369 50092 +YAMAL 202 +1 28089U 03053A 17197.93104884 .00000115 00000-0 00000-0 0 9997 +2 28089 0.0442 95.3562 0002798 0.2292 223.5383 1.00269466 50016 +EXPRESS-AM22 (SESAT 2) +1 28134U 03060A 17197.82615354 -.00000142 00000-0 00000-0 0 9994 +2 28134 0.5105 91.5301 0000448 136.8556 83.9684 1.00271228 49600 +AMC-10 (GE-10) +1 28154U 04003A 17197.58934793 .00000084 00000-0 00000-0 0 9992 +2 28154 0.0466 278.6458 0002767 185.1727 267.9500 1.00273061 49249 +ABS-4 (MOBISAT-1) +1 28184U 04007A 17196.33729913 .00000038 00000-0 00000-0 0 9996 +2 28184 0.0256 70.7623 0001726 47.2648 357.7339 1.00272044 19669 +EUTELSAT 7A +1 28187U 04008A 17197.87198733 .00000043 00000-0 00000-0 0 9996 +2 28187 0.0626 0.3494 0004768 135.5474 119.9045 1.00272715 48721 +DIRECTV 7S +1 28238U 04016A 17197.57962573 -.00000003 00000-0 00000-0 0 9997 +2 28238 0.0189 341.7420 0003024 142.9729 259.4764 1.00271744 48406 +AMC-11 (GE-11) +1 28252U 04017A 17197.58452053 .00000065 00000-0 00000-0 0 9999 +2 28252 0.0456 298.4443 0002516 174.3457 261.2359 1.00273007 48049 +INTELSAT 10-02 +1 28358U 04022A 17196.86087778 -.00000015 00000-0 00000-0 0 9996 +2 28358 0.0116 114.2113 0000105 350.7101 137.8970 1.00272156 47978 +APSTAR 5 (TELSTAR 18) +1 28364U 04024A 17197.84351736 -.00000299 00000-0 00000-0 0 9996 +2 28364 0.0143 310.6723 0002798 158.2459 267.5877 1.00271077 47957 +ANIK F2 +1 28378U 04027A 17197.47823757 -.00000054 00000-0 00000-0 0 9999 +2 28378 0.0226 50.8143 0000366 162.1211 142.6466 1.00270459 8623 +AMAZONAS 1 +1 28393U 04031A 17197.61782024 -.00000233 00000-0 00000-0 0 9997 +2 28393 1.8122 83.6466 0012463 20.1492 208.1984 0.98457372 47400 +AMC-15 +1 28446U 04041A 17197.57479852 -.00000093 00000-0 00000-0 0 9998 +2 28446 0.0202 346.4741 0002251 138.6165 271.3633 1.00270359 46720 +AMC-16 +1 28472U 04048A 17197.73382674 -.00000211 00000-0 00000-0 0 9999 +2 28472 0.0279 320.7511 0002700 155.9547 357.2207 1.00274672 46103 +NSS-10 (AMC-12) +1 28526U 05003A 17197.75671028 -.00000255 00000-0 00000-0 0 9995 +2 28526 0.0425 296.5499 0002899 192.3396 40.8459 1.00272655 20528 +XTAR-EUR +1 28542U 05005A 17197.10253226 .00000147 00000-0 00000-0 0 9999 +2 28542 0.0186 49.2488 0002533 62.3016 248.4747 1.00271068 45543 +XM-3 (RHYTHM) +1 28626U 05008A 17197.73382674 -.00000210 00000-0 00000-0 0 9996 +2 28626 0.0223 221.8676 0000176 35.5285 216.4124 1.00269866 45408 +INMARSAT 4-F1 +1 28628U 05009A 17197.81742045 -.00000267 00000-0 00000-0 0 9992 +2 28628 2.8793 12.3851 0002802 110.3032 249.9116 1.00270916 45017 +APSTAR 6 +1 28638U 05012A 17197.84820684 -.00000323 00000-0 00000-0 0 9999 +2 28638 0.0161 76.0395 0002491 56.0966 242.0940 1.00273529 69752 +SPACEWAY 1 +1 28644U 05015A 17197.56990372 -.00000106 00000-0 00000-0 0 9999 +2 28644 0.0114 212.6594 0000268 328.5770 215.5991 1.00269501 13920 +DIRECTV 8 +1 28659U 05019A 17197.46223383 -.00000119 00000-0 00000-0 0 9993 +2 28659 0.0037 7.5387 0003120 115.1445 237.3449 1.00271808 44523 +GALAXY 28 (G-28) +1 28702U 05022A 17197.73382674 -.00000189 00000-0 00000-0 0 9992 +2 28702 0.0193 37.9763 0000972 347.2977 84.6541 1.00269161 19459 +EXPRESS-AM3 +1 28707U 05023A 17197.44816957 -.00000326 00000-0 00000-0 0 9995 +2 28707 0.0478 217.8088 0000257 107.4526 233.5255 1.00270070 44187 +THAICOM 4 +1 28786U 05028A 17196.72201179 -.00000366 00000-0 00000-0 0 9995 +2 28786 0.0133 45.9288 0002245 73.1615 194.0721 1.00271241 19600 +GALAXY 14 (G-14) +1 28790U 05030A 17197.58452053 .00000032 00000-0 00000-0 0 9996 +2 28790 0.0377 257.1272 0002388 222.6386 260.2703 1.00273395 43659 +ANIK F1R +1 28868U 05036A 17197.57479852 -.00000078 00000-0 00000-0 0 9994 +2 28868 0.0500 288.7548 0002543 151.4563 314.0066 1.00271195 13842 +GALAXY 15 (G-15) +1 28884U 05041A 17197.58452053 .00000075 00000-0 00000-0 0 9999 +2 28884 0.0419 72.6122 0001162 62.6115 236.7713 1.00273223 43081 +SYRACUSE 3A +1 28885U 05041B 17197.90462373 .00000124 00000-0 00000-0 0 9997 +2 28885 0.0407 77.7507 0002740 54.4981 175.2858 1.00272491 43099 +INMARSAT 4-F2 +1 28899U 05044A 17197.04047633 .00000007 00000-0 00000-0 0 9998 +2 28899 2.5765 12.2763 0002704 117.5973 242.6484 1.00271323 42858 +TELKOM 2 +1 28902U 05046A 17197.74316799 -.00000143 00000-0 00000-0 0 9996 +2 28902 0.0063 83.2163 0001897 20.8507 255.2394 1.00271909 42771 +SPACEWAY 2 +1 28903U 05046B 17197.73869182 -.00000131 00000-0 00000-0 0 9992 +2 28903 0.0363 199.8975 0000194 312.8989 308.8060 1.00272373 42835 +INSAT-4A +1 28911U 05049A 17194.95821664 -.00000171 00000-0 00000-0 0 9992 +2 28911 0.0121 71.9436 0001463 123.4207 164.6288 1.00282895 42400 +METEOSAT-9 (MSG-2) +1 28912U 05049B 17197.78819910 .00000057 00000-0 00000-0 0 9990 +2 28912 2.2580 71.1945 0000286 117.3540 39.4050 1.00277075 42371 +EUTELSAT 172A (GE-23) +1 28924U 05052A 17197.60809846 -.00000011 00000-0 00000-0 0 9996 +2 28924 0.0622 9.6348 0005720 105.5087 210.3879 1.00270986 19684 +ECHOSTAR 10 +1 28935U 06003A 17197.57479852 -.00000060 00000-0 00000-0 0 9995 +2 28935 0.0160 55.8832 0001333 81.1301 254.3012 1.00272080 41812 +HIMAWARI-7 (MTSAT-2) +1 28937U 06004A 17197.88484734 -.00000248 00000-0 00000-0 0 9995 +2 28937 0.0472 245.2746 0004040 239.8426 273.3155 1.00270256 41695 +SPAINSAT +1 28945U 06007A 17197.26588473 -.00000220 00000-0 00000-0 0 9994 +2 28945 0.0583 245.3375 0003601 254.1763 220.5109 1.00272238 41563 +EUTELSAT HOT BIRD 13E +1 28946U 06007B 17197.14687954 .00000083 00000-0 00000-0 0 9992 +2 28946 0.0493 113.8206 0006277 32.1192 214.0987 1.00272976 41637 +JCSAT-5A +1 29045U 06010A 17197.84838045 -.00000333 00000-0 00000-0 0 9992 +2 29045 0.0112 333.8302 0001788 136.5105 261.9796 1.00271602 41119 +ASTRA 1KR +1 29055U 06012A 17197.86716012 .00000115 00000-0 00000-0 0 9993 +2 29055 0.0779 272.3639 0002593 262.8768 91.0184 1.00269149 13050 +GOES 13 +1 29155U 06018A 17197.38942444 -.00000255 00000-0 00000-0 0 9993 +2 29155 0.1107 268.8156 0003999 196.7788 254.4477 1.00274078 10727 +EUTELSAT 113 WEST A +1 29162U 06020A 17197.49591866 -.00000041 00000-0 00000-0 0 9997 +2 29162 0.0355 117.1366 0002754 357.7185 245.1713 1.00272235 40801 +THAICOM 5 +1 29163U 06020B 17197.83727546 -.00000126 00000-0 00000-0 0 9996 +2 29163 0.0368 241.7650 0002288 269.0826 163.9241 1.00271864 40838 +GALAXY 16 (G-16) +1 29236U 06023A 17197.56990372 -.00000131 00000-0 00000-0 0 9995 +2 29236 0.0187 69.5650 0002615 52.4210 278.7382 1.00270049 40564 +EUTELSAT HOT BIRD 13B +1 29270U 06032A 17197.87198733 .00000082 00000-0 00000-0 0 9992 +2 29270 0.0781 45.4007 0002831 45.6233 170.7832 1.00273444 14665 +JCSAT-3A +1 29272U 06033A 17197.84838045 -.00000350 00000-0 00000-0 0 9998 +2 29272 0.0333 279.6813 0002187 202.3114 246.2944 1.00271767 15075 +SYRACUSE 3B +1 29273U 06033B 17197.87688212 -.00000049 00000-0 00000-0 0 9996 +2 29273 0.0266 84.7615 0003388 17.0177 143.5717 1.00271336 40055 +KOREASAT 5 (MUGUNGWHA 5) +1 29349U 06034A 17197.81160424 -.00000363 00000-0 00000-0 0 9994 +2 29349 0.0180 60.9907 0001839 95.7986 183.2668 1.00272512 39976 +ZHONGXING-22A +1 29398U 06038A 17197.21018332 -.00000326 00000-0 00000-0 0 9995 +2 29398 5.8379 57.5968 0003405 136.1061 277.9297 1.00269520 39746 +DIRECTV 9S +1 29494U 06043A 17197.73869182 -.00000118 00000-0 00000-0 0 9991 +2 29494 0.0161 70.1545 0003173 51.5644 337.8606 1.00269319 39443 +OPTUS D1 +1 29495U 06043B 17197.81159323 -.00000116 00000-0 00000-0 0 9998 +2 29495 0.0502 264.6927 0003506 215.6862 266.6072 1.00272027 39482 +XM-4 (BLUES) +1 29520U 06049A 17197.78035369 -.00000027 00000-0 00000-0 0 9993 +2 29520 0.0063 273.3074 0000349 300.7256 246.3723 1.00271879 18825 +BADR-4 +1 29526U 06051A 17197.81434896 .00000139 00000-0 00000-0 0 9997 +2 29526 0.0520 331.7570 0001704 102.8206 179.4013 1.00269757 39228 +FENGYUN 2D +1 29640U 06053A 17197.71727693 -.00000367 00000-0 10000-3 0 9993 +2 29640 4.5055 64.2797 0005325 319.0315 293.1098 1.00282519 38892 +WILDBLUE-1 +1 29643U 06054A 17197.57479852 -.00000053 00000-0 00000-0 0 9990 +2 29643 0.0428 236.4535 0001314 254.1658 259.7216 1.00271326 21139 +AMC-18 +1 29644U 06054B 17197.57479852 -.00000093 00000-0 00000-0 0 9995 +2 29644 0.0353 285.4365 0002571 187.0579 284.0770 1.00271323 38922 +MEASAT-3 +1 29648U 06056A 17197.94982556 -.00000246 00000-0 00000-0 0 9992 +2 29648 0.0568 222.7424 0001905 307.0270 198.6260 1.00270292 17808 +INSAT-4B +1 30793U 07007A 17197.86299234 -.00000263 00000-0 00000-0 0 9996 +2 30793 0.0328 94.6029 0007543 4.9878 239.4450 1.00271555 37892 +SKYNET 5A +1 30794U 07007B 17197.86299234 -.00000276 00000-0 00000-0 0 9991 +2 30794 0.0644 8.6864 0003504 111.5040 220.5574 1.00272616 38039 +ANIK F3 +1 31102U 07009A 17197.57962573 -.00000005 00000-0 00000-0 0 9998 +2 31102 0.0136 62.0338 0002028 51.2715 271.2362 1.00271220 13893 +ASTRA 1L +1 31306U 07016A 17197.81924355 .00000115 00000-0 00000-0 0 9996 +2 31306 0.0874 296.7733 0000674 149.5266 162.6590 1.00269694 12415 +GALAXY 17 (G-17) +1 31307U 07016B 17197.63868792 -.00000179 00000-0 00000-0 0 9990 +2 31307 0.0166 10.0817 0003323 108.7228 314.7812 1.00273230 37414 +ZHONGXING-6B +1 31800U 07031A 17197.94509521 -.00000367 00000-0 00000-0 0 9990 +2 31800 0.0107 75.5411 0002269 51.1090 264.0806 1.00268783 36774 +DIRECTV 10 +1 31862U 07032A 17197.46765539 -.00000107 00000-0 00000-0 0 9991 +2 31862 0.0139 274.9642 0000347 278.6726 166.3623 1.00270092 12978 +SPACEWAY 3 +1 32018U 07036A 17197.73869182 -.00000156 00000-0 00000-0 0 9992 +2 32018 0.0088 210.1715 0000110 39.5285 216.0304 1.00270709 36464 +BSAT-3A +1 32019U 07036B 17197.87571799 -.00000355 00000-0 00000-0 0 9993 +2 32019 0.0196 171.9822 0002973 9.6488 178.3681 1.00270881 17839 +INSAT-4CR +1 32050U 07037A 17197.80872139 .00000120 00000-0 00000-0 0 9993 +2 32050 0.0246 101.9939 0002692 13.6209 158.1806 1.00270713 18735 +OPTUS D2 +1 32252U 07044A 17197.79215803 -.00000188 00000-0 00000-0 0 9997 +2 32252 0.0447 259.1753 0003720 218.0305 254.7836 1.00272301 35913 +INTELSAT 11 (IS-11) +1 32253U 07044B 17197.76157035 -.00000273 00000-0 00000-0 0 9992 +2 32253 0.0444 231.0451 0001775 263.5933 31.3169 1.00271540 35861 +STAR ONE C1 +1 32293U 07056A 17197.36288782 -.00000281 00000-0 00000-0 0 9998 +2 32293 0.0215 91.8718 0002649 33.8845 234.2663 1.00272871 19111 +SKYNET 5B +1 32294U 07056B 17197.86716012 .00000137 00000-0 00000-0 0 9995 +2 32294 0.0667 2.7524 0003696 113.3079 156.0955 1.00269314 35554 +ASTRA 4A (SIRIUS 4) +1 32299U 07057A 17197.87198733 .00000028 00000-0 00000-0 0 9995 +2 32299 0.0499 289.1754 0002678 179.4841 144.9654 1.00273484 19048 +HORIZONS-2 +1 32388U 07063B 17197.83995161 -.00000187 00000-0 00000-0 0 9994 +2 32388 0.0105 38.2532 0002978 80.9387 202.8868 1.00271727 35195 +THURAYA-3 +1 32404U 08001A 17197.86299234 -.00000304 00000-0 00000-0 0 9998 +2 32404 4.0430 354.0518 0004514 119.3620 230.6519 1.00271250 34852 +EXPRESS-AM33 +1 32478U 08003A 17197.01087701 -.00000285 00000-0 00000-0 0 9990 +2 32478 0.0381 234.0092 0000226 19.0823 141.3635 1.00272681 34941 +THOR 5 +1 32487U 08006A 17197.85407859 -.00000014 00000-0 00000-0 0 9995 +2 32487 0.0464 240.8068 0002221 235.3015 125.4762 1.00272186 34511 +KIZUNA (WINDS) +1 32500U 08007A 17197.84351736 -.00000264 00000-0 00000-0 0 9990 +2 32500 0.8950 90.2322 0002636 28.4756 262.8041 1.00272267 34378 +AMC-14 +1 32708U 08011A 17197.81924355 .00000082 00000-0 00000-0 0 9992 +2 32708 19.1699 62.3976 0039794 1.5941 183.7087 1.00274855 35433 +DIRECTV 11 +1 32729U 08013A 17197.73869182 -.00000130 00000-0 00000-0 0 9999 +2 32729 0.0122 202.1689 0000381 341.6956 277.6327 1.00270330 12951 +ICO G1 +1 32763U 08016A 17197.46851485 -.00000173 00000-0 00000-0 0 9994 +2 32763 3.8254 355.3623 0002558 120.7020 254.2355 1.00271226 33928 +VINASAT-1 +1 32767U 08018A 17197.81454575 -.00000333 00000-0 00000-0 0 9996 +2 32767 0.0093 358.5952 0001593 138.0351 223.3800 1.00271001 33944 +STAR ONE C2 +1 32768U 08018B 17197.37678680 -.00000268 00000-0 00000-0 0 9990 +2 32768 0.0126 223.1235 0002522 292.1051 204.7836 1.00266836 33880 +TIANLIAN 1-01 +1 32779U 08019A 17197.83451550 -.00000144 00000-0 10000-3 0 9996 +2 32779 2.8568 76.0383 0031178 231.4053 7.8363 1.00269931 33806 +AMOS-3 +1 32794U 08022A 17197.87688212 -.00000040 00000-0 00000-0 0 9999 +2 32794 0.0101 296.0636 0001113 187.7214 122.6889 1.00272782 49713 +GALAXY 18 (G-18) +1 32951U 08024A 17197.52359789 .00000021 00000-0 00000-0 0 9990 +2 32951 0.0419 240.7865 0003240 248.6873 230.5528 1.00272211 33428 +CHINASAT 9 (ZX 9) +1 33051U 08028A 17197.94982554 -.00000253 00000-0 00000-0 0 9992 +2 33051 0.0142 306.6509 0003910 176.1675 246.2879 1.00272644 33354 +SKYNET 5C +1 33055U 08030A 17197.85340934 -.00000144 00000-0 00000-0 0 9998 +2 33055 0.0600 11.1705 0003255 114.2117 98.9068 1.00270162 33309 +TURKSAT 3A +1 33056U 08030B 17197.90531278 .00000141 00000-0 00000-0 0 9994 +2 33056 0.0547 86.2488 0005313 30.1122 186.4574 1.00273281 19696 +INTELSAT 25 (IS-25) +1 33153U 08034A 17197.27009168 -.00000228 00000-0 00000-0 0 9991 +2 33153 0.0180 71.7783 0002409 28.0085 260.2383 1.00270859 33087 +BADR-6 +1 33154U 08034B 17197.86716012 .00000140 00000-0 00000-0 0 9992 +2 33154 0.0648 50.0090 0004967 38.8880 184.1558 1.00273040 33095 +ECHOSTAR 11 +1 33207U 08035A 17197.48752479 -.00000060 00000-0 00000-0 0 9999 +2 33207 0.0179 31.8452 0002691 87.6582 240.5235 1.00269190 32993 +SUPERBIRD-C2 +1 33274U 08038A 17197.88484734 -.00000256 00000-0 00000-0 0 9993 +2 33274 0.0174 40.4202 0001806 110.9843 245.9858 1.00270353 32722 +AMC-21 +1 33275U 08038B 17197.58452053 .00000032 00000-0 00000-0 0 9991 +2 33275 0.0183 350.0990 0002496 142.8390 247.1826 1.00271942 32807 +INMARSAT 4-F3 +1 33278U 08039A 17197.52827116 -.00000144 00000-0 00000-0 0 9990 +2 33278 3.0229 1.7372 0002752 114.2914 270.7097 1.00272410 13923 +NIMIQ 4 +1 33373U 08044A 17197.72896483 -.00000225 00000-0 00000-0 0 9997 +2 33373 0.0146 62.6219 0002293 42.7788 9.7613 1.00271757 32315 +GALAXY 19 (G-19) +1 33376U 08045A 17197.45156601 -.00000143 00000-0 00000-0 0 9991 +2 33376 0.0184 97.2307 0003293 33.7568 229.0389 1.00271254 32284 +VENESAT-1 +1 33414U 08055A 17197.63361951 -.00000242 00000-0 00000-0 0 9991 +2 33414 0.0338 123.5577 0001694 24.8292 296.3387 1.00273547 31885 +ASTRA 1M +1 33436U 08057A 17197.86716012 .00000115 00000-0 00000-0 0 9992 +2 33436 0.0324 91.6410 0005034 35.7108 138.8818 1.00272494 13085 +CIEL-2 +1 33453U 08063A 17197.58452053 .00000054 00000-0 00000-0 0 9991 +2 33453 0.0437 278.2813 0002763 208.0066 249.8870 1.00271970 31497 +EUTELSAT HOT BIRD 13C +1 33459U 08065A 17197.14695986 .00000083 00000-0 00000-0 0 9997 +2 33459 0.0777 66.2020 0005638 44.7233 249.1331 1.00272879 14710 +EUTELSAT 48D +1 33460U 08065B 17197.90218444 .00000119 00000-0 00000-0 0 9993 +2 33460 0.0439 17.2340 0001471 109.9302 180.5896 1.00271451 31369 +FENGYUN 2E +1 33463U 08066A 17197.94201469 -.00000209 00000-0 00000-0 0 9991 +2 33463 2.2381 67.2722 0004366 212.7527 80.7933 1.00272159 31425 +EXPRESS-AM44 +1 33595U 09007A 17197.75074213 -.00000093 00000-0 00000-0 0 9998 +2 33595 0.0280 222.1096 0000780 261.9916 69.9381 1.00272214 30893 +NSS-9 +1 33749U 09008A 17197.68246383 .00000067 00000-0 00000-0 0 9991 +2 33749 0.0361 309.7685 0002000 167.0047 246.6785 1.00270580 30906 +EUTELSAT 33E +1 33750U 09008B 17197.81434896 .00000151 00000-0 00000-0 0 9990 +2 33750 0.0439 313.6594 0004351 204.2695 103.1424 1.00270798 30932 +TELSTAR 11N +1 34111U 09009A 17197.75671028 -.00000255 00000-0 00000-0 0 9992 +2 34111 0.0214 46.0069 0002256 62.8108 60.8310 1.00269091 30755 +EUTELSAT 10A +1 34710U 09016A 17197.87198733 .00000063 00000-0 00000-0 0 9991 +2 34710 0.0617 9.4947 0004995 105.5512 143.7288 1.00271121 8590 +SES-7 (PROTOSTAR 2) +1 34941U 09027A 17197.95014576 -.00000350 00000-0 00000-0 0 9990 +2 34941 0.0209 59.5008 0001115 183.5017 142.2694 1.00272941 29975 +MEASAT-3A +1 35362U 09032A 17197.92659934 -.00000247 00000-0 00000-0 0 9999 +2 35362 0.0370 169.5350 0003499 315.4053 235.0902 1.00272428 29576 +GOES 14 +1 35491U 09033A 17197.47229959 -.00000096 00000-0 00000-0 0 9995 +2 35491 0.3220 100.5461 0005823 114.1784 145.2350 1.00269096 29501 +SIRIUS FM-5 +1 35493U 09034A 17197.63379313 -.00000204 00000-0 00000-0 0 9997 +2 35493 0.0091 344.5427 0001063 24.1238 68.0062 1.00271294 14075 +TERRESTAR-1 +1 35496U 09035A 17197.44966326 -.00000058 00000-0 00000-0 0 9993 +2 35496 2.8704 345.0194 0003028 132.5001 227.8209 1.00272354 29499 +ASIASAT 5 +1 35696U 09042A 17197.95250682 -.00000313 00000-0 00000-0 0 9994 +2 35696 0.0419 247.8053 0001605 213.5281 277.0250 1.00274208 29017 +JCSAT-RA (JCSAT-12) +1 35755U 09044A 17196.82839000 -.00000349 00000-0 00000-0 0 9993 +2 35755 0.0481 52.4370 0000913 43.8827 263.6887 1.00272450 28995 +OPTUS D3 +1 35756U 09044B 17197.29312023 -.00000151 00000-0 00000-0 0 9998 +2 35756 0.0250 14.3761 0002918 90.7858 90.6913 1.00271837 28900 +PALAPA D +1 35812U 09046A 17196.86987973 -.00000362 00000-0 00000-0 0 9991 +2 35812 0.0305 81.9854 0001803 54.4996 223.5273 1.00271583 29016 +NIMIQ 5 +1 35873U 09050A 17197.62893302 -.00000261 00000-0 00000-0 0 9998 +2 35873 0.0149 343.0233 0002127 138.6203 326.7147 1.00272212 28709 +AMAZONAS 2 +1 35942U 09054A 17197.47118299 -.00000287 00000-0 00000-0 0 9995 +2 35942 0.0352 181.2978 0005067 313.1899 268.6319 1.00273167 28522 +COMSATBW-1 +1 35943U 09054B 17197.79979837 .00000020 00000-0 00000-0 0 9998 +2 35943 0.0431 73.6183 0001909 38.9581 173.1793 1.00269950 28648 +NSS-12 +1 36032U 09058A 17197.02496802 .00000067 00000-0 00000-0 0 9995 +2 36032 0.0492 296.4637 0002600 178.2635 245.2979 1.00271385 28272 +THOR 6 +1 36033U 09058B 17197.85407859 -.00000015 00000-0 00000-0 0 9995 +2 36033 0.0240 148.2731 0001992 353.5320 99.6768 1.00271871 28373 +INTELSAT 14 (IS-14) +1 36097U 09064A 17197.30747547 -.00000278 00000-0 00000-0 0 9994 +2 36097 0.0218 40.8533 0002402 78.5720 240.5987 1.00269894 28046 +EUTELSAT 36B +1 36101U 09065A 17197.80840884 .00000150 00000-0 00000-0 0 9992 +2 36101 0.0619 9.1075 0003963 108.5111 144.1256 1.00270187 28064 +INTELSAT 15 (IS-15) +1 36106U 09067A 17197.83995161 -.00000190 00000-0 00000-0 0 9996 +2 36106 0.0079 31.5228 0002183 86.8175 204.0399 1.00272069 8646 +DIRECTV 12 +1 36131U 09075A 17197.25327059 -.00000107 00000-0 00000-0 0 9992 +2 36131 0.0115 207.7916 0000134 353.8106 81.0548 1.00269485 13936 +BEIDOU G1 +1 36287U 10001A 17197.81697791 -.00000289 00000-0 00000-0 0 9991 +2 36287 1.4796 1.8366 0003681 164.9650 202.1882 1.00269025 27511 +RADUGA-1M 2 +1 36358U 10002A 17197.83991573 -.00000189 00000-0 00000-0 0 9997 +2 36358 0.0396 240.0093 0002396 265.9953 176.2133 1.00271256 17445 +SDO +1 36395U 10005A 17197.34979910 -.00000059 00000-0 00000-0 0 9994 +2 36395 28.7960 139.9115 0000780 83.6939 94.8424 1.00269939 27360 +INTELSAT 16 (IS-16) +1 36397U 10006A 17197.71438184 -.00000289 00000-0 00000-0 0 9996 +2 36397 0.0141 74.3262 0001595 45.3048 14.1858 1.00272514 27215 +GOES 15 +1 36411U 10008A 17197.55737181 .00000084 00000-0 00000-0 0 9998 +2 36411 0.2552 101.1263 0002936 74.1887 184.6854 1.00278371 27015 +ECHOSTAR 14 +1 36499U 10010A 17197.35465847 -.00000004 00000-0 00000-0 0 9995 +2 36499 0.0175 37.4819 0002560 75.5841 190.0913 1.00270582 26861 +SES-1 +1 36516U 10016A 17197.63868792 -.00000119 00000-0 00000-0 0 9995 +2 36516 0.0477 289.9395 0002476 179.6412 313.9962 1.00272469 26388 +ASTRA 3B +1 36581U 10021A 17197.86716012 .00000132 00000-0 00000-0 0 9999 +2 36581 0.0487 320.1534 0002983 161.2926 149.0772 1.00272436 26217 +COMSATBW-2 +1 36582U 10021B 17197.87198733 .00000084 00000-0 00000-0 0 9991 +2 36582 0.0120 220.6361 0001905 277.7455 123.6077 1.00273748 26311 +BEIDOU G3 +1 36590U 10024A 17197.44433774 -.00000360 00000-0 00000-0 0 9991 +2 36590 1.3619 23.9404 0005670 317.5479 223.4387 1.00276512 26114 +BADR-5 +1 36592U 10025A 17197.80814966 .00000140 00000-0 00000-0 0 9995 +2 36592 0.0193 118.0807 0004043 23.5180 110.1231 1.00272086 20552 +COMS 1 +1 36744U 10032A 17197.84838045 -.00000349 00000-0 00000-0 0 9992 +2 36744 0.0117 61.8878 0000807 72.2418 234.3620 1.00271987 18422 +ARABSAT-5A +1 36745U 10032B 17197.81434896 .00000148 00000-0 00000-0 0 9992 +2 36745 0.0489 6.9525 0003187 106.6776 144.8493 1.00269560 25983 +ECHOSTAR 15 +1 36792U 10034A 17197.76643316 -.00000286 00000-0 00000-0 0 9993 +2 36792 0.0260 314.0977 0001924 150.5810 44.3685 1.00273881 25719 +NILESAT 201 +1 36830U 10037A 17197.87688212 -.00000063 00000-0 00000-0 0 9998 +2 36830 0.0460 206.3259 0005962 261.6447 135.5928 1.00271330 25705 +RASCOM-QAF 1R +1 36831U 10037B 17197.17474031 .00000014 00000-0 00000-0 0 9999 +2 36831 0.0251 52.0223 0003977 60.3306 247.6892 1.00269732 25644 +CHINASAT 6A (ZX 6A) +1 37150U 10042A 17197.95198072 -.00000359 00000-0 00000-0 0 9997 +2 37150 0.0449 122.2489 0000355 344.2457 296.2418 1.00269836 25245 +QZS-1 (MICHIBIKI) +1 37158U 10045A 17197.69762168 -.00000113 00000-0 00000-0 0 9990 +2 37158 40.8628 158.8980 0753913 270.4362 254.1466 1.00270300 25081 +XM-5 +1 37185U 10053A 17197.29460421 -.00000209 00000-0 00000-0 0 9998 +2 37185 0.0233 49.7879 0001931 300.4746 324.9097 1.00269721 24778 +BSAT-3B +1 37207U 10056B 17197.95179772 -.00000356 00000-0 00000-0 0 9998 +2 37207 0.0515 322.1643 0000725 27.6445 37.6607 1.00271655 19595 +BEIDOU G4 +1 37210U 10057A 17197.81159323 -.00000117 00000-0 00000-0 0 9993 +2 37210 0.7628 45.8711 0004397 163.0652 178.1099 1.00271612 24629 +SKYTERRA 1 +1 37218U 10061A 17197.38383457 -.00000119 00000-0 00000-0 0 9997 +2 37218 3.1855 330.9796 0005462 183.0887 177.2074 1.00271700 24567 +ZHONGXING-20A +1 37234U 10064A 17197.84838045 -.00000343 00000-0 00000-0 0 9996 +2 37234 0.0615 243.5549 0000406 49.3503 77.2870 1.00270483 24371 +HYLAS 1 +1 37237U 10065A 17197.75671028 -.00000238 00000-0 00000-0 0 9999 +2 37237 0.0247 359.9927 0001423 125.4667 48.2258 1.00268364 24322 +INTELSAT 17 (IS-17) +1 37238U 10065B 17197.79979837 -.00000007 00000-0 00000-0 0 9997 +2 37238 0.0050 225.6216 0002452 255.3775 167.7232 1.00272240 20762 +EUTELSAT KA-SAT 9A +1 37258U 10069A 17197.15802963 .00000057 00000-0 00000-0 0 9992 +2 37258 0.0342 287.0087 0003326 210.4001 222.6150 1.00273060 11380 +HISPASAT 1E +1 37264U 10070A 17197.85548213 -.00000221 00000-0 00000-0 0 9997 +2 37264 0.0401 113.3778 0005585 19.0547 80.3996 1.00269698 20523 +KOREASAT 6 +1 37265U 10070B 17197.94509521 -.00000367 00000-0 00000-0 0 9998 +2 37265 0.0216 75.0674 0001670 41.6186 274.5127 1.00271425 24111 +BEIDOU IGSO 3 +1 37384U 11013A 17197.87216659 -.00000202 00000-0 10000-3 0 9999 +2 37384 57.8583 72.6249 0026514 206.8252 87.4712 1.00253082 23012 +INTELSAT NEW DAWN +1 37392U 11016A 17197.81434896 .00000151 00000-0 00000-0 0 9998 +2 37392 0.0424 231.4903 0000492 195.7580 193.5424 1.00274183 20633 +YAHSAT 1A +1 37393U 11016B 17197.90126948 .00000096 00000-0 00000-0 0 9993 +2 37393 0.0164 34.3048 0001927 89.8163 187.7461 1.00273194 9745 +TELSTAR 14R +1 37602U 11021A 17197.34698800 -.00000284 00000-0 00000-0 0 9991 +2 37602 0.0176 43.7000 0000555 42.2711 270.3096 1.00270491 23129 +GSAT-8 +1 37605U 11022A 17197.89958747 .00000080 00000-0 00000-0 0 9997 +2 37605 0.0423 100.8683 0002967 168.1443 44.8058 1.00272990 20550 +ST-2 +1 37606U 11022B 17197.86299234 -.00000216 00000-0 00000-0 0 9996 +2 37606 0.0174 90.4067 0001059 37.9791 205.1734 1.00270281 22606 +CHINASAT 10 (ZX 10) +1 37677U 11026A 17197.95179772 -.00000357 00000-0 00000-0 0 9998 +2 37677 0.0430 259.7468 0004404 255.6403 232.7495 1.00270219 22319 +TIANLIAN 1-02 +1 37737U 11032A 17197.74323303 .00000022 00000-0 00000-0 0 9998 +2 37737 2.6478 77.4298 0003614 172.4899 129.2020 1.00268684 22057 +GSAT-12 +1 37746U 11034A 17196.99552814 -.00000168 00000-0 00000-0 0 9999 +2 37746 0.0135 50.0239 0007478 49.1071 276.2747 1.00268143 10815 +SES-3 +1 37748U 11035A 17197.56990372 -.00000106 00000-0 00000-0 0 9993 +2 37748 0.0137 347.7709 0002105 127.1792 281.8006 1.00271160 22036 +KAZSAT-2 +1 37749U 11035B 17197.94763171 -.00000202 00000-0 00000-0 0 9998 +2 37749 0.0376 148.6699 0001922 22.7159 191.2001 1.00269817 20731 +ASTRA 1N +1 37775U 11041A 17197.86716012 .00000115 00000-0 00000-0 0 9999 +2 37775 0.0512 37.0857 0004389 47.8220 181.3273 1.00272665 11877 +BSAT-3C (JCSAT-110R) +1 37776U 11041B 17197.96430066 -.00000356 00000-0 00000-0 0 9991 +2 37776 0.0172 6.2076 0000406 237.0924 148.7958 1.00271532 17832 +PAKSAT-1R +1 37779U 11042A 17197.80846220 .00000149 00000-0 00000-0 0 9990 +2 37779 0.0367 160.8944 0002848 307.5029 155.4968 1.00271999 21819 +CHINASAT 1A (ZX 1A) +1 37804U 11047A 17197.44849116 -.00000341 00000-0 00000-0 0 9996 +2 37804 0.0494 129.2503 0000670 20.6050 76.1103 1.00273271 21418 +COSMOS 2473 +1 37806U 11048A 17197.22025677 -.00000112 00000-0 00000-0 0 9999 +2 37806 0.0556 102.9948 0003126 29.8856 227.1439 1.00273100 21370 +SES-2 +1 37809U 11049A 17197.63379313 -.00000200 00000-0 00000-0 0 9995 +2 37809 0.0153 341.2730 0002276 123.8564 330.6931 1.00271706 21354 +ARABSAT-5C +1 37810U 11049B 17197.86716012 .00000118 00000-0 00000-0 0 9990 +2 37810 0.0617 24.5592 0002948 79.1388 163.3472 1.00273699 21243 +EUTELSAT 7 WEST A +1 37816U 11051A 17197.20307022 -.00000064 00000-0 00000-0 0 9995 +2 37816 0.0632 36.2079 0004167 107.1290 216.6898 1.00271851 21247 +QUETZSAT 1 +1 37826U 11054A 17197.72896483 -.00000246 00000-0 00000-0 0 9992 +2 37826 0.0141 14.5225 0002792 106.9098 358.7344 1.00270670 21433 +INTELSAT 18 (IS-18) +1 37834U 11056A 17197.60809846 .00000048 00000-0 00000-0 0 9996 +2 37834 0.0180 47.3279 0001828 72.6581 213.5576 1.00271907 21184 +EUTELSAT 16A +1 37836U 11057A 17197.86716012 .00000099 00000-0 00000-0 0 9995 +2 37836 0.0646 26.1068 0004333 89.7799 147.1553 1.00273503 13337 +VIASAT-1 +1 37843U 11059A 17197.48261155 -.00000028 00000-0 00000-0 0 9999 +2 37843 0.0219 47.1075 0002478 68.1022 237.9335 1.00270195 14667 +ASIASAT 7 +1 37933U 11069A 17197.85810028 -.00000339 00000-0 00000-0 0 9995 +2 37933 0.0312 90.9231 0001165 338.9825 279.3820 1.00270451 12192 +LUCH 5A +1 37951U 11074B 17197.87636775 -.00000049 00000-0 00000-0 0 9996 +2 37951 1.5685 177.9718 0002843 277.4403 321.9928 1.00274635 20527 +NIGCOMSAT 1R +1 38014U 11077A 17196.70007299 .00000140 00000-0 00000-0 0 9995 +2 38014 0.0334 191.3895 0001378 326.3517 70.5521 1.00277977 20350 +FENGYUN 2F +1 38049U 12002A 17197.81160424 -.00000363 00000-0 00000-0 0 9993 +2 38049 1.7724 78.3823 0004135 197.7094 62.5808 1.00284493 20224 +SES-4 +1 38087U 12007A 17197.89212559 -.00000173 00000-0 00000-0 0 9994 +2 38087 0.0151 6.8436 0002177 96.2240 130.9902 1.00271348 19619 +BEIDOU G5 +1 38091U 12008A 17197.80901868 .00000050 00000-0 00000-0 0 9992 +2 38091 2.2643 56.8672 0001991 210.7514 17.1080 1.00271542 19812 +INTELSAT 22 (IS-22) +1 38098U 12011A 17196.98305405 -.00000063 00000-0 00000-0 0 9991 +2 38098 0.0364 36.7795 0001807 82.2695 240.9691 1.00271196 19163 +APSTAR 7 +1 38107U 12013A 17197.58491051 -.00000106 00000-0 00000-0 0 9992 +2 38107 0.0366 89.7940 0001791 23.3851 108.4928 1.00272114 19508 +YAHSAT 1B +1 38245U 12016A 17197.05095830 .00000122 00000-0 00000-0 0 9992 +2 38245 0.0154 22.0512 0001507 83.8731 254.0923 1.00271137 12964 +JCSAT-13 +1 38331U 12023A 17196.83929208 -.00000360 00000-0 00000-0 0 9991 +2 38331 0.0188 316.4656 0002311 185.4848 218.0640 1.00272074 18859 +VINASAT-2 +1 38332U 12023B 17196.09351524 -.00000333 00000-0 00000-0 0 9990 +2 38332 0.0162 324.4674 0001774 154.5928 339.5699 1.00269437 13980 +NIMIQ 6 +1 38342U 12026A 17197.43522107 -.00000178 00000-0 00000-0 0 9997 +2 38342 0.0183 320.2140 0002225 152.4887 247.3187 1.00272997 18932 +CHINASAT 2A (ZX 2A) +1 38352U 12028A 17197.86299234 -.00000298 00000-0 00000-0 0 9992 +2 38352 0.0601 236.9757 0002004 116.3273 350.5119 1.00272732 18713 +INTELSAT 19 (IS-19) +1 38356U 12030A 17197.72021627 -.00000062 00000-0 00000-0 0 9992 +2 38356 0.0368 39.9946 0002926 76.1039 243.9316 1.00270173 18850 +ECHOSTAR 17 +1 38551U 12035A 17196.48224174 -.00000079 00000-0 00000-0 0 9996 +2 38551 0.0181 54.0799 0001930 59.9778 245.9605 1.00271972 18454 +METEOSAT-10 (MSG-3) +1 38552U 12035B 17197.18332983 -.00000010 00000-0 00000-0 0 9998 +2 38552 0.8507 355.9164 0002238 145.8196 218.2801 1.00271775 18222 +SES-5 +1 38652U 12036A 17196.62688197 .00000030 00000-0 00000-0 0 9990 +2 38652 0.0454 244.6375 0002119 229.8501 49.8268 1.00271930 11833 +TIANLIAN 1-03 +1 38730U 12040A 17197.15333264 .00000068 00000-0 00000-0 0 9994 +2 38730 0.2006 266.1221 0004376 226.7975 227.1152 1.00267725 16040 +INTELSAT 20 (IS-20) +1 38740U 12043A 17195.99575337 -.00000028 00000-0 00000-0 0 9994 +2 38740 0.0129 82.5700 0000384 223.5978 53.8264 1.00271693 18094 +HYLAS 2 +1 38741U 12043B 17197.09690673 .00000150 00000-0 00000-0 0 9994 +2 38741 0.0360 271.5384 0002049 208.3528 240.1271 1.00272014 18101 +INTELSAT 21 (IS-21) +1 38749U 12045A 17197.34351251 -.00000289 00000-0 00000-0 0 9992 +2 38749 0.0169 39.6877 0002114 79.8173 240.5161 1.00270259 17971 +ASTRA 2F +1 38778U 12051A 17197.10474599 .00000146 00000-0 00000-0 0 9997 +2 38778 0.0805 241.6393 0002654 298.1671 180.1916 1.00271904 8500 +GSAT-10 +1 38779U 12051B 17192.96382261 -.00000167 00000-0 00000-0 0 9995 +2 38779 0.0633 265.7670 0002680 174.2028 280.0569 1.00271099 17581 +INTELSAT 23 (IS-23) +1 38867U 12057A 17197.32961488 -.00000289 00000-0 00000-0 0 9993 +2 38867 0.0114 332.7219 0001777 149.4550 237.8403 1.00270325 17440 +BEIDOU G6 +1 38953U 12059A 17197.95233036 -.00000182 00000-0 00000-0 0 9993 +2 38953 1.7156 80.1203 0003567 152.3114 129.4420 1.00273048 17388 +LUCH 5B +1 38977U 12061A 17197.78715757 -.00000137 00000-0 00000-0 0 9998 +2 38977 3.6016 74.3508 0002762 3.8369 123.7505 1.00273080 17513 +YAMAL 300K +1 38978U 12061B 17196.53243713 .00000067 00000-0 00000-0 0 9990 +2 38978 0.0500 215.5863 0001386 26.8031 65.7942 1.00270773 17198 +STAR ONE C3 +1 38991U 12062A 17197.22398133 -.00000253 00000-0 00000-0 0 9998 +2 38991 0.0522 80.2170 0001703 53.5810 166.0576 1.00269078 17105 +EUTELSAT 21B +1 38992U 12062B 17197.12304661 .00000126 00000-0 00000-0 0 9999 +2 38992 0.0643 25.3549 0002300 93.5420 241.1243 1.00273363 17192 +ECHOSTAR 16 +1 39008U 12065A 17196.35591043 -.00000285 00000-0 00000-0 0 9994 +2 39008 0.0238 46.6880 0001804 68.5792 244.7514 1.00267938 17132 +CHINASAT 12 (ZX 12) +1 39017U 12067A 17197.82132632 -.00000212 00000-0 00000-0 0 9994 +2 39017 0.0229 85.3774 0002762 33.6094 199.0340 1.00270530 16844 +EUTELSAT 70B +1 39020U 12069A 17196.98757709 -.00000048 00000-0 00000-0 0 9991 +2 39020 0.0691 42.0280 0003517 96.4829 221.5139 1.00272506 16948 +YAMAL 402 +1 39022U 12070A 17197.22970573 .00000082 00000-0 10000-3 0 9990 +2 39022 0.0024 281.0204 0002874 200.4108 310.4074 1.00272251 16935 +SKYNET 5D +1 39034U 12075A 17197.90126948 .00000094 00000-0 00000-0 0 9991 +2 39034 0.0658 9.3512 0003572 109.8887 192.8757 1.00271933 16505 +MEXSAT 3 +1 39035U 12075B 17197.50085369 -.00000029 00000-0 00000-0 0 9998 +2 39035 0.0143 236.8489 0001768 241.1894 241.9796 1.00270210 16818 +TDRS 11 +1 39070U 13004A 17197.56995247 .00000092 00000-0 00000-0 0 9990 +2 39070 5.3552 328.6309 0007286 291.8739 68.2190 1.00265647 14039 +AMAZONAS 3 +1 39078U 13006A 17197.35175080 -.00000286 00000-0 00000-0 0 9998 +2 39078 0.0097 205.2794 0002698 313.6905 201.0412 1.00268498 16304 +AZERSPACE 1 +1 39079U 13006B 17197.05541876 .00000129 00000-0 00000-0 0 9991 +2 39079 0.0191 55.0507 0001497 74.7992 230.1613 1.00271938 16141 +EUTELSAT 117 WEST A +1 39122U 13012A 17197.50644756 -.00000017 00000-0 00000-0 0 9995 +2 39122 0.0292 276.1280 0002641 199.0010 244.8963 1.00272293 15784 +ANIK G1 +1 39127U 13014A 17197.48000615 -.00000078 00000-0 00000-0 0 9996 +2 39127 0.0415 264.4365 0000485 247.9836 207.5803 1.00271743 15590 +CHINASAT 11 (ZX 11) +1 39157U 13020A 17197.86299234 -.00000297 00000-0 00000-0 0 9998 +2 39157 0.0150 122.0220 0001634 178.4559 43.0756 1.00273728 15488 +EUTELSAT 7B +1 39163U 13022A 17197.16339969 .00000044 00000-0 00000-0 0 9999 +2 39163 0.0378 15.3402 0002993 24.6953 319.9845 1.00273139 15325 +SES-6 +1 39172U 13026A 17197.16199809 -.00000265 00000-0 00000-0 0 9996 +2 39172 0.0181 25.1442 0001962 94.7607 192.0899 1.00270351 15062 +IRNSS-1A +1 39199U 13034A 17196.35034573 .00000093 00000-0 00000-0 0 9998 +2 39199 28.8639 114.5509 0017905 185.2014 174.7481 1.00276071 14974 +ALPHASAT +1 39215U 13038A 17197.19450656 .00000133 00000-0 00000-0 0 9993 +2 39215 1.7175 28.8650 0001944 94.7959 265.4065 1.00271034 11382 +INSAT-3D +1 39216U 13038B 17196.95529764 -.00000161 00000-0 00000-0 0 9996 +2 39216 0.0173 330.3607 0000240 160.2796 229.3598 1.00273113 14633 +EUTELSAT 25B +1 39233U 13044A 17197.11222383 .00000139 00000-0 00000-0 0 9992 +2 39233 0.0443 9.2859 0001553 124.6913 226.0336 1.00271066 13971 +GSAT-7 +1 39234U 13044B 17194.98322181 -.00000080 00000-0 00000-0 0 9998 +2 39234 0.0895 271.0707 0001440 315.9953 132.9193 1.00272144 14210 +AMOS-4 +1 39237U 13045A 17197.00281532 .00000004 00000-0 00000-0 0 9997 +2 39237 0.0262 244.2959 0000900 238.2743 237.4364 1.00270856 14226 +ASTRA 2E +1 39285U 13056A 17197.10390332 .00000146 00000-0 00000-0 0 9999 +2 39285 0.0673 331.8248 0002183 143.3106 244.8854 1.00269869 13804 +SIRIUS FM-6 +1 39360U 13058A 17196.50713232 -.00000020 00000-0 00000-0 0 9998 +2 39360 0.0227 36.4600 0000234 228.1687 95.3687 1.00270530 13501 +RADUGA-1M 3 +1 39375U 13062A 17197.82615354 -.00000044 00000-0 00000-0 0 9997 +2 39375 0.0463 111.4458 0001948 0.0615 190.7589 1.00273019 13466 +SES-8 +1 39460U 13071A 17196.91967086 -.00000274 00000-0 00000-0 0 9998 +2 39460 0.0489 262.3354 0002883 207.6570 250.0367 1.00271559 11845 +INMARSAT 5-F1 +1 39476U 13073A 17197.79979837 .00000023 00000-0 00000-0 0 9992 +2 39476 0.0235 52.3134 0000722 185.0461 47.9932 1.00270053 12932 +TKSAT-1 (TUPAC KATARI) +1 39481U 13075A 17197.73382674 -.00000199 00000-0 00000-0 0 9996 +2 39481 0.0428 218.3076 0001647 258.0253 355.4140 1.00271573 13182 +EXPRESS-AM5 +1 39487U 13077A 17197.38182594 -.00000285 00000-0 00000-0 0 9990 +2 39487 0.0603 222.8820 0001014 124.1857 224.8088 1.00270549 13701 +GSAT-14 +1 39498U 14001A 17196.97796449 -.00000081 00000-0 00000-0 0 9998 +2 39498 0.0943 99.3229 0004477 356.1566 264.5696 1.00271486 12773 +THAICOM 6 +1 39500U 14002A 17197.82615354 -.00000126 00000-0 00000-0 0 9993 +2 39500 0.0490 132.3524 0003925 3.4570 174.9511 1.00271054 12786 +TDRS 12 +1 39504U 14004A 17197.23073932 -.00000272 00000-0 00000-0 0 9996 +2 39504 5.9463 336.0616 0000349 86.9771 273.1711 1.00279398 12788 +ABS-2 +1 39508U 14006A 17196.97532201 -.00000090 00000-0 00000-0 0 9999 +2 39508 0.0217 6.2615 0002916 108.1750 245.5920 1.00272016 12646 +ATHENA-FIDUS +1 39509U 14006B 17197.07811858 .00000150 00000-0 00000-0 0 9996 +2 39509 0.0127 66.7350 0001338 63.7266 229.5480 1.00272105 12405 +TURKSAT 4A +1 39522U 14007A 17197.06629522 .00000142 00000-0 00000-0 0 9997 +2 39522 0.0772 270.0764 0002047 279.1580 170.7598 1.00269820 12323 +EXPRESS-AT1 +1 39612U 14010A 17197.13836472 .00000074 00000-0 00000-0 0 9997 +2 39612 0.0444 227.3252 0000474 294.0029 238.6501 1.00273604 12381 +EXPRESS-AT2 +1 39613U 14010B 17197.38182594 -.00000286 00000-0 00000-0 0 9990 +2 39613 0.0367 235.4726 0000394 349.9071 346.3129 1.00270242 12210 +AMAZONAS 4A +1 39616U 14011A 17196.35451522 -.00000286 00000-0 00000-0 0 9990 +2 39616 0.0257 31.2220 0004338 58.0898 270.7359 1.00273316 12196 +ASTRA 5B +1 39617U 14011B 17197.81434896 .00000150 00000-0 00000-0 0 9997 +2 39617 0.0536 312.8632 0004074 173.9754 132.6859 1.00274556 12016 +IRNSS-1B +1 39635U 14017A 17195.85184014 .00000074 00000-0 00000-0 0 9994 +2 39635 29.0358 294.4682 0022874 181.7217 178.3409 1.00272712 11916 +LUCH 5V +1 39727U 14023A 17197.95217390 -.00000271 00000-0 00000-0 0 9990 +2 39727 2.6487 298.8768 0002049 182.4989 251.0978 1.00269433529861 +KAZSAT-3 +1 39728U 14023B 17197.02070582 .00000056 00000-0 00000-0 0 9999 +2 39728 0.0100 44.9098 0001398 131.9985 183.0904 1.00272604 9773 +EUTELSAT 3B +1 39773U 14030A 17197.87688212 .00000015 00000-0 00000-0 0 9990 +2 39773 0.0605 26.8898 0002587 107.6259 119.1451 1.00272148 11419 +ASIASAT 8 +1 40107U 14046A 17197.19363816 -.00000038 00000-0 00000-0 0 9991 +2 40107 0.0407 273.4003 0002076 216.8259 229.7899 1.00271374 69491 +ASIASAT 6 +1 40141U 14052A 17197.15121810 -.00000366 00000-0 00000-0 0 9992 +2 40141 0.0168 75.5618 0000536 44.7832 348.1825 1.00271190 10396 +OPTUS 10 +1 40146U 14054A 17196.72851213 -.00000078 00000-0 00000-0 0 9998 +2 40146 0.0358 83.1618 0001500 31.7157 245.1361 1.00271284 10367 +MEASAT-3B +1 40147U 14054B 17197.92668315 -.00000246 00000-0 00000-0 0 9998 +2 40147 0.0224 23.4808 0001512 52.1891 284.3444 1.00269332 10248 +LUCH (OLYMP) +1 40258U 14058A 17197.87198731 .00000062 00000-0 00000-0 0 9994 +2 40258 0.0272 163.0102 0000311 331.6631 123.9662 1.00271128 10274 +HIMAWARI-8 +1 40267U 14060A 17197.79039133 -.00000281 00000-0 00000-0 0 9992 +2 40267 0.0160 78.0235 0000904 66.1216 215.8586 1.00269890 10098 +IRNSS-1C +1 40269U 14061A 17196.64454233 -.00000164 00000-0 00000-0 0 9990 +2 40269 2.9687 248.4873 0019492 4.7166 355.5101 1.00274476 10013 +INTELSAT 30 (IS-30) +1 40271U 14062A 17197.22198843 -.00000155 00000-0 00000-0 0 9991 +2 40271 0.0189 46.4605 0002313 106.2352 126.4116 1.00272279 10021 +ARSAT 1 +1 40272U 14062B 17197.21712836 -.00000264 00000-0 00000-0 0 9996 +2 40272 0.0355 233.2539 0001126 252.4870 174.8599 1.00272429 9947 +EXPRESS-AM6 +1 40277U 14064A 17196.57472090 .00000094 00000-0 00000-0 0 9996 +2 40277 0.0131 229.5908 0000174 356.6552 327.2676 1.00272114 9994 +GSAT-16 +1 40332U 14078A 17197.03043139 .00000080 00000-0 00000-0 0 9998 +2 40332 0.1253 272.8636 0007158 173.3466 273.8697 1.00273307 9453 +DIRECTV 14 +1 40333U 14078B 17197.30071028 -.00000129 00000-0 00000-0 0 9992 +2 40333 0.0371 261.7552 0001082 75.9205 325.6753 1.00272097 9494 +YAMAL 401 +1 40345U 14082A 17197.44784907 -.00000233 00000-0 00000-0 0 9998 +2 40345 0.0418 142.6787 0000091 308.1027 94.8325 1.00270615 9740 +ASTRA 2G +1 40364U 14089A 17197.10481581 .00000145 00000-0 00000-0 0 9992 +2 40364 0.0345 338.2520 0004294 100.7272 281.0672 1.00269551 9309 +FENGYUN 2G +1 40367U 14090A 17197.88364072 -.00000334 00000-0 00000-0 0 9998 +2 40367 0.3787 252.3738 0003876 353.5539 111.6994 1.00268365 9375 +INMARSAT 5-F2 +1 40384U 15005A 17196.58382431 -.00000289 00000-0 00000-0 0 9998 +2 40384 0.0214 46.6599 0000352 41.4137 0.7264 1.00268931 9005 +ABS-3A +1 40424U 15010A 17197.19107278 -.00000031 00000-0 00000-0 0 9996 +2 40424 0.0200 49.4425 0001845 344.2632 326.3060 1.00268569 8766 +EUTELSAT 115 WEST B +1 40425U 15010B 17197.50106950 -.00000029 00000-0 00000-0 0 9995 +2 40425 0.0034 220.3675 0000248 185.7468 313.8856 1.00271876 8736 +EXPRESS-AM7 +1 40505U 15012A 17197.36226706 .00000146 00000-0 00000-0 0 9991 +2 40505 0.0080 52.0920 0002650 61.1271 351.5761 1.00273831 8699 +IRNSS-1D +1 40547U 15018A 17197.68913178 -.00000313 00000-0 00000-0 0 9991 +2 40547 29.0178 294.5684 0020960 184.4595 175.5843 1.00273327 8332 +BEIDOU I1-S +1 40549U 15019A 17197.52347772 -.00000180 00000-0 00000-0 0 9990 +2 40549 54.3733 333.4383 0041400 186.5972 57.6967 1.00288405 8414 +THOR 7 +1 40613U 15022A 17197.18463785 -.00000013 00000-0 00000-0 0 9996 +2 40613 0.0333 223.2795 0002602 256.4841 240.2602 1.00270829 8165 +TURKMENALEM52E/MONACOSAT +1 40617U 15023A 17197.03875707 .00000100 00000-0 00000-0 0 9992 +2 40617 0.0203 71.5270 0002539 47.9023 240.5940 1.00272396 8171 +DIRECTV 15 +1 40663U 15026A 17196.47014274 -.00000107 00000-0 00000-0 0 9995 +2 40663 0.0157 81.6825 0000204 13.2358 265.0820 1.00272785 7868 +SKY MEXICO-1 +1 40664U 15026B 17197.40109423 -.00000238 00000-0 00000-0 0 9996 +2 40664 0.0172 45.2394 0002354 79.1681 235.6148 1.00270081 7886 +METEOSAT-11 (MSG-4) +1 40732U 15034A 17197.85669871 -.00000032 00000-0 00000-0 0 9990 +2 40732 1.7728 239.4063 0000759 275.5412 84.6880 1.00272083 7382 +STAR ONE C4 +1 40733U 15034B 17196.37948140 -.00000268 00000-0 00000-0 0 9997 +2 40733 0.0407 318.0352 0001550 144.1960 257.7842 1.00269651 7369 +INTELSAT 34 (IS-34) +1 40874U 15039A 17196.33923045 -.00000289 00000-0 00000-0 0 9994 +2 40874 0.0196 34.4720 0000589 318.0779 7.4492 1.00264912 7006 +EUTELSAT 8 WEST B +1 40875U 15039B 17197.20504897 -.00000070 00000-0 00000-0 0 9990 +2 40875 0.0623 13.0854 0002618 82.8159 264.1265 1.00271670 7027 +GSAT-6 +1 40880U 15041A 17196.95264156 -.00000169 00000-0 00000-0 0 9990 +2 40880 0.0633 102.6882 0006070 162.7793 94.4608 1.00271031 6988 +INMARSAT 5-F3 +1 40882U 15042A 17195.68794442 .00000047 00000-0 00000-0 0 9992 +2 40882 0.0201 43.3568 0000601 86.6355 230.0130 1.00269177 6879 +TJS-1 +1 40892U 15046A 17197.88294493 -.00000161 00000-0 00000-0 0 9990 +2 40892 0.0794 247.7781 0003482 112.7404 47.2113 1.00273405 6890 +EXPRESS-AM8 +1 40895U 15048A 17197.82997356 -.00000116 00000-0 00000-0 0 9997 +2 40895 0.0422 238.2486 0000434 1.1597 340.2286 1.00272436 6717 +BEIDOU I2-S +1 40938U 15053A 17197.77454301 -.00000157 00000-0 00000-0 0 9998 +2 40938 54.1646 296.3416 0047955 174.1186 198.1732 1.00287885 6704 +SKY MUSTER (NBN1A) +1 40940U 15054A 17196.79435942 -.00000283 00000-0 00000-0 0 9993 +2 40940 0.0142 16.3522 0001906 103.2250 240.4418 1.00270918 6618 +ARSAT 2 +1 40941U 15054B 17197.40720413 -.00000229 00000-0 00000-0 0 9993 +2 40941 0.0395 231.3073 0001491 239.0577 249.6489 1.00272063 6654 +MORELOS 3 +1 40946U 15056A 17197.41195592 -.00000046 00000-0 00000-0 0 9992 +2 40946 6.3853 329.4932 0002974 186.8473 173.2887 1.00272072 6622 +APSTAR 9 +1 40982U 15059A 17197.78662391 -.00000271 00000-0 00000-0 0 9991 +2 40982 0.0179 120.9309 0000528 80.5847 158.4798 1.00270087 6499 +TURKSAT 4B +1 40984U 15060A 17197.04429090 .00000111 00000-0 00000-0 0 9993 +2 40984 0.0340 281.6546 0002244 204.9204 233.4437 1.00268795 6447 +CHINASAT 2C (ZX 2C) +1 41021U 15063A 17197.94967050 -.00000329 00000-0 00000-0 0 9993 +2 41021 0.0452 197.7668 0000692 188.7623 353.7437 1.00269629 6358 +GSAT-15 +1 41028U 15065A 17196.92383435 -.00000261 00000-0 00000-0 0 9993 +2 41028 0.0179 56.8803 0002115 31.3287 271.8152 1.00266200 6174 +BADR-7 (ARABSAT-6B) +1 41029U 15065B 17197.11073210 .00000140 00000-0 00000-0 0 9998 +2 41029 0.0547 243.3784 0003379 333.0166 143.5799 1.00269997 6084 +LAOSAT 1 +1 41034U 15067A 17196.82686204 -.00000347 00000-0 00000-0 0 9996 +2 41034 0.0120 231.3331 0002791 299.0646 189.6076 1.00266639 6194 +TELSTAR 12V +1 41036U 15068A 17197.22436644 -.00000123 00000-0 00000-0 0 9997 +2 41036 0.0134 64.0050 0001857 53.5491 242.4627 1.00271408 5967 +CHINASAT 1C (ZX 1C) +1 41103U 15073A 17197.41299334 -.00000154 00000-0 00000-0 0 9996 +2 41103 0.0429 187.6221 0003058 73.8950 263.0696 1.00269904 6000 +ELEKTRO-L 2 +1 41105U 15074A 17197.82615354 -.00000101 00000-0 00000-0 0 9990 +2 41105 0.0684 285.5336 0001557 349.9208 32.8712 1.00267235 5853 +COSMOS 2513 +1 41121U 15075A 17197.82615354 -.00000143 00000-0 00000-0 0 9995 +2 41121 0.0898 112.9868 0002848 34.6913 164.8200 1.00271317 5939 +EXPRESS-AMU1 +1 41191U 15082A 17197.36226706 .00000151 00000-0 00000-0 0 9996 +2 41191 0.0055 262.9553 0002184 213.1381 344.8072 1.00269845 5844 +GAOFEN 4 +1 41194U 15083A 17197.88364072 -.00000340 00000-0 00000-0 0 9997 +2 41194 0.0699 267.5330 0005182 305.6885 145.4886 1.00269809 5828 +BELINTERSAT-1 +1 41238U 16001A 17197.14163275 .00000103 00000-0 00000-0 0 9994 +2 41238 0.0128 273.3871 0001995 188.0509 295.2027 1.00271390 5608 +IRNSS-1E +1 41241U 16003A 17197.19003385 -.00000291 00000-0 00000-0 0 9999 +2 41241 28.8285 114.1927 0019493 184.7831 175.1656 1.00264570 5528 +INTELSAT 29E (IS-29E) +1 41308U 16004A 17196.32404055 -.00000285 00000-0 00000-0 0 9990 +2 41308 0.0127 83.1991 0001829 34.0266 242.7909 1.00274193 5500 +EUTELSAT 9B +1 41310U 16005A 17197.15778969 .00000058 00000-0 00000-0 0 9991 +2 41310 0.0473 102.8796 0001669 169.1243 87.9747 1.00272262 5454 +SES-9 +1 41380U 16013A 17196.88278222 -.00000349 00000-0 00000-0 0 9997 +2 41380 0.0428 290.0550 0001552 186.2919 243.6670 1.00271312 4821 +EUTELSAT 65 WEST A +1 41382U 16014A 17197.36338476 -.00000280 00000-0 00000-0 0 9996 +2 41382 0.0450 6.9601 0001654 119.2534 233.7997 1.00272523 4895 +IRNSS-1F +1 41384U 16015A 17196.82852108 .00000157 00000-0 00000-0 0 9994 +2 41384 4.0998 264.3906 0022193 181.4061 178.8107 1.00266910 5024 +BEIDOU IGSO 6 +1 41434U 16021A 17197.94012594 -.00000157 00000-0 10000-3 0 9993 +2 41434 55.5761 72.0729 0027055 179.6432 116.4263 1.00264735 4820 +IRNSS-1G +1 41469U 16027A 17197.56108365 -.00000337 00000-0 00000-0 0 9993 +2 41469 4.1703 265.7506 0004516 201.7558 158.4489 1.00278631 4535 +JCSAT 2B +1 41471U 16028A 17194.76168568 -.00000169 00000-0 00000-0 0 9990 +2 41471 0.0239 48.3891 0002103 68.6835 242.9489 1.00268209 4424 +THAICOM 8 +1 41552U 16031A 17196.96536964 -.00000125 00000-0 00000-0 0 9999 +2 41552 0.0759 57.2029 0003031 8.2402 294.5864 1.00270042 4118 +INTELSAT 31 (IS-31) +1 41581U 16035A 17196.44876454 -.00000154 00000-0 00000-0 0 9991 +2 41581 0.0420 228.9079 0001558 352.8050 138.2730 1.00270808 4022 +BEIDOU G7 +1 41586U 16037A 17197.66939319 -.00000254 00000-0 00000-0 0 9994 +2 41586 1.1932 319.2086 0002558 260.5971 100.2639 1.00265543 4136 +ABS-2A (MONGOLSAT-1) +1 41588U 16038A 17195.97852024 -.00000087 00000-0 00000-0 0 9990 +2 41588 0.0132 81.1909 0001505 308.1381 330.6772 1.00270713 4033 +EUTELSAT 117 WEST B +1 41589U 16038B 17196.50948087 -.00000015 00000-0 00000-0 0 9997 +2 41589 0.0019 155.2785 0000377 220.5754 344.1473 1.00269142 4032 +BRISAT +1 41591U 16039A 17194.77136145 -.00000200 00000-0 00000-0 0 9998 +2 41591 0.0170 33.1640 0002252 88.2417 238.6163 1.00268983 3951 +ECHOSTAR 18 +1 41592U 16039B 17197.35276505 -.00000286 00000-0 00000-0 0 9995 +2 41592 0.0362 264.9244 0001869 200.2534 254.8408 1.00270369 3962 +TIANTONG-1 1 +1 41725U 16048A 17197.89411248 -.00000320 00000-0 00000-0 0 9996 +2 41725 4.5448 325.3477 0000570 94.1306 298.7369 1.00273956 3619 +JCSAT-16 +1 41729U 16050A 17195.73662713 -.00000095 00000-0 00000-0 0 9998 +2 41729 0.0181 83.9912 0001809 35.5011 240.5236 1.00270396 3395 +INTELSAT 36 (IS-36) +1 41747U 16053A 17195.99574901 -.00000028 00000-0 00000-0 0 9996 +2 41747 0.0129 45.4786 0002035 324.5623 349.9610 1.00271172 3305 +INTELSAT 33E (IS-33E) +1 41748U 16053B 17197.01661471 .00000045 00000-0 00000-0 0 9999 +2 41748 0.0124 32.6480 0002968 118.4173 208.9492 1.00271474 3593 +INSAT-3DR +1 41752U 16054A 17196.97764965 -.00000081 00000-0 00000-0 0 9992 +2 41752 0.0373 102.1328 0006231 167.2135 90.5800 1.00270981 3157 +GSAT-18 +1 41793U 16060A 17193.98630277 -.00000080 00000-0 00000-0 0 9999 +2 41793 0.0606 103.2991 0008397 351.0516 265.7424 1.00271969 2839 +SKY MUSTER 2 +1 41794U 16060B 17194.78713117 -.00000248 00000-0 00000-0 0 9990 +2 41794 0.0150 20.1942 0001586 100.6425 239.1789 1.00268438 2888 +HIMAWARI-9 +1 41836U 16064A 17197.79015454 -.00000280 00000-0 00000-0 0 9990 +2 41836 0.0230 301.1916 0001052 194.0552 224.7594 1.00272670 2521 +SHIJIAN-17 (SJ-17) +1 41838U 16065A 17197.88517722 -.00000360 00000-0 00000-0 0 9997 +2 41838 0.0390 128.0551 0001642 69.6357 180.6469 1.00264449 2577 +GOES 16 +1 41866U 16071A 17196.43342164 -.00000186 00000-0 00000-0 0 9997 +2 41866 0.0401 205.2303 0000407 309.2405 205.5291 1.00271720 2434 +TIANLIAN 1-04 +1 41869U 16072A 17197.90416891 -.00000109 00000-0 00000-0 0 9998 +2 41869 2.5957 289.5655 0006607 159.2896 248.5248 1.00271144 2653 +FENGYUN 4A +1 41882U 16077A 17197.88364072 -.00000336 00000-0 00000-0 0 9990 +2 41882 0.0627 115.7444 0008266 330.7796 271.2039 1.00274221 2312 +ECHOSTAR 19 +1 41893U 16079A 17197.45175459 -.00000142 00000-0 00000-0 0 9991 +2 41893 0.0215 49.5858 0001365 71.8365 238.5911 1.00270084 2068 +STAR ONE D1 +1 41904U 16082B 17197.41555037 -.00000215 00000-0 00000-0 0 9999 +2 41904 0.0324 87.7526 0002299 35.6985 236.5687 1.00271347 2118 +TJS-2 +1 41911U 17001A 17197.95014576 -.00000347 00000-0 00000-0 0 9992 +2 41911 0.6152 279.0833 0000265 214.9781 250.5407 1.00271632 2073 +HISPASAT 36W-1 +1 41942U 17006A 17197.28210944 -.00000248 00000-0 00000-0 0 9994 +2 41942 0.0274 221.7740 0001049 251.4829 246.7520 1.00270928 1863 +TELKOM 3S +1 41944U 17007A 17197.85318101 -.00000368 00000-0 00000-0 0 9997 +2 41944 0.0169 75.8407 0002110 46.2588 237.9187 1.00271041 1473 +INTELSAT 32E (IS-32E) +1 41945U 17007B 17197.30236244 -.00000273 00000-0 00000-0 0 9990 +2 41945 0.0218 49.1924 0000041 152.7515 158.0559 1.00269740 1582 +ECHOSTAR 23 +1 42070U 17014A 17197.30720652 -.00000277 00000-0 00000-0 0 9993 +2 42070 0.0215 48.2592 0002013 66.3510 245.4108 1.00269372 1285 +SES-10 +1 42432U 17017A 17197.36812929 -.00000277 00000-0 00000-0 0 9993 +2 42432 0.0112 36.9724 0002189 92.6173 230.4276 1.00270392 1111 +CHINASAT 16 (SJ-13) +1 42662U 17018A 17197.87371056 -.00000357 00000-0 00000-0 0 9995 +2 42662 0.0362 91.7677 0005768 125.3617 142.8283 1.00269694 1063 +KOREASAT 7 +1 42691U 17023A 17191.95440698 -.00000364 00000-0 00000-0 0 9993 +2 42691 0.0124 41.6483 0001417 55.2270 291.6569 1.00271507 721 +SGDC +1 42692U 17023B 17197.72896483 -.00000254 00000-0 00000-0 0 9990 +2 42692 0.0197 24.5993 0001628 107.6694 350.0531 1.00269041 789 +GSAT-9 +1 42695U 17024A 17192.62962565 -.00000290 00000-0 00000-0 0 9993 +2 42695 0.0830 124.1309 0003116 333.5614 156.1256 1.00271623 711 +======= +1 19548U 88091B 17157.86807803 -.00000309 00000-0 00000-0 0 9997 +2 19548 14.4416 8.0727 0035139 315.3143 182.2791 1.00277792 92347 +SKYNET 4C +1 20776U 90079A 17157.24407692 .00000117 00000-0 00000-0 0 9991 +2 20776 13.8245 16.2209 0003137 48.2774 311.7180 1.00276680 97853 +TDRS 5 +1 21639U 91054B 17157.76236800 .00000078 00000-0 00000-0 0 9998 +2 21639 14.3705 21.5279 0024207 350.4285 350.3256 1.00280423 94648 +TDRS 6 +1 22314U 93003B 17157.86825340 -.00000301 00000-0 00000-0 0 9999 +2 22314 13.8980 24.4494 0003763 305.2309 192.4426 1.00268641 89385 +ASTRA 1D +1 23331U 94070A 17157.42011801 -.00000298 00000-0 00000-0 0 9990 +2 23331 7.5473 49.3635 0000659 296.5264 4.6759 1.00104533 83216 +BRASILSAT B2 +1 23536U 95016A 17157.69941272 -.00000285 00000-0 00000-0 0 9997 +2 23536 7.1712 51.2584 0002332 20.9281 6.8855 1.00271709 81251 +AMSC 1 +1 23553U 95019A 17156.69144898 -.00000124 00000-0 00000-0 0 9999 +2 23553 10.0698 39.9829 0003984 11.9967 347.9227 1.00271961 81090 +TDRS 7 +1 23613U 95035B 17157.60700767 -.00000209 00000-0 00000-0 0 9993 +2 23613 14.9710 15.2291 0030718 2.0194 181.2233 1.00269402 80185 +ECHOSTAR 1 +1 23754U 95073A 17157.49163003 -.00000246 00000-0 00000-0 0 9995 +2 23754 0.7924 90.2435 0002974 350.0571 274.5284 1.00272032 78375 +INMARSAT 3-F1 +1 23839U 96020A 17157.85035990 .00000002 00000-0 00000-0 0 9994 +2 23839 3.9663 67.5573 0005447 7.0278 191.4687 1.00272109 77250 +ASTRA 1F +1 23842U 96021A 17157.91317255 .00000135 00000-0 00000-0 0 9990 +2 23842 0.0562 314.1346 0004059 128.6019 185.7968 1.00272030 19280 +MSAT M1 +1 23846U 96022A 17156.72760441 -.00000092 00000-0 00000-0 0 9995 +2 23846 7.7361 48.8942 0005104 25.5910 334.2903 1.00272898 77348 +INMARSAT 3-F2 +1 24307U 96053A 17157.49688167 -.00000129 00000-0 00000-0 0 9992 +2 24307 2.6068 77.7716 0005484 340.3412 0.3761 1.00272172 75958 +AMC-1 (GE-1) +1 24315U 96054A 17156.88615406 .00000052 00000-0 00000-0 0 9994 +2 24315 1.5468 85.1195 0003085 352.0953 7.1338 1.00272423 13257 +AFRICASAT-2 (MEASAT-2) +1 24653U 96063B 17157.54179772 -.00000234 00000-0 00000-0 0 9997 +2 24653 7.4699 49.7796 0006474 178.0401 10.3776 1.00272601 75398 +INMARSAT 3-F3 +1 24674U 96070A 17157.76269751 .00000032 00000-0 00000-0 0 9994 +2 24674 3.4130 71.8223 0005433 3.1247 273.0973 1.00274605 74907 +AMC-2 (GE-2) +1 24713U 97002A 17157.30467139 -.00000217 00000-0 00000-0 0 9990 +2 24713 4.3187 66.0034 0005466 6.7557 206.9821 1.00273283 25250 +INTELSAT 26 (IS-26) +1 24732U 97007A 17157.92907338 -.00000004 00000-0 00000-0 0 9998 +2 24732 7.4468 50.1090 0005481 8.4977 235.6218 1.00274085 39676 +GALAXY 25 (G-25) +1 24812U 97026A 17156.55276483 -.00000169 00000-0 00000-0 0 9998 +2 24812 0.0263 331.2615 0003489 101.7437 287.0330 1.00270031 73285 +ABS-3 +1 24901U 97042A 17157.82985428 -.00000197 00000-0 00000-0 0 9993 +2 24901 4.8711 63.3290 0006867 355.5837 220.6103 1.00271955 72480 +INTELSAT 5 (IS-5) +1 24916U 97046A 17157.05344110 -.00000149 00000-0 00000-0 0 9992 +2 24916 3.5265 71.1570 0003183 356.4821 3.1426 1.00272346 72550 +AMC-3 (GE-3) +1 24936U 97050A 17157.39970170 -.00000264 00000-0 00000-0 0 9995 +2 24936 0.3597 92.2509 0003074 345.4247 249.2166 1.00272581 19365 +NSS-5 +1 24957U 97053A 17157.76527155 .00000103 00000-0 00000-0 0 9994 +2 24957 3.8209 69.3592 0003661 358.6132 153.3551 1.00271660 72116 +ECHOSTAR 3 +1 25004U 97059A 17157.68394641 -.00000287 00000-0 00000-0 0 9991 +2 25004 2.1365 80.3085 0001609 11.9974 347.3946 1.00272496 71994 +JCSAT-1B +1 25067U 97075A 17157.65122240 -.00000213 00000-0 00000-0 0 9998 +2 25067 5.5436 58.9740 0002484 352.1285 228.5799 1.00272836 71483 +ASTRA 1G +1 25071U 97076A 17157.76538498 .00000102 00000-0 00000-0 0 9998 +2 25071 2.3038 78.4519 0003655 354.3072 149.2269 1.00273075 71499 +BRASILSAT B3 +1 25152U 98006A 17156.65845583 -.00000290 00000-0 00000-0 0 9994 +2 25152 4.0090 68.4273 0002828 3.0590 356.6200 1.00273130 10445 +INMARSAT 3-F5 +1 25153U 98006B 17157.25743942 -.00000293 00000-0 00000-0 0 9991 +2 25153 2.5563 74.2286 0005365 0.4178 218.8480 1.00268538 70828 +NSS-806 +1 25239U 98014A 17157.57688493 -.00000283 00000-0 00000-0 0 9998 +2 25239 0.0704 41.6431 0004502 32.6989 341.0322 1.00272485 14235 +CHINASAT 5A (ZX 5A) +1 25354U 98033A 17157.64465316 -.00000358 00000-0 00000-0 0 9995 +2 25354 1.2212 87.1786 0001287 274.3863 251.2674 1.00268487 74179 +THOR III +1 25358U 98035A 17156.46990006 -.00000052 00000-0 00000-0 0 9990 +2 25358 5.4063 59.1747 0001643 6.5467 353.2248 1.00271491 69779 +INTELSAT 805 (IS-805) +1 25371U 98037A 17157.58191515 -.00000035 00000-0 00000-0 0 9990 +2 25371 0.0103 314.0624 0003659 127.6349 191.9694 1.00272663 69482 +ASTRA 2A +1 25462U 98050A 17157.88659128 -.00000363 00000-0 00000-0 0 9992 +2 25462 0.0759 256.1314 0002007 177.7985 254.2102 1.00268909 13282 +AFRISTAR +1 25515U 98063A 17157.75189699 .00000119 00000-0 00000-0 0 9990 +2 25515 3.2821 69.7456 0003679 5.8761 111.3929 1.00270803 68062 +JCSAT-4A +1 25630U 99006A 17157.82921876 -.00000331 00000-0 00000-0 0 9992 +2 25630 2.2754 80.0941 0000925 328.3183 270.6482 1.00579415 66939 +SKYNET 4E +1 25639U 99009B 17157.80109448 .00000014 00000-0 00000-0 0 9992 +2 25639 10.1255 28.6832 0002187 51.5487 109.5193 1.00270428 66956 +ASIASAT 3S +1 25657U 99013A 17157.61576939 -.00000242 00000-0 00000-0 0 9993 +2 25657 2.4890 78.2975 0003096 342.3571 202.2375 1.00269091 66754 +NIMIQ 1 +1 25740U 99027A 17157.39957437 -.00000203 00000-0 00000-0 0 9999 +2 25740 0.0106 324.8530 0006101 92.4300 255.0543 1.00273030 66134 +ASTRA 1H +1 25785U 99033A 17157.97189061 .00000133 00000-0 00000-0 0 9990 +2 25785 3.8060 69.5124 0002962 358.6213 220.7807 1.00270882 18351 +TELKOM 1 +1 25880U 99042A 17157.87353010 -.00000349 00000-0 00000-0 0 9992 +2 25880 0.0476 125.4053 0001661 348.3920 204.1525 1.00275014 65320 +ABS-7 +1 25894U 99046A 17157.75623596 -.00000367 00000-0 00000-0 0 9997 +2 25894 0.0142 11.5448 0002770 67.3211 204.8136 1.00266504 64071 +ABS-6 +1 25924U 99053A 17156.85154310 -.00000126 00000-0 00000-0 0 9995 +2 25924 0.0384 323.6013 0002447 117.1377 279.2886 1.00273349 64811 +TELSTAR 12 (ORION 2) +1 25949U 99059A 17157.76511053 -.00000066 00000-0 00000-0 0 9993 +2 25949 0.9151 88.8354 0003209 346.3667 346.3914 1.00272197 64461 +AMC-4 (GE-4) +1 25954U 99060A 17156.48039619 -.00000280 00000-0 00000-0 0 9990 +2 25954 0.0442 284.7377 0002671 157.0802 278.2116 1.00270511 10661 +GALAXY 11 (G-11) +1 26038U 99071A 17157.91317255 .00000133 00000-0 00000-0 0 9996 +2 26038 0.0088 145.9068 0000374 257.2525 225.9702 1.00272198 64043 +HISPASAT 1C +1 26071U 00007A 17157.52223545 .00000048 00000-0 00000-0 0 9994 +2 26071 0.5428 89.4925 0002589 72.6119 170.7654 0.99201181 14572 +SUPERBIRD-B2 +1 26095U 00012A 17157.67454814 -.00000097 00000-0 00000-0 0 9992 +2 26095 0.3791 94.5663 0003041 339.8576 225.6408 1.00271692 63369 +ASIASTAR +1 26107U 00016A 17157.86893387 -.00000337 00000-0 00000-0 0 9990 +2 26107 1.6532 81.9634 0004341 354.1170 237.1785 1.00269745 62868 +EUTELSAT 16C +1 26243U 00019A 17157.75174454 .00000086 00000-0 00000-0 0 9999 +2 26243 4.2466 66.3709 0002418 11.9963 102.0901 1.00273976 62686 +EUTELSAT 80A +1 26369U 00028A 17157.85005696 .00000026 00000-0 00000-0 0 9994 +2 26369 0.9945 85.2151 0005047 330.7769 212.9123 1.00032976 62374 +TDRS 8 +1 26388U 00034A 17157.19884633 -.00000238 00000-0 00000-0 0 9991 +2 26388 7.4759 55.9283 0003614 246.3223 113.4765 1.00270515 62106 +ECHOSTAR 6 +1 26402U 00038A 17157.54494727 -.00000154 00000-0 00000-0 0 9999 +2 26402 4.1671 67.1693 0003849 10.8801 277.0633 1.00272694 61847 +INTELSAT 9 (IS-9) +1 26451U 00043A 17157.57202302 -.00000265 00000-0 00000-0 0 9991 +2 26451 3.5142 71.3824 0003799 350.3295 358.0679 1.00365439 11073 +BRASILSAT B4 +1 26469U 00046A 17156.78370957 -.00000176 00000-0 00000-0 0 9998 +2 26469 1.6370 85.2597 0003484 349.2296 10.0438 1.00271930 61899 +NILESAT 102 +1 26470U 00046B 17157.54216150 -.00000064 00000-0 00000-0 0 9995 +2 26470 1.6601 83.7061 0003857 345.8061 13.7579 1.00272468 12139 +ASTRA 2B +1 26494U 00054A 17157.68035657 .00000067 00000-0 00000-0 0 9998 +2 26494 2.1910 79.0928 0002631 287.8567 148.5516 1.00093376 13823 +AMC-7 (GE-7) +1 26495U 00054B 17157.66591004 .00000083 00000-0 00000-0 0 9998 +2 26495 0.0425 70.3004 0000575 293.2921 356.4085 1.00272353 61199 +NSS-11 (AAP-1) +1 26554U 00059A 17157.75422963 -.00000349 00000-0 00000-0 0 9992 +2 26554 0.0206 311.3634 0002835 132.7724 190.9234 1.00270805 8242 +N-SAT-110 (JCSAT-110) +1 26559U 00060A 17157.96923611 -.00000355 00000-0 00000-0 0 9995 +2 26559 0.0511 101.0793 0001551 336.4429 277.0289 1.00272458 8215 +AMC-6 (GE-6) +1 26580U 00067A 17157.36854942 -.00000206 00000-0 00000-0 0 9995 +2 26580 0.0431 293.8127 0000377 175.2322 198.9257 1.00016707 60911 +INTELSAT 12 (IS-12) +1 26590U 00068A 17157.75722942 .00000132 00000-0 00000-0 0 9991 +2 26590 0.4642 93.2981 0002778 18.8500 100.8023 1.00273874 18654 +INTELSAT 1R (IS-1R) +1 26608U 00072A 17157.82344980 -.00000051 00000-0 00000-0 0 9997 +2 26608 0.2962 92.8891 0001314 76.9935 193.6059 1.00082695 60592 +ANIK F1 +1 26624U 00076A 17157.58929326 -.00000078 00000-0 00000-0 0 9994 +2 26624 0.0073 330.8252 0002626 129.0283 260.1762 1.00268795 60666 +ASTRA 2D +1 26638U 00081A 17157.31978469 .00000042 00000-0 00000-0 0 9998 +2 26638 3.6306 70.1028 0001749 3.1681 356.4654 1.00270542 19849 +AMC-8 (GE-8) +1 26639U 00081B 17157.50931538 .00000099 00000-0 00000-0 0 9998 +2 26639 0.0155 1.7174 0003007 70.9878 226.7467 1.00273654 60208 +SKYNET 4F +1 26695U 01005B 17156.48174351 -.00000258 00000-0 00000-0 0 9993 +2 26695 8.8865 36.7282 0002854 21.9931 334.8059 1.00273913 59807 +EUTELSAT 33C +1 26719U 01011A 17157.91808519 .00000151 00000-0 00000-0 0 9997 +2 26719 0.0657 14.7416 0004077 45.4654 198.8809 1.00272805 59488 +INTELSAT 10 (IS-10) +1 26766U 01019A 17157.91226983 .00000122 00000-0 00000-0 0 9994 +2 26766 1.4974 85.2555 0002810 328.5020 217.6481 1.00273208 12572 +INTELSAT 901 (IS-901) +1 26824U 01024A 17157.56229900 -.00000146 00000-0 00000-0 0 9995 +2 26824 0.0314 72.5832 0002605 339.3795 27.6129 1.00271212 58636 +ASTRA 2C +1 26853U 01025A 17157.85283747 .00000042 00000-0 00000-0 0 9993 +2 26853 0.3795 91.4600 0003533 340.7739 190.5107 1.00273957 11994 +ARTEMIS +1 26863U 01029A 17157.90349637 -.00000377 00000-0 00000-0 0 9997 +2 26863 12.7220 33.1765 0002052 60.8791 249.7556 1.00272583 11082 +INTELSAT 902 (IS-902) +1 26900U 01039A 17157.85096675 .00000028 00000-0 00000-0 0 9997 +2 26900 0.0262 33.6893 0003013 55.7823 174.2913 1.00273188 57658 +EUTELSAT 12 WEST B +1 26927U 01042A 17157.91924353 -.00000104 00000-0 00000-0 0 9996 +2 26927 0.0391 7.2969 0005667 56.4965 150.1242 1.00273270 57451 +DIRECTV 4S +1 26985U 01052A 17157.53742727 -.00000117 00000-0 00000-0 0 9996 +2 26985 0.0233 331.2984 0002305 112.5189 263.5725 1.00269707 56932 +INSAT-3C +1 27298U 02002A 17157.89595112 -.00000262 00000-0 00000-0 0 9994 +2 27298 0.6042 91.6269 0002103 228.4690 351.4248 1.00270722 56348 +ECHOSTAR 7 +1 27378U 02006A 17157.50735625 -.00000005 00000-0 00000-0 0 9995 +2 27378 0.0111 338.1778 0001931 118.0619 222.7119 1.00271538 55998 +INTELSAT 904 (IS-904) +1 27380U 02007A 17157.75723111 .00000132 00000-0 00000-0 0 9993 +2 27380 0.0571 120.8959 0002880 308.6601 143.4987 1.00272687 18706 +TDRS 9 +1 27389U 02011A 17157.72953012 -.00000105 00000-0 00000-0 0 9990 +2 27389 5.2291 79.2046 0017938 252.8065 173.8674 1.00272866 57374 +JCSAT 2A +1 27399U 02015A 17157.82602378 -.00000311 00000-0 00000-0 0 9991 +2 27399 0.4587 92.8420 0001099 40.3381 195.6030 1.00268306 55559 +ASTRA 3A +1 27400U 02015B 17156.61468224 -.00000288 00000-0 00000-0 0 9993 +2 27400 3.7937 68.8431 0003222 15.9485 343.7218 1.00274601 55655 +INTELSAT 903 (IS-903) +1 27403U 02016A 17157.57202302 -.00000243 00000-0 00000-0 0 9997 +2 27403 0.0148 323.3270 0003052 105.3474 357.9124 1.00273140 12603 +NSS-7 +1 27414U 02019A 17156.57859080 -.00000163 00000-0 00000-0 0 9993 +2 27414 1.8718 83.1197 0002435 355.0749 4.2885 1.00272047 55494 +DIRECTV 5 (TEMPO 1) +1 27426U 02023A 17156.59985321 -.00000063 00000-0 00000-0 0 9990 +2 27426 0.0250 327.0495 0003596 106.1164 286.8736 1.00269966 55236 +INTELSAT 905 (IS-905) +1 27438U 02027A 17157.56716090 -.00000189 00000-0 00000-0 0 9999 +2 27438 0.0156 297.3086 0003061 119.7567 17.7793 1.00272874 54890 +EXPRESS-A4 +1 27441U 02029A 17157.83061253 -.00000254 00000-0 00000-0 0 9992 +2 27441 6.0451 56.5744 0004021 51.2124 231.9396 1.00266835 54901 +GALAXY 3C (G-3C) +1 27445U 02030A 17155.56072771 -.00000160 00000-0 00000-0 0 9999 +2 27445 0.0146 313.9998 0002083 317.0344 88.9393 1.00268666 13494 +EUTELSAT 5 WEST A +1 27460U 02035A 17157.30598495 -.00000048 00000-0 00000-0 0 9996 +2 27460 0.0407 354.0164 0005408 77.7738 288.2692 1.00271976 54561 +N-STAR C +1 27461U 02035B 17157.67386207 -.00000317 00000-0 00000-0 0 9992 +2 27461 4.6131 64.8577 0004203 348.0196 220.9577 1.00269035 54595 +EUTELSAT 36 WEST A +1 27508U 02040A 17157.39182088 -.00000249 00000-0 00000-0 0 9994 +2 27508 0.0671 16.5719 0004714 27.6473 315.8189 1.00274510 54130 +METEOSAT-8 (MSG-1) +1 27509U 02040B 17157.91560703 .00000134 00000-0 00000-0 0 9999 +2 27509 4.8249 58.4007 0000781 321.3004 247.0559 1.00282771 54194 +INTELSAT 906 (IS-906) +1 27513U 02041A 17157.85051046 .00000010 00000-0 00000-0 0 9996 +2 27513 0.0167 304.9366 0002695 145.8257 175.0220 1.00272562 53975 +KODAMA (DRTS) +1 27516U 02042B 17157.92791715 -.00000245 00000-0 00000-0 0 9993 +2 27516 5.0249 62.1271 0003126 12.9916 245.2045 1.00267568 12844 +KALPANA-1 (METSAT 1) +1 27525U 02043A 17157.24074489 -.00000087 00000-0 00000-0 0 9995 +2 27525 6.3332 55.3089 0012521 233.7089 125.9805 1.00272053 53999 +HISPASAT 1D +1 27528U 02044A 17157.86991012 -.00000220 00000-0 00000-0 0 9996 +2 27528 0.0259 332.1791 0004154 85.5483 120.9071 1.00272546 9753 +TDRS 10 +1 27566U 02055A 17156.93899134 .00000071 00000-0 00000-0 0 9992 +2 27566 5.0166 58.4666 0007385 248.0779 111.5909 1.00270185 53166 +NSS-6 +1 27603U 02057A 17156.77498163 -.00000277 00000-0 00000-0 0 9994 +2 27603 0.0473 102.4211 0001387 313.2719 212.6914 1.00271799 53021 +NIMIQ 2 +1 27632U 02062A 17156.69497149 -.00000288 00000-0 00000-0 0 9998 +2 27632 1.9736 82.0863 0001443 250.4056 108.9664 1.00268898 11131 +INTELSAT 907 (IS-907) +1 27683U 03007A 17157.36824828 -.00000207 00000-0 00000-0 0 9998 +2 27683 0.0167 299.5781 0002888 136.1041 284.3503 1.00272710 52377 +GALAXY 12 (G-12) +1 27715U 03013B 17157.47798205 .00000054 00000-0 00000-0 0 9991 +2 27715 0.0187 320.3459 0001910 124.4962 213.2990 1.00273091 19071 +ASIASAT 4 +1 27718U 03014A 17154.76078257 -.00000373 00000-0 00000-0 0 9997 +2 27718 0.0554 107.4671 0000332 120.2394 60.6607 1.00269696 51826 +HELLAS-SAT 2 +1 27811U 03020A 17157.95948205 .00000148 00000-0 00000-0 0 9990 +2 27811 0.0173 15.2568 0004017 55.5793 209.0975 1.00271046 9793 +AMC-9 (GE-12) +1 27820U 03024A 17157.36854942 -.00000221 00000-0 00000-0 0 9996 +2 27820 0.0149 345.1473 0002670 86.0434 233.4626 1.00271443 51310 +THURAYA-2 +1 27825U 03026A 17157.77479958 .00000124 00000-0 00000-0 0 9999 +2 27825 4.9108 29.1082 0004667 32.3379 156.8443 1.00274495 51289 +OPTUS C1 +1 27831U 03028B 17157.64800564 -.00000152 00000-0 00000-0 0 9997 +2 27831 0.0147 142.7331 0003679 312.2794 189.5222 1.00269917 51256 +ECHOSTAR 12 (RAINBOW 1) +1 27852U 03033A 17157.85925034 -.00000286 00000-0 00000-0 0 9997 +2 27852 0.0153 320.1155 0002459 153.4265 30.0486 1.00271393 50921 +GALAXY 23 (G-23) +1 27854U 03034A 17157.55834939 .00000009 00000-0 00000-0 0 9992 +2 27854 0.0078 50.3401 0002591 20.5670 264.2678 1.00266961 55470 +EUTELSAT 33A +1 27948U 03043A 17157.91808519 .00000148 00000-0 00000-0 0 9995 +2 27948 2.3530 78.3719 0002192 246.4604 292.0221 1.00272390 12410 +GALAXY 13 (HORIZONS-1) +1 27954U 03044A 17157.49490420 .00000044 00000-0 00000-0 0 9999 +2 27954 0.0095 68.2889 0001794 34.0552 203.9008 1.00269771 50093 +ZHONGXING-20 +1 28082U 03052A 17157.86442207 -.00000331 00000-0 00000-0 0 9992 +2 28082 3.4896 71.3775 0002820 340.2019 258.3647 1.00271326 49698 +YAMAL 202 +1 28089U 03053A 17156.89999981 .00000113 00000-0 00000-0 0 9995 +2 28089 0.0645 108.1958 0003615 299.6727 219.6142 1.00274795 49602 +EXPRESS-AM22 (SESAT 2) +1 28134U 03060A 17157.82012833 -.00000142 00000-0 00000-0 0 9993 +2 28134 0.4310 91.3126 0000677 12.5441 166.9011 1.00271968 49211 +AMC-10 (GE-10) +1 28154U 04003A 17157.68986111 .00000083 00000-0 00000-0 0 9999 +2 28154 0.0102 324.5364 0002911 113.5854 290.5135 1.00274282 48870 +ABS-4 (MOBISAT-1) +1 28184U 04007A 17157.85283747 .00000037 00000-0 00000-0 0 9999 +2 28184 0.0179 315.6427 0001657 131.2375 176.5646 1.00271252 19275 +EUTELSAT 7A +1 28187U 04008A 17157.64713779 .00000044 00000-0 00000-0 0 9991 +2 28187 0.0661 14.8212 0004472 83.1599 37.2438 1.00275037 48320 +DIRECTV 7S +1 28238U 04016A 17157.55819626 -.00000004 00000-0 00000-0 0 9992 +2 28238 0.0157 340.2692 0003146 93.8117 262.9614 1.00273727 47995 +AMC-11 (GE-11) +1 28252U 04017A 17157.57680061 .00000064 00000-0 00000-0 0 9995 +2 28252 0.0180 353.1619 0002945 81.1891 257.4684 1.00274073 47636 +INTELSAT 10-02 +1 28358U 04022A 17157.83869049 -.00000015 00000-0 00000-0 0 9999 +2 28358 0.0120 356.1950 0000295 58.0826 142.0919 1.00269757 47582 +APSTAR 5 (TELSTAR 18) +1 28364U 04024A 17157.83092135 -.00000298 00000-0 00000-0 0 9995 +2 28364 0.0030 6.5684 0003143 80.0270 245.9630 1.00271874 47487 +ANIK F2 +1 28378U 04027A 17157.51971437 -.00000055 00000-0 00000-0 0 9990 +2 28378 0.0287 34.3513 0000292 66.2633 230.5249 1.00273695 47284 +AMAZONAS 1 +1 28393U 04031A 17157.57202302 -.00000251 00000-0 00000-0 0 9994 +2 28393 1.7315 83.7697 0004323 359.8041 341.2300 1.00271596 47001 +AMC-15 +1 28446U 04041A 17157.35743792 -.00000094 00000-0 00000-0 0 9998 +2 28446 0.0306 43.6946 0002577 24.0323 210.8459 1.00270854 46323 +AMC-16 +1 28472U 04048A 17157.39961249 -.00000211 00000-0 00000-0 0 9998 +2 28472 0.0300 46.8859 0002736 27.0149 239.9535 1.00272492 45742 +NSS-10 (AMC-12) +1 28526U 05003A 17157.57202302 -.00000255 00000-0 00000-0 0 9996 +2 28526 0.0171 331.5816 0002986 103.2954 348.7724 1.00271963 20118 +XTAR-EUR +1 28542U 05005A 17156.21444778 .00000143 00000-0 00000-0 0 9996 +2 28542 0.0436 105.4196 0002521 319.0050 295.6000 1.00270784 45101 +XM-3 (RHYTHM) +1 28626U 05008A 17157.39961249 -.00000210 00000-0 00000-0 0 9995 +2 28626 0.0068 215.5294 0000192 171.9039 286.3071 1.00266636 44993 +INMARSAT 4-F1 +1 28628U 05009A 17156.92660775 -.00000269 00000-0 00000-0 0 9990 +2 28628 2.8757 11.8827 0003527 65.6031 294.1247 1.00272126 44606 +APSTAR 6 +1 28638U 05012A 17157.83122773 -.00000322 00000-0 00000-0 0 9997 +2 28638 0.0306 58.4940 0002057 17.2640 252.9201 1.00272736 69343 +SPACEWAY 1 +1 28644U 05015A 17157.53283144 -.00000106 00000-0 00000-0 0 9994 +2 28644 0.0476 154.0547 0000531 193.5024 356.4599 1.00266303 44440 +DIRECTV 8 +1 28659U 05019A 17156.57419940 -.00000123 00000-0 00000-0 0 9991 +2 28659 0.0097 10.0881 0003284 61.1747 288.7721 1.00272405 44070 +GALAXY 28 (G-28) +1 28702U 05022A 17156.36348095 -.00000193 00000-0 00000-0 0 9990 +2 28702 0.0123 38.9577 0002187 345.0013 271.8678 1.00272171 43748 +EXPRESS-AM3 +1 28707U 05023A 17157.96047541 -.00000326 00000-0 00000-0 0 9993 +2 28707 0.0067 246.6538 0000998 196.3073 261.3603 1.00271254 43783 +THAICOM 4 +1 28786U 05028A 17157.76759243 -.00000367 00000-0 00000-0 0 9997 +2 28786 0.0135 354.6117 0002419 79.0491 217.5158 1.00271590 43264 +GALAXY 14 (G-14) +1 28790U 05030A 17157.55541164 .00000032 00000-0 00000-0 0 9991 +2 28790 0.0190 327.0194 0002682 102.3421 260.7443 1.00273905 43230 +ANIK F1R +1 28868U 05036A 17157.61521618 -.00000079 00000-0 00000-0 0 9994 +2 28868 0.0535 80.6010 0003176 336.5033 312.2768 1.00272802 13445 +GALAXY 15 (G-15) +1 28884U 05041A 17157.62737733 .00000074 00000-0 00000-0 0 9990 +2 28884 0.0095 323.7164 0001455 110.0613 274.2944 1.00274202 42555 +SYRACUSE 3A +1 28885U 05041B 17157.91226983 .00000125 00000-0 00000-0 0 9990 +2 28885 0.0123 47.9590 0003052 34.9277 188.0114 1.00271206 42698 +INMARSAT 4-F2 +1 28899U 05044A 17157.14672115 .00000004 00000-0 00000-0 0 9991 +2 28899 2.5707 11.7812 0002835 68.5546 291.1256 1.00271873 42451 +TELKOM 2 +1 28902U 05046A 17157.64800564 -.00000143 00000-0 00000-0 0 9999 +2 28902 0.0827 108.2191 0002043 326.9180 210.4049 1.00271196 42171 +SPACEWAY 2 +1 28903U 05046B 17157.53940951 -.00000132 00000-0 00000-0 0 9991 +2 28903 0.0462 140.7429 0000754 280.0859 289.4343 1.00279699 42429 +INSAT-4A +1 28911U 05049A 17157.06201003 -.00000171 00000-0 00000-0 0 9992 +2 28911 0.0380 105.4216 0001734 235.8286 18.7432 1.00272070 42024 +METEOSAT-9 (MSG-2) +1 28912U 05049B 17157.96248359 .00000057 00000-0 00000-0 0 9999 +2 28912 2.1848 71.0339 0000745 329.3322 211.1678 1.00265631 41971 +EUTELSAT 172A (GE-23) +1 28924U 05052A 17157.82344980 -.00000010 00000-0 00000-0 0 9998 +2 28924 0.0640 4.2410 0006025 69.7644 289.8344 1.00272333 19286 +ECHOSTAR 10 +1 28935U 06003A 17157.52223405 -.00000060 00000-0 00000-0 0 9997 +2 28935 0.0128 334.6690 0001561 122.9496 235.2838 1.00272215 41441 +HIMAWARI-7 (MTSAT-2) +1 28937U 06004A 17157.83045837 -.00000248 00000-0 00000-0 0 9993 +2 28937 0.0441 108.7166 0003613 332.5543 258.1068 1.00268894 41415 +SPAINSAT +1 28945U 06007A 17157.37511961 -.00000221 00000-0 00000-0 0 9991 +2 28945 0.0293 238.9210 0003133 211.3907 269.7246 1.00272988 41167 +EUTELSAT HOT BIRD 13E +1 28946U 06007B 17157.25603244 .00000082 00000-0 00000-0 0 9999 +2 28946 0.0016 224.9414 0004732 246.4182 248.6911 1.00274880 41238 +JCSAT-5A +1 29045U 06010A 17157.64299369 -.00000333 00000-0 00000-0 0 9996 +2 29045 0.0169 331.4853 0001801 104.7579 182.5102 1.00271734 40714 +ASTRA 1KR +1 29055U 06012A 17157.85991851 .00000115 00000-0 00000-0 0 9994 +2 29055 0.0465 282.5731 0001283 185.5859 116.0417 1.00270907 12662 +GOES 13 +1 29155U 06018A 17157.49990045 -.00000253 00000-0 00000-0 0 9999 +2 29155 0.1971 273.2915 0005903 163.6851 283.0905 1.00263260 10321 +EUTELSAT 113 WEST A +1 29162U 06020A 17156.60780462 -.00000044 00000-0 00000-0 0 9990 +2 29162 0.0229 128.7916 0002707 304.2820 286.9552 1.00271454 40391 +THAICOM 5 +1 29163U 06020B 17157.93664823 -.00000125 00000-0 00000-0 0 9990 +2 29163 0.0397 277.1662 0002921 155.9102 238.1599 1.00271082 40439 +GALAXY 16 (G-16) +1 29236U 06023A 17157.39925420 -.00000132 00000-0 00000-0 0 9995 +2 29236 0.0415 123.1487 0002843 321.6184 214.9466 1.00272656 40197 +EUTELSAT HOT BIRD 13B +1 29270U 06032A 17157.67673214 .00000083 00000-0 00000-0 0 9999 +2 29270 0.0640 13.7956 0004892 38.2230 99.8869 1.00275274 14264 +JCSAT-3A +1 29272U 06033A 17157.90924543 -.00000349 00000-0 00000-0 0 9998 +2 29272 0.0158 340.2173 0002301 69.5341 301.0817 1.00271640 14671 +SYRACUSE 3B +1 29273U 06033B 17157.79424205 -.00000048 00000-0 00000-0 0 9992 +2 29273 0.0116 334.5227 0004493 82.6200 118.9653 1.00273722 39657 +KOREASAT 5 (MUGUNGWHA 5) +1 29349U 06034A 17157.88670208 -.00000362 00000-0 00000-0 0 9992 +2 29349 0.0198 52.2408 0001592 61.2599 214.2556 1.00271627 8253 +ZHONGXING-22A +1 29398U 06038A 17156.94851480 -.00000327 00000-0 00000-0 0 9990 +2 29398 5.7706 57.8311 0001241 149.2261 130.6660 1.00268293 39337 +DIRECTV 9S +1 29494U 06043A 17157.53742660 -.00000118 00000-0 00000-0 0 9996 +2 29494 0.0144 345.2743 0003696 90.6367 271.5991 1.00270006 18337 +OPTUS D1 +1 29495U 06043B 17157.76302275 -.00000115 00000-0 00000-0 0 9993 +2 29495 0.0171 16.4417 0003644 55.5225 258.0832 1.00272516 39053 +XM-4 (BLUES) +1 29520U 06049A 17157.57626399 -.00000028 00000-0 00000-0 0 9996 +2 29520 0.0294 135.2494 0000467 280.6183 291.5103 1.00277015 38924 +BADR-4 +1 29526U 06051A 17157.97290778 .00000140 00000-0 00000-0 0 9991 +2 29526 0.0475 335.9603 0003641 58.1927 237.6604 1.00269975 18249 +FENGYUN 2D +1 29640U 06053A 17157.72187311 -.00000366 00000-0 10000-3 0 9996 +2 29640 4.4356 64.4357 0005259 316.6810 257.5736 1.00280861 38495 +WILDBLUE-1 +1 29643U 06054A 17157.51971192 -.00000054 00000-0 00000-0 0 9995 +2 29643 0.0427 124.0490 0001177 301.0075 265.9807 1.00271293 38475 +AMC-18 +1 29644U 06054B 17156.34682649 -.00000097 00000-0 00000-0 0 9999 +2 29644 0.0212 48.5605 0002690 21.6517 203.6505 1.00271544 38476 +MEASAT-3 +1 29648U 06056A 17157.77607686 -.00000246 00000-0 00000-0 0 9997 +2 29648 0.0544 134.4165 0003237 323.0236 168.8382 1.00272457 17408 +INSAT-4B +1 30793U 07007A 17157.78369844 -.00000262 00000-0 00000-0 0 9997 +2 30793 0.0520 278.1197 0008119 159.1606 193.7065 1.00270878 9141 +SKYNET 5A +1 30794U 07007B 17157.86214683 -.00000276 00000-0 00000-0 0 9992 +2 30794 0.0669 9.2549 0003424 69.8600 221.9497 1.00271597 37586 +ANIK F3 +1 31102U 07009A 17157.55819626 -.00000006 00000-0 00000-0 0 9993 +2 31102 0.0221 62.7142 0002439 5.1715 269.5064 1.00273137 13496 +ASTRA 1L +1 31306U 07016A 17157.85991851 .00000115 00000-0 00000-0 0 9991 +2 31306 0.0620 310.2522 0001942 67.5327 206.4174 1.00270848 36973 +GALAXY 17 (G-17) +1 31307U 07016B 17157.75267660 -.00000178 00000-0 00000-0 0 9995 +2 31307 0.0199 19.2854 0003333 52.0696 3.9542 1.00271618 36899 +ZHONGXING-6B +1 31800U 07031A 17157.60290969 -.00000367 00000-0 00000-0 0 9992 +2 31800 0.0230 52.6434 0002613 19.1105 156.0270 1.00270162 36405 +DIRECTV 10 +1 31862U 07032A 17156.57961764 -.00000110 00000-0 00000-0 0 9990 +2 31862 0.0171 229.8134 0000365 192.5210 297.6683 1.00272418 12553 +SPACEWAY 3 +1 32018U 07036A 17157.39936093 -.00000157 00000-0 00000-0 0 9997 +2 32018 0.0105 85.9695 0000327 288.7294 289.1154 1.00273225 36052 +BSAT-3A +1 32019U 07036B 17156.98760919 -.00000357 00000-0 00000-0 0 9996 +2 32019 0.0533 228.9851 0001387 295.7273 195.2915 1.00273708 17432 +INSAT-4CR +1 32050U 07037A 17157.91226983 .00000121 00000-0 00000-0 0 9992 +2 32050 0.0621 273.6058 0003315 164.6304 193.5538 1.00268840 18336 +OPTUS D2 +1 32252U 07044A 17157.83029597 -.00000187 00000-0 00000-0 0 9990 +2 32252 0.0170 311.7706 0003786 123.2105 271.3583 1.00272406 35376 +INTELSAT 11 (IS-11) +1 32253U 07044B 17157.42131497 -.00000274 00000-0 00000-0 0 9996 +2 32253 0.0215 79.4921 0001089 18.7092 265.5013 1.00269309 35462 +STAR ONE C1 +1 32293U 07056A 17156.47486952 -.00000284 00000-0 00000-0 0 9997 +2 32293 0.0179 339.0598 0002792 94.1440 286.8268 1.00271095 35033 +SKYNET 5B +1 32294U 07056B 17157.78452358 .00000137 00000-0 00000-0 0 9992 +2 32294 0.0666 355.6274 0003416 80.4168 126.8368 1.00271896 35155 +ASTRA 4A (SIRIUS 4) +1 32299U 07057A 17157.79354764 .00000028 00000-0 00000-0 0 9990 +2 32299 0.0158 4.3499 0003071 61.6161 119.9002 1.00271361 18644 +HORIZONS-2 +1 32388U 07063B 17157.82951910 -.00000187 00000-0 00000-0 0 9993 +2 32388 0.0098 359.5424 0003256 74.6363 204.7150 1.00271755 34790 +THURAYA-3 +1 32404U 08001A 17157.85732615 -.00000309 00000-0 00000-0 0 9993 +2 32404 4.0606 353.6630 0004915 73.1219 235.8036 1.00271427 34456 +EXPRESS-AM33 +1 32478U 08003A 17157.75390184 -.00000285 00000-0 00000-0 0 9999 +2 32478 0.0086 238.5799 0001616 270.5402 114.1081 1.00270725 34543 +THOR 5 +1 32487U 08006A 17157.83869049 -.00000013 00000-0 00000-0 0 9991 +2 32487 0.0156 281.8742 0002857 150.3466 124.4036 1.00274295 34240 +KIZUNA (WINDS) +1 32500U 08007A 17157.89696484 -.00000263 00000-0 00000-0 0 9992 +2 32500 0.8125 90.3689 0002920 345.1458 285.8835 1.00271207 33832 +AMC-14 +1 32708U 08011A 17156.91785617 .00000083 00000-0 00000-0 0 9995 +2 32708 19.0978 63.0141 0041500 358.6629 181.1967 1.00270864 35021 +DIRECTV 11 +1 32729U 08013A 17157.25083755 -.00000131 00000-0 00000-0 0 9997 +2 32729 0.0372 153.5491 0000269 220.5677 231.8543 1.00272501 12547 +ICO G1 +1 32763U 08016A 17157.46018359 -.00000179 00000-0 00000-0 0 9991 +2 32763 3.8428 354.8787 0003081 84.0600 248.9372 1.00271214 33391 +VINASAT-1 +1 32767U 08018A 17156.92650029 -.00000335 00000-0 00000-0 0 9997 +2 32767 0.0204 41.0751 0001934 39.4019 279.5445 1.00272775 33557 +STAR ONE C2 +1 32768U 08018B 17156.48870814 -.00000272 00000-0 00000-0 0 9995 +2 32768 0.0671 122.9474 0002024 346.7193 250.3540 1.00274515 33473 +TIANLIAN 1-01 +1 32779U 08019A 17157.82023682 -.00000144 00000-0 10000-3 0 9992 +2 32779 2.7809 76.1983 0032662 234.4128 320.1133 1.00274328 33403 +AMOS-3 +1 32794U 08022A 17157.83869049 -.00000039 00000-0 00000-0 0 9998 +2 32794 0.0154 261.8990 0001577 150.5664 140.7638 1.00272098 49314 +GALAXY 18 (G-18) +1 32951U 08024A 17156.63537712 .00000018 00000-0 00000-0 0 9997 +2 32951 0.0151 336.3800 0002935 102.9117 280.7413 1.00270821 33015 +CHINASAT 9 (ZX 9) +1 33051U 08028A 17155.32934455 -.00000258 00000-0 00000-0 0 9990 +2 33051 0.0161 341.0801 0003689 86.6287 35.9581 1.00268589 32928 +SKYNET 5C +1 33055U 08030A 17157.56229900 -.00000144 00000-0 00000-0 0 9991 +2 33055 0.0609 351.9781 0004718 100.8819 346.9248 1.00271510 32833 +TURKSAT 3A +1 33056U 08030B 17157.91500177 .00000142 00000-0 00000-0 0 9996 +2 33056 0.0566 91.3709 0005689 343.1426 192.3863 1.00274806 19297 +INTELSAT 25 (IS-25) +1 33153U 08034A 17157.37932809 -.00000229 00000-0 00000-0 0 9996 +2 33153 0.0166 338.1349 0002961 79.1305 302.7632 1.00269297 32570 +BADR-6 +1 33154U 08034B 17157.66748696 .00000140 00000-0 00000-0 0 9999 +2 33154 0.0743 51.2760 0005921 15.3876 94.8981 1.00275158 32698 +ECHOSTAR 11 +1 33207U 08035A 17156.59952255 -.00000064 00000-0 00000-0 0 9994 +2 33207 0.0528 99.8600 0003197 341.5030 278.6723 1.00272504 32584 +SUPERBIRD-C2 +1 33274U 08038A 17157.83045837 -.00000256 00000-0 00000-0 0 9991 +2 33274 0.0130 310.3152 0001601 133.2629 254.7403 1.00270812 72661 +AMC-21 +1 33275U 08038B 17157.55541164 .00000031 00000-0 00000-0 0 9995 +2 33275 0.0173 2.9638 0002983 87.0691 240.1617 1.00273272 32396 +INMARSAT 4-F3 +1 33278U 08039A 17157.58629861 -.00000145 00000-0 00000-0 0 9990 +2 33278 3.0222 1.3769 0002696 75.6386 291.2543 1.00271476 32209 +NIMIQ 4 +1 33373U 08044A 17157.36854942 -.00000225 00000-0 00000-0 0 9997 +2 33373 0.0106 46.0570 0002274 25.7256 233.8662 1.00271139 31909 +GALAXY 19 (G-19) +1 33376U 08045A 17156.56351010 -.00000146 00000-0 00000-0 0 9992 +2 33376 0.0189 310.2271 0003369 124.8513 284.9581 1.00271945 31766 +VENESAT-1 +1 33414U 08055A 17157.59285705 -.00000242 00000-0 00000-0 0 9994 +2 33414 0.0085 204.2447 0001484 265.7345 280.6349 1.00273402 31489 +ASTRA 1M +1 33436U 08057A 17156.96996942 .00000114 00000-0 00000-0 0 9999 +2 33436 0.0138 294.8713 0004901 170.0549 158.0159 1.00274166 31401 +CIEL-2 +1 33453U 08063A 17157.47798289 .00000053 00000-0 00000-0 0 9998 +2 33453 0.0098 325.2717 0003163 97.7131 235.3074 1.00272818 31091 +EUTELSAT HOT BIRD 13C +1 33459U 08065A 17157.25613886 .00000082 00000-0 00000-0 0 9993 +2 33459 0.0576 46.8414 0006473 34.2156 279.0166 1.00275065 14318 +EUTELSAT 48D +1 33460U 08065B 17157.14927659 .00000118 00000-0 00000-0 0 9999 +2 33460 0.0760 54.4942 0002013 19.4905 282.6043 1.00274429 31045 +FENGYUN 2E +1 33463U 08066A 17157.75360454 -.00000198 00000-0 00000-0 0 9993 +2 33463 2.1632 66.9548 0003261 212.3566 333.3623 1.00259862 31022 +EXPRESS-AM44 +1 33595U 09007A 17157.91924353 -.00000093 00000-0 00000-0 0 9991 +2 33595 0.0070 222.3990 0001170 247.4182 105.6063 1.00271553 30499 +NSS-9 +1 33749U 09008A 17157.76339559 .00000067 00000-0 00000-0 0 9994 +2 33749 0.0174 351.2485 0002402 76.2173 285.7820 1.00272814 30451 +EUTELSAT 33E +1 33750U 09008B 17157.91762347 .00000152 00000-0 00000-0 0 9993 +2 33750 0.0257 9.3758 0002718 102.9611 146.5826 1.00272786 30394 +TELSTAR 11N +1 34111U 09009A 17157.57202302 -.00000255 00000-0 00000-0 0 9993 +2 34111 0.0025 13.2728 0002760 51.7493 358.5206 1.00272628 30354 +EUTELSAT 10A +1 34710U 09016A 17157.96249140 .00000064 00000-0 00000-0 0 9997 +2 34710 0.0633 3.3505 0004813 70.8917 177.7955 1.00271293 8197 +SES-7 (PROTOSTAR 2) +1 34941U 09027A 17157.49923914 -.00000350 00000-0 00000-0 0 9990 +2 34941 0.0488 80.0440 0001143 201.2986 261.7544 1.00272726 29553 +MEASAT-3A +1 35362U 09032A 17157.03850047 -.00000248 00000-0 00000-0 0 9996 +2 35362 0.0448 227.8773 0001048 273.5393 218.5906 1.00272701 29178 +GOES 14 +1 35491U 09033A 17156.58341343 -.00000101 00000-0 00000-0 0 9991 +2 35491 0.2454 102.7014 0004603 117.0014 140.2619 1.00270799 29088 +SIRIUS FM-5 +1 35493U 09034A 17157.39958199 -.00000205 00000-0 00000-0 0 9992 +2 35493 0.0100 316.6200 0001231 61.8476 294.2336 1.00271929 28903 +TERRESTAR-1 +1 35496U 09035A 17156.55817255 -.00000066 00000-0 00000-0 0 9995 +2 35496 2.9032 344.2414 0002757 94.4467 265.4160 1.00271910 29109 +ASIASAT 5 +1 35696U 09042A 17157.89006208 -.00000312 00000-0 00000-0 0 9995 +2 35696 0.0352 100.7177 0001776 295.7994 279.8860 1.00273901 28609 +JCSAT-RA (JCSAT-12) +1 35755U 09044A 17156.93761316 -.00000352 00000-0 00000-0 0 9999 +2 35755 0.0661 62.5615 0001582 7.4265 290.0286 1.00272601 28551 +OPTUS D3 +1 35756U 09044B 17157.54201878 -.00000151 00000-0 00000-0 0 9997 +2 35756 0.0273 351.7635 0004121 60.9845 193.5266 1.00274675 28565 +PALAPA D +1 35812U 09046A 17156.97914051 -.00000365 00000-0 00000-0 0 9999 +2 35812 0.0136 18.9745 0002748 87.3136 253.7419 1.00272895 28616 +NIMIQ 5 +1 35873U 09050A 17157.36854942 -.00000262 00000-0 00000-0 0 9993 +2 35873 0.0172 14.4735 0002299 59.0155 241.4463 1.00271352 28295 +AMAZONAS 2 +1 35942U 09054A 17157.85448323 -.00000286 00000-0 00000-0 0 9996 +2 35942 0.0276 90.9532 0004533 11.8293 39.2946 1.00270624 28136 +COMSATBW-1 +1 35943U 09054B 17157.85096675 .00000020 00000-0 00000-0 0 9991 +2 35943 0.0503 88.9976 0002552 343.7982 191.9970 1.00271497 28244 +NSS-12 +1 36032U 09058A 17157.13414867 .00000065 00000-0 00000-0 0 9992 +2 36032 0.0414 65.0318 0002355 10.3984 284.5958 1.00272655 27882 +THOR 6 +1 36033U 09058B 17157.83869049 -.00000014 00000-0 00000-0 0 9991 +2 36033 0.0452 132.8724 0002159 307.5934 116.0491 1.00273364 27976 +INTELSAT 14 (IS-14) +1 36097U 09064A 17157.41670870 -.00000278 00000-0 00000-0 0 9996 +2 36097 0.0148 325.1446 0002797 106.8970 287.9895 1.00272855 27637 +EUTELSAT 36B +1 36101U 09065A 17157.91762347 .00000151 00000-0 00000-0 0 9998 +2 36101 0.0632 1.4658 0004225 73.3033 186.9720 1.00271862 27661 +INTELSAT 15 (IS-15) +1 36106U 09067A 17157.82951986 -.00000190 00000-0 00000-0 0 9998 +2 36106 0.0098 1.9457 0002487 70.1153 207.1345 1.00272292 8240 +DIRECTV 12 +1 36131U 09075A 17156.72800127 -.00000109 00000-0 00000-0 0 9993 +2 36131 0.0275 159.6681 0000566 199.0592 54.8869 1.00270150 27317 +BEIDOU G1 +1 36287U 10001A 17157.89712527 -.00000288 00000-0 00000-0 0 9999 +2 36287 1.4884 359.4741 0002313 160.5357 198.5265 1.00272476 27107 +RADUGA-1M 2 +1 36358U 10002A 17156.06102971 -.00000193 00000-0 00000-0 0 9998 +2 36358 0.0197 278.0107 0002278 180.8803 261.7570 1.00273357 26932 +SDO +1 36395U 10005A 17154.53430946 -.00000039 00000-0 00000-0 0 9997 +2 36395 28.7501 140.6633 0000222 100.1228 102.0693 1.00272472 26930 +INTELSAT 16 (IS-16) +1 36397U 10006A 17157.39494062 -.00000290 00000-0 00000-0 0 9995 +2 36397 0.0100 319.2844 0001807 116.2508 263.5401 1.00272891 26662 +GOES 15 +1 36411U 10008A 17157.66643394 .00000085 00000-0 00000-0 0 9999 +2 36411 0.1816 104.1057 0001663 47.8919 208.0117 1.00264667 26611 +ECHOSTAR 14 +1 36499U 10010A 17157.55819626 -.00000004 00000-0 00000-0 0 9991 +2 36499 0.0147 313.2379 0002913 120.6589 263.3049 1.00272444 26468 +SES-1 +1 36516U 10016A 17157.53742503 -.00000119 00000-0 00000-0 0 9991 +2 36516 0.0219 30.5483 0002873 37.3979 279.6608 1.00272382 25983 +ASTRA 3B +1 36581U 10021A 17157.75195799 .00000133 00000-0 00000-0 0 9997 +2 36581 0.0391 331.8898 0002753 112.5158 105.1380 1.00273632 25816 +COMSATBW-2 +1 36582U 10021B 17157.96011799 .00000085 00000-0 00000-0 0 9994 +2 36582 0.0552 288.8943 0002570 161.1769 164.3284 1.00276949 25918 +BEIDOU G3 +1 36590U 10024A 17157.17118737 -.00000362 00000-0 00000-0 0 9998 +2 36590 1.3400 21.0961 0005900 326.7456 79.1070 1.00268923 25719 +BADR-5 +1 36592U 10025A 17157.71285259 .00000140 00000-0 00000-0 0 9998 +2 36592 0.0149 268.1660 0003147 207.7859 61.9736 1.00275049 25831 +COMS 1 +1 36744U 10032A 17157.77345323 -.00000349 00000-0 00000-0 0 9992 +2 36744 0.0223 54.6123 0001126 17.2407 230.1570 1.00272611 18024 +ARABSAT-5A +1 36745U 10032B 17157.91808519 .00000149 00000-0 00000-0 0 9997 +2 36745 0.0516 7.4356 0002774 71.0605 178.0009 1.00270875 25588 +ECHOSTAR 15 +1 36792U 10034A 17157.93114624 -.00000285 00000-0 00000-0 0 9992 +2 36792 0.0163 326.6210 0002811 120.7234 81.7356 1.00274228 25317 +NILESAT 201 +1 36830U 10037A 17157.91924353 -.00000061 00000-0 00000-0 0 9996 +2 36830 0.0557 147.5290 0006449 289.2971 142.6059 1.00272093 25309 +RASCOM-QAF 1R +1 36831U 10037B 17157.28397349 .00000013 00000-0 00000-0 0 9992 +2 36831 0.0241 4.5323 0004147 67.0781 288.4347 1.00269772 25245 +CHINASAT 6A (ZX 6A) +1 37150U 10042A 17156.38172375 -.00000362 00000-0 00000-0 0 9991 +2 37150 0.0303 76.0858 0002117 105.5893 334.7872 1.00270274 24823 +QZS-1 (MICHIBIKI) +1 37158U 10045A 17157.90776417 -.00000101 00000-0 00000-0 0 9999 +2 37158 40.8420 159.4727 0752934 270.2097 289.7799 1.00282324 24689 +XM-5 +1 37185U 10053A 17157.39960486 -.00000210 00000-0 00000-0 0 9993 +2 37185 0.0159 321.5041 0001950 37.8879 314.2652 1.00273149 24370 +BSAT-3B +1 37207U 10056B 17157.73216803 -.00000355 00000-0 00000-0 0 9996 +2 37207 0.0458 328.4181 0002832 38.4537 261.9045 1.00271999 19195 +BEIDOU G4 +1 37210U 10057A 17157.76302275 -.00000117 00000-0 00000-0 0 9999 +2 37210 0.7140 41.5129 0002592 174.3277 114.1286 1.00273985 24226 +SKYTERRA 1 +1 37218U 10061A 17157.49089657 -.00000124 00000-0 00000-0 0 9996 +2 37218 3.2345 330.5505 0003926 156.4352 203.5108 1.00273487 24161 +ZHONGXING-20A +1 37234U 10064A 17157.83107270 -.00000342 00000-0 00000-0 0 9999 +2 37234 0.0497 252.4998 0003318 154.1537 277.9389 1.00267000 23962 +HYLAS 1 +1 37237U 10065A 17157.38521387 -.00000239 00000-0 00000-0 0 9997 +2 37237 0.0389 40.1805 0001814 38.8492 281.1460 1.00270886 23942 +INTELSAT 17 (IS-17) +1 37238U 10065B 17157.89278181 -.00000006 00000-0 00000-0 0 9997 +2 37238 0.0101 291.2063 0002311 147.7385 203.9456 1.00272275 20368 +EUTELSAT KA-SAT 9A +1 37258U 10069A 17157.26711220 .00000057 00000-0 00000-0 0 9995 +2 37258 0.0333 291.8546 0002476 175.7444 252.4284 1.00278754 10981 +HISPASAT 1E +1 37264U 10070A 17157.65195397 -.00000220 00000-0 00000-0 0 9991 +2 37264 0.0706 110.0648 0004979 347.7622 2.1245 1.00271641 20128 +KOREASAT 6 +1 37265U 10070B 17157.93007414 -.00000366 00000-0 00000-0 0 9996 +2 37265 0.0092 309.0212 0002028 105.8293 291.4938 1.00270400 23716 +BEIDOU IGSO 3 +1 37384U 11013A 17157.95024447 -.00000219 00000-0 10000-3 0 9994 +2 37384 57.8138 73.0428 0026511 210.5075 74.5458 1.00264335 22616 +INTELSAT NEW DAWN +1 37392U 11016A 17157.91808519 .00000151 00000-0 00000-0 0 9992 +2 37392 0.0124 310.0296 0000824 63.2254 245.5350 1.00271368 20239 +YAHSAT 1A +1 37393U 11016B 17157.57855374 .00000096 00000-0 00000-0 0 9994 +2 37393 0.0088 304.6116 0002219 144.9465 66.3902 1.00271269 22492 +TELSTAR 14R +1 37602U 11021A 17157.95317137 -.00000284 00000-0 00000-0 0 9995 +2 37602 0.0172 352.7963 0001552 49.4524 133.4413 1.00272534 22799 +GSAT-8 +1 37605U 11022A 17157.85329606 .00000080 00000-0 00000-0 0 9995 +2 37605 0.0441 274.3293 0003400 45.0355 298.2936 1.00273271 20151 +ST-2 +1 37606U 11022B 17157.45981177 -.00000217 00000-0 00000-0 0 9992 +2 37606 0.0397 114.8699 0001056 289.8834 103.8397 1.00271415 22203 +CHINASAT 10 (ZX 10) +1 37677U 11026A 17157.96923471 -.00000356 00000-0 00000-0 0 9997 +2 37677 0.0638 276.1553 0002479 222.3704 216.4311 1.00268996 21901 +TIANLIAN 1-02 +1 37737U 11032A 17157.76269751 .00000024 00000-0 00000-0 0 9994 +2 37737 2.5713 77.5385 0004133 224.3807 44.7881 1.00275324 21659 +GSAT-12 +1 37746U 11034A 17157.90983847 -.00000169 00000-0 00000-0 0 9992 +2 37746 0.0175 312.6345 0007942 142.4166 210.9774 1.00271473 10424 +SES-3 +1 37748U 11035A 17157.53283324 -.00000106 00000-0 00000-0 0 9998 +2 37748 0.0233 312.0806 0002815 86.6892 305.1847 1.00269738 21629 +KAZSAT-2 +1 37749U 11035B 17157.54021977 -.00000202 00000-0 00000-0 0 9991 +2 37749 0.0336 243.8747 0001402 224.8646 67.3812 1.00269450 21500 +ASTRA 1N +1 37775U 11041A 17156.64834056 .00000113 00000-0 00000-0 0 9997 +2 37775 0.0509 21.2424 0005680 34.8032 90.8175 1.00275052 11463 +BSAT-3C (JCSAT-110R) +1 37776U 11041B 17157.96923750 -.00000355 00000-0 00000-0 0 9993 +2 37776 0.0173 339.7994 0000221 150.8905 223.7644 1.00270349 17439 +PAKSAT-1R +1 37779U 11042A 17157.91606583 .00000150 00000-0 00000-0 0 9996 +2 37779 0.0561 124.7736 0003650 295.9957 202.4185 1.00274039 21413 +CHINASAT 1A (ZX 1A) +1 37804U 11047A 17156.11357760 -.00000347 00000-0 00000-0 0 9990 +2 37804 0.0612 100.8674 0000325 277.4419 46.1710 1.00270138 21007 +COSMOS 2473 +1 37806U 11048A 17156.33223026 -.00000116 00000-0 00000-0 0 9998 +2 37806 0.0617 100.9188 0004391 357.4588 261.6708 1.00272552 20998 +SES-2 +1 37809U 11049A 17157.39955912 -.00000201 00000-0 00000-0 0 9990 +2 37809 0.0142 329.0445 0002694 87.8130 254.9818 1.00272084 20947 +ARABSAT-5C +1 37810U 11049B 17157.85991851 .00000119 00000-0 00000-0 0 9992 +2 37810 0.0615 358.9626 0002970 80.4993 145.5734 1.00273302 20844 +EUTELSAT 7 WEST A +1 37816U 11051A 17157.31235323 -.00000066 00000-0 00000-0 0 9999 +2 37816 0.0591 3.6728 0004397 139.9932 216.3640 1.00271238 20904 +QUETZSAT 1 +1 37826U 11054A 17157.59285705 -.00000246 00000-0 00000-0 0 9992 +2 37826 0.0168 345.0766 0003228 96.2390 310.2983 1.00272494 16853 +INTELSAT 18 (IS-18) +1 37834U 11056A 17157.76221866 .00000048 00000-0 00000-0 0 9999 +2 37834 0.0183 358.4864 0002192 77.2725 273.9864 1.00273099 20878 +EUTELSAT 16A +1 37836U 11057A 17157.75177503 .00000100 00000-0 00000-0 0 9998 +2 37836 0.0640 358.7853 0004559 80.3391 102.8677 1.00273992 20720 +VIASAT-1 +1 37843U 11059A 17157.55657872 -.00000028 00000-0 00000-0 0 9998 +2 37843 0.0236 332.0258 0002788 98.6617 269.7295 1.00270478 21207 +ASIASAT 7 +1 37933U 11069A 17157.96397713 -.00000338 00000-0 00000-0 0 9993 +2 37933 0.0339 90.0623 0001623 314.3435 303.6651 1.00269996 11791 +LUCH 5A +1 37951U 11074B 17157.76286118 -.00000048 00000-0 00000-0 0 9991 +2 37951 1.5593 181.5961 0002924 232.2936 283.0553 1.00269984 20125 +NIGCOMSAT 1R +1 38014U 11077A 17157.73438644 .00000140 00000-0 00000-0 0 9997 +2 38014 0.0313 230.4947 0000634 180.2270 151.4601 1.00273119 19964 +FENGYUN 2F +1 38049U 12002A 17157.96468103 -.00000362 00000-0 00000-0 0 9999 +2 38049 1.6969 78.1971 0003839 190.7806 85.9216 1.00278696 19824 +SES-4 +1 38087U 12007A 17157.11470229 -.00000174 00000-0 00000-0 0 9996 +2 38087 0.0170 356.7705 0002200 91.8215 185.4172 1.00271589 19202 +BEIDOU G5 +1 38091U 12008A 17157.85253652 .00000051 00000-0 00000-0 0 9995 +2 38091 2.2012 56.2652 0002344 222.1259 342.6549 1.00271392 19415 +INTELSAT 22 (IS-22) +1 38098U 12011A 17157.09228884 -.00000065 00000-0 00000-0 0 9997 +2 38098 0.0185 354.8786 0001888 85.1505 279.9922 1.00273219 18772 +APSTAR 7 +1 38107U 12013A 17157.96725832 -.00000106 00000-0 00000-0 0 9997 +2 38107 0.0373 65.1972 0002380 6.2732 248.8047 1.00272749 19103 +YAHSAT 1B +1 38245U 12016A 17157.50535265 .00000121 00000-0 00000-0 0 9998 +2 38245 0.0196 306.8057 0001866 128.0132 49.8106 1.00274079 18857 +JCSAT-13 +1 38331U 12023A 17156.94850367 -.00000363 00000-0 00000-0 0 9991 +2 38331 0.0110 308.1395 0002132 120.4353 291.4477 1.00272159 18467 +VINASAT-2 +1 38332U 12023B 17157.91601519 -.00000333 00000-0 00000-0 0 9990 +2 38332 0.0132 25.7857 0001991 60.3401 270.9879 1.00271910 13596 +NIMIQ 6 +1 38342U 12026A 17157.54443457 -.00000178 00000-0 00000-0 0 9995 +2 38342 0.0105 358.5601 0002789 64.2544 297.2147 1.00272560 18539 +CHINASAT 2A (ZX 2A) +1 38352U 12028A 17157.85699163 -.00000297 00000-0 00000-0 0 9991 +2 38352 0.0494 237.5227 0003466 135.8783 288.8087 1.00268939 18572 +INTELSAT 19 (IS-19) +1 38356U 12030A 17156.83216273 -.00000063 00000-0 00000-0 0 9993 +2 38356 0.0168 354.6506 0002633 79.7464 285.6317 1.00272104 17403 +ECHOSTAR 17 +1 38551U 12035A 17157.58873433 -.00000080 00000-0 00000-0 0 9994 +2 38551 0.0233 332.4519 0001981 103.0033 284.5667 1.00270136 18016 +METEOSAT-10 (MSG-3) +1 38552U 12035B 17157.29126091 -.00000010 00000-0 00000-0 0 9997 +2 38552 0.8697 351.3752 0002086 124.9845 243.6636 1.00265605 17823 +SES-5 +1 38652U 12036A 17157.75152347 .00000029 00000-0 00000-0 0 9992 +2 38652 0.0395 274.3756 0002074 160.0925 96.3891 1.00272923 18004 +TIANLIAN 1-03 +1 38730U 12040A 17157.26256946 .00000068 00000-0 00000-0 0 9993 +2 38730 0.1236 269.7366 0003508 194.5925 255.7104 1.00276653 17928 +INTELSAT 20 (IS-20) +1 38740U 12043A 17157.10209497 -.00000031 00000-0 00000-0 0 9990 +2 38740 0.0074 355.5859 0000369 257.1739 107.2361 1.00270572 17706 +HYLAS 2 +1 38741U 12043B 17157.20607275 .00000148 00000-0 00000-0 0 9996 +2 38741 0.0225 332.1395 0002536 109.3849 278.5043 1.00270614 17705 +INTELSAT 21 (IS-21) +1 38749U 12045A 17156.45544027 -.00000292 00000-0 00000-0 0 9998 +2 38749 0.0207 327.2182 0002224 103.5571 289.2487 1.00269618 17471 +ASTRA 2F +1 38778U 12051A 17157.21388270 .00000144 00000-0 00000-0 0 9993 +2 38778 0.0550 223.5384 0001024 294.3720 202.0940 1.00274747 17227 +GSAT-10 +1 38779U 12051B 17157.06200223 -.00000172 00000-0 00000-0 0 9990 +2 38779 0.0600 108.0287 0003098 319.0622 292.9417 1.00272826 17225 +INTELSAT 23 (IS-23) +1 38867U 12057A 17157.43886168 -.00000290 00000-0 00000-0 0 9994 +2 38867 0.0168 327.2962 0001873 101.8709 290.8530 1.00269890 17049 +BEIDOU G6 +1 38953U 12059A 17157.96657905 -.00000180 00000-0 10000-3 0 9997 +2 38953 1.6354 80.0230 0003232 164.6746 82.8829 1.00271201 16981 +LUCH 5B +1 38977U 12061A 17157.68524606 -.00000137 00000-0 00000-0 0 9994 +2 38977 3.5243 74.5915 0003594 334.5503 76.4936 1.00270463 17116 +YAMAL 300K +1 38978U 12061B 17157.76339559 .00000067 00000-0 00000-0 0 9996 +2 38978 0.0077 269.8177 0001550 295.7230 147.5796 1.00272474 16564 +STAR ONE C3 +1 38991U 12062A 17157.71332171 -.00000253 00000-0 00000-0 0 9998 +2 38991 0.0734 91.7888 0001666 340.8503 4.4402 1.00270979 16702 +EUTELSAT 21B +1 38992U 12062B 17157.23219512 .00000124 00000-0 00000-0 0 9995 +2 38992 0.0675 19.6007 0002324 63.2598 277.1661 1.00274141 16791 +ECHOSTAR 16 +1 39008U 12065A 17157.46241711 -.00000287 00000-0 00000-0 0 9999 +2 39008 0.0183 335.1454 0002154 98.7759 286.1030 1.00272183 16748 +CHINASAT 12 (ZX 12) +1 39017U 12067A 17157.45137810 -.00000212 00000-0 00000-0 0 9992 +2 39017 0.0380 80.8874 0003130 347.3808 76.7743 1.00271328 16441 +EUTELSAT 70B +1 39020U 12069A 17157.09675105 -.00000050 00000-0 00000-0 0 9992 +2 39020 0.0642 23.6083 0002690 84.5928 251.8281 1.00271618 16441 +YAMAL 402 +1 39022U 12070A 17156.83195538 .00000079 00000-0 10000-3 0 9998 +2 39022 0.0026 350.1820 0002673 86.6284 172.0224 1.00273066 16524 +SKYNET 5D +1 39034U 12075A 17157.95131024 .00000095 00000-0 00000-0 0 9994 +2 39034 0.0732 340.9460 0003806 99.6409 210.1949 1.00274362 16102 +MEXSAT 3 +1 39035U 12075B 17156.61273742 -.00000033 00000-0 00000-0 0 9994 +2 39035 0.0056 236.9808 0001770 202.6099 280.4292 1.00271446 16102 +TDRS 11 +1 39070U 13004A 17157.67865594 .00000085 00000-0 00000-0 0 9991 +2 39070 5.4081 328.6812 0008105 303.3057 56.5753 1.00265821 13633 +AMAZONAS 3 +1 39078U 13006A 17156.46368881 -.00000290 00000-0 00000-0 0 9993 +2 39078 0.0058 178.2682 0001754 277.6277 264.1241 1.00269298 11819 +AZERSPACE 1 +1 39079U 13006B 17156.16738929 .00000124 00000-0 00000-0 0 9990 +2 39079 0.0450 109.2747 0002427 335.6506 275.1008 1.00273612 15733 +EUTELSAT 117 WEST A +1 39122U 13012A 17156.61823271 -.00000020 00000-0 00000-0 0 9997 +2 39122 0.0301 334.3523 0002356 95.1526 290.5205 1.00270899 15386 +ANIK G1 +1 39127U 13014A 17157.58925234 -.00000079 00000-0 00000-0 0 9997 +2 39127 0.0122 300.7710 0001022 91.0215 328.2144 1.00272314 15190 +CHINASAT 11 (ZX 11) +1 39157U 13020A 17157.88521376 -.00000296 00000-0 00000-0 0 9990 +2 39157 0.0216 297.5545 0002161 19.5915 355.0250 1.00272870 15084 +EUTELSAT 7B +1 39163U 13022A 17157.27263000 .00000043 00000-0 00000-0 0 9998 +2 39163 0.0500 34.9279 0004218 2.0841 323.0174 1.00274777 14935 +SES-6 +1 39172U 13026A 17157.86072084 -.00000265 00000-0 00000-0 0 9994 +2 39172 0.0343 44.6534 0002271 33.2374 86.9252 1.00272899 14661 +IRNSS-1A +1 39199U 13034A 17157.45833099 .00000110 00000-0 00000-0 0 9996 +2 39199 28.8033 115.2188 0018966 189.2548 170.6083 1.00273932 14579 +ALPHASAT +1 39215U 13038A 17157.30226941 .00000131 00000-0 00000-0 0 9998 +2 39215 1.6886 29.2099 0002635 31.5775 327.7603 1.00270357 10987 +INSAT-3D +1 39216U 13038B 17157.06441889 -.00000163 00000-0 00000-0 0 9998 +2 39216 0.0121 6.4352 0000691 34.8253 318.7445 1.00271459 14239 +EUTELSAT 25B +1 39233U 13044A 17157.22143286 .00000137 00000-0 00000-0 0 9992 +2 39233 0.0521 26.6700 0001824 46.4596 286.8905 1.00271878 13578 +GSAT-7 +1 39234U 13044B 17157.08691953 -.00000084 00000-0 00000-0 0 9998 +2 39234 0.0182 263.6715 0000935 51.5189 44.8019 1.00273002 12284 +AMOS-4 +1 39237U 13045A 17157.11192798 .00000001 00000-0 00000-0 0 9997 +2 39237 0.0546 115.1014 0000970 303.3385 301.5694 1.00273651 13899 +ASTRA 2E +1 39285U 13056A 17157.21313460 .00000144 00000-0 00000-0 0 9992 +2 39285 0.0570 13.9752 0002212 49.4873 296.5603 1.00271660 13402 +SIRIUS FM-6 +1 39360U 13058A 17156.61640136 -.00000024 00000-0 00000-0 0 9992 +2 39360 0.0064 1.2561 0001302 214.3345 144.3998 1.00270910 13277 +RADUGA-1M 3 +1 39375U 13062A 17153.54222145 -.00000055 00000-0 00000-0 0 9992 +2 39375 0.0111 85.9904 0003557 1.3292 69.0907 1.00272620 13021 +SES-8 +1 39460U 13071A 17157.02889498 -.00000276 00000-0 00000-0 0 9999 +2 39460 0.0261 285.7228 0003217 152.2287 282.0846 1.00271753 11454 +INMARSAT 5-F1 +1 39476U 13073A 17157.78416375 .00000023 00000-0 00000-0 0 9990 +2 39476 0.0226 348.4229 0000042 157.5437 94.3041 1.00271057 12862 +TKSAT-1 (TUPAC KATARI) +1 39481U 13075A 17157.39955912 -.00000199 00000-0 00000-0 0 9995 +2 39481 0.0262 80.8028 0002650 325.1093 265.7352 1.00268861 12778 +EXPRESS-AM5 +1 39487U 13077A 17157.08737148 -.00000286 00000-0 00000-0 0 9995 +2 39487 0.0183 225.9272 0001087 152.4247 47.8212 1.00272613 13308 +GSAT-14 +1 39498U 14001A 17157.08704643 -.00000083 00000-0 00000-0 0 9994 +2 39498 0.0121 359.3211 0005096 75.5744 285.1609 1.00269350 12386 +THAICOM 6 +1 39500U 14002A 17157.93664877 -.00000125 00000-0 00000-0 0 9994 +2 39500 0.0699 124.7999 0003423 337.4406 209.0050 1.00271102 12387 +TDRS 12 +1 39504U 14004A 17157.33909738 -.00000280 00000-0 00000-0 0 9994 +2 39504 5.9899 336.1128 0000870 62.9722 296.9805 1.00276997 11215 +ABS-2 +1 39508U 14006A 17157.08454168 -.00000092 00000-0 00000-0 0 9995 +2 39508 0.0260 25.0067 0002927 56.4361 278.5904 1.00271774 12254 +ATHENA-FIDUS +1 39509U 14006B 17157.18733805 .00000148 00000-0 00000-0 0 9996 +2 39509 0.0240 56.4962 0001464 32.4149 271.1056 1.00273442 12002 +TURKSAT 4A +1 39522U 14007A 17157.17566243 .00000140 00000-0 00000-0 0 9993 +2 39522 0.0407 278.7972 0000805 116.4412 324.7670 1.00270948 11932 +EXPRESS-AT1 +1 39612U 14010A 17157.99154439 .00000074 00000-0 00000-0 0 9993 +2 39612 0.0243 210.4438 0000568 272.7509 185.3502 1.00273705 11983 +EXPRESS-AT2 +1 39613U 14010B 17157.08877310 -.00000288 00000-0 00000-0 0 9992 +2 39613 0.0210 217.2465 0000533 238.6254 330.6118 1.00270915 11813 +AMAZONAS 4A +1 39616U 14011A 17157.46096683 -.00000287 00000-0 00000-0 0 9993 +2 39616 0.0867 79.0306 0005518 343.3597 297.6664 1.00273138 11801 +ASTRA 5B +1 39617U 14011B 17157.91823566 .00000151 00000-0 00000-0 0 9991 +2 39617 0.0442 321.6428 0003825 122.9841 172.8998 1.00272907 11610 +IRNSS-1B +1 39635U 14017A 17156.95952933 .00000048 00000-0 00000-0 0 9996 +2 39635 29.1089 295.0821 0021490 179.1997 180.7604 1.00275528 11528 +LUCH 5V +1 39727U 14023A 17157.96502630 -.00000273 00000-0 00000-0 0 9993 +2 39727 2.7255 299.0335 0002078 147.0891 251.5913 1.00273263529465 +KAZSAT-3 +1 39728U 14023B 17157.12992527 .00000054 00000-0 00000-0 0 9996 +2 39728 0.0095 359.2657 0000563 147.0049 213.7329 1.00271437 9383 +EUTELSAT 3B +1 39773U 14030A 17157.94471205 .00000016 00000-0 00000-0 0 9997 +2 39773 0.0590 5.2305 0002365 82.6403 150.8644 1.00273880 11019 +ASIASAT 8 +1 40107U 14046A 17157.30284274 -.00000039 00000-0 00000-0 0 9991 +2 40107 0.0156 316.3110 0002166 118.5885 285.1248 1.00271407 69098 +ASIASAT 6 +1 40141U 14052A 17157.93766262 -.00000366 00000-0 00000-0 0 9990 +2 40141 0.0178 58.3054 0000886 3.9150 290.7769 1.00271863 9998 +OPTUS 10 +1 40146U 14054A 17156.83773548 -.00000081 00000-0 00000-0 0 9994 +2 40146 0.0340 82.9484 0001623 350.1925 286.8765 1.00271044 10053 +MEASAT-3B +1 40147U 14054B 17157.03852819 -.00000248 00000-0 00000-0 0 9992 +2 40147 0.0238 357.1097 0002084 48.7697 314.1376 1.00269730 10103 +LUCH (OLYMP) +1 40258U 14058A 17157.78938271 .00000063 00000-0 00000-0 0 9992 +2 40258 0.0460 143.2667 0000810 265.0279 141.1304 1.00271236 9870 +HIMAWARI-8 +1 40267U 14060A 17156.90236236 -.00000282 00000-0 00000-0 0 9994 +2 40267 0.0119 325.0622 0001214 124.4028 270.5486 1.00271594 9797 +IRNSS-1C +1 40269U 14061A 17157.75544524 -.00000164 00000-0 00000-0 0 9992 +2 40269 3.0397 249.9431 0018690 6.2154 354.2400 1.00272682 9756 +INTELSAT 30 (IS-30) +1 40271U 14062A 17156.40832028 -.00000159 00000-0 00000-0 0 9990 +2 40271 0.0114 8.1186 0001576 102.5867 195.2506 1.00272785 9687 +ARSAT 1 +1 40272U 14062B 17157.39970265 -.00000265 00000-0 00000-0 0 9994 +2 40272 0.0314 136.5216 0001345 294.2969 256.2682 1.00272031 9818 +EXPRESS-AM6 +1 40277U 14064A 17157.95131343 .00000094 00000-0 00000-0 0 9998 +2 40277 0.0134 313.3619 0001000 156.2831 181.3635 1.00271307 8526 +GSAT-16 +1 40332U 14078A 17157.13958014 .00000078 00000-0 00000-0 0 9999 +2 40332 0.0783 272.6390 0007957 162.2825 285.1671 1.00272671 9190 +DIRECTV 14 +1 40333U 14078B 17157.53940927 -.00000130 00000-0 00000-0 0 9998 +2 40333 0.0193 291.3592 0001426 68.8528 349.8871 1.00274125 9178 +YAMAL 401 +1 40345U 14082A 17152.86438141 -.00000245 00000-0 00000-0 0 9994 +2 40345 0.0664 103.2093 0000168 299.4691 248.9586 1.00269334 9297 +ASTRA 2G +1 40364U 14089A 17157.21405344 .00000144 00000-0 00000-0 0 9992 +2 40364 0.0364 31.6860 0005116 29.5303 298.8354 1.00272096 8904 +FENGYUN 2G +1 40367U 14090A 17157.97017683 -.00000331 00000-0 00000-0 0 9994 +2 40367 0.4550 257.2998 0003702 327.1910 124.6866 1.00261694 8979 +INMARSAT 5-F2 +1 40384U 15005A 17157.57688493 -.00000290 00000-0 00000-0 0 9993 +2 40384 0.0216 336.1453 0000002 138.6792 293.0412 1.00270180 8618 +ABS-3A +1 40424U 15010A 17156.30270265 -.00000034 00000-0 00000-0 0 9994 +2 40424 0.0166 334.1046 0001967 21.5779 4.3158 1.00270458 8336 +EUTELSAT 115 WEST B +1 40425U 15010B 17156.61293761 -.00000032 00000-0 00000-0 0 9993 +2 40425 0.0060 158.5821 0000506 154.2196 47.1932 1.00268158 8366 +EXPRESS-AM7 +1 40505U 15012A 17157.74217898 .00000146 00000-0 00000-0 0 9991 +2 40505 0.0070 32.4634 0002254 29.6477 140.4119 1.00274561 8298 +IRNSS-1D +1 40547U 15018A 17157.79985935 -.00000331 00000-0 00000-0 0 9999 +2 40547 29.0945 295.1992 0021169 178.4207 181.5447 1.00273872 7935 +BEIDOU I1-S +1 40549U 15019A 17157.96031042 -.00000167 00000-0 00000-0 0 9999 +2 40549 54.4117 333.8858 0040189 185.8887 173.9188 1.00295772 8010 +THOR 7 +1 40613U 15022A 17157.29387069 -.00000014 00000-0 00000-0 0 9995 +2 40613 0.0055 16.7658 0002798 58.2999 284.9653 1.00269452 7763 +TURKMENALEM52E/MONACOSAT +1 40617U 15023A 17157.14794716 .00000097 00000-0 00000-0 0 9995 +2 40617 0.0108 344.4284 0002771 86.6968 288.9050 1.00274348 7770 +DIRECTV 15 +1 40663U 15026A 17156.57931752 -.00000110 00000-0 00000-0 0 9995 +2 40663 0.0400 105.4351 0000308 356.6694 257.8980 1.00270125 7468 +SKY MEXICO-1 +1 40664U 15026B 17156.51304984 -.00000241 00000-0 00000-0 0 9996 +2 40664 0.0192 334.0846 0002191 94.4621 291.4767 1.00269981 7460 +METEOSAT-11 (MSG-4) +1 40732U 15034A 17156.97556449 -.00000031 00000-0 00000-0 0 9993 +2 40732 1.8409 241.7802 0000480 251.7722 108.9386 1.00266938 6974 +STAR ONE C4 +1 40733U 15034B 17156.48870247 -.00000272 00000-0 00000-0 0 9992 +2 40733 0.0645 72.8856 0002561 335.6664 311.4689 1.00273409 6966 +INTELSAT 34 (IS-34) +1 40874U 15039A 17157.44569474 -.00000290 00000-0 00000-0 0 9997 +2 40874 0.0253 324.4014 0000673 42.2274 353.3721 1.00270149 6611 +EUTELSAT 8 WEST B +1 40875U 15039B 17157.31420641 -.00000071 00000-0 00000-0 0 9993 +2 40875 0.0669 345.0647 0002924 77.3120 297.6536 1.00272288 6625 +GSAT-6 +1 40880U 15041A 17157.06177879 -.00000171 00000-0 00000-0 0 9997 +2 40880 0.0248 283.2072 0005968 358.2972 78.4282 1.00271204 6581 +INMARSAT 5-F3 +1 40882U 15042A 17156.79441291 .00000043 00000-0 00000-0 0 9998 +2 40882 0.0217 333.5493 0000755 130.8034 255.6557 1.00268467 6498 +TJS-1 +1 40892U 15046A 17157.67437281 -.00000160 00000-0 00000-0 0 9996 +2 40892 0.0390 94.0423 0001961 297.6627 261.4249 1.00274282 6487 +EXPRESS-AM8 +1 40895U 15048A 17156.34083615 -.00000119 00000-0 00000-0 0 9996 +2 40895 0.0188 221.4276 0000582 228.7531 272.4900 1.00273368 6305 +BEIDOU I2-S +1 40938U 15053A 17157.91354792 -.00000167 00000-0 00000-0 0 9994 +2 40938 54.2196 296.7873 0047087 172.5226 207.7175 1.00295744 6306 +SKY MUSTER (NBN1A) +1 40940U 15054A 17156.90352899 -.00000286 00000-0 00000-0 0 9994 +2 40940 0.0244 321.8934 0002086 107.5619 290.5671 1.00269508 6225 +ARSAT 2 +1 40941U 15054B 17156.51913242 -.00000232 00000-0 00000-0 0 9998 +2 40941 0.0430 126.2431 0001678 307.5160 286.2584 1.00272441 6259 +MORELOS 3 +1 40946U 15056A 17156.52375644 -.00000058 00000-0 00000-0 0 9990 +2 40946 6.4382 329.6573 0001266 194.3751 165.5754 1.00273198 6211 +APSTAR 9 +1 40982U 15059A 17156.89859662 -.00000273 00000-0 00000-0 0 9999 +2 40982 0.0437 132.3717 0000361 252.7207 334.9088 1.00271279 6097 +TURKSAT 4B +1 40984U 15060A 17157.15358557 .00000109 00000-0 00000-0 0 9997 +2 40984 0.0129 13.5932 0002306 57.1606 289.2712 1.00271214 6047 +CHINASAT 2C (ZX 2C) +1 41021U 15063A 17157.96519169 -.00000328 00000-0 00000-0 0 9994 +2 41021 0.0135 187.6740 0002205 206.8564 311.9405 1.00272905 5949 +GSAT-15 +1 41028U 15065A 17157.03303586 -.00000264 00000-0 00000-0 0 9994 +2 41028 0.0814 274.8255 0003106 130.7632 314.4368 1.00272144 5785 +BADR-7 (ARABSAT-6B) +1 41029U 15065B 17157.21998263 .00000139 00000-0 00000-0 0 9997 +2 41029 0.0441 258.8634 0002007 329.0067 132.1129 1.00271737 5685 +LAOSAT 1 +1 41034U 15067A 17156.93622780 -.00000350 00000-0 00000-0 0 9997 +2 41034 0.0174 12.3004 0001327 146.2409 201.4638 1.00267265 5801 +TELSTAR 12V +1 41036U 15068A 17157.33359668 -.00000124 00000-0 00000-0 0 9996 +2 41036 0.0227 64.3782 0002247 3.4888 292.1572 1.00272340 5555 +CHINASAT 1C (ZX 1C) +1 41103U 15073A 17157.98537590 -.00000155 00000-0 00000-0 0 9994 +2 41103 0.0095 189.8426 0002402 127.5052 14.4726 1.00273936 5609 +ELEKTRO-L 2 +1 41105U 15074A 17157.96725832 -.00000102 00000-0 00000-0 0 9995 +2 41105 0.0738 190.6773 0001945 246.5160 242.6717 1.00272238 5455 +COSMOS 2513 +1 41121U 15075A 17157.45624638 -.00000143 00000-0 00000-0 0 9995 +2 41121 0.0997 101.1679 0001968 48.3364 350.0262 1.00270866 5534 +EXPRESS-AMU1 +1 41191U 15082A 17157.91591514 .00000151 00000-0 00000-0 0 9995 +2 41191 0.0024 331.7311 0002025 93.7745 195.8078 1.00271621 5448 +GAOFEN 4 +1 41194U 15083A 17157.96397770 -.00000339 00000-0 00000-0 0 9991 +2 41194 0.0802 99.3310 0003190 117.4378 131.5242 1.00269785 5427 +BELINTERSAT-1 +1 41238U 16001A 17156.89909698 .00000100 00000-0 10000-3 0 9999 +2 41238 0.0412 131.9830 0001783 301.3605 196.3216 1.00272261 5193 +IRNSS-1E +1 41241U 16003A 17151.92699686 -.00000279 00000-0 00000-0 0 9991 +2 41241 28.7592 114.9659 0019172 183.8467 36.2942 1.00270514 5077 +INTELSAT 29E (IS-29E) +1 41308U 16004A 17157.43055619 -.00000287 00000-0 00000-0 0 9999 +2 41308 0.0402 124.8072 0002054 314.9781 280.2382 1.00272516 5118 +EUTELSAT 9B +1 41310U 16005A 17157.26699015 .00000057 00000-0 00000-0 0 9992 +2 41310 0.0496 126.1871 0001739 220.0825 13.7258 1.00274685 5054 +SES-9 +1 41380U 16013A 17156.99199875 -.00000352 00000-0 00000-0 0 9995 +2 41380 0.0171 323.9761 0001871 110.6916 285.3528 1.00272955 4681 +EUTELSAT 65 WEST A +1 41382U 16014A 17156.47536617 -.00000284 00000-0 00000-0 0 9994 +2 41382 0.0464 4.2061 0001803 67.6657 288.1467 1.00273478 4491 +IRNSS-1F +1 41384U 16015A 17156.94054837 .00000154 00000-0 00000-0 0 9993 +2 41384 4.1802 265.3994 0022688 181.7070 178.5192 1.00276072 4625 +BEIDOU IGSO 6 +1 41434U 16021A 17157.65734022 -.00000177 00000-0 10000-3 0 9996 +2 41434 55.5278 72.5149 0026618 183.6472 331.4539 1.00272722 4423 +IRNSS-1G +1 41469U 16027A 17157.67271219 -.00000337 00000-0 00000-0 0 9990 +2 41469 4.2514 266.7228 0000811 126.7626 233.4852 1.00276255 4138 +JCSAT 2B +1 41471U 16028A 17156.86540709 -.00000172 00000-0 00000-0 0 9994 +2 41471 0.0206 344.0388 0001744 97.0403 278.9406 1.00271311 4046 +THAICOM 8 +1 41552U 16031A 17156.07731655 -.00000130 00000-0 00000-0 0 9997 +2 41552 0.0755 54.9061 0004450 354.2584 310.8724 1.00271674 3708 +INTELSAT 31 (IS-31) +1 41581U 16035A 17156.55797754 -.00000158 00000-0 00000-0 0 9998 +2 41581 0.0263 266.5979 0001050 350.7469 102.6424 1.00272562 3621 +BEIDOU G7 +1 41586U 16037A 17157.77149967 -.00000255 00000-0 00000-0 0 9995 +2 41586 1.2548 317.4376 0001449 263.9468 96.1170 1.00267179 3733 +ABS-2A (MONGOLSAT-1) +1 41588U 16038A 17157.08504291 -.00000090 00000-0 00000-0 0 9994 +2 41588 0.0175 352.9121 0002063 11.1873 355.9023 1.00271473 3652 +EUTELSAT 117 WEST B +1 41589U 16038B 17156.61871427 -.00000019 00000-0 00000-0 0 9992 +2 41589 0.0011 150.6444 0000191 117.9652 91.3882 1.00273023 3638 +BRISAT +1 41591U 16039A 17156.87509979 -.00000203 00000-0 00000-0 0 9999 +2 41591 0.0197 323.0587 0002303 109.2375 287.7287 1.00271878 3561 +ECHOSTAR 18 +1 41592U 16039B 17156.46482146 -.00000290 00000-0 00000-0 0 9997 +2 41592 0.0186 349.3730 0002661 75.4375 295.2171 1.00272715 3558 +TIANTONG-1 1 +1 41725U 16048A 17157.96535390 -.00000323 00000-0 00000-0 0 9998 +2 41725 4.6001 325.3222 0003197 61.0390 318.1514 1.00268250 3213 +JCSAT-16 +1 41729U 16050A 17156.84308590 -.00000099 00000-0 00000-0 0 9991 +2 41729 0.0182 4.5057 0001977 77.2034 278.3128 1.00270643 3001 +INTELSAT 36 (IS-36) +1 41747U 16053A 17157.10224625 -.00000031 00000-0 00000-0 0 9996 +2 41747 0.0351 68.1148 0003188 305.6980 346.1959 1.00271935 2921 +INTELSAT 33E (IS-33E) +1 41748U 16053B 17157.12580693 .00000042 00000-0 00000-0 0 9990 +2 41748 0.0280 53.2312 0001987 42.9356 263.8558 1.00273968 3158 +INSAT-3DR +1 41752U 16054A 17157.08690279 -.00000083 00000-0 00000-0 0 9999 +2 41752 0.0492 273.0204 0005898 5.9511 80.9615 1.00272237 2752 +GSAT-18 +1 41793U 16060A 17157.08728701 -.00000083 00000-0 00000-0 0 9993 +2 41793 0.0522 125.5807 0008392 321.2972 273.2183 1.00272754 2478 +SKY MUSTER 2 +1 41794U 16060B 17156.89088062 -.00000251 00000-0 00000-0 0 9998 +2 41794 0.0159 317.9919 0001850 114.8702 287.1579 1.00271100 2461 +HIMAWARI-9 +1 41836U 16064A 17156.90204452 -.00000281 00000-0 00000-0 0 9997 +2 41836 0.0132 44.4867 0001500 36.3302 279.1996 1.00273071 2125 +SHIJIAN-17 (SJ-17) +1 41838U 16065A 17157.62437860 -.00000315 00000-0 00000-0 0 9999 +2 41838 0.1537 86.2147 0001778 18.5593 154.3135 1.00090507 2167 +GOES 16 +1 41866U 16071A 17156.54258151 -.00000188 00000-0 00000-0 0 9999 +2 41866 0.0014 287.1718 0000772 114.4348 318.3993 1.00261476 2035 +TIANLIAN 1-04 +1 41869U 16072A 17157.90505278 -.00000111 00000-0 00000-0 0 9995 +2 41869 2.6784 289.9420 0007110 146.7236 221.6497 1.00272396 2259 +FENGYUN 4A +1 41882U 16077A 17157.97017885 -.00000334 00000-0 00000-0 0 9991 +2 41882 0.0320 250.4568 0009426 195.4519 263.5833 1.00269626 1918 +ECHOSTAR 19 +1 41893U 16079A 17156.56377543 -.00000146 00000-0 00000-0 0 9990 +2 41893 0.0231 328.6797 0001923 102.3709 288.9703 1.00273918 1663 +STAR ONE D1 +1 41904U 16082B 17156.52745717 -.00000218 00000-0 00000-0 0 9995 +2 41904 0.0372 91.4069 0002354 350.9388 277.6800 1.00271924 1716 +TJS-2 +1 41911U 17001A 17157.96319302 -.00000345 00000-0 00000-0 0 9992 +2 41911 0.6987 279.6145 0001076 207.3678 222.8143 1.00267197 1667 +HISPASAT 36W-1 +1 41942U 17006A 17156.39406066 -.00000251 00000-0 00000-0 0 9997 +2 41942 0.0574 107.7778 0001097 335.2546 276.9788 1.00272717 1454 +TELKOM 3S +1 41944U 17007A 17156.96517789 -.00000369 00000-0 00000-0 0 9998 +2 41944 0.0196 325.4121 0002604 119.1288 275.4888 1.00269877 1070 +INTELSAT 32E (IS-32E) +1 41945U 17007B 17157.41157112 -.00000274 00000-0 00000-0 0 9995 +2 41945 0.0179 8.1546 0000641 349.1981 2.6473 1.00270850 1176 +ECHOSTAR 23 +1 42070U 17014A 17157.41643175 -.00000278 00000-0 00000-0 0 9996 +2 42070 0.0216 331.8718 0002115 103.7733 284.3784 1.00270214 887 +SES-10 +1 42432U 17017A 17157.47759086 -.00000277 00000-0 00000-0 0 9995 +2 42432 0.0328 338.8066 0002019 110.1376 271.0789 1.00269446 719 +CHINASAT 16 (SJ-13) +1 42662U 17018A 17156.98568600 -.00000359 00000-0 00000-0 0 9997 +2 42662 0.1082 97.0396 0003514 129.1950 133.7356 1.00271270 667 +KOREASAT 7 +1 42691U 17023A 17157.60290750 -.00000367 00000-0 00000-0 0 9992 +2 42691 0.0077 349.1222 0000873 76.8932 162.0996 1.00270811 377 +SGDC +1 42692U 17023B 17157.42566131 -.00000256 00000-0 00000-0 0 9999 +2 42692 0.0526 44.5619 0000855 34.5487 254.8001 1.00271224 375 +GSAT-9 +1 42695U 17024A 17156.71022076 -.00000294 00000-0 00000-0 0 9991 +2 42695 0.0413 178.9945 0003863 260.0872 168.2197 1.00273618 354 +>>>>>>> master diff --git a/data/scene/satellites/tle/gps-ops.txt b/data/scene/satellites/tle/gps-ops.txt index 75e18e3533..018264a3f1 100644 --- a/data/scene/satellites/tle/gps-ops.txt +++ b/data/scene/satellites/tle/gps-ops.txt @@ -1,93 +1,93 @@ -GPS BIIR-2 (PRN 13) -1 24876U 97035A 17157.59786847 .00000019 00000-0 00000-0 0 9996 -2 24876 55.5513 227.5274 0034589 106.0906 254.3641 2.00561883145810 -GPS BIIR-3 (PRN 11) -1 25933U 99055A 17157.81823278 -.00000081 00000-0 00000-0 0 9990 -2 25933 51.6254 78.0928 0166095 94.4525 354.0300 2.00558378129440 -GPS BIIR-4 (PRN 20) -1 26360U 00025A 17157.82515987 .00000060 00000-0 00000-0 0 9996 -2 26360 53.1170 155.3222 0040993 91.9775 104.3666 2.00561532125131 -GPS BIIR-5 (PRN 28) -1 26407U 00040A 17157.93926722 -.00000076 00000-0 00000-0 0 9998 -2 26407 56.6372 345.5470 0199158 270.1220 289.7792 2.00567008123812 -GPS BIIR-6 (PRN 14) -1 26605U 00071A 17157.87543271 .00000026 00000-0 00000-0 0 9993 -2 26605 55.1227 225.2520 0093903 248.3083 174.0281 2.00565489121414 -GPS BIIR-7 (PRN 18) -1 26690U 01004A 17157.89507387 .00000063 00000-0 00000-0 0 9995 -2 26690 53.0389 158.2602 0183394 256.9116 288.9071 2.00570451119814 -GPS BIIR-8 (PRN 16) -1 27663U 03005A 17157.94951778 -.00000076 00000-0 00000-0 0 9997 -2 27663 56.7061 345.2850 0092504 24.7076 300.8478 2.00560319105174 -GPS BIIR-9 (PRN 21) -1 27704U 03010A 17157.88465515 -.00000050 00000-0 00000-0 0 9993 -2 27704 53.8528 98.6489 0242249 264.5394 334.3334 2.00563816103977 -GPS BIIR-10 (PRN 22) -1 28129U 03058A 17157.28858587 .00000066 00000-0 00000-0 0 9992 -2 28129 52.9268 158.2762 0077488 261.4987 97.6433 2.00547197 98653 -GPS BIIR-11 (PRN 19) -1 28190U 04009A 17157.67197517 -.00000090 00000-0 00000-0 0 9997 -2 28190 55.9984 46.3329 0100885 55.9552 221.8691 2.00564644 96849 -GPS BIIR-12 (PRN 23) -1 28361U 04023A 17157.86272955 .00000033 00000-0 00000-0 0 9990 -2 28361 54.1085 220.3751 0119012 220.1274 106.1343 2.00555923 94908 -GPS BIIR-13 (PRN 02) -1 28474U 04045A 17157.74251056 -.00000050 00000-0 00000-0 0 9995 -2 28474 54.2321 98.1213 0170418 247.2038 351.6925 2.00548722 92298 -GPS BIIRM-1 (PRN 17) -1 28874U 05038A 17157.68738399 -.00000090 00000-0 00000-0 0 9999 -2 28874 56.1546 43.5924 0118451 254.5136 55.9262 2.00568186 85694 -GPS BIIRM-2 (PRN 31) -1 29486U 06042A 17157.89402977 -.00000073 00000-0 00000-0 0 9999 -2 29486 55.4047 282.7005 0084721 343.9526 36.5660 2.00559154 78309 -GPS BIIRM-3 (PRN 12) -1 29601U 06052A 17157.30711204 -.00000075 00000-0 00000-0 0 9993 -2 29601 56.6791 344.2294 0064809 49.4604 311.1238 2.00552294 77266 -GPS BIIRM-4 (PRN 15) -1 32260U 07047A 17157.13563594 .00000032 00000-0 00000-0 0 9993 -2 32260 53.2348 216.7628 0090280 32.1796 328.4497 2.00547487 70695 -GPS BIIRM-5 (PRN 29) -1 32384U 07062A 17156.21822177 -.00000098 00000-0 00000-0 0 9993 -2 32384 56.2180 44.2317 0006335 4.0971 192.7823 2.00570259 69404 -GPS BIIRM-6 (PRN 07) -1 32711U 08012A 17157.53427379 -.00000075 00000-0 00000-0 0 9999 -2 32711 55.1332 282.0856 0107470 212.2063 147.1234 2.00556288 67631 -GPS BIIRM-8 (PRN 05) -1 35752U 09043A 17157.70219478 .00000069 00000-0 00000-0 0 9992 -2 35752 54.2537 159.9422 0048788 28.4210 116.6992 2.00553334 57229 -GPS BIIF-1 (PRN 25) -1 36585U 10022A 17157.89436302 -.00000078 00000-0 00000-0 0 9994 -2 36585 55.9864 341.0322 0063534 45.4099 345.2901 2.00574808 51467 -GPS BIIF-2 (PRN 01) -1 37753U 11036A 17157.85963422 -.00000044 00000-0 00000-0 0 9995 -2 37753 55.4395 101.1871 0066031 30.2070 60.5198 2.00562311 43146 -GPS BIIF-3 (PRN 24) -1 38833U 12053A 17157.72375300 -.00000072 00000-0 00000-0 0 9994 -2 38833 54.1611 279.0056 0055661 25.8719 334.3965 2.00561617 33411 -GPS BIIF-4 (PRN 27) -1 39166U 13023A 17157.07836358 -.00000093 00000-0 00000-0 0 9998 -2 39166 55.8615 40.6350 0047704 18.0209 342.1899 2.00565151 29728 -GPS BIIF-5 (PRN 30) -1 39533U 14008A 17157.58173524 -.00000078 00000-0 00000-0 0 9998 -2 39533 54.3154 284.3055 0028684 182.6529 177.3191 2.00563830 23567 -GPS BIIF-6 (PRN 06) -1 39741U 14026A 17157.35873360 -.00000044 00000-0 00000-0 0 9992 -2 39741 55.4261 100.7272 0009830 291.4939 68.3647 2.00562339 22395 -GPS BIIF-7 (PRN 09) -1 40105U 14045A 17157.45126217 .00000031 00000-0 00000-0 0 9997 -2 40105 54.6318 220.2927 0005069 122.1672 237.9622 2.00569715 19965 -GPS BIIF-8 (PRN 03) -1 40294U 14068A 17157.32446828 .00000074 00000-0 00000-0 0 9997 -2 40294 55.0008 160.9300 0007263 345.6258 14.3805 2.00557500 19060 -GPS BIIF-9 (PRN 26) -1 40534U 15013A 17157.46020623 -.00000081 00000-0 00000-0 0 9990 -2 40534 54.9417 340.1560 0018129 358.6255 1.3832 2.00559260 16117 -GPS BIIF-10 (PRN 08) -1 40730U 15033A 17157.11983367 -.00000094 00000-0 00000-0 0 9999 -2 40730 55.3960 40.3091 0027177 318.4074 41.4282 2.00567662 13865 -GPS BIIF-11 (PRN 10) -1 41019U 15062A 17157.67265313 .00000072 00000-0 00000-0 0 9992 -2 41019 55.0103 160.7038 0026458 206.0557 153.8364 2.00563621 11698 -GPS BIIF-12 (PRN 32) -1 41328U 16007A 17157.76013989 .00000034 00000-0 00000-0 0 9993 -2 41328 54.8890 220.4662 0013935 220.3704 139.6078 2.00556828 9756 +GPS BIIR-2 (PRN 13) +1 24876U 97035A 17157.59786847 .00000019 00000-0 00000-0 0 9996 +2 24876 55.5513 227.5274 0034589 106.0906 254.3641 2.00561883145810 +GPS BIIR-3 (PRN 11) +1 25933U 99055A 17157.81823278 -.00000081 00000-0 00000-0 0 9990 +2 25933 51.6254 78.0928 0166095 94.4525 354.0300 2.00558378129440 +GPS BIIR-4 (PRN 20) +1 26360U 00025A 17157.82515987 .00000060 00000-0 00000-0 0 9996 +2 26360 53.1170 155.3222 0040993 91.9775 104.3666 2.00561532125131 +GPS BIIR-5 (PRN 28) +1 26407U 00040A 17157.93926722 -.00000076 00000-0 00000-0 0 9998 +2 26407 56.6372 345.5470 0199158 270.1220 289.7792 2.00567008123812 +GPS BIIR-6 (PRN 14) +1 26605U 00071A 17157.87543271 .00000026 00000-0 00000-0 0 9993 +2 26605 55.1227 225.2520 0093903 248.3083 174.0281 2.00565489121414 +GPS BIIR-7 (PRN 18) +1 26690U 01004A 17157.89507387 .00000063 00000-0 00000-0 0 9995 +2 26690 53.0389 158.2602 0183394 256.9116 288.9071 2.00570451119814 +GPS BIIR-8 (PRN 16) +1 27663U 03005A 17157.94951778 -.00000076 00000-0 00000-0 0 9997 +2 27663 56.7061 345.2850 0092504 24.7076 300.8478 2.00560319105174 +GPS BIIR-9 (PRN 21) +1 27704U 03010A 17157.88465515 -.00000050 00000-0 00000-0 0 9993 +2 27704 53.8528 98.6489 0242249 264.5394 334.3334 2.00563816103977 +GPS BIIR-10 (PRN 22) +1 28129U 03058A 17157.28858587 .00000066 00000-0 00000-0 0 9992 +2 28129 52.9268 158.2762 0077488 261.4987 97.6433 2.00547197 98653 +GPS BIIR-11 (PRN 19) +1 28190U 04009A 17157.67197517 -.00000090 00000-0 00000-0 0 9997 +2 28190 55.9984 46.3329 0100885 55.9552 221.8691 2.00564644 96849 +GPS BIIR-12 (PRN 23) +1 28361U 04023A 17157.86272955 .00000033 00000-0 00000-0 0 9990 +2 28361 54.1085 220.3751 0119012 220.1274 106.1343 2.00555923 94908 +GPS BIIR-13 (PRN 02) +1 28474U 04045A 17157.74251056 -.00000050 00000-0 00000-0 0 9995 +2 28474 54.2321 98.1213 0170418 247.2038 351.6925 2.00548722 92298 +GPS BIIRM-1 (PRN 17) +1 28874U 05038A 17157.68738399 -.00000090 00000-0 00000-0 0 9999 +2 28874 56.1546 43.5924 0118451 254.5136 55.9262 2.00568186 85694 +GPS BIIRM-2 (PRN 31) +1 29486U 06042A 17157.89402977 -.00000073 00000-0 00000-0 0 9999 +2 29486 55.4047 282.7005 0084721 343.9526 36.5660 2.00559154 78309 +GPS BIIRM-3 (PRN 12) +1 29601U 06052A 17157.30711204 -.00000075 00000-0 00000-0 0 9993 +2 29601 56.6791 344.2294 0064809 49.4604 311.1238 2.00552294 77266 +GPS BIIRM-4 (PRN 15) +1 32260U 07047A 17157.13563594 .00000032 00000-0 00000-0 0 9993 +2 32260 53.2348 216.7628 0090280 32.1796 328.4497 2.00547487 70695 +GPS BIIRM-5 (PRN 29) +1 32384U 07062A 17156.21822177 -.00000098 00000-0 00000-0 0 9993 +2 32384 56.2180 44.2317 0006335 4.0971 192.7823 2.00570259 69404 +GPS BIIRM-6 (PRN 07) +1 32711U 08012A 17157.53427379 -.00000075 00000-0 00000-0 0 9999 +2 32711 55.1332 282.0856 0107470 212.2063 147.1234 2.00556288 67631 +GPS BIIRM-8 (PRN 05) +1 35752U 09043A 17157.70219478 .00000069 00000-0 00000-0 0 9992 +2 35752 54.2537 159.9422 0048788 28.4210 116.6992 2.00553334 57229 +GPS BIIF-1 (PRN 25) +1 36585U 10022A 17157.89436302 -.00000078 00000-0 00000-0 0 9994 +2 36585 55.9864 341.0322 0063534 45.4099 345.2901 2.00574808 51467 +GPS BIIF-2 (PRN 01) +1 37753U 11036A 17157.85963422 -.00000044 00000-0 00000-0 0 9995 +2 37753 55.4395 101.1871 0066031 30.2070 60.5198 2.00562311 43146 +GPS BIIF-3 (PRN 24) +1 38833U 12053A 17157.72375300 -.00000072 00000-0 00000-0 0 9994 +2 38833 54.1611 279.0056 0055661 25.8719 334.3965 2.00561617 33411 +GPS BIIF-4 (PRN 27) +1 39166U 13023A 17157.07836358 -.00000093 00000-0 00000-0 0 9998 +2 39166 55.8615 40.6350 0047704 18.0209 342.1899 2.00565151 29728 +GPS BIIF-5 (PRN 30) +1 39533U 14008A 17157.58173524 -.00000078 00000-0 00000-0 0 9998 +2 39533 54.3154 284.3055 0028684 182.6529 177.3191 2.00563830 23567 +GPS BIIF-6 (PRN 06) +1 39741U 14026A 17157.35873360 -.00000044 00000-0 00000-0 0 9992 +2 39741 55.4261 100.7272 0009830 291.4939 68.3647 2.00562339 22395 +GPS BIIF-7 (PRN 09) +1 40105U 14045A 17157.45126217 .00000031 00000-0 00000-0 0 9997 +2 40105 54.6318 220.2927 0005069 122.1672 237.9622 2.00569715 19965 +GPS BIIF-8 (PRN 03) +1 40294U 14068A 17157.32446828 .00000074 00000-0 00000-0 0 9997 +2 40294 55.0008 160.9300 0007263 345.6258 14.3805 2.00557500 19060 +GPS BIIF-9 (PRN 26) +1 40534U 15013A 17157.46020623 -.00000081 00000-0 00000-0 0 9990 +2 40534 54.9417 340.1560 0018129 358.6255 1.3832 2.00559260 16117 +GPS BIIF-10 (PRN 08) +1 40730U 15033A 17157.11983367 -.00000094 00000-0 00000-0 0 9999 +2 40730 55.3960 40.3091 0027177 318.4074 41.4282 2.00567662 13865 +GPS BIIF-11 (PRN 10) +1 41019U 15062A 17157.67265313 .00000072 00000-0 00000-0 0 9992 +2 41019 55.0103 160.7038 0026458 206.0557 153.8364 2.00563621 11698 +GPS BIIF-12 (PRN 32) +1 41328U 16007A 17157.76013989 .00000034 00000-0 00000-0 0 9993 +2 41328 54.8890 220.4662 0013935 220.3704 139.6078 2.00556828 9756 \ No newline at end of file diff --git a/data/scene/satellites/tle/stations.txt b/data/scene/satellites/tle/stations.txt index fdab931a9d..063546f33b 100644 --- a/data/scene/satellites/tle/stations.txt +++ b/data/scene/satellites/tle/stations.txt @@ -1,285 +1,285 @@ -ISS (ZARYA) -1 25544U 98067A 17157.94655197 .00002630 00000-0 47191-4 0 9994 -2 25544 51.6418 89.3693 0004703 241.3496 157.2990 15.53992000 60168 -TIANGONG 1 -1 37820U 11053A 17157.70967876 .00020914 00000-0 11813-3 0 9994 -2 37820 42.7593 264.1306 0019426 359.5204 148.5490 15.78435713326314 -AGGIESAT 4 -1 41313U 98067HP 17157.16086447 .00018711 00000-0 13577-3 0 9993 -2 41313 51.6375 59.3234 0004723 101.9367 258.2161 15.73442509 77199 -BEVO 2 -1 41314U 98067HQ 17157.88632967 .00703414 31345-3 45291-3 0 9995 -2 41314 51.6177 25.8163 0007485 251.9715 108.0487 16.16778687 77482 -NODES 2 -1 41477U 98067HX 17157.90383726 .00052219 00000-0 26238-3 0 9995 -2 41477 51.6294 56.6595 0003371 94.5932 265.5455 15.81168393 60445 -NODES 1 -1 41478U 98067HY 17157.81578248 .00053127 00000-0 27329-3 0 9992 -2 41478 51.6327 57.5946 0003116 94.0560 266.0798 15.80650524 60427 -FLOCK 2E'-1 -1 41479U 98067HZ 17157.82937824 .00017516 00000-0 15561-3 0 9990 -2 41479 51.6361 69.0720 0001235 132.9379 227.1721 15.68631858 60232 -FLOCK 2E'-3 -1 41480U 98067JA 17157.85350922 .00015886 00000-0 14210-3 0 9991 -2 41480 51.6360 68.5033 0000732 66.0320 294.0753 15.68548906 60237 -FLOCK 2E'-2 -1 41481U 98067JB 17157.93598542 .00014396 00000-0 12524-3 0 9994 -2 41481 51.6345 66.7643 0001590 141.5719 218.5391 15.69326443 60254 -FLOCK 2E'-4 -1 41482U 98067JC 17157.79065223 .00022341 00000-0 17773-3 0 9994 -2 41482 51.6345 66.5289 0001496 79.7829 280.3337 15.71128503 60244 -FLOCK 2E-1 -1 41483U 98067ID 17157.29569450 .00013969 00000-0 13019-3 0 9996 -2 41483 51.6375 72.3135 0002141 32.0954 328.0172 15.67656718 59998 -FLOCK 2E-2 -1 41484U 98067JE 17157.23012824 .00019455 00000-0 16890-3 0 9995 -2 41484 51.6385 71.1428 0002213 46.7114 313.4067 15.69112127 60000 -FLOCK 2E-3 -1 41486U 98067JG 17157.94249624 .00012046 00000-0 11618-3 0 9997 -2 41486 51.6371 70.6259 0002649 64.7641 295.3629 15.66964173 60095 -FLOCK 2E-4 -1 41487U 98067JH 17157.79997702 .00013956 00000-0 12913-3 0 9998 -2 41487 51.6373 69.6496 0003643 57.6827 302.4521 15.67836732 60092 -FLOCK 2E-6 -1 41563U 98067JM 17157.84789515 .00010970 00000-0 10867-3 0 9999 -2 41563 51.6366 71.4681 0001397 138.8569 221.2533 15.66405325 58148 -FLOCK 2E-5 -1 41564U 98067JN 17157.85787038 .00011762 00000-0 11662-3 0 9993 -2 41564 51.6367 71.5423 0001207 135.2529 224.8564 15.66295284 58135 -FLOCK 2E-7 -1 41565U 98067JP 17157.81556449 .00017448 00000-0 15131-3 0 9992 -2 41565 51.6360 68.2287 0004609 80.6839 279.4679 15.69221451 58070 -FLOCK 2E-8 -1 41566U 98067JQ 17157.91086070 .00121698 16725-4 36063-3 0 9997 -2 41566 51.6286 49.8665 0004713 142.6928 217.4407 15.92335896 58310 -FLOCK 2E'-5 -1 41567U 98067JR 17157.78191446 .00011191 00000-0 11495-3 0 9990 -2 41567 51.6378 73.2981 0004907 93.3825 266.7732 15.65457253 57979 -FLOCK 2E'-6 -1 41568U 98067JS 17157.77145550 .00014626 00000-0 13869-3 0 9998 -2 41568 51.6364 70.9405 0004513 92.1048 268.0465 15.67174872 58038 -FLOCK 2E'-8 -1 41569U 98067JT 17157.91417765 .00016441 00000-0 14148-3 0 9993 -2 41569 51.6361 67.3905 0002434 64.2282 295.8966 15.69467197 57974 -FLOCK 2E'-7 -1 41570U 98067JU 17157.81477341 .00022161 00000-0 16934-3 0 9991 -2 41570 51.6364 65.2376 0002923 51.8320 308.2941 15.72094779 58010 -FLOCK 2E-9 -1 41571U 98067JV 17157.85234832 .00017668 00000-0 14924-3 0 9995 -2 41571 51.6366 66.9928 0004309 82.3948 277.7538 15.69854026 57958 -FLOCK 2E-10 -1 41572U 98067JW 17157.81407914 .00017118 00000-0 15232-3 0 9998 -2 41572 51.6364 68.9926 0004709 84.5269 275.6265 15.68604804 57928 -FLOCK 2E-12 -1 41573U 98067JX 17157.94759666 .00016648 00000-0 14342-3 0 9995 -2 41573 51.6359 67.6218 0004148 94.9148 265.2323 15.69425430 57951 -FLOCK 2E-11 -1 41574U 98067JY 17157.94425949 .00017277 00000-0 14780-3 0 9995 -2 41574 51.6347 66.8056 0005101 97.8056 262.3520 15.69560822 57963 -FLOCK 2E'-9 -1 41575U 98067JZ 17157.81983142 .00020007 00000-0 16391-3 0 9991 -2 41575 51.6346 66.7030 0004859 109.2903 250.8620 15.70492303 57943 -FLOCK 2E'-10 -1 41576U 98067KA 17157.81080505 .00018690 00000-0 16006-3 0 9991 -2 41576 51.6368 68.2311 0004669 108.5169 251.6336 15.69470167 57824 -FLOCK 2E'-11 -1 41577U 98067KB 17157.84387094 .00016884 00000-0 14804-3 0 9995 -2 41577 51.6373 68.4600 0005029 90.7988 269.3585 15.68978391 57649 -FLOCK 2E'-12 -1 41578U 98067KC 17157.85229234 .00021128 00000-0 17555-3 0 9991 -2 41578 51.6350 67.7005 0005424 83.6803 276.4812 15.70108031 57654 -FLOCK 2E'-13 -1 41761U 98067KH 17157.84121992 .00007650 00000-0 96912-4 0 9995 -2 41761 51.6386 82.7486 0005694 217.4113 142.6484 15.60558941 41297 -FLOCK 2E'-14 -1 41762U 98067KJ 17157.95581036 .00008251 00000-0 10337-3 0 9991 -2 41762 51.6398 82.0348 0005588 217.7092 142.3510 15.60728191 41318 -FLOCK 2E'-16 -1 41763U 98067KK 17157.86607714 .00009474 00000-0 11591-3 0 9995 -2 41763 51.6398 82.1815 0004711 229.1912 130.8674 15.61149602 41266 -FLOCK 2E'-15 -1 41764U 98067KL 17157.85165937 .00007422 00000-0 94554-4 0 9993 -2 41764 51.6395 82.8349 0005200 225.0806 134.9766 15.60465657 41250 -TIANGONG-2 -1 41765U 16057A 17157.80446253 .00002148 00000-0 29064-4 0 9995 -2 41765 42.7836 56.6308 0011038 266.5003 156.2729 15.61250586 41363 -FLOCK 2E'-18 -1 41769U 98067KM 17157.90167314 .00007746 00000-0 98248-4 0 9998 -2 41769 51.6397 82.4126 0004132 251.5664 108.4880 15.60508848 41269 -FLOCK 2E'-17 -1 41776U 98067KN 17157.95839727 .00007735 00000-0 97973-4 0 9997 -2 41776 51.6407 82.0579 0004483 252.8988 107.1514 15.60548603 41262 -FLOCK 2E'-19 -1 41777U 98067KP 17157.25856684 .00014123 00000-0 15879-3 0 9995 -2 41777 51.6383 83.3506 0003434 249.6465 110.4161 15.62884005 41142 -FLOCK 2E'-20 -1 41782U 98067KQ 17157.95631435 .00009933 00000-0 11651-3 0 9990 -2 41782 51.6397 80.5325 0003339 246.9810 113.0833 15.62193473 41113 -BANXING-2 -1 41834U 16057H 17157.77057558 .00008103 00000-0 75609-4 0 9997 -2 41834 42.7847 52.6919 0007283 184.5004 279.8030 15.67673228 35473 -STARS-C -1 41895U 98067KR 17157.84313134 .00019979 00000-0 23763-3 0 9994 -2 41895 51.6388 85.7683 0002910 282.4174 77.6493 15.61123932 26374 -TANCREDO-1 -1 41931U 98067KT 17157.96072007 .00039094 00000-0 36943-3 0 9993 -2 41931 51.6375 82.7854 0004077 216.5790 143.4928 15.66595418 21991 -ITF-2 -1 41932U 98067KU 17157.88784681 .00010759 00000-0 14197-3 0 9997 -2 41932 51.6410 86.8287 0004551 222.4119 137.6522 15.58968825 21931 -WASEDA-SAT3 -1 41933U 98067KV 17157.86766680 .00012735 00000-0 16372-3 0 9998 -2 41933 51.6393 86.6847 0004401 224.8923 135.1714 15.59470034 21932 -AOBA-VELOX 3 -1 41935U 98067KX 17157.81606468 .00011476 00000-0 14944-3 0 9996 -2 41935 51.6407 87.0963 0003886 226.1035 133.9638 15.59246212 22020 -TUPOD -1 41936U 98067KY 17157.83506049 .00063704 00000-0 50159-3 0 9992 -2 41936 51.6364 81.9421 0002677 193.2921 166.8006 15.70842192 21474 -OSNSAT -1 41939U 98067KZ 17157.84088402 .00022114 00000-0 24411-3 0 9996 -2 41939 51.6393 84.9970 0004937 223.7956 136.2648 15.62981464 21312 -PROGRESS-MS 05 -1 42056U 17010A 17157.62806167 .00002380 00000-0 43406-4 0 9997 -2 42056 51.6419 90.9570 0004682 239.7339 175.9756 15.53988626 60112 -LEMUR-2-REDFERN-GOES -1 42059U 98067LA 17157.87023427 .00010532 00000-0 14537-3 0 9998 -2 42059 51.6398 88.2022 0006952 257.0236 102.9980 15.57773986 14409 -TECHEDSAT 5 -1 42066U 98067LB 17157.88081783 .00130272 00000-0 92629-3 0 9998 -2 42066 51.6337 83.7399 0002362 159.2104 200.8991 15.72955201 14190 -LEMUR-2-TRUTNA -1 42067U 98067LC 17157.83820430 .00021776 00000-0 27852-3 0 9998 -2 42067 51.6394 87.9877 0006160 253.1659 106.8658 15.59134351 14230 -LEMUR-2-AUSTINTACIOUS -1 42068U 98067LD 17157.86892448 .00014740 00000-0 19909-3 0 9997 -2 42068 51.6396 88.1920 0006243 256.1891 103.8407 15.57991820 14338 -LEMUR-2-TRUTNAHD -1 42069U 98067LE 17157.80477585 .00011342 00000-0 15525-3 0 9998 -2 42069 51.6404 88.5168 0006281 253.3949 106.6354 15.57911149 14374 -ISS DEB -1 42434U 98067LF 17157.20389631 .00040897 00000-0 48519-3 0 9998 -2 42434 51.6377 91.2421 0003699 204.1460 155.9360 15.60776006 10458 -CYGNUS OA-7 -1 42681U 17019A 17157.83399044 .00001407 00000-0 30326-4 0 9990 -2 42681 51.6394 89.9608 0004737 238.3552 236.4249 15.52253009 7650 -SOYUZ-MS 04 -1 42682U 17020A 17157.62806167 .00002380 00000-0 43406-4 0 9993 -2 42682 51.6419 90.9570 0004682 239.7339 175.9756 15.53988626 60117 -TIANZHOU 1 -1 42684U 17021A 17153.14877196 .00078565 00000-0 89444-3 0 9998 -2 42684 42.7826 84.4016 0010794 236.6582 266.9899 15.61251018 6668 -ISS DEB -1 42697U 98067LG 17157.84861892 .00037507 00000-0 52116-3 0 9995 -2 42697 51.6412 89.5469 0003850 241.7810 118.2802 15.56620141 5063 -SOMP2 -1 42700U 98067LH 17157.85852898 .00010448 00000-0 15717-3 0 9998 -2 42700 51.6402 89.6186 0005697 289.6047 70.4329 15.55441951 3338 -HAVELSAT -1 42701U 98067LJ 17157.85877506 .00009249 00000-0 14019-3 0 9993 -2 42701 51.6404 89.6204 0005687 290.2093 69.8287 15.55398233 3328 -COLUMBIA -1 42702U 98067LK 17157.85640689 .00019375 00000-0 28110-3 0 9992 -2 42702 51.6402 89.6049 0005582 283.5939 76.4431 15.55829187 3256 -SGSAT -1 42703U 98067LL 17157.85837147 .00016082 00000-0 23650-3 0 9996 -2 42703 51.6399 89.6179 0001779 215.0092 145.0783 15.55619060 3249 -CXBN-2 -1 42704U 98067LM 17157.86087475 .00009857 00000-0 14967-3 0 9992 -2 42704 51.6403 89.6346 0001531 217.8699 142.2185 15.55266596 3259 -ICECUBE -1 42705U 98067LN 17157.86139170 .00012469 00000-0 18766-3 0 9997 -2 42705 51.6404 89.6388 0001477 225.7849 134.3021 15.55229909 3316 -PHOENIX -1 42706U 98067LP 17157.85919097 .00010424 00000-0 15699-3 0 9992 -2 42706 51.6405 89.6243 0000606 264.1635 95.9287 15.55419085 3245 -X-CUBESAT -1 42707U 98067LQ 17157.85942325 .00010489 00000-0 15798-3 0 9994 -2 42707 51.6402 89.6253 0000714 261.3522 98.7388 15.55408199 3234 -QBEE50-LTU-OC -1 42708U 98067LR 17157.85976115 .00010073 00000-0 15218-3 0 9995 -2 42708 51.6403 89.6273 0000806 257.2200 102.8701 15.55374747 3199 -ALTAIR PATHFINDER -1 42711U 98067LS 17157.86492244 .00006899 00000-0 10825-3 0 9996 -2 42711 51.6401 89.6607 0004088 214.3267 145.7460 15.54917330 2901 -SHARC -1 42712U 98067LT 17157.86348986 .00006919 00000-0 10815-3 0 9992 -2 42712 51.6404 89.6521 0001998 212.8804 147.2063 15.55020563 3144 -ZA-AEROSAT -1 42713U 98067LU 17157.86235707 .00008829 00000-0 13523-3 0 9990 -2 42713 51.6402 89.6446 0001922 199.0347 161.0573 15.55180619 2906 -LINK -1 42714U 98067LV 17157.86266135 .00009504 00000-0 14497-3 0 9992 -2 42714 51.6401 89.6466 0002117 206.7176 153.3706 15.55190802 3011 -CSUNSAT 1 -1 42715U 98067LW 17157.86415953 .00009161 00000-0 14070-3 0 9993 -2 42715 51.6400 89.6561 0004236 203.1814 156.8987 15.55050192 2904 -UPSAT -1 42716U 98067LX 17157.86094233 .00011468 00000-0 17226-3 0 9997 -2 42716 51.6402 89.6352 0004008 295.0779 64.9796 15.55373568 3039 -SPACECUBE -1 42717U 98067LY 17157.86170034 .00009917 00000-0 15049-3 0 9999 -2 42717 51.6403 89.6401 0003993 293.5006 66.5565 15.55272760 2273 -HOOPOE -1 42718U 98067LZ 17157.86153836 .00010781 00000-0 16274-3 0 9993 -2 42718 51.6403 89.6391 0003987 292.5690 67.4879 15.55311723 2274 -UNSW-ECO -1 42721U 98067MA 17157.80343503 .00013771 00000-0 20735-3 0 9992 -2 42721 51.6403 89.9999 0007120 268.2498 91.7677 15.55097441 1963 -NJUST-1 -1 42722U 98067MB 17157.25292095 .00001440 00000-0 28291-4 0 9997 -2 42722 51.6402 92.7556 0007027 267.2164 245.0421 15.54901758 1874 -CHALLENGER -1 42723U 98067MC 17157.80404552 .00011009 00000-0 16798-3 0 9992 -2 42723 51.6404 90.0040 0006958 268.5782 91.4412 15.54978044 1941 -DUTHSAT -1 42724U 98067MD 17157.80428604 .00013264 00000-0 20078-3 0 9998 -2 42724 51.6404 90.0056 0006075 271.4432 88.5863 15.54994883 1861 -LILACSAT-1 -1 42725U 98067ME 17157.80476334 .00008530 00000-0 13233-3 0 9997 -2 42725 51.6404 90.0092 0006008 272.8653 87.1650 15.54873181 1864 -NSIGHT-1 -1 42726U 98067MF 17157.86942714 .00006534 00000-0 10336-3 0 9997 -2 42726 51.6405 89.6907 0005990 273.7292 86.3014 15.54792750 1882 -SNUSAT-1 -1 42727U 98067MG 17157.86945727 .00009989 00000-0 15371-3 0 9996 -2 42727 51.6398 89.6902 0007575 228.4973 131.5369 15.54864564 1848 -QBITO -1 42728U 98067MH 17155.94045484 .00010441 00000-0 16007-3 0 9997 -2 42728 51.6397 99.3085 0003029 277.2248 82.8398 15.54926471 1380 -AALTO-2 -1 42729U 98067MJ 17155.81189444 .00010269 00000-0 15754-3 0 9995 -2 42729 51.6399 99.9497 0003050 275.8476 84.2168 15.54929551 1379 -SUSAT -1 42730U 98067MK 17157.80448090 .00010291 00000-0 15784-3 0 9991 -2 42730 51.6404 90.0078 0003110 281.5326 78.5315 15.54933074 1678 -I-INSPIRE II -1 42731U 98067ML 17156.13327249 .00009265 00000-0 14256-3 0 9991 -2 42731 51.6393 98.3448 0007164 207.3399 152.7216 15.54972835 1467 -POLYITAN-2-SAU -1 42732U 98067MM 17155.94043987 .00010678 00000-0 16312-3 0 9999 -2 42732 51.6392 99.3069 0007216 206.4771 153.5852 15.54981238 1438 -SNUSAT-1B -1 42733U 98067MN 17157.80452231 .00009513 00000-0 14625-3 0 9994 -2 42733 51.6398 90.0067 0007034 214.9107 145.1423 15.54959154 1721 -EXALTA-1 -1 42734U 98067MP 17156.39039283 .00009453 00000-0 14516-3 0 9998 -2 42734 51.6396 97.0623 0008589 235.9084 124.1092 15.54988337 1452 -AOXIANG-1 -1 42735U 98067MQ 17157.80450021 .00008356 00000-0 12927-3 0 9998 -2 42735 51.6402 90.0072 0007677 265.5134 94.4980 15.54971752 3094 -BEEAGLESAT -1 42736U 98067MR 17155.94091570 .00008525 00000-0 13203-3 0 9998 -2 42736 51.6398 99.3106 0007570 257.5066 102.5078 15.54911642 1499 -ATLANTIS -1 42737U 98067MS 17157.73973140 .00018727 00000-0 27851-3 0 9999 -2 42737 51.6395 90.3231 0007506 257.5958 102.4193 15.55165668 1662 -DRAGON CRS-11 -1 42744U 17030A 17157.37842914 .00002356 00000-0 43046-4 0 9998 -2 42744 51.6419 92.2016 0004681 238.9005 219.3491 15.53987082 60075 -FALCON 9 DEB -1 42745U 17030B 17156.27917736 -.00003619 11440-4 00000-0 0 9999 -2 42745 51.6486 97.5083 0103286 51.0958 103.4391 16.01768424 228 -FALCON 9 DEB -1 42746U 17030C 17156.87548135 -.00561144 11417-4 -52194-3 0 9990 -2 42746 51.6257 94.2528 0099282 55.6445 305.5405 16.01548785 322 +ISS (ZARYA) +1 25544U 98067A 17157.94655197 .00002630 00000-0 47191-4 0 9994 +2 25544 51.6418 89.3693 0004703 241.3496 157.2990 15.53992000 60168 +TIANGONG 1 +1 37820U 11053A 17157.70967876 .00020914 00000-0 11813-3 0 9994 +2 37820 42.7593 264.1306 0019426 359.5204 148.5490 15.78435713326314 +AGGIESAT 4 +1 41313U 98067HP 17157.16086447 .00018711 00000-0 13577-3 0 9993 +2 41313 51.6375 59.3234 0004723 101.9367 258.2161 15.73442509 77199 +BEVO 2 +1 41314U 98067HQ 17157.88632967 .00703414 31345-3 45291-3 0 9995 +2 41314 51.6177 25.8163 0007485 251.9715 108.0487 16.16778687 77482 +NODES 2 +1 41477U 98067HX 17157.90383726 .00052219 00000-0 26238-3 0 9995 +2 41477 51.6294 56.6595 0003371 94.5932 265.5455 15.81168393 60445 +NODES 1 +1 41478U 98067HY 17157.81578248 .00053127 00000-0 27329-3 0 9992 +2 41478 51.6327 57.5946 0003116 94.0560 266.0798 15.80650524 60427 +FLOCK 2E'-1 +1 41479U 98067HZ 17157.82937824 .00017516 00000-0 15561-3 0 9990 +2 41479 51.6361 69.0720 0001235 132.9379 227.1721 15.68631858 60232 +FLOCK 2E'-3 +1 41480U 98067JA 17157.85350922 .00015886 00000-0 14210-3 0 9991 +2 41480 51.6360 68.5033 0000732 66.0320 294.0753 15.68548906 60237 +FLOCK 2E'-2 +1 41481U 98067JB 17157.93598542 .00014396 00000-0 12524-3 0 9994 +2 41481 51.6345 66.7643 0001590 141.5719 218.5391 15.69326443 60254 +FLOCK 2E'-4 +1 41482U 98067JC 17157.79065223 .00022341 00000-0 17773-3 0 9994 +2 41482 51.6345 66.5289 0001496 79.7829 280.3337 15.71128503 60244 +FLOCK 2E-1 +1 41483U 98067ID 17157.29569450 .00013969 00000-0 13019-3 0 9996 +2 41483 51.6375 72.3135 0002141 32.0954 328.0172 15.67656718 59998 +FLOCK 2E-2 +1 41484U 98067JE 17157.23012824 .00019455 00000-0 16890-3 0 9995 +2 41484 51.6385 71.1428 0002213 46.7114 313.4067 15.69112127 60000 +FLOCK 2E-3 +1 41486U 98067JG 17157.94249624 .00012046 00000-0 11618-3 0 9997 +2 41486 51.6371 70.6259 0002649 64.7641 295.3629 15.66964173 60095 +FLOCK 2E-4 +1 41487U 98067JH 17157.79997702 .00013956 00000-0 12913-3 0 9998 +2 41487 51.6373 69.6496 0003643 57.6827 302.4521 15.67836732 60092 +FLOCK 2E-6 +1 41563U 98067JM 17157.84789515 .00010970 00000-0 10867-3 0 9999 +2 41563 51.6366 71.4681 0001397 138.8569 221.2533 15.66405325 58148 +FLOCK 2E-5 +1 41564U 98067JN 17157.85787038 .00011762 00000-0 11662-3 0 9993 +2 41564 51.6367 71.5423 0001207 135.2529 224.8564 15.66295284 58135 +FLOCK 2E-7 +1 41565U 98067JP 17157.81556449 .00017448 00000-0 15131-3 0 9992 +2 41565 51.6360 68.2287 0004609 80.6839 279.4679 15.69221451 58070 +FLOCK 2E-8 +1 41566U 98067JQ 17157.91086070 .00121698 16725-4 36063-3 0 9997 +2 41566 51.6286 49.8665 0004713 142.6928 217.4407 15.92335896 58310 +FLOCK 2E'-5 +1 41567U 98067JR 17157.78191446 .00011191 00000-0 11495-3 0 9990 +2 41567 51.6378 73.2981 0004907 93.3825 266.7732 15.65457253 57979 +FLOCK 2E'-6 +1 41568U 98067JS 17157.77145550 .00014626 00000-0 13869-3 0 9998 +2 41568 51.6364 70.9405 0004513 92.1048 268.0465 15.67174872 58038 +FLOCK 2E'-8 +1 41569U 98067JT 17157.91417765 .00016441 00000-0 14148-3 0 9993 +2 41569 51.6361 67.3905 0002434 64.2282 295.8966 15.69467197 57974 +FLOCK 2E'-7 +1 41570U 98067JU 17157.81477341 .00022161 00000-0 16934-3 0 9991 +2 41570 51.6364 65.2376 0002923 51.8320 308.2941 15.72094779 58010 +FLOCK 2E-9 +1 41571U 98067JV 17157.85234832 .00017668 00000-0 14924-3 0 9995 +2 41571 51.6366 66.9928 0004309 82.3948 277.7538 15.69854026 57958 +FLOCK 2E-10 +1 41572U 98067JW 17157.81407914 .00017118 00000-0 15232-3 0 9998 +2 41572 51.6364 68.9926 0004709 84.5269 275.6265 15.68604804 57928 +FLOCK 2E-12 +1 41573U 98067JX 17157.94759666 .00016648 00000-0 14342-3 0 9995 +2 41573 51.6359 67.6218 0004148 94.9148 265.2323 15.69425430 57951 +FLOCK 2E-11 +1 41574U 98067JY 17157.94425949 .00017277 00000-0 14780-3 0 9995 +2 41574 51.6347 66.8056 0005101 97.8056 262.3520 15.69560822 57963 +FLOCK 2E'-9 +1 41575U 98067JZ 17157.81983142 .00020007 00000-0 16391-3 0 9991 +2 41575 51.6346 66.7030 0004859 109.2903 250.8620 15.70492303 57943 +FLOCK 2E'-10 +1 41576U 98067KA 17157.81080505 .00018690 00000-0 16006-3 0 9991 +2 41576 51.6368 68.2311 0004669 108.5169 251.6336 15.69470167 57824 +FLOCK 2E'-11 +1 41577U 98067KB 17157.84387094 .00016884 00000-0 14804-3 0 9995 +2 41577 51.6373 68.4600 0005029 90.7988 269.3585 15.68978391 57649 +FLOCK 2E'-12 +1 41578U 98067KC 17157.85229234 .00021128 00000-0 17555-3 0 9991 +2 41578 51.6350 67.7005 0005424 83.6803 276.4812 15.70108031 57654 +FLOCK 2E'-13 +1 41761U 98067KH 17157.84121992 .00007650 00000-0 96912-4 0 9995 +2 41761 51.6386 82.7486 0005694 217.4113 142.6484 15.60558941 41297 +FLOCK 2E'-14 +1 41762U 98067KJ 17157.95581036 .00008251 00000-0 10337-3 0 9991 +2 41762 51.6398 82.0348 0005588 217.7092 142.3510 15.60728191 41318 +FLOCK 2E'-16 +1 41763U 98067KK 17157.86607714 .00009474 00000-0 11591-3 0 9995 +2 41763 51.6398 82.1815 0004711 229.1912 130.8674 15.61149602 41266 +FLOCK 2E'-15 +1 41764U 98067KL 17157.85165937 .00007422 00000-0 94554-4 0 9993 +2 41764 51.6395 82.8349 0005200 225.0806 134.9766 15.60465657 41250 +TIANGONG-2 +1 41765U 16057A 17157.80446253 .00002148 00000-0 29064-4 0 9995 +2 41765 42.7836 56.6308 0011038 266.5003 156.2729 15.61250586 41363 +FLOCK 2E'-18 +1 41769U 98067KM 17157.90167314 .00007746 00000-0 98248-4 0 9998 +2 41769 51.6397 82.4126 0004132 251.5664 108.4880 15.60508848 41269 +FLOCK 2E'-17 +1 41776U 98067KN 17157.95839727 .00007735 00000-0 97973-4 0 9997 +2 41776 51.6407 82.0579 0004483 252.8988 107.1514 15.60548603 41262 +FLOCK 2E'-19 +1 41777U 98067KP 17157.25856684 .00014123 00000-0 15879-3 0 9995 +2 41777 51.6383 83.3506 0003434 249.6465 110.4161 15.62884005 41142 +FLOCK 2E'-20 +1 41782U 98067KQ 17157.95631435 .00009933 00000-0 11651-3 0 9990 +2 41782 51.6397 80.5325 0003339 246.9810 113.0833 15.62193473 41113 +BANXING-2 +1 41834U 16057H 17157.77057558 .00008103 00000-0 75609-4 0 9997 +2 41834 42.7847 52.6919 0007283 184.5004 279.8030 15.67673228 35473 +STARS-C +1 41895U 98067KR 17157.84313134 .00019979 00000-0 23763-3 0 9994 +2 41895 51.6388 85.7683 0002910 282.4174 77.6493 15.61123932 26374 +TANCREDO-1 +1 41931U 98067KT 17157.96072007 .00039094 00000-0 36943-3 0 9993 +2 41931 51.6375 82.7854 0004077 216.5790 143.4928 15.66595418 21991 +ITF-2 +1 41932U 98067KU 17157.88784681 .00010759 00000-0 14197-3 0 9997 +2 41932 51.6410 86.8287 0004551 222.4119 137.6522 15.58968825 21931 +WASEDA-SAT3 +1 41933U 98067KV 17157.86766680 .00012735 00000-0 16372-3 0 9998 +2 41933 51.6393 86.6847 0004401 224.8923 135.1714 15.59470034 21932 +AOBA-VELOX 3 +1 41935U 98067KX 17157.81606468 .00011476 00000-0 14944-3 0 9996 +2 41935 51.6407 87.0963 0003886 226.1035 133.9638 15.59246212 22020 +TUPOD +1 41936U 98067KY 17157.83506049 .00063704 00000-0 50159-3 0 9992 +2 41936 51.6364 81.9421 0002677 193.2921 166.8006 15.70842192 21474 +OSNSAT +1 41939U 98067KZ 17157.84088402 .00022114 00000-0 24411-3 0 9996 +2 41939 51.6393 84.9970 0004937 223.7956 136.2648 15.62981464 21312 +PROGRESS-MS 05 +1 42056U 17010A 17157.62806167 .00002380 00000-0 43406-4 0 9997 +2 42056 51.6419 90.9570 0004682 239.7339 175.9756 15.53988626 60112 +LEMUR-2-REDFERN-GOES +1 42059U 98067LA 17157.87023427 .00010532 00000-0 14537-3 0 9998 +2 42059 51.6398 88.2022 0006952 257.0236 102.9980 15.57773986 14409 +TECHEDSAT 5 +1 42066U 98067LB 17157.88081783 .00130272 00000-0 92629-3 0 9998 +2 42066 51.6337 83.7399 0002362 159.2104 200.8991 15.72955201 14190 +LEMUR-2-TRUTNA +1 42067U 98067LC 17157.83820430 .00021776 00000-0 27852-3 0 9998 +2 42067 51.6394 87.9877 0006160 253.1659 106.8658 15.59134351 14230 +LEMUR-2-AUSTINTACIOUS +1 42068U 98067LD 17157.86892448 .00014740 00000-0 19909-3 0 9997 +2 42068 51.6396 88.1920 0006243 256.1891 103.8407 15.57991820 14338 +LEMUR-2-TRUTNAHD +1 42069U 98067LE 17157.80477585 .00011342 00000-0 15525-3 0 9998 +2 42069 51.6404 88.5168 0006281 253.3949 106.6354 15.57911149 14374 +ISS DEB +1 42434U 98067LF 17157.20389631 .00040897 00000-0 48519-3 0 9998 +2 42434 51.6377 91.2421 0003699 204.1460 155.9360 15.60776006 10458 +CYGNUS OA-7 +1 42681U 17019A 17157.83399044 .00001407 00000-0 30326-4 0 9990 +2 42681 51.6394 89.9608 0004737 238.3552 236.4249 15.52253009 7650 +SOYUZ-MS 04 +1 42682U 17020A 17157.62806167 .00002380 00000-0 43406-4 0 9993 +2 42682 51.6419 90.9570 0004682 239.7339 175.9756 15.53988626 60117 +TIANZHOU 1 +1 42684U 17021A 17153.14877196 .00078565 00000-0 89444-3 0 9998 +2 42684 42.7826 84.4016 0010794 236.6582 266.9899 15.61251018 6668 +ISS DEB +1 42697U 98067LG 17157.84861892 .00037507 00000-0 52116-3 0 9995 +2 42697 51.6412 89.5469 0003850 241.7810 118.2802 15.56620141 5063 +SOMP2 +1 42700U 98067LH 17157.85852898 .00010448 00000-0 15717-3 0 9998 +2 42700 51.6402 89.6186 0005697 289.6047 70.4329 15.55441951 3338 +HAVELSAT +1 42701U 98067LJ 17157.85877506 .00009249 00000-0 14019-3 0 9993 +2 42701 51.6404 89.6204 0005687 290.2093 69.8287 15.55398233 3328 +COLUMBIA +1 42702U 98067LK 17157.85640689 .00019375 00000-0 28110-3 0 9992 +2 42702 51.6402 89.6049 0005582 283.5939 76.4431 15.55829187 3256 +SGSAT +1 42703U 98067LL 17157.85837147 .00016082 00000-0 23650-3 0 9996 +2 42703 51.6399 89.6179 0001779 215.0092 145.0783 15.55619060 3249 +CXBN-2 +1 42704U 98067LM 17157.86087475 .00009857 00000-0 14967-3 0 9992 +2 42704 51.6403 89.6346 0001531 217.8699 142.2185 15.55266596 3259 +ICECUBE +1 42705U 98067LN 17157.86139170 .00012469 00000-0 18766-3 0 9997 +2 42705 51.6404 89.6388 0001477 225.7849 134.3021 15.55229909 3316 +PHOENIX +1 42706U 98067LP 17157.85919097 .00010424 00000-0 15699-3 0 9992 +2 42706 51.6405 89.6243 0000606 264.1635 95.9287 15.55419085 3245 +X-CUBESAT +1 42707U 98067LQ 17157.85942325 .00010489 00000-0 15798-3 0 9994 +2 42707 51.6402 89.6253 0000714 261.3522 98.7388 15.55408199 3234 +QBEE50-LTU-OC +1 42708U 98067LR 17157.85976115 .00010073 00000-0 15218-3 0 9995 +2 42708 51.6403 89.6273 0000806 257.2200 102.8701 15.55374747 3199 +ALTAIR PATHFINDER +1 42711U 98067LS 17157.86492244 .00006899 00000-0 10825-3 0 9996 +2 42711 51.6401 89.6607 0004088 214.3267 145.7460 15.54917330 2901 +SHARC +1 42712U 98067LT 17157.86348986 .00006919 00000-0 10815-3 0 9992 +2 42712 51.6404 89.6521 0001998 212.8804 147.2063 15.55020563 3144 +ZA-AEROSAT +1 42713U 98067LU 17157.86235707 .00008829 00000-0 13523-3 0 9990 +2 42713 51.6402 89.6446 0001922 199.0347 161.0573 15.55180619 2906 +LINK +1 42714U 98067LV 17157.86266135 .00009504 00000-0 14497-3 0 9992 +2 42714 51.6401 89.6466 0002117 206.7176 153.3706 15.55190802 3011 +CSUNSAT 1 +1 42715U 98067LW 17157.86415953 .00009161 00000-0 14070-3 0 9993 +2 42715 51.6400 89.6561 0004236 203.1814 156.8987 15.55050192 2904 +UPSAT +1 42716U 98067LX 17157.86094233 .00011468 00000-0 17226-3 0 9997 +2 42716 51.6402 89.6352 0004008 295.0779 64.9796 15.55373568 3039 +SPACECUBE +1 42717U 98067LY 17157.86170034 .00009917 00000-0 15049-3 0 9999 +2 42717 51.6403 89.6401 0003993 293.5006 66.5565 15.55272760 2273 +HOOPOE +1 42718U 98067LZ 17157.86153836 .00010781 00000-0 16274-3 0 9993 +2 42718 51.6403 89.6391 0003987 292.5690 67.4879 15.55311723 2274 +UNSW-ECO +1 42721U 98067MA 17157.80343503 .00013771 00000-0 20735-3 0 9992 +2 42721 51.6403 89.9999 0007120 268.2498 91.7677 15.55097441 1963 +NJUST-1 +1 42722U 98067MB 17157.25292095 .00001440 00000-0 28291-4 0 9997 +2 42722 51.6402 92.7556 0007027 267.2164 245.0421 15.54901758 1874 +CHALLENGER +1 42723U 98067MC 17157.80404552 .00011009 00000-0 16798-3 0 9992 +2 42723 51.6404 90.0040 0006958 268.5782 91.4412 15.54978044 1941 +DUTHSAT +1 42724U 98067MD 17157.80428604 .00013264 00000-0 20078-3 0 9998 +2 42724 51.6404 90.0056 0006075 271.4432 88.5863 15.54994883 1861 +LILACSAT-1 +1 42725U 98067ME 17157.80476334 .00008530 00000-0 13233-3 0 9997 +2 42725 51.6404 90.0092 0006008 272.8653 87.1650 15.54873181 1864 +NSIGHT-1 +1 42726U 98067MF 17157.86942714 .00006534 00000-0 10336-3 0 9997 +2 42726 51.6405 89.6907 0005990 273.7292 86.3014 15.54792750 1882 +SNUSAT-1 +1 42727U 98067MG 17157.86945727 .00009989 00000-0 15371-3 0 9996 +2 42727 51.6398 89.6902 0007575 228.4973 131.5369 15.54864564 1848 +QBITO +1 42728U 98067MH 17155.94045484 .00010441 00000-0 16007-3 0 9997 +2 42728 51.6397 99.3085 0003029 277.2248 82.8398 15.54926471 1380 +AALTO-2 +1 42729U 98067MJ 17155.81189444 .00010269 00000-0 15754-3 0 9995 +2 42729 51.6399 99.9497 0003050 275.8476 84.2168 15.54929551 1379 +SUSAT +1 42730U 98067MK 17157.80448090 .00010291 00000-0 15784-3 0 9991 +2 42730 51.6404 90.0078 0003110 281.5326 78.5315 15.54933074 1678 +I-INSPIRE II +1 42731U 98067ML 17156.13327249 .00009265 00000-0 14256-3 0 9991 +2 42731 51.6393 98.3448 0007164 207.3399 152.7216 15.54972835 1467 +POLYITAN-2-SAU +1 42732U 98067MM 17155.94043987 .00010678 00000-0 16312-3 0 9999 +2 42732 51.6392 99.3069 0007216 206.4771 153.5852 15.54981238 1438 +SNUSAT-1B +1 42733U 98067MN 17157.80452231 .00009513 00000-0 14625-3 0 9994 +2 42733 51.6398 90.0067 0007034 214.9107 145.1423 15.54959154 1721 +EXALTA-1 +1 42734U 98067MP 17156.39039283 .00009453 00000-0 14516-3 0 9998 +2 42734 51.6396 97.0623 0008589 235.9084 124.1092 15.54988337 1452 +AOXIANG-1 +1 42735U 98067MQ 17157.80450021 .00008356 00000-0 12927-3 0 9998 +2 42735 51.6402 90.0072 0007677 265.5134 94.4980 15.54971752 3094 +BEEAGLESAT +1 42736U 98067MR 17155.94091570 .00008525 00000-0 13203-3 0 9998 +2 42736 51.6398 99.3106 0007570 257.5066 102.5078 15.54911642 1499 +ATLANTIS +1 42737U 98067MS 17157.73973140 .00018727 00000-0 27851-3 0 9999 +2 42737 51.6395 90.3231 0007506 257.5958 102.4193 15.55165668 1662 +DRAGON CRS-11 +1 42744U 17030A 17157.37842914 .00002356 00000-0 43046-4 0 9998 +2 42744 51.6419 92.2016 0004681 238.9005 219.3491 15.53987082 60075 +FALCON 9 DEB +1 42745U 17030B 17156.27917736 -.00003619 11440-4 00000-0 0 9999 +2 42745 51.6486 97.5083 0103286 51.0958 103.4391 16.01768424 228 +FALCON 9 DEB +1 42746U 17030C 17156.87548135 -.00561144 11417-4 -52194-3 0 9990 +2 42746 51.6257 94.2528 0099282 55.6445 305.5405 16.01548785 322 \ No newline at end of file diff --git a/include/openspace/rendering/abufferrenderer.h b/include/openspace/rendering/abufferrenderer.h index ad9d616cd9..99c2df646a 100644 --- a/include/openspace/rendering/abufferrenderer.h +++ b/include/openspace/rendering/abufferrenderer.h @@ -70,6 +70,13 @@ public: void setScene(Scene* scene) override; void setResolution(glm::ivec2 res) override; void setNAaSamples(int nAaSamples) override; + void setHDRExposure(float hdrExposure) override; + void setHDRBackground(float hdrBackground) override; + void setGamma(float gamma) override; + + float hdrBackground() const override; + int nAaSamples() const override; + std::vector mSSAPattern() const override; using Renderer::preRaycast; void preRaycast(const RaycasterTask& raycasterTask); @@ -91,7 +98,10 @@ private: void updateResolution(); void updateRaycastData(); void updateResolveDictionary(); - + void updateMSAASamplingPattern(); + void saveTextureToMemory(const GLenum color_buffer_attachment, + const int width, const int height, std::vector & memory) const; + Camera* _camera; Scene* _scene; glm::ivec2 _resolution; @@ -133,8 +143,13 @@ private: GLuint _vertexPositionBuffer; int _nAaSamples; + float _hdrExposure; + float _hdrBackground; + float _gamma; float _blackoutFactor; + std::vector _mSAAPattern; + ghoul::Dictionary _rendererData; }; diff --git a/include/openspace/rendering/deferredcaster.h b/include/openspace/rendering/deferredcaster.h new file mode 100644 index 0000000000..2bd6d411a4 --- /dev/null +++ b/include/openspace/rendering/deferredcaster.h @@ -0,0 +1,76 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_CORE___DEFERREDCASTER___H +#define __OPENSPACE_CORE___DEFERREDCASTER___H + +#include +#include +#include + +namespace ghoul::opengl { + class Texture; + class ProgramObject; +} // ghoul::opengl + +namespace openspace { + +struct RenderData; +struct DeferredcastData; + +class Deferredcaster { +public: + /** + * Destructor + */ + virtual ~Deferredcaster() {}; + + virtual void preRaycast(const RenderData& /*renderData*/, + const DeferredcastData& /*deferredData*/, ghoul::opengl::ProgramObject& /*program*/) {}; + + virtual void postRaycast(const RenderData & /*renderData*/, + const DeferredcastData& /*deferredData*/, ghoul::opengl::ProgramObject& /*program*/) {}; + + virtual std::string deferredcastPath() const = 0; + + virtual std::string deferredcastVSPath() const = 0; + + virtual std::string deferredcastFSPath() const = 0; + + /** + * Return a path to a glsl file with helper functions required for the + * transformation and raycast steps. + * This file will be included once per shader program generated, + * regardless of how many volumes say they require the file. + * Ideal to avoid redefinitions of helper functions. + * + * The shader preprocessor will have access to the #{namespace} variable (unique per helper file) + * which should be a prefix to all symbols defined by the helper + */ + virtual std::string helperPath() const = 0; +}; + +} // namespace openspace + +#endif // __OPENSPACE_CORE___DEFERREDCASTER___H diff --git a/include/openspace/rendering/deferredcasterlistener.h b/include/openspace/rendering/deferredcasterlistener.h new file mode 100644 index 0000000000..75aa4d860e --- /dev/null +++ b/include/openspace/rendering/deferredcasterlistener.h @@ -0,0 +1,45 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_CORE___DEFERREDCASTERLISTENER___H__ +#define __OPENSPACE_CORE___DEFERREDCASTERLISTENER___H__ + +#include + +namespace openspace { + +class Deferredcaster; + +class DeferredcasterListener { +public: + using isAttached = ghoul::Boolean; + + virtual void deferredcastersChanged(Deferredcaster& deferredcaster, + isAttached isAttached) = 0; +}; + +} // openspace + + +#endif // __OPENSPACE_CORE___DEFERREDCASTERLISTENER___H__ diff --git a/include/openspace/rendering/deferredcastermanager.h b/include/openspace/rendering/deferredcastermanager.h new file mode 100644 index 0000000000..5553a98c2c --- /dev/null +++ b/include/openspace/rendering/deferredcastermanager.h @@ -0,0 +1,55 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_CORE___DEFERREDCASTERMANAGER___H__ +#define __OPENSPACE_CORE___DEFERREDCASTERMANAGER___H__ + +#include + +namespace openspace { + +class Deferredcaster; +class DeferredcasterListener; + +class DeferredcasterManager { +public: + DeferredcasterManager(); + ~DeferredcasterManager(); + void attachDeferredcaster(Deferredcaster& deferredcaster); + void detachDeferredcaster(Deferredcaster& deferredcaster); + bool isAttached(Deferredcaster& deferredcaster); + const std::vector& deferredcasters(); + + void addListener(DeferredcasterListener& listener); + void removeListener(DeferredcasterListener& listener); + +private: + std::vector _deferredcasters; + std::vector _listeners; +}; + +} // namespace openspace + + +#endif // __OPENSPACE_CORE___DEFERREDCASTERMANAGER___H__ diff --git a/include/openspace/rendering/framebufferrenderer.h b/include/openspace/rendering/framebufferrenderer.h index fa8051b36c..f69b7f6bf9 100644 --- a/include/openspace/rendering/framebufferrenderer.h +++ b/include/openspace/rendering/framebufferrenderer.h @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -48,8 +49,10 @@ namespace openspace { class Camera; class Scene; - -class FramebufferRenderer : public Renderer, public RaycasterListener { + +class FramebufferRenderer : public Renderer, public RaycasterListener, + public DeferredcasterListener +{ public: FramebufferRenderer(); virtual ~FramebufferRenderer(); @@ -59,11 +62,22 @@ public: void updateResolution(); void updateRaycastData(); + void updateDeferredcastData(); + void updateHDRData(); + void updateMSAASamplingPattern(); void setCamera(Camera* camera) override; void setScene(Scene* scene) override; void setResolution(glm::ivec2 res) override; void setNAaSamples(int nAaSamples) override; + void setHDRExposure(float hdrExposure) override; + void setHDRBackground(float hdrBackground) override; + void setGamma(float gamma) override; + + float hdrBackground() const override; + int nAaSamples() const override; + /*const double * mSSAPattern() const override;*/ + std::vector mSSAPattern() const override; void update() override; void render(float blackoutFactor, bool doPerformanceMeasurements) override; @@ -75,6 +89,7 @@ public: virtual void updateRendererData() override; virtual void raycastersChanged(VolumeRaycaster& raycaster, bool attached) override; + virtual void deferredcastersChanged(Deferredcaster& deferredcaster, ghoul::Boolean isAttached) override; private: std::map _raycastData; @@ -88,17 +103,27 @@ private: VolumeRaycaster*, std::unique_ptr > _insideRaycastPrograms; + std::map _deferredcastData; + std::map> _deferredcastPrograms; + std::unique_ptr _hdrBackGroundProgram; + std::unique_ptr _resolveProgram; GLuint _screenQuad; GLuint _vertexPositionBuffer; GLuint _mainColorTexture; + GLuint _mainOtherDataTexture; + GLuint _mainPositionTexture; + GLuint _mainNormalTexture; GLuint _mainDepthTexture; GLuint _exitColorTexture; GLuint _mainFramebuffer; GLuint _exitDepthTexture; GLuint _exitFramebuffer; + GLuint _deferredFramebuffer; + GLuint _deferredColorTexture; + bool _dirtyDeferredcastData; bool _dirtyRaycastData; bool _dirtyResolution; @@ -106,6 +131,12 @@ private: Scene* _scene; glm::vec2 _resolution; int _nAaSamples; + float _hdrExposure; + float _hdrBackground; + float _gamma; + + //double * _mSAAPattern; + std::vector _mSAAPattern; ghoul::Dictionary _rendererData; }; diff --git a/include/openspace/rendering/renderengine.h b/include/openspace/rendering/renderengine.h index 283d8949e6..b7cce6c050 100644 --- a/include/openspace/rendering/renderengine.h +++ b/include/openspace/rendering/renderengine.h @@ -30,6 +30,7 @@ #include #include #include +#include #include namespace ghoul { @@ -46,6 +47,7 @@ namespace scripting { struct LuaLibrary; } class Camera; class RaycasterManager; +class DeferredcasterManager; class Renderer; class Scene; class SceneManager; @@ -78,6 +80,7 @@ public: Renderer* renderer() const; RendererImplementation rendererImplementation() const; RaycasterManager& raycasterManager(); + DeferredcasterManager& deferredcasterManager(); void updateShaderPrograms(); @@ -173,6 +176,7 @@ private: Camera* _camera; Scene* _scene; std::unique_ptr _raycasterManager; + std::unique_ptr _deferredcasterManager; properties::BoolProperty _doPerformanceMeasurements; std::unique_ptr _performanceManager; @@ -199,6 +203,10 @@ private: float _currentFadeTime; int _fadeDirection; properties::IntProperty _nAaSamples; + properties::FloatProperty _hdrExposure; + properties::FloatProperty _hdrBackground; + properties::FloatProperty _gamma; + uint64_t _frameNumber; std::vector _programs; diff --git a/include/openspace/rendering/renderer.h b/include/openspace/rendering/renderer.h index 3bf31044cb..abc8351e66 100644 --- a/include/openspace/rendering/renderer.h +++ b/include/openspace/rendering/renderer.h @@ -56,6 +56,13 @@ public: virtual void setScene(Scene* scene) = 0; virtual void setResolution(glm::ivec2 res) = 0; virtual void setNAaSamples(int nAaSamples) = 0; + virtual void setHDRExposure(float hdrExposure) = 0; + virtual void setHDRBackground(float hdrBackground) = 0; + virtual void setGamma(float gamma) = 0; + + virtual float hdrBackground() const = 0; + virtual int nAaSamples() const = 0; + virtual std::vector mSSAPattern() const = 0; /** * Set raycasting uniforms on the program object, and setup raycasting. diff --git a/include/openspace/util/camera.h b/include/openspace/util/camera.h index 06ad1bb247..f8c6467e4a 100644 --- a/include/openspace/util/camera.h +++ b/include/openspace/util/camera.h @@ -133,9 +133,11 @@ public: class SgctInternal { friend class Camera; public: + void setSceneMatrix(glm::mat4 sceneMatrix); void setViewMatrix(glm::mat4 viewMatrix); void setProjectionMatrix(glm::mat4 projectionMatrix); + const glm::mat4& sceneMatrix() const; const glm::mat4& viewMatrix() const; const glm::mat4& projectionMatrix() const; const glm::mat4& viewProjectionMatrix() const; @@ -148,6 +150,7 @@ public: {} // State + glm::mat4 _sceneMatrix; glm::mat4 _viewMatrix; glm::mat4 _projectionMatrix; diff --git a/include/openspace/util/updatestructures.h b/include/openspace/util/updatestructures.h index f63d641b5e..e2a2b76066 100644 --- a/include/openspace/util/updatestructures.h +++ b/include/openspace/util/updatestructures.h @@ -31,6 +31,7 @@ namespace openspace { +class Deferredcaster; class VolumeRaycaster; struct InitializeData {}; @@ -63,8 +64,14 @@ struct RaycasterTask { RenderData renderData; }; +struct DeferredcasterTask { + Deferredcaster* deferredcaster; + RenderData renderData; +}; + struct RendererTasks { std::vector raycasterTasks; + std::vector deferredcasterTasks; }; struct RaycastData { @@ -72,6 +79,11 @@ struct RaycastData { std::string namespaceName; }; +struct DeferredcastData { + int id; + std::string namespaceName; +}; + /** * Defines the position of an object relative to a surface. The surface is defined as * a reference surface together with a height offset from that reference surface. diff --git a/modules/atmosphere/CMakeLists.txt b/modules/atmosphere/CMakeLists.txt new file mode 100644 index 0000000000..d68c74baa3 --- /dev/null +++ b/modules/atmosphere/CMakeLists.txt @@ -0,0 +1,76 @@ +######################################################################################### +# # +# OpenSpace # +# # +# Copyright (c) 2014-2017 # +# # +# Permission is hereby granted, free of charge, to any person obtaining a copy of this # +# software and associated documentation files (the "Software"), to deal in the Software # +# without restriction, including without limitation the rights to use, copy, modify, # +# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to # +# permit persons to whom the Software is furnished to do so, subject to the following # +# conditions: # +# # +# The above copyright notice and this permission notice shall be included in all copies # +# or substantial portions of the Software. # +# # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, # +# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A # +# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT # +# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF # +# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE # +# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # +######################################################################################### + +include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) + +set(HEADER_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/atmospheredeferredcaster.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableatmosphere.h +) +source_group("Header Files" FILES ${HEADER_FILES}) + +set(SOURCE_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/atmospheredeferredcaster.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableatmosphere.cpp +) +source_group("Source Files" FILES ${SOURCE_FILES}) + +set(SHADER_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/atmosphere_common.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/atmosphere_deferred_vs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/atmosphere_deferred_fs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/deltaE_calc_vs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/deltaE_calc_fs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/deltaJ_calc_vs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/deltaJ_calc_fs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/deltaJ_calc_gs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/deltaS_calc_vs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/deltaS_calc_gs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/deltaS_calc_fs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/deltaS_sup_calc_vs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/deltaS_sup_calc_gs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/deltaS_sup_calc_fs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/inScattering_calc_vs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/inScattering_calc_gs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/inScattering_calc_fs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/inScattering_sup_calc_vs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/inScattering_sup_calc_gs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/inScattering_sup_calc_fs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/irradiance_calc_vs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/irradiance_calc_fs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/irradiance_final_vs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/irradiance_final_fs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/irradiance_sup_calc_vs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/irradiance_sup_calc_fs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/transmittance_calc_vs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/transmittance_calc_fs.glsl +) +source_group("Shader Files" FILES ${SHADER_FILES}) + +create_new_module( + "Atmosphere" + atmosphere_module + STATIC + ${HEADER_FILES} ${SOURCE_FILES} ${SHADER_FILES} +) diff --git a/modules/atmosphere/atmospheremodule.cpp b/modules/atmosphere/atmospheremodule.cpp new file mode 100644 index 0000000000..e3aea05dfe --- /dev/null +++ b/modules/atmosphere/atmospheremodule.cpp @@ -0,0 +1,45 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#include +#include +#include + +#include + +#include + +namespace openspace { + +AtmosphereModule::AtmosphereModule() : + OpenSpaceModule("Atmosphere") +{} + +void AtmosphereModule::internalInitialize() { + auto fRenderable = FactoryManager::ref().factory(); + ghoul_assert(fRenderable, "No renderable factory existed"); + fRenderable->registerClass("RenderableAtmosphere"); +} + +} // namespace openspace diff --git a/modules/atmosphere/atmospheremodule.h b/modules/atmosphere/atmospheremodule.h new file mode 100644 index 0000000000..af35b12fab --- /dev/null +++ b/modules/atmosphere/atmospheremodule.h @@ -0,0 +1,41 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_ATMOSPHERE___ATMOSPHERE_MODULE___H__ +#define __OPENSPACE_MODULE_ATMOSPHERE___ATMOSPHERE_MODULE___H__ + +#include +#include + +namespace openspace { + +class AtmosphereModule : public OpenSpaceModule { +public: + AtmosphereModule(); + void internalInitialize() override; +}; + +} // namespace openspace + +#endif // __OPENSPACE_MODULE_ATMOSPHERE___ATMOSPHERE_MODULE___H__ diff --git a/modules/atmosphere/include.cmake b/modules/atmosphere/include.cmake new file mode 100644 index 0000000000..ded20927fb --- /dev/null +++ b/modules/atmosphere/include.cmake @@ -0,0 +1 @@ +#set (DEFAULT_MODULE ON) diff --git a/modules/atmosphere/rendering/atmospheredeferredcaster.cpp b/modules/atmosphere/rendering/atmospheredeferredcaster.cpp new file mode 100644 index 0000000000..aab64e73cc --- /dev/null +++ b/modules/atmosphere/rendering/atmospheredeferredcaster.cpp @@ -0,0 +1,1531 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + + /*************************************************************************************** + * Modified part of the code (4D texture mechanism) from Eric Bruneton is used in the + * following code. + ****************************************************************************************/ + + /** + * Precomputed Atmospheric Scattering + * Copyright (c) 2008 INRIA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define _USE_MATH_DEFINES +#include + + +namespace { + const char* _loggerCat = "AtmosphereDeferredcaster"; + const char* GlslDeferredcastPath = + "${MODULES}/atmosphere/shaders/atmosphere_deferred_fs.glsl"; + const char* GlslDeferredcastFSPath = + "${MODULES}/atmosphere/shaders/atmosphere_deferred_fs.glsl"; + const char* GlslDeferredcastVsPath = + "${MODULES}/atmosphere/shaders/atmosphere_deferred_vs.glsl"; + + const float ATM_EPS = 2.0; + const double KM_TO_M = 1000.0; +} // namespace + +namespace openspace { + +AtmosphereDeferredcaster::AtmosphereDeferredcaster() + : _transmittanceProgramObject(nullptr) + , _irradianceProgramObject(nullptr) + , _irradianceSupTermsProgramObject(nullptr) + , _irradianceFinalProgramObject(nullptr) + , _inScatteringProgramObject(nullptr) + , _inScatteringSupTermsProgramObject(nullptr) + , _deltaEProgramObject(nullptr) + , _deltaSProgramObject(nullptr) + , _deltaSSupTermsProgramObject(nullptr) + , _deltaJProgramObject(nullptr) + , _atmosphereProgramObject(nullptr) + , _transmittanceTableTexture(0) + , _irradianceTableTexture(0) + , _inScatteringTableTexture(0) + , _deltaETableTexture(0) + , _deltaSRayleighTableTexture(0) + , _deltaSMieTableTexture(0) + , _deltaJTableTexture(0) + , _atmosphereTexture(0) + , _atmosphereCalculated(false) + , _ozoneEnabled(false) + , _sunFollowingCameraEnabled(false) + , _atmosphereRadius(0.f) + , _atmospherePlanetRadius(0.f) + , _planetAverageGroundReflectance(0.f) + , _planetGroundRadianceEmittion(0.f) + , _rayleighHeightScale(0.f) + , _ozoneHeightScale(0.f) + , _mieHeightScale(0.f) + , _miePhaseConstant(0.f) + , _sunRadianceIntensity(50.0f) + , _rayleighScatteringCoeff(glm::vec3(0.f)) + , _ozoneExtinctionCoeff(glm::vec3(0.f)) + , _mieScatteringCoeff(glm::vec3(0.f)) + , _mieExtinctionCoeff(glm::vec3(0.f)) + , _ellipsoidRadii(glm::dvec3(0.0)) + , _transmittance_table_width(256) + , _transmittance_table_height(64) + , _irradiance_table_width(64) + , _irradiance_table_height(16) + , _delta_e_table_width(64) + , _delta_e_table_height(16) + , _r_samples(32) + , _mu_samples(128) + , _mu_s_samples(32) + , _nu_samples(8) + , _hardShadowsEnabled(false) + , _calculationTextureScale(1.0) + , _saveCalculationTextures(false) +{} + +void AtmosphereDeferredcaster::initialize() { + if (!_atmosphereCalculated) { + preCalculateAtmosphereParam(); + } +} + +void AtmosphereDeferredcaster::deinitialize() { + _transmittanceProgramObject = nullptr; + _irradianceProgramObject = nullptr; + _irradianceSupTermsProgramObject = nullptr; + _inScatteringProgramObject = nullptr; + _inScatteringSupTermsProgramObject = nullptr; + _deltaEProgramObject = nullptr; + _deltaSProgramObject = nullptr; + _deltaSSupTermsProgramObject = nullptr; + _deltaJProgramObject = nullptr; + + glDeleteTextures(1, &_transmittanceTableTexture); + glDeleteTextures(1, &_irradianceTableTexture); + glDeleteTextures(1, &_inScatteringTableTexture); + glDeleteTextures(1, &_deltaETableTexture); + glDeleteTextures(1, &_deltaSRayleighTableTexture); + glDeleteTextures(1, &_deltaSMieTableTexture); + glDeleteTextures(1, &_deltaJTableTexture); + glDeleteTextures(1, &_atmosphereTexture); + +} + +void AtmosphereDeferredcaster::preRaycast(const RenderData& renderData, + const DeferredcastData& deferredData, + ghoul::opengl::ProgramObject& program) +{ + // Atmosphere Frustum Culling + glm::dvec3 tPlanetPosWorld = glm::dvec3( + _modelTransform * glm::dvec4(0.0, 0.0, 0.0, 1.0) + ); + + double distance = glm::distance(tPlanetPosWorld, renderData.camera.positionVec3()); + if (distance > DISTANCE_CULLING) { + program.setUniform("cullAtmosphere", 1); + } + else { + glm::dmat4 MV = glm::dmat4( + renderData.camera.sgctInternal.projectionMatrix() + ) * renderData.camera.combinedViewMatrix(); + + if (!isAtmosphereInFrustum( + glm::value_ptr(MV), + tPlanetPosWorld, + (_atmosphereRadius + ATM_EPS)*KM_TO_M) + ) + { + program.setUniform("cullAtmosphere", 1); + } + else { + program.setUniform("cullAtmosphere", 0); + program.setUniform("Rg", _atmospherePlanetRadius); + program.setUniform("Rt", _atmosphereRadius); + program.setUniform( + "AverageGroundReflectance", + _planetAverageGroundReflectance + ); + program.setUniform("groundRadianceEmittion", _planetGroundRadianceEmittion); + program.setUniform("HR", _rayleighHeightScale); + program.setUniform("betaRayleigh", _rayleighScatteringCoeff); + program.setUniform("HM", _mieHeightScale); + program.setUniform("betaMieScattering", _mieScatteringCoeff); + program.setUniform("betaMieExtinction", _mieExtinctionCoeff); + program.setUniform("mieG", _miePhaseConstant); + program.setUniform("sunRadiance", _sunRadianceIntensity); + program.setUniform("ozoneLayerEnabled", _ozoneEnabled); + program.setUniform("HO", _ozoneHeightScale); + program.setUniform("betaOzoneExtinction", _ozoneExtinctionCoeff); + + program.setUniform("TRANSMITTANCE_W", _transmittance_table_width); + program.setUniform("TRANSMITTANCE_H", _transmittance_table_height); + program.setUniform("SKY_W", _irradiance_table_width); + program.setUniform("SKY_H", _irradiance_table_height); + program.setUniform("OTHER_TEXTURES_W", _delta_e_table_width); + program.setUniform("OTHER_TEXTURES_H", _delta_e_table_height); + program.setUniform("SAMPLES_R", _r_samples); + program.setUniform("SAMPLES_MU", _mu_samples); + program.setUniform("SAMPLES_MU_S", _mu_s_samples); + program.setUniform("SAMPLES_NU", _nu_samples); + + program.setUniform("ModelTransformMatrix", _modelTransform); + + // Object Space + glm::dmat4 inverseModelMatrix = glm::inverse(_modelTransform); + program.setUniform("dInverseModelTransformMatrix", inverseModelMatrix); + program.setUniform("dModelTransformMatrix", _modelTransform); + + // The following scale comes from PSC transformations. + float fScaleFactor = renderData.camera.scaling().x * + pow(10.0, renderData.camera.scaling().y); + glm::dmat4 dfScaleCamTransf = glm::scale(glm::dvec3(fScaleFactor)); + program.setUniform( + "dInverseScaleTransformMatrix", + glm::inverse(dfScaleCamTransf) + ); + + // World to Eye Space in OS + program.setUniform( + "dInverseCamRotTransform", + glm::mat4_cast( + static_cast(renderData.camera.rotationQuaternion()) + ) + ); + + program.setUniform( + "dInverseSgctEyeToWorldTranform", + glm::inverse(renderData.camera.combinedViewMatrix()) + ); + + // Eye Space in OS to Eye Space in SGCT + glm::dmat4 dOsEye2SGCTEye = glm::dmat4(renderData.camera.viewMatrix()); + glm::dmat4 dSgctEye2OSEye = glm::inverse(dOsEye2SGCTEye); + program.setUniform("dSgctEyeToOSEyeTranform", dSgctEye2OSEye); + + // Eye Space in SGCT to Projection (Clip) Space in SGCT + glm::dmat4 dSgctEye2Clip = glm::dmat4(renderData.camera.projectionMatrix()); + glm::dmat4 dInverseProjection = glm::inverse(dSgctEye2Clip); + + program.setUniform("dInverseSgctProjectionMatrix", dInverseProjection); + + program.setUniform("dObjpos", glm::dvec4(renderData.position.dvec3(), 1.0)); + program.setUniform("dCampos", renderData.camera.positionVec3()); + + double lt; + glm::dvec3 sunPosWorld = SpiceManager::ref().targetPosition( + "SUN", + "SUN", + "GALACTIC", + {}, + _time, + lt + ); + glm::dvec4 sunPosObj = glm::dvec4(0.0); + + // Sun following camera position + if (_sunFollowingCameraEnabled) { + sunPosObj = inverseModelMatrix * glm::dvec4( + renderData.camera.positionVec3(), + 1.0 + ); + } + else { + sunPosObj = inverseModelMatrix * + glm::dvec4(sunPosWorld - renderData.modelTransform.translation, 1.0); + } + + // Sun Position in Object Space + program.setUniform("sunDirectionObj", glm::normalize(glm::dvec3(sunPosObj))); + + program.setUniform("ellipsoidRadii", _ellipsoidRadii); + + // Shadow calculations.. + if (!_shadowConfArray.empty()) { + std::vector shadowDataArray; + shadowDataArray.reserve(_shadowConfArray.size()); + + for (const auto & shadowConf : _shadowConfArray) { + // TO REMEMBER: all distances and lengths in world coordinates are in + // meters!!! We need to move this to view space... + // Getting source and caster: + glm::dvec3 sourcePos = SpiceManager::ref().targetPosition( + shadowConf.source.first, + "SUN", "GALACTIC", + {}, + _time, + lt + ); + sourcePos *= KM_TO_M; // converting to meters + glm::dvec3 casterPos = SpiceManager::ref().targetPosition( + shadowConf.caster.first, + "SUN", "GALACTIC", + {}, + _time, + lt + ); + casterPos *= KM_TO_M; // converting to meters + + // First we determine if the caster is shadowing the current planet + // (all calculations in World Coordinates): + glm::dvec3 planetCasterVec = casterPos - renderData.position.dvec3(); + glm::dvec3 sourceCasterVec = casterPos - sourcePos; + double sc_length = glm::length(sourceCasterVec); + glm::dvec3 planetCaster_proj = ( + glm::dot(planetCasterVec, sourceCasterVec) / + (sc_length*sc_length)) * sourceCasterVec; + double d_test = glm::length(planetCasterVec - planetCaster_proj); + double xp_test = shadowConf.caster.second * + sc_length / (shadowConf.source.second + shadowConf.caster.second); + double rp_test = shadowConf.caster.second * + (glm::length(planetCaster_proj) + xp_test) / xp_test; + + double casterDistSun = glm::length(casterPos - sunPosWorld); + double planetDistSun = glm::length( + renderData.position.dvec3() - sunPosWorld + ); + + ShadowRenderingStruct shadowData; + shadowData.isShadowing = false; + + if (((d_test - rp_test) < (_atmospherePlanetRadius * KM_TO_M)) && + //if (((d_test - rp_test) < (_atmosphereRadius * KM_TO_M)) && + (casterDistSun < planetDistSun)) { + // The current caster is shadowing the current planet + shadowData.isShadowing = true; + shadowData.rs = shadowConf.source.second; + shadowData.rc = shadowConf.caster.second; + shadowData.sourceCasterVec = glm::normalize(sourceCasterVec); + shadowData.xp = xp_test; + shadowData.xu = shadowData.rc * sc_length / + (shadowData.rs - shadowData.rc); + shadowData.casterPositionVec = casterPos; + } + shadowDataArray.push_back(shadowData); + } + + const std::string uniformVarName("shadowDataArray["); + unsigned int counter = 0; + for (const auto & sd : shadowDataArray) { + std::stringstream ss; + ss << uniformVarName << counter << "].isShadowing"; + program.setUniform(ss.str(), sd.isShadowing); + if (sd.isShadowing) { + ss.str(std::string()); + ss << uniformVarName << counter << "].xp"; + program.setUniform(ss.str(), sd.xp); + ss.str(std::string()); + ss << uniformVarName << counter << "].xu"; + program.setUniform(ss.str(), sd.xu); + /*ss.str(std::string()); + ss << uniformVarName << counter << "].rs"; + program.setUniform(ss.str(), sd.rs);*/ + ss.str(std::string()); + ss << uniformVarName << counter << "].rc"; + program.setUniform(ss.str(), sd.rc); + ss.str(std::string()); + ss << uniformVarName << counter << "].sourceCasterVec"; + program.setUniform(ss.str(), sd.sourceCasterVec); + ss.str(std::string()); + ss << uniformVarName << counter << "].casterPositionVec"; + program.setUniform(ss.str(), sd.casterPositionVec); + } + counter++; + } + program.setUniform("hardShadows", _hardShadowsEnabled); + } + + } + } + _transmittanceTableTextureUnit.activate(); + glBindTexture(GL_TEXTURE_2D, _transmittanceTableTexture); + program.setUniform("transmittanceTexture", _transmittanceTableTextureUnit); + + _irradianceTableTextureUnit.activate(); + glBindTexture(GL_TEXTURE_2D, _irradianceTableTexture); + program.setUniform("irradianceTexture", _irradianceTableTextureUnit); + + _inScatteringTableTextureUnit.activate(); + glBindTexture(GL_TEXTURE_3D, _inScatteringTableTexture); + program.setUniform("inscatterTexture", _inScatteringTableTextureUnit); +} + +void AtmosphereDeferredcaster::postRaycast(const RenderData& renderData, + const DeferredcastData& deferredData, + ghoul::opengl::ProgramObject& program) +{ + // Deactivate the texture units + _transmittanceTableTextureUnit.deactivate(); + _irradianceTableTextureUnit.deactivate(); + _inScatteringTableTextureUnit.deactivate(); +} + +std::string AtmosphereDeferredcaster::deferredcastPath() const { + return GlslDeferredcastPath; +} + +std::string AtmosphereDeferredcaster::deferredcastFSPath() const { + return GlslDeferredcastFSPath; +} + +std::string AtmosphereDeferredcaster::deferredcastVSPath() const { + return GlslDeferredcastVsPath; +} + +std::string AtmosphereDeferredcaster::helperPath() const { + return ""; // no helper file +} + +void AtmosphereDeferredcaster::setModelTransform(const glm::dmat4& transform) { + _modelTransform = transform; +} + +void AtmosphereDeferredcaster::setTime(double time) { + _time = time; +} + +void AtmosphereDeferredcaster::setAtmosphereRadius(float atmRadius) { + _atmosphereRadius = atmRadius; +} + +void AtmosphereDeferredcaster::setPlanetRadius(float planetRadius) { + _atmospherePlanetRadius = planetRadius; +} + +void AtmosphereDeferredcaster::setPlanetAverageGroundReflectance( + float averageGReflectance) +{ + _planetAverageGroundReflectance = averageGReflectance; +} + +void AtmosphereDeferredcaster::setPlanetGroundRadianceEmittion( + float groundRadianceEmittion) +{ + _planetGroundRadianceEmittion = groundRadianceEmittion; +} + +void AtmosphereDeferredcaster::setRayleighHeightScale(float rayleighHeightScale) { + _rayleighHeightScale = rayleighHeightScale; +} + +void AtmosphereDeferredcaster::enableOzone(bool enable) { + _ozoneEnabled = enable; +} + +void AtmosphereDeferredcaster::setOzoneHeightScale(float ozoneHeightScale) { + _ozoneHeightScale = ozoneHeightScale; +} + + +void AtmosphereDeferredcaster::setMieHeightScale(float mieHeightScale) { + _mieHeightScale = mieHeightScale; +} + +void AtmosphereDeferredcaster::setMiePhaseConstant(float miePhaseConstant) { + _miePhaseConstant = miePhaseConstant; +} + +void AtmosphereDeferredcaster::setSunRadianceIntensity(float sunRadiance) { + _sunRadianceIntensity = sunRadiance; +} + +void AtmosphereDeferredcaster::setRayleighScatteringCoefficients( + const glm::vec3& rayScattCoeff) +{ + _rayleighScatteringCoeff = rayScattCoeff; +} + +void AtmosphereDeferredcaster::setOzoneExtinctionCoefficients( + const glm::vec3& ozoneExtCoeff) +{ + _ozoneExtinctionCoeff = ozoneExtCoeff; +} + +void AtmosphereDeferredcaster::setMieScatteringCoefficients( + const glm::vec3& mieScattCoeff) +{ + _mieScatteringCoeff = mieScattCoeff; +} + +void AtmosphereDeferredcaster::setMieExtinctionCoefficients(const glm::vec3& mieExtCoeff) +{ + _mieExtinctionCoeff = mieExtCoeff; +} + +void AtmosphereDeferredcaster::setEllipsoidRadii(const glm::dvec3& radii) { + _ellipsoidRadii = radii; +} + +void AtmosphereDeferredcaster::setHardShadows(bool enabled) { + _hardShadowsEnabled = enabled; +} + +void AtmosphereDeferredcaster::setShadowConfigArray( + const std::vector& shadowConfigArray) +{ + _shadowConfArray = shadowConfigArray; +} + +void AtmosphereDeferredcaster::enableSunFollowing(bool enable) { + _sunFollowingCameraEnabled = enable; +} + +void AtmosphereDeferredcaster::setPrecalculationTextureScale( + float preCalculatedTexturesScale) +{ + _calculationTextureScale = preCalculatedTexturesScale; + _transmittance_table_width *= static_cast(_calculationTextureScale); + _transmittance_table_height *= static_cast(_calculationTextureScale); + _irradiance_table_width *= static_cast(_calculationTextureScale); + _irradiance_table_height *= static_cast(_calculationTextureScale); + _delta_e_table_width *= static_cast(_calculationTextureScale); + _delta_e_table_height *= static_cast(_calculationTextureScale); + _r_samples *= static_cast(_calculationTextureScale); + _mu_samples *= static_cast(_calculationTextureScale); + _mu_s_samples *= static_cast(_calculationTextureScale); + _nu_samples *= static_cast(_calculationTextureScale); +} + +void AtmosphereDeferredcaster::enablePrecalculationTexturesSaving() { + _saveCalculationTextures = true; +} + +void AtmosphereDeferredcaster::loadComputationPrograms() { + //============== Transmittance T ================= + if (!_transmittanceProgramObject) { + _transmittanceProgramObject = ghoul::opengl::ProgramObject::Build( + "transmittanceCalcProgram", + absPath("${MODULE_ATMOSPHERE}/shaders/transmittance_calc_vs.glsl"), + absPath("${MODULE_ATMOSPHERE}/shaders/transmittance_calc_fs.glsl")); + } + using IgnoreError = ghoul::opengl::ProgramObject::IgnoreError; + _transmittanceProgramObject->setIgnoreSubroutineUniformLocationError( + IgnoreError::Yes + ); + _transmittanceProgramObject->setIgnoreUniformLocationError(IgnoreError::Yes); + + //============== Irradiance E ================= + if (!_irradianceProgramObject) { + _irradianceProgramObject = ghoul::opengl::ProgramObject::Build( + "irradianceCalcProgram", + absPath("${MODULE_ATMOSPHERE}/shaders/irradiance_calc_vs.glsl"), + absPath("${MODULE_ATMOSPHERE}/shaders/irradiance_calc_fs.glsl")); + } + _irradianceProgramObject->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); + _irradianceProgramObject->setIgnoreUniformLocationError(IgnoreError::Yes); + + if (!_irradianceSupTermsProgramObject) { + _irradianceSupTermsProgramObject = ghoul::opengl::ProgramObject::Build( + "irradianceSupTermsCalcProgram", + absPath("${MODULE_ATMOSPHERE}/shaders/irradiance_sup_calc_vs.glsl"), + absPath("${MODULE_ATMOSPHERE}/shaders/irradiance_sup_calc_fs.glsl")); + } + _irradianceSupTermsProgramObject->setIgnoreSubroutineUniformLocationError( + IgnoreError::Yes + ); + _irradianceSupTermsProgramObject->setIgnoreUniformLocationError(IgnoreError::Yes); + + //============== InScattering S ================= + if (!_inScatteringProgramObject) { + _inScatteringProgramObject = ghoul::opengl::ProgramObject::Build( + "inScatteringCalcProgram", + absPath("${MODULE_ATMOSPHERE}/shaders/inScattering_calc_vs.glsl"), + absPath("${MODULE_ATMOSPHERE}/shaders/inScattering_calc_fs.glsl"), + absPath("${MODULE_ATMOSPHERE}/shaders/inScattering_calc_gs.glsl")); + } + _inScatteringProgramObject->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); + _inScatteringProgramObject->setIgnoreUniformLocationError(IgnoreError::Yes); + + if (!_inScatteringSupTermsProgramObject) { + _inScatteringSupTermsProgramObject = ghoul::opengl::ProgramObject::Build( + "inScatteringSupTermsCalcProgram", + absPath("${MODULE_ATMOSPHERE}/shaders/inScattering_sup_calc_vs.glsl"), + absPath("${MODULE_ATMOSPHERE}/shaders/inScattering_sup_calc_fs.glsl"), + absPath("${MODULE_ATMOSPHERE}/shaders/inScattering_sup_calc_gs.glsl")); + } + _inScatteringSupTermsProgramObject->setIgnoreSubroutineUniformLocationError( + IgnoreError::Yes + ); + _inScatteringSupTermsProgramObject->setIgnoreUniformLocationError(IgnoreError::Yes); + + //============== Delta E ================= + if (!_deltaEProgramObject) { + _deltaEProgramObject = ghoul::opengl::ProgramObject::Build( + "deltaECalcProgram", + absPath("${MODULE_ATMOSPHERE}/shaders/deltaE_calc_vs.glsl"), + absPath("${MODULE_ATMOSPHERE}/shaders/deltaE_calc_fs.glsl")); + } + _deltaEProgramObject->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); + _deltaEProgramObject->setIgnoreUniformLocationError(IgnoreError::Yes); + + //============== Irradiance finel E ================= + if (!_irradianceFinalProgramObject) { + _irradianceFinalProgramObject = ghoul::opengl::ProgramObject::Build( + "irradianceEFinalProgram", + absPath("${MODULE_ATMOSPHERE}/shaders/irradiance_final_vs.glsl"), + absPath("${MODULE_ATMOSPHERE}/shaders/irradiance_final_fs.glsl")); + } + _irradianceFinalProgramObject->setIgnoreSubroutineUniformLocationError( + IgnoreError::Yes + ); + _irradianceFinalProgramObject->setIgnoreUniformLocationError(IgnoreError::Yes); + + //============== Delta S ================= + if (!_deltaSProgramObject) { + _deltaSProgramObject = ghoul::opengl::ProgramObject::Build( + "deltaSCalcProgram", + absPath("${MODULE_ATMOSPHERE}/shaders/deltaS_calc_vs.glsl"), + absPath("${MODULE_ATMOSPHERE}/shaders/deltaS_calc_fs.glsl"), + absPath("${MODULE_ATMOSPHERE}/shaders/deltaS_calc_gs.glsl")); + } + _deltaSProgramObject->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); + _deltaSProgramObject->setIgnoreUniformLocationError(IgnoreError::Yes); + + if (!_deltaSSupTermsProgramObject) { + _deltaSSupTermsProgramObject = ghoul::opengl::ProgramObject::Build( + "deltaSSUPTermsCalcProgram", + absPath("${MODULE_ATMOSPHERE}/shaders/deltaS_sup_calc_vs.glsl"), + absPath("${MODULE_ATMOSPHERE}/shaders/deltaS_sup_calc_fs.glsl"), + absPath("${MODULE_ATMOSPHERE}/shaders/deltaS_sup_calc_gs.glsl")); + } + _deltaSSupTermsProgramObject->setIgnoreSubroutineUniformLocationError( + IgnoreError::Yes + ); + _deltaSSupTermsProgramObject->setIgnoreUniformLocationError(IgnoreError::Yes); + + //============== Delta J (Radiance Scattered) ================= + if (!_deltaJProgramObject) { + _deltaJProgramObject = ghoul::opengl::ProgramObject::Build( + "deltaJCalcProgram", + absPath("${MODULE_ATMOSPHERE}/shaders/deltaJ_calc_vs.glsl"), + absPath("${MODULE_ATMOSPHERE}/shaders/deltaJ_calc_fs.glsl"), + absPath("${MODULE_ATMOSPHERE}/shaders/deltaJ_calc_gs.glsl")); + } + _deltaJProgramObject->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); + _deltaJProgramObject->setIgnoreUniformLocationError(IgnoreError::Yes); +} + +void AtmosphereDeferredcaster::unloadComputationPrograms() { + _transmittanceProgramObject = nullptr; + _irradianceProgramObject = nullptr; + _irradianceSupTermsProgramObject = nullptr; + _inScatteringProgramObject = nullptr; + _inScatteringSupTermsProgramObject = nullptr; + _deltaEProgramObject = nullptr; + _irradianceFinalProgramObject = nullptr; + _deltaSProgramObject = nullptr; + _deltaSSupTermsProgramObject = nullptr; + _deltaJProgramObject = nullptr; +} + +void AtmosphereDeferredcaster::createComputationTextures() { + if (!_atmosphereCalculated) { + //============== Transmittance ================= + ghoul::opengl::TextureUnit transmittanceTableTextureUnit; + transmittanceTableTextureUnit.activate(); + glGenTextures(1, &_transmittanceTableTexture); + glBindTexture(GL_TEXTURE_2D, _transmittanceTableTexture); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + // Stopped using a buffer object for GL_PIXEL_UNPACK_BUFFER + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB32F, _transmittance_table_width, + _transmittance_table_height, 0, GL_RGB, GL_FLOAT, nullptr); + + //============== Irradiance ================= + ghoul::opengl::TextureUnit irradianceTableTextureUnit; + irradianceTableTextureUnit.activate(); + glGenTextures(1, &_irradianceTableTexture); + glBindTexture(GL_TEXTURE_2D, _irradianceTableTexture); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB32F, _irradiance_table_width, + _irradiance_table_height, 0, GL_RGB, GL_FLOAT, nullptr); + + //============== InScattering ================= + ghoul::opengl::TextureUnit inScatteringTableTextureUnit; + inScatteringTableTextureUnit.activate(); + glGenTextures(1, &_inScatteringTableTexture); + glBindTexture(GL_TEXTURE_3D, _inScatteringTableTexture); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); + glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA32F, _mu_s_samples * _nu_samples, + _mu_samples, _r_samples, 0, GL_RGB, GL_FLOAT, nullptr); + } + + //============== Delta E ================= + ghoul::opengl::TextureUnit deltaETableTextureUnit; + deltaETableTextureUnit.activate(); + glGenTextures(1, &_deltaETableTexture); + glBindTexture(GL_TEXTURE_2D, _deltaETableTexture); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB32F, _delta_e_table_width, + _delta_e_table_height, 0, GL_RGB, GL_FLOAT, nullptr); + + //============== Delta S ================= + ghoul::opengl::TextureUnit deltaSRayleighTableTextureUnit; + deltaSRayleighTableTextureUnit.activate(); + glGenTextures(1, &_deltaSRayleighTableTexture); + glBindTexture(GL_TEXTURE_3D, _deltaSRayleighTableTexture); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); + glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB32F, _mu_s_samples * _nu_samples, + _mu_samples, _r_samples, 0, GL_RGB, GL_FLOAT, nullptr); + + ghoul::opengl::TextureUnit deltaSMieTableTextureUnit; + deltaSMieTableTextureUnit.activate(); + glGenTextures(1, &_deltaSMieTableTexture); + glBindTexture(GL_TEXTURE_3D, _deltaSMieTableTexture); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); + glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB32F, _mu_s_samples * _nu_samples, + _mu_samples, _r_samples, 0, GL_RGB, GL_FLOAT, nullptr); + + //============== Delta J (Radiance Scattered) ================= + ghoul::opengl::TextureUnit deltaJTableTextureUnit; + deltaJTableTextureUnit.activate(); + glGenTextures(1, &_deltaJTableTexture); + glBindTexture(GL_TEXTURE_3D, _deltaJTableTexture); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); + glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB32F, _mu_s_samples * _nu_samples, + _mu_samples, _r_samples, 0, GL_RGB, GL_FLOAT, nullptr); + +} + +void AtmosphereDeferredcaster::deleteComputationTextures() { + // Cleaning up + glDeleteTextures(1, &_transmittanceTableTexture); + glDeleteTextures(1, &_irradianceTableTexture); + glDeleteTextures(1, &_inScatteringTableTexture); + glDeleteTextures(1, &_deltaETableTexture); + glDeleteTextures(1, &_deltaSRayleighTableTexture); + glDeleteTextures(1, &_deltaSMieTableTexture); + glDeleteTextures(1, &_deltaJTableTexture); +} + +void AtmosphereDeferredcaster::deleteUnusedComputationTextures() { + glDeleteTextures(1, &_deltaETableTexture); + glDeleteTextures(1, &_deltaSRayleighTableTexture); + glDeleteTextures(1, &_deltaSMieTableTexture); + glDeleteTextures(1, &_deltaJTableTexture); +} + +void AtmosphereDeferredcaster::executeCalculations(GLuint quadCalcVAO, + GLenum drawBuffers[1], + GLsizei vertexSize) +{ + ghoul::opengl::TextureUnit transmittanceTableTextureUnit; + ghoul::opengl::TextureUnit irradianceTableTextureUnit; + ghoul::opengl::TextureUnit inScatteringTableTextureUnit; + ghoul::opengl::TextureUnit deltaETableTextureUnit; + ghoul::opengl::TextureUnit deltaSRayleighTableTextureUnit; + ghoul::opengl::TextureUnit deltaSMieTableTextureUnit; + ghoul::opengl::TextureUnit deltaJTableTextureUnit; + + // Saving current OpenGL state + GLboolean blendEnabled = glIsEnabled(GL_BLEND); + GLenum blendEquationRGB; + GLenum blendEquationAlpha; + GLenum blendDestAlpha; + GLenum blendDestRGB; + GLenum blendSrcAlpha; + GLenum blendSrcRGB; + + if (blendEnabled) { + glDisable(GL_BLEND); + } + glGetIntegerv(GL_BLEND_EQUATION_RGB, &blendEquationRGB); + glGetIntegerv(GL_BLEND_EQUATION_ALPHA, &blendEquationAlpha); + glGetIntegerv(GL_BLEND_DST_ALPHA, &blendDestAlpha); + glGetIntegerv(GL_BLEND_DST_RGB, &blendDestRGB); + glGetIntegerv(GL_BLEND_SRC_ALPHA, &blendSrcAlpha); + glGetIntegerv(GL_BLEND_SRC_RGB, &blendSrcRGB); + + // =========================================================== + // See Precomputed Atmosphere Scattering from Bruneton et al. paper, algorithm 4.1: + // =========================================================== + glFramebufferTexture( + GL_FRAMEBUFFER, + GL_COLOR_ATTACHMENT0, + _transmittanceTableTexture, + 0 + ); + checkFrameBufferState("_transmittanceTableTexture"); + glViewport(0, 0, _transmittance_table_width, _transmittance_table_height); + _transmittanceProgramObject->activate(); + loadAtmosphereDataIntoShaderProgram(_transmittanceProgramObject); + //glClear(GL_COLOR_BUFFER_BIT); + static const float black[] = { 0.0f, 0.0f, 0.0f, 0.0f }; + glClearBufferfv(GL_COLOR, 0, black); + renderQuadForCalc(quadCalcVAO, vertexSize); + if (_saveCalculationTextures) { + saveTextureToPPMFile( + GL_COLOR_ATTACHMENT0, + std::string("transmittance_texture.ppm"), + _transmittance_table_width, + _transmittance_table_height + ); + } + _transmittanceProgramObject->deactivate(); + + // line 2 in algorithm 4.1 + glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, _deltaETableTexture, 0); + checkFrameBufferState("_deltaETableTexture"); + glViewport(0, 0, _delta_e_table_width, _delta_e_table_height); + _irradianceProgramObject->activate(); + transmittanceTableTextureUnit.activate(); + glBindTexture(GL_TEXTURE_2D, _transmittanceTableTexture); + _irradianceProgramObject->setUniform( + "transmittanceTexture", + transmittanceTableTextureUnit + ); + loadAtmosphereDataIntoShaderProgram(_irradianceProgramObject); + glClear(GL_COLOR_BUFFER_BIT); + renderQuadForCalc(quadCalcVAO, vertexSize); + if (_saveCalculationTextures) { + saveTextureToPPMFile( + GL_COLOR_ATTACHMENT0, + std::string("deltaE_table_texture.ppm"), + _delta_e_table_width, + _delta_e_table_height + ); + } + _irradianceProgramObject->deactivate(); + + // line 3 in algorithm 4.1 + glFramebufferTexture( + GL_FRAMEBUFFER, + GL_COLOR_ATTACHMENT0, + _deltaSRayleighTableTexture, + 0 + ); + glFramebufferTexture( + GL_FRAMEBUFFER, + GL_COLOR_ATTACHMENT1, + _deltaSMieTableTexture, + 0 + ); + GLenum colorBuffers[2] = { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1 }; + glDrawBuffers(2, colorBuffers); + checkFrameBufferState("_deltaSRay and _deltaSMie TableTexture"); + glViewport(0, 0, _mu_s_samples * _nu_samples, _mu_samples); + _inScatteringProgramObject->activate(); + transmittanceTableTextureUnit.activate(); + glBindTexture(GL_TEXTURE_2D, _transmittanceTableTexture); + _inScatteringProgramObject->setUniform( + "transmittanceTexture", + transmittanceTableTextureUnit + ); + loadAtmosphereDataIntoShaderProgram(_inScatteringProgramObject); + glClear(GL_COLOR_BUFFER_BIT); + for (int layer = 0; layer < static_cast(_r_samples); ++layer) { + step3DTexture(_inScatteringProgramObject, layer); + renderQuadForCalc(quadCalcVAO, vertexSize); + } + if (_saveCalculationTextures) { + saveTextureToPPMFile( + GL_COLOR_ATTACHMENT0, + std::string("deltaS_rayleigh_texture.ppm"), + _mu_s_samples * _nu_samples, + _mu_samples + ); + saveTextureToPPMFile( + GL_COLOR_ATTACHMENT1, + std::string("deltaS_mie_texture.ppm"), + _mu_s_samples * _nu_samples, + _mu_samples + ); + } + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_TEXTURE_2D, 0, 0); + glDrawBuffers(1, drawBuffers); + + _inScatteringProgramObject->deactivate(); + + // line 4 in algorithm 4.1 + glFramebufferTexture( + GL_FRAMEBUFFER, + GL_COLOR_ATTACHMENT0, + _irradianceTableTexture, + 0 + ); + checkFrameBufferState("_irradianceTableTexture"); + glDrawBuffer(GL_COLOR_ATTACHMENT0); + + glViewport(0, 0, _delta_e_table_width, _delta_e_table_height); + _deltaEProgramObject->activate(); + //_deltaEProgramObject->setUniform("line", 4); + deltaETableTextureUnit.activate(); + glBindTexture(GL_TEXTURE_2D, _deltaETableTexture); + _deltaEProgramObject->setUniform("deltaETexture", deltaETableTextureUnit); + loadAtmosphereDataIntoShaderProgram(_deltaEProgramObject); + glClear(GL_COLOR_BUFFER_BIT); + renderQuadForCalc(quadCalcVAO, vertexSize); + if (_saveCalculationTextures) { + saveTextureToPPMFile(GL_COLOR_ATTACHMENT0, std::string("irradiance_texture.ppm"), + _delta_e_table_width, _delta_e_table_height); + } + _deltaEProgramObject->deactivate(); + + // line 5 in algorithm 4.1 + glFramebufferTexture( + GL_FRAMEBUFFER, + GL_COLOR_ATTACHMENT0, + _inScatteringTableTexture, + 0 + ); + checkFrameBufferState("_inScatteringTableTexture"); + glViewport(0, 0, _mu_s_samples * _nu_samples, _mu_samples); + _deltaSProgramObject->activate(); + deltaSRayleighTableTextureUnit.activate(); + glBindTexture(GL_TEXTURE_3D, _deltaSRayleighTableTexture); + deltaSMieTableTextureUnit.activate(); + glBindTexture(GL_TEXTURE_3D, _deltaSMieTableTexture); + _deltaSProgramObject->setUniform("deltaSRTexture", deltaSRayleighTableTextureUnit); + _deltaSProgramObject->setUniform("deltaSMTexture", deltaSMieTableTextureUnit); + loadAtmosphereDataIntoShaderProgram(_deltaSProgramObject); + glClear(GL_COLOR_BUFFER_BIT); + for (int layer = 0; layer < static_cast(_r_samples); ++layer) { + step3DTexture(_deltaSProgramObject, layer, false); + renderQuadForCalc(quadCalcVAO, vertexSize); + } + if (_saveCalculationTextures) { + saveTextureToPPMFile(GL_COLOR_ATTACHMENT0, std::string("S_texture.ppm"), + _mu_s_samples * _nu_samples, _mu_samples); + } + _deltaSProgramObject->deactivate(); + + // loop in line 6 in algorithm 4.1 + for (int scatteringOrder = 2; scatteringOrder <= 4; ++scatteringOrder) { + + // line 7 in algorithm 4.1 + glFramebufferTexture( + GL_FRAMEBUFFER, + GL_COLOR_ATTACHMENT0, + _deltaJTableTexture, + 0 + ); + checkFrameBufferState("_deltaJTableTexture"); + glViewport(0, 0, _mu_s_samples * _nu_samples, _mu_samples); + _deltaJProgramObject->activate(); + if (scatteringOrder == 2) { + _deltaJProgramObject->setUniform("firstIteraction", 1); + } + else { + _deltaJProgramObject->setUniform("firstIteraction", 0); + } + transmittanceTableTextureUnit.activate(); + glBindTexture(GL_TEXTURE_2D, _transmittanceTableTexture); + _deltaJProgramObject->setUniform( + "transmittanceTexture", + transmittanceTableTextureUnit + ); + deltaETableTextureUnit.activate(); + glBindTexture(GL_TEXTURE_2D, _deltaETableTexture); + _deltaJProgramObject->setUniform("deltaETexture", deltaETableTextureUnit); + deltaSRayleighTableTextureUnit.activate(); + glBindTexture(GL_TEXTURE_3D, _deltaSRayleighTableTexture); + _deltaJProgramObject->setUniform( + "deltaSRTexture", + deltaSRayleighTableTextureUnit + ); + deltaSMieTableTextureUnit.activate(); + glBindTexture(GL_TEXTURE_3D, _deltaSMieTableTexture); + _deltaJProgramObject->setUniform("deltaSMTexture", deltaSMieTableTextureUnit); + loadAtmosphereDataIntoShaderProgram(_deltaJProgramObject); + for (int layer = 0; layer < static_cast(_r_samples); ++layer) { + step3DTexture(_deltaJProgramObject, layer); + renderQuadForCalc(quadCalcVAO, vertexSize); + } + std::stringstream sst; + if (_saveCalculationTextures) { + sst << "deltaJ_texture-scattering_order-" << scatteringOrder << ".ppm"; + saveTextureToPPMFile(GL_COLOR_ATTACHMENT0, sst.str(), + _mu_s_samples * _nu_samples, _mu_samples); + } + _deltaJProgramObject->deactivate(); + + // line 8 in algorithm 4.1 + glFramebufferTexture( + GL_FRAMEBUFFER, + GL_COLOR_ATTACHMENT0, + _deltaETableTexture, + 0 + ); + checkFrameBufferState("_deltaETableTexture"); + glViewport(0, 0, _delta_e_table_width, _delta_e_table_height); + _irradianceSupTermsProgramObject->activate(); + if (scatteringOrder == 2) { + _irradianceSupTermsProgramObject->setUniform( + "firstIteraction", + static_cast(1) + ); + } + else { + _irradianceSupTermsProgramObject->setUniform( + "firstIteraction", + static_cast(0) + ); + } + transmittanceTableTextureUnit.activate(); + glBindTexture(GL_TEXTURE_2D, _transmittanceTableTexture); + _irradianceSupTermsProgramObject->setUniform( + "transmittanceTexture", + transmittanceTableTextureUnit + ); + deltaSRayleighTableTextureUnit.activate(); + glBindTexture(GL_TEXTURE_3D, _deltaSRayleighTableTexture); + _irradianceSupTermsProgramObject->setUniform( + "deltaSRTexture", + deltaSRayleighTableTextureUnit + ); + deltaSMieTableTextureUnit.activate(); + glBindTexture(GL_TEXTURE_3D, _deltaSMieTableTexture); + _irradianceSupTermsProgramObject->setUniform( + "deltaSMTexture", + deltaSMieTableTextureUnit + ); + loadAtmosphereDataIntoShaderProgram(_irradianceSupTermsProgramObject); + renderQuadForCalc(quadCalcVAO, vertexSize); + if (_saveCalculationTextures) { + sst.str(std::string()); + sst << "deltaE_texture-scattering_order-" << scatteringOrder << ".ppm"; + saveTextureToPPMFile(GL_COLOR_ATTACHMENT0, sst.str(), + _delta_e_table_width, _delta_e_table_height); + } + _irradianceSupTermsProgramObject->deactivate(); + + // line 9 in algorithm 4.1 + glFramebufferTexture( + GL_FRAMEBUFFER, + GL_COLOR_ATTACHMENT0, + _deltaSRayleighTableTexture, + 0 + ); + checkFrameBufferState("_deltaSRayleighTableTexture"); + glViewport(0, 0, _mu_s_samples * _nu_samples, _mu_samples); + _inScatteringSupTermsProgramObject->activate(); + transmittanceTableTextureUnit.activate(); + glBindTexture(GL_TEXTURE_2D, _transmittanceTableTexture); + _inScatteringSupTermsProgramObject->setUniform( + "transmittanceTexture", + transmittanceTableTextureUnit + ); + deltaJTableTextureUnit.activate(); + glBindTexture(GL_TEXTURE_3D, _deltaJTableTexture); + _inScatteringSupTermsProgramObject->setUniform( + "deltaJTexture", + deltaJTableTextureUnit + ); + loadAtmosphereDataIntoShaderProgram(_inScatteringSupTermsProgramObject); + for (int layer = 0; layer < static_cast(_r_samples); ++layer) { + step3DTexture(_inScatteringSupTermsProgramObject, layer); + renderQuadForCalc(quadCalcVAO, vertexSize); + } + if (_saveCalculationTextures) { + sst.str(std::string()); + sst << "deltaS_texture-scattering_order-" << scatteringOrder << ".ppm"; + saveTextureToPPMFile( + GL_COLOR_ATTACHMENT0, + sst.str(), + _mu_s_samples * _nu_samples, + _mu_samples + ); + } + _inScatteringSupTermsProgramObject->deactivate(); + + glEnable(GL_BLEND); + glBlendEquationSeparate(GL_FUNC_ADD, GL_FUNC_ADD); + glBlendFuncSeparate(GL_ONE, GL_ONE, GL_ONE, GL_ONE); + + // line 10 in algorithm 4.1 + glFramebufferTexture( + GL_FRAMEBUFFER, + GL_COLOR_ATTACHMENT0, + _irradianceTableTexture, + 0 + ); + checkFrameBufferState("_irradianceTableTexture"); + glViewport(0, 0, _delta_e_table_width, _delta_e_table_height); + _irradianceFinalProgramObject->activate(); + deltaETableTextureUnit.activate(); + glBindTexture(GL_TEXTURE_2D, _deltaETableTexture); + _irradianceFinalProgramObject->setUniform( + "deltaETexture", + deltaETableTextureUnit + ); + loadAtmosphereDataIntoShaderProgram(_irradianceFinalProgramObject); + renderQuadForCalc(quadCalcVAO, vertexSize); + if (_saveCalculationTextures) { + sst.str(std::string()); + sst << "irradianceTable_order-" << scatteringOrder << ".ppm"; + saveTextureToPPMFile(GL_COLOR_ATTACHMENT0, sst.str(), + _delta_e_table_width, _delta_e_table_height); + } + _irradianceFinalProgramObject->deactivate(); + + // line 11 in algorithm 4.1 + glFramebufferTexture( + GL_FRAMEBUFFER, + GL_COLOR_ATTACHMENT0, + _inScatteringTableTexture, + 0 + ); + checkFrameBufferState("_inScatteringTableTexture"); + glViewport(0, 0, _mu_s_samples * _nu_samples, _mu_samples); + _deltaSSupTermsProgramObject->activate(); + deltaSRayleighTableTextureUnit.activate(); + glBindTexture(GL_TEXTURE_3D, _deltaSRayleighTableTexture); + _deltaSSupTermsProgramObject->setUniform( + "deltaSTexture", + deltaSRayleighTableTextureUnit + ); + loadAtmosphereDataIntoShaderProgram(_deltaSSupTermsProgramObject); + for (int layer = 0; layer < static_cast(_r_samples); ++layer) { + step3DTexture(_deltaSSupTermsProgramObject, layer, false); + renderQuadForCalc(quadCalcVAO, vertexSize); + } + if (_saveCalculationTextures) { + sst.str(std::string()); + sst << "inscatteringTable_order-" << scatteringOrder << ".ppm"; + saveTextureToPPMFile(GL_COLOR_ATTACHMENT0, sst.str(), + _mu_s_samples * _nu_samples, _mu_samples); + } + _deltaSSupTermsProgramObject->deactivate(); + + glDisable(GL_BLEND); + } + + // Restores OpenGL blending state + if (blendEnabled) + glEnable(GL_BLEND); + + glBlendEquationSeparate(blendEquationRGB, blendEquationAlpha); + glBlendFuncSeparate(blendSrcRGB, blendDestRGB, blendSrcAlpha, blendDestAlpha); +} + +void AtmosphereDeferredcaster::preCalculateAtmosphereParam() { + //========================================================== + //========= Load Shader Programs for Calculations ========== + //========================================================== + loadComputationPrograms(); + + //========================================================== + //============ Create Textures for Calculations ============ + //========================================================== + createComputationTextures(); + + // Saves current FBO first + GLint defaultFBO; + glGetIntegerv(GL_FRAMEBUFFER_BINDING, &defaultFBO); + + GLint m_viewport[4]; + glGetIntegerv(GL_VIEWPORT, m_viewport); + + // Creates the FBO for the calculations + GLuint calcFBO; + glGenFramebuffers(1, &calcFBO); + glBindFramebuffer(GL_FRAMEBUFFER, calcFBO); + GLenum drawBuffers[1] = { GL_COLOR_ATTACHMENT0 }; + glDrawBuffers(1, drawBuffers); + + // Prepare for rendering/calculations + GLuint quadCalcVAO; + GLuint quadCalcVBO; + createRenderQuad(&quadCalcVAO, &quadCalcVBO, 1.0f); + + // Starting Calculations... + LDEBUG("Starting precalculations for scattering effects..."); + + //========================================================== + //=================== Execute Calculations ================= + //========================================================== + executeCalculations(quadCalcVAO, drawBuffers, 6); + + deleteUnusedComputationTextures(); + + // Restores system state + glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO); + glViewport(m_viewport[0], m_viewport[1], + m_viewport[2], m_viewport[3]); + glDeleteBuffers(1, &quadCalcVBO); + glDeleteVertexArrays(1, &quadCalcVAO); + glDeleteFramebuffers(1, &calcFBO); + + LDEBUG("Ended precalculations for Atmosphere effects..."); +} + +void AtmosphereDeferredcaster::resetAtmosphereTextures(){ + +} + +void AtmosphereDeferredcaster::createRenderQuad(GLuint* vao, GLuint* vbo, GLfloat size) { + glGenVertexArrays(1, vao); + glGenBuffers(1, vbo); + glBindVertexArray(*vao); + glBindBuffer(GL_ARRAY_BUFFER, *vbo); + + const GLfloat vertex_data[] = { + // x y z w + -size, -size, 0.0f, 1.0f, + size, size, 0.0f, 1.0f, + -size, size, 0.0f, 1.0f, + -size, -size, 0.0f, 1.0f, + size, -size, 0.0f, 1.0f, + size, size, 0.0f, 1.0f + }; + + glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_data), vertex_data, GL_STATIC_DRAW); + glVertexAttribPointer( + 0, + 4, + GL_FLOAT, + GL_FALSE, + sizeof(GLfloat) * 4, + reinterpret_cast(0) + ); + glEnableVertexAttribArray(0); + + glBindVertexArray(0); +} + +void AtmosphereDeferredcaster::loadAtmosphereDataIntoShaderProgram( + std::unique_ptr& shaderProg) +{ + shaderProg->setUniform("Rg", _atmospherePlanetRadius); + shaderProg->setUniform("Rt", _atmosphereRadius); + shaderProg->setUniform("AverageGroundReflectance", _planetAverageGroundReflectance); + shaderProg->setUniform("groundRadianceEmittion", _planetGroundRadianceEmittion); + shaderProg->setUniform("HR", _rayleighHeightScale); + shaderProg->setUniform("betaRayleigh", _rayleighScatteringCoeff); + shaderProg->setUniform("HM", _mieHeightScale); + shaderProg->setUniform("betaMieScattering", _mieScatteringCoeff); + shaderProg->setUniform("betaMieExtinction", _mieExtinctionCoeff); + shaderProg->setUniform("mieG", _miePhaseConstant); + shaderProg->setUniform("sunRadiance", _sunRadianceIntensity); + shaderProg->setUniform( + "TRANSMITTANCE_W", + static_cast(_transmittance_table_width) + ); + shaderProg->setUniform( + "TRANSMITTANCE_H", + static_cast(_transmittance_table_height) + ); + shaderProg->setUniform("SKY_W", static_cast(_irradiance_table_width)); + shaderProg->setUniform("SKY_H", static_cast(_irradiance_table_height)); + shaderProg->setUniform("OTHER_TEXTURES_W", static_cast(_delta_e_table_width)); + shaderProg->setUniform("OTHER_TEXTURES_H", static_cast(_delta_e_table_height)); + shaderProg->setUniform("SAMPLES_R", static_cast(_r_samples)); + shaderProg->setUniform("SAMPLES_MU", static_cast(_mu_samples)); + shaderProg->setUniform("SAMPLES_MU_S", static_cast(_mu_s_samples)); + shaderProg->setUniform("SAMPLES_NU", static_cast(_nu_samples)); + shaderProg->setUniform("ozoneLayerEnabled", _ozoneEnabled); + shaderProg->setUniform("HO", _ozoneHeightScale); + shaderProg->setUniform("betaOzoneExtinction", _ozoneExtinctionCoeff); +} + +void AtmosphereDeferredcaster::checkFrameBufferState( + const std::string& codePosition) const +{ + if (glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) { + LERROR("Framework not built. " + codePosition); + GLenum fbErr = glCheckFramebufferStatus(GL_FRAMEBUFFER); + switch (fbErr) { + case GL_FRAMEBUFFER_UNDEFINED: + LERROR("Indefined framebuffer."); + break; + case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT: + LERROR("Incomplete, missing attachement."); + break; + case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: + LERROR("Framebuffer doesn't have at least one image attached to it."); + break; + case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER: + LERROR("Returned if the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is " + "GL_NONE for any color attachment point(s) named by GL_DRAW_BUFFERi."); + break; + case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER: + LERROR("Returned if GL_READ_BUFFER is not GL_NONE and the value of " + "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is GL_NONE for the color attachment " + "point named by GL_READ_BUFFER."); + break; + case GL_FRAMEBUFFER_UNSUPPORTED: + LERROR("Returned if the combination of internal formats of the attached " + "images violates an implementation - dependent set of restrictions."); + break; + case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: + LERROR("Returned if the value of GL_RENDERBUFFE_r_samples is not the same " + "for all attached renderbuffers; if the value of GL_TEXTURE_SAMPLES is " + "the not same for all attached textures; or , if the attached images are " + "a mix of renderbuffers and textures, the value of " + "GL_RENDERBUFFE_r_samples does not match the value of " + "GL_TEXTURE_SAMPLES."); + LERROR("Returned if the value of GL_TEXTURE_FIXED_SAMPLE_LOCATIONS is not " + "the same for all attached textures; or , if the attached images are a " + "mix of renderbuffers and textures, the value of " + "GL_TEXTURE_FIXED_SAMPLE_LOCATIONS is not GL_TRUE for all attached " + "textures."); + break; + case GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS: + LERROR("Returned if any framebuffer attachment is layered, and any populated " + "attachment is not layered, or if all populated color attachments are " + "not from textures of the same target."); + break; + default: + LDEBUG("No error found checking framebuffer: " + codePosition); + break; + } + } +} + +void AtmosphereDeferredcaster::renderQuadForCalc(GLuint vao, GLsizei numberOfVertices) { + glBindVertexArray(vao); + glDrawArrays(GL_TRIANGLES, 0, numberOfVertices); + glBindVertexArray(0); +} + +void AtmosphereDeferredcaster::step3DTexture( + std::unique_ptr& shaderProg, + int layer, bool doCalc) +{ + // See OpenGL redbook 8th Edition page 556 for Layered Rendering + if (doCalc) { + float earth2 = _atmospherePlanetRadius * _atmospherePlanetRadius; + float atm2 = _atmosphereRadius * _atmosphereRadius; + float diff = atm2 - earth2; + float ri = static_cast(layer) / static_cast(_r_samples - 1); + float ri_2 = ri * ri; + float epsilon = + (layer == 0) ? + 0.01f : + (layer == (static_cast(_r_samples) - 1)) ? -0.001f : 0.0f; + float r = sqrtf(earth2 + ri_2 * diff) + epsilon; + float dminG = r - _atmospherePlanetRadius; + float dminT = _atmosphereRadius - r; + float dh = sqrtf(r * r - earth2); + float dH = dh + sqrtf(diff); + + shaderProg->setUniform("r", r); + shaderProg->setUniform("dhdH", dminT, dH, dminG, dh); + } + + shaderProg->setUniform("layer", static_cast(layer)); +} + +void AtmosphereDeferredcaster::saveTextureToPPMFile(GLenum color_buffer_attachment, + const std::string& fileName, + int width, int height) const +{ + std::fstream ppmFile; + + ppmFile.open(fileName.c_str(), std::fstream::out); + if (ppmFile.is_open()) { + unsigned char * pixels = new unsigned char[width*height * 3]; + for (int t = 0; t < width*height * 3; ++t) + pixels[t] = 255; + + if (color_buffer_attachment != GL_DEPTH_ATTACHMENT) { + glReadBuffer(color_buffer_attachment); + glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, pixels); + + } + else { + glReadPixels( + 0, + 0, + width, + height, + GL_DEPTH_COMPONENT, + GL_UNSIGNED_BYTE, + pixels + ); + } + + ppmFile << "P3" << std::endl; + ppmFile << width << " " << height << std::endl; + ppmFile << "255" << std::endl; + + std::cout << "\n\nFILE\n\n"; + int k = 0; + for (int i = 0; i < width; i++) { + for (int j = 0; j < height; j++) { + ppmFile << static_cast(pixels[k]) << " " + << static_cast(pixels[k + 1]) << " " + << static_cast(pixels[k + 2]) << " "; + k += 3; + } + ppmFile << std::endl; + } + delete[] pixels; + + ppmFile.close(); + } +} + +bool AtmosphereDeferredcaster::isAtmosphereInFrustum(const double* MVMatrix, + const glm::dvec3& position, + double radius) const +{ + + // Frustum Planes + glm::dvec3 col1(MVMatrix[0], MVMatrix[4], MVMatrix[8]); + glm::dvec3 col2(MVMatrix[1], MVMatrix[5], MVMatrix[9]); + glm::dvec3 col3(MVMatrix[2], MVMatrix[6], MVMatrix[10]); + glm::dvec3 col4(MVMatrix[3], MVMatrix[7], MVMatrix[11]); + + glm::dvec3 leftNormal = col4 + col1; + glm::dvec3 rightNormal = col4 - col1; + glm::dvec3 bottomNormal = col4 + col2; + glm::dvec3 topNormal = col4 - col2; + glm::dvec3 nearNormal = col3 + col4; + glm::dvec3 farNormal = col4 - col3; + + + // Plane Distances + double leftDistance = MVMatrix[15] + MVMatrix[12]; + double rightDistance = MVMatrix[15] - MVMatrix[12]; + double bottomDistance = MVMatrix[15] + MVMatrix[13]; + double topDistance = MVMatrix[15] - MVMatrix[13]; + double nearDistance = MVMatrix[15] + MVMatrix[14]; + double farDistance = MVMatrix[15] - MVMatrix[14]; + + // Normalize Planes + double invMag = 1.0 / glm::length(leftNormal); + leftNormal *= invMag; + leftDistance *= invMag; + + invMag = 1.0 / glm::length(rightNormal); + rightNormal *= invMag; + rightDistance *= invMag; + + invMag = 1.0 / glm::length(bottomNormal); + bottomNormal *= invMag; + bottomDistance *= invMag; + + invMag = 1.0 / glm::length(topNormal); + topNormal *= invMag; + topDistance *= invMag; + + invMag = 1.0 / glm::length(nearNormal); + nearNormal *= invMag; + nearDistance *= invMag; + + invMag = 1.0 / glm::length(farNormal); + farNormal *= invMag; + farDistance *= invMag; + + if ((glm::dot(leftNormal, position) + leftDistance) < -radius) { + return false; + } else if ((glm::dot(rightNormal, position) + rightDistance) < -radius) { + return false; + } else if ((glm::dot(bottomNormal, position) + bottomDistance) < -radius) { + return false; + } else if ((glm::dot(topNormal, position) + topDistance) < -radius) { + return false; + } else if ((glm::dot(nearNormal, position) + nearDistance) < -radius) { + return false; + } + // The far plane testing is disabled because the atm has no depth. + /*else if ((glm::dot(farNormal, position) + farDistance) < -radius) { + return false; + }*/ + + return true; +} + +} // namespace openspace diff --git a/modules/atmosphere/rendering/atmospheredeferredcaster.h b/modules/atmosphere/rendering/atmospheredeferredcaster.h new file mode 100644 index 0000000000..9143e928f1 --- /dev/null +++ b/modules/atmosphere/rendering/atmospheredeferredcaster.h @@ -0,0 +1,187 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_ATMOSPHERE___ATMOSPHEREDEFERREDCASTER___H__ +#define __OPENSPACE_MODULE_ATMOSPHERE___ATMOSPHEREDEFERREDCASTER___H__ + +#include +#include +#include +#include +#include + +//#include + +namespace ghoul::opengl { + class Texture; + class ProgramObject; +} // namespace ghoul::opengl + +namespace openspace { + +struct RenderData; +struct DeferredcastData; +struct ShadowConfiguration; + +class AtmosphereDeferredcaster : public Deferredcaster { +public: + AtmosphereDeferredcaster(); + virtual ~AtmosphereDeferredcaster() = default; + + void initialize(); + void deinitialize(); + void preRaycast(const RenderData& renderData, const DeferredcastData& deferredData, + ghoul::opengl::ProgramObject& program) override; + void postRaycast(const RenderData& renderData, const DeferredcastData& deferredData, + ghoul::opengl::ProgramObject& program) override; + + std::string deferredcastPath() const override; + std::string deferredcastVSPath() const override; + std::string deferredcastFSPath() const override; + std::string helperPath() const override; + + void preCalculateAtmosphereParam(); + + void setModelTransform(const glm::dmat4 &transform); + void setTime(double time); + void setAtmosphereRadius(float atmRadius); + void setPlanetRadius(float planetRadius); + void setPlanetAverageGroundReflectance(float averageGReflectance); + void setPlanetGroundRadianceEmittion(float groundRadianceEmittion); + void setRayleighHeightScale(float rayleighHeightScale); + void enableOzone(bool enable); + void setOzoneHeightScale(float ozoneHeightScale); + void setMieHeightScale(float mieHeightScale); + void setMiePhaseConstant(float miePhaseConstant); + void setSunRadianceIntensity(float sunRadiance); + void setRayleighScatteringCoefficients(const glm::vec3& rayScattCoeff); + void setOzoneExtinctionCoefficients(const glm::vec3& ozoneExtCoeff); + void setMieScatteringCoefficients(const glm::vec3& mieScattCoeff); + void setMieExtinctionCoefficients(const glm::vec3& mieExtCoeff); + void setEllipsoidRadii(const glm::dvec3& radii); + void setShadowConfigArray(const std::vector& shadowConfigArray); + void setHardShadows(bool enabled); + void enableSunFollowing(bool enable); + + void setPrecalculationTextureScale(float preCalculatedTexturesScale); + void enablePrecalculationTexturesSaving(); + +private: + void loadComputationPrograms(); + void unloadComputationPrograms(); + void createComputationTextures(); + void deleteComputationTextures(); + void deleteUnusedComputationTextures(); + void executeCalculations(GLuint quadCalcVAO, GLenum drawBuffers[1], + GLsizei vertexSize); + void resetAtmosphereTextures(); + void createRenderQuad(GLuint* vao, GLuint* vbo, GLfloat size); + void step3DTexture(std::unique_ptr& shaderProg, + int layer, bool doCalc = true); + void checkFrameBufferState(const std::string& codePosition) const; + void loadAtmosphereDataIntoShaderProgram( + std::unique_ptr & shaderProg + ); + void renderQuadForCalc(GLuint vao, GLsizei numberOfVertices); + void saveTextureToPPMFile(GLenum color_buffer_attachment, const std::string& fileName, + int width, int height) const; + bool isAtmosphereInFrustum(const double* MVMatrix, const glm::dvec3& position, + double radius) const; + + + const double DISTANCE_CULLING = 1e10; + + std::unique_ptr _transmittanceProgramObject; + std::unique_ptr _irradianceProgramObject; + std::unique_ptr _irradianceSupTermsProgramObject; + std::unique_ptr _irradianceFinalProgramObject; + std::unique_ptr _inScatteringProgramObject; + std::unique_ptr _inScatteringSupTermsProgramObject; + std::unique_ptr _deltaEProgramObject; + std::unique_ptr _deltaSProgramObject; + std::unique_ptr _deltaSSupTermsProgramObject; + std::unique_ptr _deltaJProgramObject; + std::unique_ptr _atmosphereProgramObject; + std::unique_ptr _deferredAtmosphereProgramObject; + + GLuint _transmittanceTableTexture; + GLuint _irradianceTableTexture; + GLuint _inScatteringTableTexture; + GLuint _deltaETableTexture; + GLuint _deltaSRayleighTableTexture; + GLuint _deltaSMieTableTexture; + GLuint _deltaJTableTexture; + GLuint _atmosphereTexture; + + ghoul::opengl::TextureUnit _transmittanceTableTextureUnit; + ghoul::opengl::TextureUnit _irradianceTableTextureUnit; + ghoul::opengl::TextureUnit _inScatteringTableTextureUnit; + + // Atmosphere Data + bool _atmosphereCalculated; + bool _ozoneEnabled; + bool _sunFollowingCameraEnabled; + float _atmosphereRadius; + float _atmospherePlanetRadius; + float _planetAverageGroundReflectance; + float _planetGroundRadianceEmittion; + float _rayleighHeightScale; + float _ozoneHeightScale; + float _mieHeightScale; + float _miePhaseConstant; + float _sunRadianceIntensity; + + glm::vec3 _rayleighScatteringCoeff; + glm::vec3 _ozoneExtinctionCoeff; + glm::vec3 _mieScatteringCoeff; + glm::vec3 _mieExtinctionCoeff; + glm::dvec3 _ellipsoidRadii; + + // Atmosphere Textures Dimmensions + int _transmittance_table_width; + int _transmittance_table_height; + int _irradiance_table_width; + int _irradiance_table_height; + int _delta_e_table_width; + int _delta_e_table_height; + int _r_samples; + int _mu_samples; + int _mu_s_samples; + int _nu_samples; + + glm::dmat4 _modelTransform; + double _time; + + // Eclipse Shadows + std::vector _shadowConfArray; + bool _hardShadowsEnabled; + + // Atmosphere Debugging + float _calculationTextureScale; + bool _saveCalculationTextures; +}; + +} // openspace + +#endif // __OPENSPACE_MODULE_ATMOSPHERE___ATMOSPHEREDEFERREDCASTER___H__ diff --git a/modules/atmosphere/rendering/renderableatmosphere.cpp b/modules/atmosphere/rendering/renderableatmosphere.cpp new file mode 100644 index 0000000000..15377dca83 --- /dev/null +++ b/modules/atmosphere/rendering/renderableatmosphere.cpp @@ -0,0 +1,763 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#define _USE_MATH_DEFINES +#include + +namespace { + static const char* _loggerCat = "RenderableAtmosphere"; + + const char* keyShadowGroup = "ShadowGroup"; + const char* keyShadowSource = "Source"; + const char* keyShadowCaster = "Caster"; + + const char* keyAtmosphere = "Atmosphere"; + const char* keyAtmosphereRadius = "AtmosphereRadius"; + const char* keyPlanetRadius = "PlanetRadius"; + const char* keyAverageGroundReflectance = "PlanetAverageGroundReflectance"; + const char* keyRayleigh = "Rayleigh"; + const char* keyRayleighHeightScale = "H_R"; + const char* keyOzone = "Ozone"; + const char* keyOzoneHeightScale = "H_O"; + const char* keyMie = "Mie"; + const char* keyMieHeightScale = "H_M"; + const char* keyMiePhaseConstant = "G"; + const char* keyImage = "Image"; + const char* keyToneMappingOp = "ToneMapping"; + const char* keyATMDebug = "Debug"; + const char* keyTextureScale = "PreCalculatedTextureScale"; + const char* keySaveTextures = "SaveCalculatedTextures"; + + static const openspace::properties::Property::PropertyInfo AtmosphereHeightInfo = { + "atmmosphereHeight", + "Atmosphere Height (KM)", + "The thickness of the atmosphere in Km" + }; + + static const openspace::properties::Property::PropertyInfo AverageGroundReflectanceInfo = { + "AverageGroundReflectance", + "Average Ground Reflectance (%)", + "Average percentage of light reflected by the ground during the pre-calculation phase" + }; + + static const openspace::properties::Property::PropertyInfo GroundRadianceEmittioninfo = { + "GroundRadianceEmittion", + "Percentage of initial radiance emitted from ground", + "Multiplier of the ground radiance color during the rendering phase" + }; + + static const openspace::properties::Property::PropertyInfo RayleighHeightScaleInfo = { + "RayleighHeightScale", + "Rayleigh Scale Height (KM)", + "It is the vertical distance over which the density and pressure fall by a constant factor" + }; + + static const openspace::properties::Property::PropertyInfo RayleighScatteringCoeffXInfo = { + "RayleighScatteringCoeffX", + "Rayleigh Scattering Coeff X (x10e-3)", + "Rayleigh sea-level scattering coefficients in meters" + }; + + static const openspace::properties::Property::PropertyInfo RayleighScatteringCoeffYInfo = { + "RayleighScatteringCoeffY", + "Rayleigh Scattering Coeff Y (x10e-3)", + "Rayleigh sea-level scattering coefficients in meters" + }; + + static const openspace::properties::Property::PropertyInfo RayleighScatteringCoeffZInfo = { + "RayleighScatteringCoeffZ", + "Rayleigh Scattering Coeff Z (x10e-3)", + "Rayleigh sea-level scattering coefficients in meters" + }; + + static const openspace::properties::Property::PropertyInfo OzoneLayerInfo = { + "Ozone", + "Ozone Layer Enabled", + "Enables/Disable Ozone Layer during pre-calculation phase" + }; + + static const openspace::properties::Property::PropertyInfo OzoneHeightScaleInfo = { + "OzoneLayerHeightScale", + "Ozone Scale Height (KM)", + "It is the vertical distance over which the density and pressure fall by a constant factor" + }; + + static const openspace::properties::Property::PropertyInfo OzoneLayerCoeffXInfo = { + "OzoneLayerCoeffX", + "Ozone Layer Extinction Coeff X (x10e-5)", + "Ozone scattering coefficients in meters" + }; + + static const openspace::properties::Property::PropertyInfo OzoneLayerCoeffYInfo = { + "OzoneLayerCoeffY", + "Ozone Layer Extinction Coeff Y (x10e-5)", + "Ozone scattering coefficients in meters" + }; + + static const openspace::properties::Property::PropertyInfo OzoneLayerCoeffZInfo = { + "OzoneLayerCoeffZ", + "Ozone Layer Extinction Coeff Z (x10e-5)", + "Ozone scattering coefficients in meters" + }; + + static const openspace::properties::Property::PropertyInfo MieHeightScaleInfo = { + "MieHeightScale", + "Mie Scale Height (KM)", + "It is the vertical distance over which the density and pressure fall by a constant factor" + }; + + static const openspace::properties::Property::PropertyInfo MieScatteringCoeffXInfo = { + "MieScatteringCoeffX", + "Mie Scattering Coeff X (x10e-3)", + "Mie sea-level scattering coefficients in meters" + }; + + static const openspace::properties::Property::PropertyInfo MieScatteringCoeffYInfo = { + "MieScatteringCoeffY", + "Mie Scattering Coeff Y (x10e-3)", + "Mie sea-level scattering coefficients in meters" + }; + + static const openspace::properties::Property::PropertyInfo MieScatteringCoeffZInfo = { + "MieScatteringCoeffZ", + "Mie Scattering Coeff Z (x10e-3)", + "Mie sea-level scattering coefficients in meters" + }; + + static const openspace::properties::Property::PropertyInfo MieScatteringExtinctionPropCoeffInfo = { + "MieScatteringExtinctionPropCoefficient", + "Mie Scattering/Extinction Proportion Coefficient (%)", + "Mie Scattering/Extinction Proportion Coefficient (%)" + }; + + static const openspace::properties::Property::PropertyInfo MieAsymmetricFactorGInfo = { + "MieAsymmetricFactorG", + "Mie Asymmetric Factor G", + "Averaging of the scattering angle over a high number of scattering events" + }; + + static const openspace::properties::Property::PropertyInfo SunIntensityInfo = { + "SunIntensity", + "Sun Intensity", + "Unitless for now" + }; + + static const openspace::properties::Property::PropertyInfo AtmosphereExposureInfo = { + "HdrExposure", + "Atmosphere Exposure", + "Constant to controls the exposure of the radiance range" + }; + + static const openspace::properties::Property::PropertyInfo AtmosphereGammaInfo = { + "Gamma", + "Gamma Correction", + "Gamma Correction" + }; + + static const openspace::properties::Property::PropertyInfo EnableSunOnCameraPositionInfo = { + "SunFollowingCamera", + "Enable Sun On Camera Position", + "When selected the Sun is artificially positioned behind the observer all times" + }; + + static const openspace::properties::Property::PropertyInfo EclipseHardShadowsInfo = { + "EclipseHardShadowsInfo", + "Enable Hard Shadows for Eclipses", + "Enable/Disables hard shadows through the atmosphere" + }; +} // namespace + +namespace openspace { + +documentation::Documentation RenderableAtmosphere::Documentation() { + using namespace documentation; + return { + "RenderableAtmosphere", + "atmosphere_renderable_atmosphere", + { /* + { + keyAtmosphereRadius, + new ReferencingVerifier("atmosphere"), + "Specifies the atmosphere's height in this RenderableAtmosphere.", + Optional::No + }, + + { + KeyShading, + new BoolVerifier, + "Specifies whether the atmosphere should be rendered shaded by the Sun. If " + "this value is 'false', any existing night texture will not be used. " + "This value defaults to 'true'.", + Optional::Yes + } + */ + } + }; +} + +RenderableAtmosphere::RenderableAtmosphere(const ghoul::Dictionary& dictionary) + : Renderable(dictionary) + , _atmosphereHeightP(AtmosphereHeightInfo, 60.0f, 0.1f, 99.0f) + , _groundAverageReflectanceP(AverageGroundReflectanceInfo, 0.1f, 0.0f, 1.0f) + , _groundRadianceEmittionP(GroundRadianceEmittioninfo, 0.3f, 0.0f, 1.0f) + , _rayleighHeightScaleP(RayleighHeightScaleInfo, 8.0f, 0.1f, 20.0f) + , _rayleighScatteringCoeffXP(RayleighScatteringCoeffXInfo, 1.0f, 0.01f, 100.0f) + , _rayleighScatteringCoeffYP(RayleighScatteringCoeffYInfo, 1.0f, 0.01f, 100.0f) + , _rayleighScatteringCoeffZP(RayleighScatteringCoeffZInfo, 1.0f, 0.01f, 100.0f) + , _ozoneEnabledP(OzoneLayerInfo, true) + , _ozoneHeightScaleP(OzoneHeightScaleInfo, 8.0f, 0.1f, 20.0f) + , _ozoneCoeffXP(OzoneLayerCoeffXInfo, 3.426f, 0.01f, 100.0f) + , _ozoneCoeffYP(OzoneLayerCoeffYInfo, 8.298f, 0.01f, 100.0f) + , _ozoneCoeffZP(OzoneLayerCoeffZInfo, 0.356f, 0.01f, 100.0f) + , _mieHeightScaleP(MieHeightScaleInfo, 1.2f, 0.1f, 20.0f) + , _mieScatteringCoeffXP(MieScatteringCoeffXInfo, 4.0f, 0.01f, 1000.0f) + , _mieScatteringCoeffYP(MieScatteringCoeffYInfo, 4.0f, 0.01f, 1000.0f) + , _mieScatteringCoeffZP(MieScatteringCoeffZInfo, 4.0f, 0.01f, 1000.0f) + , _mieScatteringExtinctionPropCoefficientP(MieScatteringExtinctionPropCoeffInfo, 0.9f, 0.01f, 1.0f) + , _mieAsymmetricFactorGP(MieAsymmetricFactorGInfo, 0.85f, -1.0f, 1.0f) + , _sunIntensityP(SunIntensityInfo, 50.0f, 0.1f, 1000.0f) + , _sunFollowingCameraEnabledP(EnableSunOnCameraPositionInfo, false) + , _hardShadowsEnabledP(EclipseHardShadowsInfo, false) + , _atmosphereEnabled(false) + , _ozoneLayerEnabled(false) + , _sunFollowingCameraEnabled(false) + , _atmosphereRadius(0.f) + , _atmospherePlanetRadius(0.f) + , _planetAverageGroundReflectance(0.f) + , _planetGroundRadianceEmittion(0.f) + , _rayleighHeightScale(0.f) + , _ozoneHeightScale(0.f) + , _mieHeightScale(0.f) + , _miePhaseConstant(0.f) + , _sunRadianceIntensity(50.f) + , _mieExtinctionCoeff(glm::vec3(0.f)) + , _rayleighScatteringCoeff(glm::vec3(0.f)) + , _ozoneExtinctionCoeff(glm::vec3(0.f)) + , _mieScatteringCoeff(glm::vec3(0.f)) + , _saveCalculationsToTexture(false) + , _preCalculatedTexturesScale(1.0) + , _shadowEnabled(false) + , _hardShadows(false) + { + ghoul_precondition( + dictionary.hasKeyAndValue(SceneGraphNode::KeyName), + "RenderableAtmosphere needs the name to be specified" + ); + + documentation::testSpecificationAndThrow( + Documentation(), + dictionary, + "RenderableAtmosphere" + ); + + const std::string name = dictionary.value(SceneGraphNode::KeyName); + + //================================================================ + //======== Reads Shadow (Eclipses) Entries in mod file =========== + //================================================================ + ghoul::Dictionary shadowDictionary; + bool success = dictionary.getValue(keyShadowGroup, shadowDictionary); + bool disableShadows = false; + if (success) { + std::vector> sourceArray; + unsigned int sourceCounter = 1; + while (success) { + std::string sourceName; + success = shadowDictionary.getValue(keyShadowSource + + std::to_string(sourceCounter) + ".Name", sourceName); + if (success) { + double sourceRadius; + success = shadowDictionary.getValue(keyShadowSource + + std::to_string(sourceCounter) + ".Radius", sourceRadius); + if (success) { + sourceArray.emplace_back(sourceName, sourceRadius); + } + else { + LWARNING("No Radius value expecified for Shadow Source Name " + << sourceName << " from " << name + << " planet.\nDisabling shadows for this planet."); + disableShadows = true; + break; + } + } + sourceCounter++; + } + + if (!disableShadows && !sourceArray.empty()) { + success = true; + std::vector> casterArray; + unsigned int casterCounter = 1; + while (success) { + std::string casterName; + success = shadowDictionary.getValue(keyShadowCaster + + std::to_string(casterCounter) + ".Name", casterName); + if (success) { + double casterRadius; + success = shadowDictionary.getValue(keyShadowCaster + + std::to_string(casterCounter) + ".Radius", casterRadius); + if (success) { + casterArray.emplace_back(casterName, casterRadius); + } + else { + LWARNING("No Radius value expecified for Shadow Caster Name " + << casterName << " from " << name + << " planet.\nDisabling shadows for this planet."); + disableShadows = true; + break; + } + } + + casterCounter++; + } + + if (!disableShadows && (!sourceArray.empty() && !casterArray.empty())) { + for (const auto & source : sourceArray) { + for (const auto & caster : casterArray) { + ShadowConfiguration sc; + sc.source = source; + sc.caster = caster; + _shadowConfArray.push_back(sc); + } + } + _shadowEnabled = true; + } + } + } + + //================================================================ + //========== Reads Atmosphere Entries from mod file ============== + //================================================================ + bool errorReadingAtmosphereData = false; + ghoul::Dictionary atmosphereDictionary; + success = dictionary.getValue(keyAtmosphere, atmosphereDictionary); + if (success) { + if (!atmosphereDictionary.getValue(keyAtmosphereRadius, _atmosphereRadius)) { + errorReadingAtmosphereData = true; + LWARNING("No Atmosphere Radius value expecified for Atmosphere Effects of " + << name << " planet.\nDisabling atmosphere effects for this planet."); + } + + if (!atmosphereDictionary.getValue(keyPlanetRadius, _atmospherePlanetRadius)) { + errorReadingAtmosphereData = true; + LWARNING("No Planet Radius value expecified for Atmosphere Effects of " + << name << " planet.\nDisabling atmosphere effects for this planet."); + } + + if (!atmosphereDictionary.getValue(keyAverageGroundReflectance, _planetAverageGroundReflectance)) { + errorReadingAtmosphereData = true; + LWARNING("No Average Atmosphere Ground Reflectance value expecified for Atmosphere Effects of " + << name << " planet.\nDisabling atmosphere effects for this planet."); + } + + if (!atmosphereDictionary.getValue(GroundRadianceEmittioninfo.identifier, _planetGroundRadianceEmittion)) { + errorReadingAtmosphereData = true; + LWARNING("No Ground Radiance Emitted percentage value expecified for Atmosphere Effects of " + << name << " planet.\nDisabling atmosphere effects for this planet."); + } + + ghoul::Dictionary rayleighDictionary; + success = atmosphereDictionary.getValue(keyRayleigh, rayleighDictionary); + + if (success) { + // Not using right now. + glm::vec3 rayleighWavelengths; + success = rayleighDictionary.getValue("Coefficients.Wavelengths", rayleighWavelengths); + + if (!rayleighDictionary.getValue("Coefficients.Scattering", _rayleighScatteringCoeff)) { + errorReadingAtmosphereData = true; + LWARNING("No Rayleigh Scattering parameters expecified for Atmosphere Effects of " + << name << " planet.\nDisabling atmosphere effects for this planet."); + } + + if (!rayleighDictionary.getValue(keyRayleighHeightScale, _rayleighHeightScale)) { + errorReadingAtmosphereData = true; + LWARNING("No Rayleigh Height Scale value expecified for Atmosphere Effects of " + << name << " planet.\nDisabling atmosphere effects for this planet."); + } + } + else { + errorReadingAtmosphereData = true; + LWARNING("No Rayleigh parameters expecified for Atmosphere Effects of " + << name << " planet.\nDisabling atmosphere effects for this planet."); + } + + ghoul::Dictionary ozoneDictionary; + success = atmosphereDictionary.getValue(keyOzone, ozoneDictionary); + if (success) { + _ozoneLayerEnabled = true; + if (!ozoneDictionary.getValue(keyOzoneHeightScale, _ozoneHeightScale)) { + _ozoneLayerEnabled = false; + } + + if (!ozoneDictionary.getValue("Coefficients.Extinction", _ozoneExtinctionCoeff)) { + _ozoneLayerEnabled = false; + } + } + else { + _ozoneLayerEnabled = false; + } + + ghoul::Dictionary mieDictionary; + success = atmosphereDictionary.getValue(keyMie, mieDictionary); + if (success) { + if (!mieDictionary.getValue(keyMieHeightScale, _mieHeightScale)) { + errorReadingAtmosphereData = true; + LWARNING("No Mie Height Scale value expecified for Atmosphere Effects of " + << name << " planet.\nDisabling atmosphere effects for this planet."); + } + + if (!mieDictionary.getValue("Coefficients.Scattering", _mieScatteringCoeff)) { + errorReadingAtmosphereData = true; + LWARNING("No Mie Scattering parameters expecified for Atmosphere Effects of " + << name << " planet.\nDisabling atmosphere effects for this planet."); + } + + if (!mieDictionary.getValue("Coefficients.Extinction", _mieExtinctionCoeff)) { + errorReadingAtmosphereData = true; + LWARNING("No Mie Extinction parameters expecified for Atmosphere Effects of " + << name << " planet.\nDisabling atmosphere effects for this planet."); + } + + if (!mieDictionary.getValue(keyMiePhaseConstant, _miePhaseConstant)) { + errorReadingAtmosphereData = true; + LWARNING("No Mie Phase Constant value expecified for Atmosphere Effects of " + << name << " planet.\nDisabling atmosphere effects for this planet."); + } + } + else { + errorReadingAtmosphereData = true; + LWARNING("No Mie parameters expecified for Atmosphere Effects of " + << name << " planet.\nDisabling atmosphere effects for this planet."); + } + + ghoul::Dictionary ImageDictionary; + success = atmosphereDictionary.getValue(keyImage, ImageDictionary); + if (success) { + if (ImageDictionary.getValue(keyToneMappingOp, _preCalculatedTexturesScale)) { + LDEBUG("Atmosphere Texture Scaled to " << _preCalculatedTexturesScale); + } + } + + ghoul::Dictionary debugDictionary; + success = atmosphereDictionary.getValue(keyATMDebug, debugDictionary); + if (success) { + if (debugDictionary.getValue(keyTextureScale, _preCalculatedTexturesScale)) { + LDEBUG("Atmosphere Texture Scaled to " << _preCalculatedTexturesScale); + } + + if (debugDictionary.getValue(keySaveTextures, _saveCalculationsToTexture)) { + LDEBUG("Saving Precalculated Atmosphere Textures."); + } + + } + + if (!errorReadingAtmosphereData) { + _atmosphereEnabled = true; + + //======================================================== + //============== Atmosphere Properties =================== + //======================================================== + + auto updateAtmosphere = [this]() { updateAtmosphereParameters(); }; + + _atmosphereHeightP =_atmosphereRadius - _atmospherePlanetRadius; + _atmosphereHeightP.onChange(updateAtmosphere); + addProperty(_atmosphereHeightP); + + _groundAverageReflectanceP = _planetAverageGroundReflectance; + _groundAverageReflectanceP.onChange(updateAtmosphere); + addProperty(_groundAverageReflectanceP); + + _groundRadianceEmittionP = _planetGroundRadianceEmittion; + _groundRadianceEmittionP.onChange(updateAtmosphere); + addProperty(_groundRadianceEmittionP); + + _rayleighHeightScaleP = _rayleighHeightScale; + _rayleighHeightScaleP.onChange(updateAtmosphere); + addProperty(_rayleighHeightScaleP); + + _rayleighScatteringCoeffXP = _rayleighScatteringCoeff.x * 1000.0f; + _rayleighScatteringCoeffXP.onChange(updateAtmosphere); + addProperty(_rayleighScatteringCoeffXP); + + _rayleighScatteringCoeffYP = _rayleighScatteringCoeff.y * 1000.0f; + _rayleighScatteringCoeffYP.onChange(updateAtmosphere); + addProperty(_rayleighScatteringCoeffYP); + + _rayleighScatteringCoeffZP = _rayleighScatteringCoeff.z * 1000.0f; + _rayleighScatteringCoeffZP.onChange(updateAtmosphere); + addProperty(_rayleighScatteringCoeffZP); + + _ozoneEnabledP = _ozoneLayerEnabled; + _ozoneEnabledP.onChange(updateAtmosphere); + addProperty(_ozoneEnabledP); + + _ozoneHeightScaleP = _ozoneHeightScale; + _ozoneHeightScaleP.onChange(updateAtmosphere); + addProperty(_ozoneHeightScaleP); + + _ozoneCoeffXP = _ozoneExtinctionCoeff.x * 100000.0f; + _ozoneCoeffXP.onChange(updateAtmosphere); + addProperty(_ozoneCoeffXP); + + _ozoneCoeffYP = _ozoneExtinctionCoeff.y * 100000.0f; + _ozoneCoeffYP.onChange(updateAtmosphere); + addProperty(_ozoneCoeffYP); + + + _ozoneCoeffZP = _ozoneExtinctionCoeff.z * 100000.0f; + _ozoneCoeffZP.onChange(updateAtmosphere); + addProperty(_ozoneCoeffZP); + + _mieHeightScaleP = _mieHeightScale; + _mieHeightScaleP.onChange(updateAtmosphere); + addProperty(_mieHeightScaleP); + + _mieScatteringCoeffXP = _mieScatteringCoeff.x * 1000.0f; + _mieScatteringCoeffXP.onChange(updateAtmosphere); + addProperty(_mieScatteringCoeffXP); + + _mieScatteringCoeffYP = _mieScatteringCoeff.y * 1000.0f; + _mieScatteringCoeffYP.onChange(updateAtmosphere); + addProperty(_mieScatteringCoeffYP); + + _mieScatteringCoeffZP = _mieScatteringCoeff.z * 1000.0f; + _mieScatteringCoeffZP.onChange(updateAtmosphere); + addProperty(_mieScatteringCoeffZP); + + _mieScatteringExtinctionPropCoefficientP = + _mieScatteringCoeff.x / _mieExtinctionCoeff.x; + _mieScatteringExtinctionPropCoefficientP.onChange(updateAtmosphere); + addProperty(_mieScatteringExtinctionPropCoefficientP); + + _mieAsymmetricFactorGP = _miePhaseConstant; + _mieAsymmetricFactorGP.onChange(updateAtmosphere); + addProperty(_mieAsymmetricFactorGP); + + _sunIntensityP = _sunRadianceIntensity; + _sunIntensityP.onChange(updateAtmosphere); + addProperty(_sunIntensityP); + + _sunFollowingCameraEnabledP = _sunFollowingCameraEnabled; + _sunFollowingCameraEnabledP.onChange(updateAtmosphere); + addProperty(_sunFollowingCameraEnabledP); + + _hardShadowsEnabledP = _hardShadows; + _hardShadowsEnabledP.onChange(updateAtmosphere); + if (_shadowEnabled) { + addProperty(_hardShadowsEnabledP); + } + } + } +} + +void RenderableAtmosphere::deinitialize() { + if (_deferredcaster) { + OsEng.renderEngine().deferredcasterManager().detachDeferredcaster( + *_deferredcaster + ); + _deferredcaster = nullptr; + } +} + +void RenderableAtmosphere::initializeGL() { + if (_atmosphereEnabled) { + _deferredcaster = std::make_unique(); + if (_deferredcaster) { + _deferredcaster->setAtmosphereRadius(_atmosphereRadius); + _deferredcaster->setPlanetRadius(_atmospherePlanetRadius); + _deferredcaster->setPlanetAverageGroundReflectance( + _planetAverageGroundReflectance + ); + _deferredcaster->setPlanetGroundRadianceEmittion( + _planetGroundRadianceEmittion + ); + _deferredcaster->setRayleighHeightScale(_rayleighHeightScale); + _deferredcaster->enableOzone(_ozoneLayerEnabled); + _deferredcaster->setOzoneHeightScale(_ozoneHeightScale); + _deferredcaster->setMieHeightScale(_mieHeightScale); + _deferredcaster->setMiePhaseConstant(_miePhaseConstant); + _deferredcaster->setSunRadianceIntensity(_sunRadianceIntensity); + _deferredcaster->setRayleighScatteringCoefficients(_rayleighScatteringCoeff); + _deferredcaster->setOzoneExtinctionCoefficients(_ozoneExtinctionCoeff); + _deferredcaster->setMieScatteringCoefficients(_mieScatteringCoeff); + _deferredcaster->setMieExtinctionCoefficients(_mieExtinctionCoeff); + // TODO: Fix the ellipsoid nature of the renderable globe (JCC) + //_deferredcaster->setEllipsoidRadii(_ellipsoid.radii()); + _deferredcaster->enableSunFollowing(_sunFollowingCameraEnabled); + + _deferredcaster->setPrecalculationTextureScale(_preCalculatedTexturesScale); + if (_saveCalculationsToTexture) + _deferredcaster->enablePrecalculationTexturesSaving(); + + if (_shadowEnabled) { + _deferredcaster->setShadowConfigArray(_shadowConfArray); + _deferredcaster->setHardShadows(_hardShadows); + } + + _deferredcaster->initialize(); + } + + OsEng.renderEngine().deferredcasterManager().attachDeferredcaster( + *_deferredcaster + ); + } + + return; +} + +void RenderableAtmosphere::deinitializeGL() { +} + +bool RenderableAtmosphere::isReady() const { + bool ready = true; + ready &= (_deferredcaster != nullptr); + return ready; +} + +glm::dmat4 RenderableAtmosphere::computeModelTransformMatrix( + const openspace::TransformData& transformData) +{ + // scale the planet to appropriate size since the planet is a unit sphere + return glm::translate(glm::dmat4(1.0), transformData.translation) * // Translation + glm::dmat4(transformData.rotation) * // Spice rotation + glm::dmat4(glm::scale(glm::dmat4(1.0), glm::dvec3(transformData.scale))); +} + +void RenderableAtmosphere::render(const RenderData& data, RendererTasks& renderTask) { + if (_atmosphereEnabled) { + DeferredcasterTask task{ _deferredcaster.get(), data }; + renderTask.deferredcasterTasks.push_back(task); + } +} + +void RenderableAtmosphere::update(const UpdateData& data) { + _stateMatrix = data.modelTransform.rotation; + + if (_deferredcaster) { + _deferredcaster->setTime(data.time.j2000Seconds()); + glm::dmat4 modelTransform = computeModelTransformMatrix(data.modelTransform); + _deferredcaster->setModelTransform(modelTransform); + } +} + +void RenderableAtmosphere::updateAtmosphereParameters() { + bool executeComputation = true; + + if (_sunRadianceIntensity != _sunIntensityP || + _planetGroundRadianceEmittion != _groundRadianceEmittionP || + _sunFollowingCameraEnabled != _sunFollowingCameraEnabledP || + _hardShadows != _hardShadowsEnabledP) { + executeComputation = false; + } + + _atmosphereRadius = _atmospherePlanetRadius + _atmosphereHeightP; + _planetAverageGroundReflectance = _groundAverageReflectanceP; + _planetGroundRadianceEmittion = _groundRadianceEmittionP; + _rayleighHeightScale = _rayleighHeightScaleP; + _rayleighScatteringCoeff = glm::vec3( + _rayleighScatteringCoeffXP * 0.001f, + _rayleighScatteringCoeffYP * 0.001f, + _rayleighScatteringCoeffZP * 0.001f + ); + _ozoneLayerEnabled = _ozoneEnabledP; + _ozoneHeightScale = _ozoneHeightScaleP; + _ozoneExtinctionCoeff = glm::vec3(_ozoneCoeffXP.value() * 0.00001f, + _ozoneCoeffYP.value() * 0.00001f, + _ozoneCoeffZP.value() * 0.00001f); + _mieHeightScale = _mieHeightScaleP; + _mieScatteringCoeff = glm::vec3( + _mieScatteringCoeffXP * 0.001f, + _mieScatteringCoeffYP * 0.001f, + _mieScatteringCoeffZP * 0.001f + ); + _mieExtinctionCoeff = _mieScatteringCoeff * (1.0f / + static_cast(_mieScatteringExtinctionPropCoefficientP)); + _miePhaseConstant = _mieAsymmetricFactorGP; + _sunRadianceIntensity = _sunIntensityP; + _sunFollowingCameraEnabled = _sunFollowingCameraEnabledP; + _hardShadows = _hardShadowsEnabledP; + + + if (_deferredcaster) { + _deferredcaster->setAtmosphereRadius(_atmosphereRadius); + _deferredcaster->setPlanetRadius(_atmospherePlanetRadius); + _deferredcaster->setPlanetAverageGroundReflectance( + _planetAverageGroundReflectance + ); + _deferredcaster->setPlanetGroundRadianceEmittion(_planetGroundRadianceEmittion); + _deferredcaster->setRayleighHeightScale(_rayleighHeightScale); + _deferredcaster->enableOzone(_ozoneLayerEnabled); + _deferredcaster->setOzoneHeightScale(_ozoneHeightScale); + _deferredcaster->setMieHeightScale(_mieHeightScale); + _deferredcaster->setMiePhaseConstant(_miePhaseConstant); + _deferredcaster->setSunRadianceIntensity(_sunRadianceIntensity); + _deferredcaster->setRayleighScatteringCoefficients(_rayleighScatteringCoeff); + _deferredcaster->setOzoneExtinctionCoefficients(_ozoneExtinctionCoeff); + _deferredcaster->setMieScatteringCoefficients(_mieScatteringCoeff); + _deferredcaster->setMieExtinctionCoefficients(_mieExtinctionCoeff); + _deferredcaster->enableSunFollowing(_sunFollowingCameraEnabled); + //_deferredcaster->setEllipsoidRadii(_ellipsoid.radii()); + + if (_shadowEnabled) { + _deferredcaster->setHardShadows(_hardShadows); + } + + if (executeComputation) { + _deferredcaster->preCalculateAtmosphereParam(); + } + } +} + +} // namespace openspace diff --git a/modules/atmosphere/rendering/renderableatmosphere.h b/modules/atmosphere/rendering/renderableatmosphere.h new file mode 100644 index 0000000000..be8ad47c65 --- /dev/null +++ b/modules/atmosphere/rendering/renderableatmosphere.h @@ -0,0 +1,153 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_SPACE___RENDERABLEATMOSPHERE___H__ +#define __OPENSPACE_MODULE_SPACE___RENDERABLEATMOSPHERE___H__ + +#include + +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include + +namespace ghoul::opengl { + class ProgramObject; + class Texture; +} + +namespace openspace { + +class AtmosphereDeferredcaster; + +struct TransformData; + +// Shadow structure +struct ShadowConfiguration { + std::pair source; + std::pair caster; +}; + +struct ShadowRenderingStruct { + double xu, + xp; + double rs, + rc; + glm::dvec3 sourceCasterVec; + glm::dvec3 casterPositionVec; + bool isShadowing; +}; + +namespace planetgeometry { +class PlanetGeometry; +} + +namespace documentation { struct Documentation; } +namespace planetgeometry { class PlanetGeometry; } + +class RenderableAtmosphere : public Renderable { +public: + + RenderableAtmosphere(const ghoul::Dictionary& dictionary); + + void deinitialize() override; + void initializeGL() override; + void deinitializeGL() override; + bool isReady() const override; + + void render(const RenderData& data, RendererTasks& rendererTask) override; + void update(const UpdateData& data) override; + + static documentation::Documentation Documentation(); + +private: + glm::dmat4 computeModelTransformMatrix(const openspace::TransformData& transformData); + void updateAtmosphereParameters(); + + properties::FloatProperty _atmosphereHeightP; + properties::FloatProperty _groundAverageReflectanceP; + properties::FloatProperty _groundRadianceEmittionP; + properties::FloatProperty _rayleighHeightScaleP; + properties::FloatProperty _rayleighScatteringCoeffXP; + properties::FloatProperty _rayleighScatteringCoeffYP; + properties::FloatProperty _rayleighScatteringCoeffZP; + properties::BoolProperty _ozoneEnabledP; + properties::FloatProperty _ozoneHeightScaleP; + properties::FloatProperty _ozoneCoeffXP; + properties::FloatProperty _ozoneCoeffYP; + properties::FloatProperty _ozoneCoeffZP; + properties::FloatProperty _mieHeightScaleP; + properties::FloatProperty _mieScatteringCoeffXP; + properties::FloatProperty _mieScatteringCoeffYP; + properties::FloatProperty _mieScatteringCoeffZP; + properties::FloatProperty _mieScatteringExtinctionPropCoefficientP; + properties::FloatProperty _mieAsymmetricFactorGP; + properties::FloatProperty _sunIntensityP; + properties::BoolProperty _sunFollowingCameraEnabledP; + properties::BoolProperty _hardShadowsEnabledP; + + bool _atmosphereEnabled; + bool _ozoneLayerEnabled; + bool _sunFollowingCameraEnabled; + float _atmosphereRadius; + float _atmospherePlanetRadius; + float _planetAverageGroundReflectance; + float _planetGroundRadianceEmittion; + float _rayleighHeightScale; + float _ozoneHeightScale; + float _mieHeightScale; + float _miePhaseConstant; + float _sunRadianceIntensity; + + glm::vec3 _mieExtinctionCoeff; + glm::vec3 _rayleighScatteringCoeff; + glm::vec3 _ozoneExtinctionCoeff; + glm::vec3 _mieScatteringCoeff; + + // Atmosphere Debug + bool _saveCalculationsToTexture; + float _preCalculatedTexturesScale; + + std::unique_ptr _deferredcaster; + + bool _shadowEnabled; + bool _hardShadows; + + glm::dmat3 _stateMatrix; + + std::vector _shadowConfArray; +}; + +} // namespace openspace + +#endif // __OPENSPACE_MODULE_SPACE___RENDERABLEATMOSPHERE___H__ diff --git a/modules/atmosphere/shaders/atmosphere_common.glsl b/modules/atmosphere/shaders/atmosphere_common.glsl new file mode 100644 index 0000000000..9d6e82e4b5 --- /dev/null +++ b/modules/atmosphere/shaders/atmosphere_common.glsl @@ -0,0 +1,375 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +/***************************************************************************************** + * Modified parts of the code (4D texture mechanism, analytical transmittance etc) * + * from Eric Bruneton is used in the following code. * + ****************************************************************************************/ + + /** + * Precomputed Atmospheric Scattering + * Copyright (c) 2008 INRIA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + + +// Atmosphere Rendering Parameters +uniform float Rg; +uniform float Rt; +uniform float AverageGroundReflectance; +uniform float groundRadianceEmittion; +uniform float HR; +uniform vec3 betaRayleigh; +uniform float HO; +uniform vec3 betaOzoneExtinction; +uniform float HM; +uniform vec3 betaMieScattering; +uniform vec3 betaMieExtinction; +uniform float mieG; +uniform float sunRadiance; + +uniform bool ozoneLayerEnabled; + +uniform int TRANSMITTANCE_W; +uniform int TRANSMITTANCE_H; +uniform int SKY_W; +uniform int SKY_H; +uniform int OTHER_TEXTURES_W; +uniform int OTHER_TEXTURES_H; +uniform int SAMPLES_R; +uniform int SAMPLES_MU; +uniform int SAMPLES_MU_S; +uniform int SAMPLES_NU; + +const float ATM_EPSILON = 1.0; + +// Integration steps +const int TRANSMITTANCE_STEPS = 500; +const int INSCATTER_INTEGRAL_SAMPLES = 50; +const int IRRADIANCE_INTEGRAL_SAMPLES = 32; +const int INSCATTER_SPHERICAL_INTEGRAL_SAMPLES = 16; + +const float M_PI = 3.141592657; + +uniform sampler2D transmittanceTexture; + +float opticalDepth(const float H, const float r, const float mu, const float d) { + float a = sqrt((0.5/H)*r); + vec2 a01 = a*vec2(mu, mu + d / r); + vec2 a01s = sign(a01); + vec2 a01sq = a01*a01; + float x = a01s.y > a01s.x ? exp(a01sq.x) : 0.0; + vec2 y = a01s / (2.3193*abs(a01) + sqrt(1.52*a01sq + 4.0)) * vec2(1.0, exp(-d/H*(d/(2.0*r)+mu))); + return sqrt((6.2831*H)*r) * exp((Rg-r)/H) * (x + dot(y, vec2(1.0, -1.0))); +} + +vec3 analyticTransmittance(const float r, const float mu, const float d) { + if (ozoneLayerEnabled) { + return exp(-betaRayleigh * opticalDepth(HR, r, mu, d) - + betaOzoneExtinction * (0.0000006) * opticalDepth(HO, r, mu, d) - + betaMieExtinction * opticalDepth(HM, r, mu, d)); + } else { + return exp(-betaRayleigh * opticalDepth(HR, r, mu, d) - + betaMieExtinction * opticalDepth(HM, r, mu, d)); + } +} + +vec3 irradiance(sampler2D sampler, const float r, const float muSun) { + float u_r = (r - Rg) / (Rt - Rg); + float u_muSun = (muSun + 0.2) / (1.0 + 0.2); + return texture(sampler, vec2(u_muSun, u_r)).rgb; +} + + +//================================================// +//=============== General Functions ==============// +//================================================// +// In the following shaders r (altitude) is the length of vector/position x in the +// atmosphere (or on the top of it when considering an observer in space), +// where the light is comming from the opposite direction of the view direction, +// here the vector v or viewDirection. +// Rg is the planet radius and Rt the atmosphere radius. + +//--- Calculate the distance of the ray starting at x (height r) +// until the planet's ground or top of atmosphere. --- +// r := || vec(x) || e [0, Rt] +// mu := cosine of the zeith angle of vec(v). Or mu = (vec(x) * vec(v))/r +float rayDistance(const float r, const float mu) { + // The light ray starting at the observer in/on the atmosphere can + // have to possible end points: the top of the atmosphere or the + // planet ground. So the shortest path is the one we are looking for, + // otherwise we may be passing through the ground. + + // cosine law + float atmRadiusEps = Rt + ATM_EPSILON; + float rayDistanceAtmosphere = -r * mu + + sqrt(r * r * (mu * mu - 1.0f) + atmRadiusEps * atmRadiusEps); + float delta = r * r * (mu * mu - 1.0f) + Rg * Rg; + + // Ray may be hitting ground + if (delta >= 0.0f) { + float rayDistanceGround = -r * mu - sqrt(delta); + if (rayDistanceGround >= 0.0f) { + return min(rayDistanceAtmosphere, rayDistanceGround); + } + } + return rayDistanceAtmosphere; +} + +//-- Given the window's fragment coordinates, for a defined +// viewport, gives back the interpolated r e [Rg, Rt] and +// mu e [-1, 1] -- +// r := height of starting point vect(x) +// mu := cosine of the zeith angle of vec(v). Or mu = (vec(x) * vec(v))/r +void unmappingRAndMu(out float r, out float mu) { + float u_mu = gl_FragCoord.x / float(TRANSMITTANCE_W); + float u_r = gl_FragCoord.y / float(TRANSMITTANCE_H); + + // In the paper u_r^2 = (r^2-Rg^2)/(Rt^2-Rg^2) + // So, extracting r from u_r in the above equation: + //r = sqrt( Rg * Rg + (u_r * u_r) * (Rt * Rt - Rg * Rg) ); + r = Rg + (u_r * u_r) * (Rt - Rg); + + // In the paper the Bruneton suggest mu = dot(v,x)/||x|| with ||v|| = 1.0 + // Later he proposes u_mu = (1-exp(-3mu-0.6))/(1-exp(-3.6)) + // But the below one is better. See Colliene. + // One must remember that mu is defined from 0 to PI/2 + epsillon. + mu = -0.15f + tan(1.5f * u_mu) / tan(1.5f) * (1.0f + 0.15f); +} + +//-- Given the windows's fragment coordinates, for a defined view port, +// gives back the interpolated r e [Rg, Rt] and muSun e [-1, 1] -- +// r := height of starting point vect(x) +// muSun := cosine of the zeith angle of vec(s). Or muSun = (vec(s) * vec(v)) +void unmappingRAndMuSun(out float r, out float muSun) { + // See Bruneton and Colliene to understand the mapping. + muSun = -0.2f + (gl_FragCoord.x - 0.5f) / (float(OTHER_TEXTURES_W) - 1.0f) * (1.0f + 0.2f); + //r = Rg + (gl_FragCoord.y - 0.5f) / (float(OTHER_TEXTURES_H) - 1.0f) * (Rt - Rg); + r = Rg + (gl_FragCoord.y - 0.5f) / (float(OTHER_TEXTURES_H) ) * (Rt - Rg); +} + +//-- Given the windows's fragment coordinates, for a defined view port, +// gives back the interpolated r e [Rg, Rt] and muSun e [-1, 1] for the +// Irradiance deltaE texture table -- +// r := height of starting point vect(x) +// muSun := cosine of the zeith angle of vec(s). Or muSun = (vec(s) * vec(v)) +void unmappingRAndMuSunIrradiance(out float r, out float muSun) { + // See Bruneton and Colliene to understand the mapping. + muSun = -0.2f + (gl_FragCoord.x - 0.5f) / (float(SKY_W) - 1.0f) * (1.0f + 0.2f); + r = Rg + (gl_FragCoord.y - 0.5f) / (float(SKY_H) - 1.0f) * (Rt - Rg); +} + +//-- Given the windows's fragment coordinates, for a defined view port, +// gives back the interpolated r e [Rg, Rt] and mu, muSun amd nu e [-1, 1] -- +// r := height of starting point vect(x) +// mu := cosine of the zeith angle of vec(v). Or mu = (vec(x) * vec(v))/r +// muSun := cosine of the zeith angle of vec(s). Or muSun = (vec(s) * vec(v)) +// nu := cosone of the angle between vec(s) and vec(v) +// dhdH := it is a vec4. dhdH.x stores the dminT := Rt - r, dhdH.y stores the dH value (see paper), +// dhdH.z stores dminG := r - Rg and dhdH.w stores dh (see paper). +void unmappingMuMuSunNu(const float r, vec4 dhdH, out float mu, out float muSun, out float nu) { + // Window coordinates of pixel (uncentering also) + float fragmentX = gl_FragCoord.x - 0.5f; + float fragmentY = gl_FragCoord.y - 0.5f; + + // Pre-calculations + float Rg2 = Rg * Rg; + float Rt2 = Rt * Rt; + float r2 = r * r; + + float halfSAMPLE_MU = float(SAMPLES_MU) / 2.0f; + // If the (vec(x) dot vec(v))/r is negative, i.e., + // the light ray has great probability to touch + // the ground, we obtain mu considering the geometry + // of the ground + if (fragmentY < halfSAMPLE_MU) { + float ud = 1.0f - (fragmentY / (halfSAMPLE_MU - 1.0f)); + float d = min(max(dhdH.z, ud * dhdH.w), dhdH.w * 0.999); + // cosine law: Rg^2 = r^2 + d^2 - 2rdcos(pi-theta) + // where cosine(theta) = mu + mu = (Rg2 - r2 - d * d) / (2.0 * r * d); + // We can't handle a ray inside the planet, i.e., + // when r ~ Rg, so we check against it. + // If that is the case, we approximate to + // a ray touching the ground. + // cosine(pi-theta) = dh/r = sqrt(r^2-Rg^2) + // cosine(theta) = - sqrt(1 - Rg^2/r^2) + mu = min(mu, -sqrt(1.0 - (Rg2 / r2)) - 0.001); + } + // The light ray is touching the atmosphere and + // not the ground + else { + float d = (fragmentY - halfSAMPLE_MU) / (halfSAMPLE_MU - 1.0f); + d = min(max(dhdH.x, d * dhdH.y), dhdH.y * 0.999); + // cosine law: Rt^2 = r^2 + d^2 - 2rdcos(pi-theta) + // whre cosine(theta) = mu + mu = (Rt2 - r2 - d * d) / (2.0f * r * d); + } + + float modValueMuSun = mod(fragmentX, float(SAMPLES_MU_S)) / (float(SAMPLES_MU_S) - 1.0f); + // The following mapping is different from the paper. See Colliene for an details. + muSun = tan((2.0f * modValueMuSun - 1.0f + 0.26f) * 1.1f) / tan(1.26f * 1.1f); + nu = -1.0f + floor(fragmentX / float(SAMPLES_MU_S)) / (float(SAMPLES_NU) - 1.0f) * 2.0f; +} + + +//-- Function to access the transmittance texture. Given r +// and mu, returns the transmittance of a ray starting at vec(x), +// height r, and direction vec(v), mu, and length until it hits +// the ground or the top of atmosphere. -- +// r := height of starting point vect(x) +// mu := cosine of the zeith angle of vec(v). Or mu = (vec(x) * vec(v))/r +vec3 transmittanceLUT(const float r, const float mu) { + // Given the position x (here the altitude r) and the view + // angle v (here the cosine(v)= mu), we map this + float u_r = sqrt((r - Rg) / (Rt - Rg)); + //float u_r = sqrt((r*r - Rg*Rg) / (Rt*Rt - Rg*Rg)); + // See Colliene to understand the different mapping. + float u_mu = atan((mu + 0.15f) / (1.0f + 0.15f) * tan(1.5f)) / 1.5f; + + return texture(transmittanceTexture, vec2(u_mu, u_r)).rgb; +} + +// -- Given a position r and direction mu, calculates de transmittance +// along the ray with length d. This function uses the propriety +// of Transmittance: T(a,b) = TableT(a,v)/TableT(b, v) -- +// r := height of starting point vect(x) +// mu := cosine of the zeith angle of vec(v). Or mu = (vec(x) * vec(v))/r +vec3 transmittance(const float r, const float mu, const float d) { + // Here we use the transmittance property: T(x,v) = T(x,d)*T(d,v) + // to, given a distance d, calculates that transmittance along + // that distance starting in x (hight r): T(x,d) = T(x,v)/T(d,v). + // + // From cosine law: c^2 = a^2 + b^2 - 2*a*b*cos(ab) + float ri = sqrt(d * d + r * r + 2.0 * r * d * mu); + // mu_i = (vec(d) dot vec(v)) / r_i + // = ((vec(x) + vec(d-x)) dot vec(v))/ r_i + // = (r*mu + d) / r_i + float mui = (d + r * mu) / ri; + + // It's important to remember that we calculate the Transmittance + // table only for zenith angles between 0 and pi/2+episilon. + // Then, if mu < 0.0, we just need to invert the view direction + // and the start and end points between them, i.e., if + // x --> x0, then x0-->x. + // Also, let's use the property: T(a,c) = T(a,b)*T(b,c) + // Because T(a,c) and T(b,c) are already in the table T, + // T(a,b) = T(a,c)/T(b,c). + if (mu > 0.0f) { + return min(transmittanceLUT(r, mu) / + transmittanceLUT(ri, mui), 1.0f); + } else { + return min(transmittanceLUT(ri, -mui) / + transmittanceLUT(r, -mu), 1.0f); + } +} + +// -- Calculates Rayleigh phase function given the +// scattering cosine angle mu -- +// mu := cosine of the zeith angle of vec(v). Or mu = (vec(x) * vec(v))/r +float rayleighPhaseFunction(const float mu) { + return (3.0f / (16.0f * M_PI)) * (1.0f + mu * mu); +} + +// -- Calculates Mie phase function given the +// scattering cosine angle mu -- +// mu := cosine of the zeith angle of vec(v). Or mu = (vec(x) * vec(v))/r +float miePhaseFunction(const float mu) { + //return (3.0f / (8.0f * M_PI)) * + // ( ( (1.0f - (mieG * mieG) ) * (1.0f + mu * mu) ) / + // ( (2.0f + mieG * mieG) * + // pow(1.0f + mieG * mieG - 2.0f * mieG * mu, 3.0f/2.0f) ) ); + return 1.5f * 1.0f / (4.0f * M_PI) * (1.0f - mieG * mieG) * + pow(1.0f + (mieG * mieG) - 2.0f * mieG * mu, -3.0f/2.0f) * (1.0f + mu * mu) / (2.0f + mieG*mieG); +} + +// -- Given the height rm view-zenith angle (cosine) mu, +// sun-zenith angle (cosine) muSun and the angle (cosine) +// between the vec(s) and vec(v), nu, we access the 3D textures +// and interpolate between them (r) to find the value for the +// 4D texture. -- +// r := height of starting point vect(x) +// mu := cosine of the zeith angle of vec(v). Or mu = (vec(x) * vec(v))/r +// muSun := cosine of the zeith angle of vec(s). Or muSun = (vec(s) * vec(v)) +// nu := cosine of the angle between vec(s) and vec(v) +vec4 texture4D(sampler3D table, const float r, const float mu, + const float muSun, const float nu) +{ + float Rg2 = Rg * Rg; + float Rt2 = Rt * Rt; + float r2 = r * r; + float H = sqrt(Rt2 - Rg2); + float rho = sqrt(r2 - Rg2); + float rmu = r * mu; + float delta = rmu * rmu - r2 + Rg2; + vec4 cst = rmu < 0.0f && delta > 0.0f ? + vec4(1.0f, 0.0f, 0.0f, 0.5f - 0.5f / float(SAMPLES_MU)) : + vec4(-1.0f, H * H, H, 0.5f + 0.5f / float(SAMPLES_MU)); + float u_r = 0.5f / float(SAMPLES_R) + rho / H * (1.0f - 1.0f / float(SAMPLES_R)); + float u_mu = cst.w + (rmu * cst.x + sqrt(delta + cst.y)) / (rho + cst.z) * (0.5f - 1.0f / float(SAMPLES_MU)); + float u_mu_s = 0.5f / float(SAMPLES_MU_S) + + (atan(max(muSun, -0.1975) * tan(1.26f * 1.1f)) / 1.1f + (1.0f - 0.26f)) * 0.5f * (1.0f - 1.0f / float(SAMPLES_MU_S)); + float lerp = (nu + 1.0f) / 2.0f * (float(SAMPLES_NU) - 1.0f); + float u_nu = floor(lerp); + lerp = lerp - u_nu; + return texture(table, vec3((u_nu + u_mu_s) / float(SAMPLES_NU), u_mu, u_r)) * (1.0f - lerp) + + texture(table, vec3((u_nu + u_mu_s + 1.0f) / float(SAMPLES_NU), u_mu, u_r)) * lerp; +} + +// -- Given the irradiance texture table, the cosine of zenith sun vector +// and the height of the observer (ray's stating point x), calculates the +// mapping for u_r and u_muSun and returns the value in the LUT. -- +// lut := OpenGL texture2D sampler (the irradiance texture deltaE) +// muSun := cosine of the zeith angle of vec(s). Or muSun = (vec(s) * vec(v)) +// r := height of starting point vect(x) +vec3 irradianceLUT(sampler2D lut, const float muSun, const float r) { + // See Bruneton paper and Coliene to understand the mapping + float u_muSun = (muSun + 0.2f) / (1.0f + 0.2f); + float u_r = (r - Rg) / (Rt - Rg); + return texture(lut, vec2(u_muSun, u_r)).rgb; +} diff --git a/modules/atmosphere/shaders/atmosphere_deferred_fs.glsl b/modules/atmosphere/shaders/atmosphere_deferred_fs.glsl new file mode 100644 index 0000000000..9be7437924 --- /dev/null +++ b/modules/atmosphere/shaders/atmosphere_deferred_fs.glsl @@ -0,0 +1,744 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +/***************************************************************************************** + * Modified parts of the code (4D texture mechanism) from Eric Bruneton is used in the * + * following code. * + ****************************************************************************************/ + + /** + * Precomputed Atmospheric Scattering + * Copyright (c) 2008 INRIA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#version __CONTEXT__ + +#include "floatoperations.glsl" + +#include "hdr.glsl" +#include "atmosphere_common.glsl" + +out vec4 renderTarget; +in vec3 interpolatedNDCPos; + +uniform int nAaSamples; +uniform double msaaSamplePatter[48]; +uniform int cullAtmosphere; + +// The following uniforms are +// set into the current Renderer +// Background exposure hack +uniform float backgroundConstant; +uniform bool firstPaint; +uniform float atmExposure; + +uniform sampler2D irradianceTexture; +uniform sampler3D inscatterTexture; +uniform sampler2DMS mainPositionTexture; +uniform sampler2DMS mainNormalTexture; +uniform sampler2DMS mainColorTexture; +uniform sampler2DMS otherDataTexture; + +// Model Transform Matrix Used for Globe Rendering +uniform dmat4 dInverseSgctEyeToWorldTranform; // SGCT Eye to OS World +uniform dmat4 dSgctEyeToOSEyeTranform; // SGCT Eye to OS Eye * +uniform dmat4 dInverseSgctProjectionMatrix; // Clip to SGCT Eye * +uniform dmat4 dInverseCamRotTransform; +uniform dmat4 dInverseModelTransformMatrix; +uniform dmat4 dModelTransformMatrix; +//uniform dmat4 dSGCTEyeToOSWorldTransformMatrix; + +uniform dvec4 dObjpos; +uniform dvec3 dCampos; +uniform dvec3 sunDirectionObj; +uniform dvec3 ellipsoidRadii; + +/******************************************************************************* + ***** ALL CALCULATIONS FOR ECLIPSE ARE IN METERS AND IN WORLD SPACE SYSTEM **** + *******************************************************************************/ +// JCC: Remove and use dictionary to +// decides the number of shadows +const uint numberOfShadows = 1; + +struct ShadowRenderingStruct { + double xu, xp; + double rs, rc; + dvec3 sourceCasterVec; + dvec3 casterPositionVec; + bool isShadowing; +}; + +// Eclipse shadow data +// JCC: Remove and use dictionary to +// decides the number of shadows +uniform ShadowRenderingStruct shadowDataArray[numberOfShadows]; +uniform int shadows; +uniform bool hardShadows; + +vec4 butterworthFunc(const float d, const float r, const float n) { + return vec4(vec3(sqrt(r/(r + pow(d, 2*n)))), 1.0); +} + +vec4 calcShadow(const ShadowRenderingStruct shadowInfoArray[numberOfShadows], const dvec3 position, + const bool ground) { + if (shadowInfoArray[0].isShadowing) { + dvec3 pc = shadowInfoArray[0].casterPositionVec - position; + dvec3 sc_norm = shadowInfoArray[0].sourceCasterVec; + dvec3 pc_proj = dot(pc, sc_norm) * sc_norm; + dvec3 d = pc - pc_proj; + + float length_d = float(length(d)); + double length_pc_proj = length(pc_proj); + + float r_p_pi = float(shadowInfoArray[0].rc * (length_pc_proj + shadowInfoArray[0].xp) / shadowInfoArray[0].xp); + float r_u_pi = float(shadowInfoArray[0].rc * (shadowInfoArray[0].xu - length_pc_proj) / shadowInfoArray[0].xu); + + if ( length_d < r_u_pi ) { // umbra + if (ground) { + if (hardShadows) { + return vec4(0.2, 0.2, 0.2, 1.0); + } else { + return butterworthFunc(length_d, r_u_pi, 4.0); + } + } + else { + if (hardShadows) { + return vec4(0.5, 0.5, 0.5, 1.0); + } else { + return vec4(vec3(length_d/r_p_pi), 1.0); + } + } + } + else if ( length_d < r_p_pi ) {// penumbra + if (hardShadows) { + return vec4(0.5, 0.5, 0.5, 1.0); + } else { + return vec4(vec3(length_d/r_p_pi), 1.0); + } + } + } + + return vec4(1.0); +} + +/******************************************************************************* + ******* ALL CALCULATIONS FOR ATMOSPHERE ARE KM AND IN WORLD SPACE SYSTEM ****** + *******************************************************************************/ + +struct dRay { + dvec4 origin; + dvec4 direction; +}; + +/* Function to calculate the initial intersection of the eye (camera) ray + * with the atmosphere. + * In (all parameters in the same coordinate system and same units): + * - planet position + * - ray direction (normalized) + * - eye position + * - atmosphere radius + * Out: true if an intersection happens, false otherwise + * - inside: true if the ray origin is inside atmosphere, false otherwise + * - offset: the initial intersection distance from eye position when + * the eye is outside the atmosphere + * - maxLength : the second intersection distance from eye position when the + * eye is outside the atmosphere or the initial (and only) + * intersection of the ray with atmosphere when the eye position + * is inside atmosphere. + */ +bool dAtmosphereIntersection(const dvec3 planetPosition, const dRay ray, const double atmRadius, + out bool inside, out double offset, out double maxLength ) { + dvec3 l = planetPosition - ray.origin.xyz; + double s = dot(l, ray.direction.xyz); + double l2 = dot(l, l); + double r2 = atmRadius * atmRadius; // avoiding surface acne + + // Ray origin (eye position) is behind sphere + if ((s < 0.0) && (l2 > r2)) { + inside = false; + offset = 0.0; + maxLength = 0.0; + return false; + } + + double m2 = l2 - s*s; + + // Ray misses atmospere + if (m2 > r2) { + inside = false; + offset = 0.0; + maxLength = 0.0; + return false; + } + + // We already now the ray hits the atmosphere + + // If q = 0.0f, there is only one intersection + double q = sqrt(r2 - m2); + + // If l2 < r2, the ray origin is inside the sphere + if (l2 > r2) { + inside = false; + offset = s - q; + maxLength = s + q; + } else { + inside = true; + offset = 0.0; + maxLength = s + q; + } + + return true; +} + +/* + * Calculates Intersection Ray by walking through + * all the graphic pipile transformations in the + * opposite direction. + * Instead of passing through all the pipeline, + * it starts at NDC from the interpolated + * positions from the screen quad. + * This method avoids matrices multiplications + * wherever is possible. + */ +void dCalculateRayRenderableGlobe(in int mssaSample, out dRay ray, + out dvec4 planetPositionObjectCoords, + out dvec4 cameraPositionInObject) { + // ====================================== + // ======= Avoiding Some Matrices ======= + + // NDC to clip coordinates (gl_FragCoord.w = 1.0/w_clip) + // Using the interpolated coords: + // Assuming Red Book is right: z_ndc e [0, 1] and not [-1, 1] + dvec2 samplePos = dvec2(msaaSamplePatter[mssaSample], + msaaSamplePatter[mssaSample+1]); + dvec4 clipCoords = dvec4(interpolatedNDCPos.xy + samplePos, interpolatedNDCPos.z, 1.0) / gl_FragCoord.w; + + // Clip to SGCT Eye + dvec4 sgctEyeCoords = dInverseSgctProjectionMatrix * clipCoords; + sgctEyeCoords.w = 1.0; + + // SGCT Eye to OS Eye + dvec4 tOSEyeCoordsInv = dSgctEyeToOSEyeTranform * sgctEyeCoords; + + // OS Eye to World coords + dvec4 tmpRInv = dInverseCamRotTransform * tOSEyeCoordsInv; + dvec4 worldCoords = dvec4(dvec3(tmpRInv) + dCampos, 1.0); + + // World to Object + dvec4 objectCoords = dInverseModelTransformMatrix * worldCoords; + + // Planet Position in Object Space + // JCC: Applying the inverse of the model transformation on the object postion in World + // space results in imprecision. + planetPositionObjectCoords = dvec4(0.0, 0.0, 0.0, 1.0); + //planetPositionObjectCoords = dInverseModelTransformMatrix * dvec4(dObjpos.xyz, 1.0); + + // Camera Position in Object Space + cameraPositionInObject = dInverseModelTransformMatrix * dvec4(dCampos, 1.0); + + // ============================ + // ====== Building Ray ======== + // Ray in object space (in KM) + ray.origin = cameraPositionInObject * dvec4(0.001, 0.001, 0.001, 1.0); + ray.direction = dvec4(normalize(objectCoords.xyz - cameraPositionInObject.xyz), 0.0); +} + +/* + * Calculates the light scattering in the view direction comming from other + * light rays scattered in the atmosphere. + * Following the paper: S[L]|x - T(x,xs) * S[L]|xs + * The view direction here is the ray: x + tv, s is the sun direction, + * r and mu the position and zenith cosine angle as in the paper. + * Arguments: + * x := camera position + * t := ray displacement variable after calculating the intersection with the + * atmosphere. It is the distance from the camera to the last intersection with + * the atmosphere. If the ray hits the ground, t is updated to the correct value + * v := view direction (ray's direction) (normalized) + * s := Sun direction (normalized) + * r := out of ||x|| inside atmosphere (or top of atmosphere) + * mu := out of cosine of the zenith view angle + * attenuation := out of transmittance T(x,x0). This will be used later when + * calculating the reflectance R[L]. + */ +vec3 inscatterRadiance(inout vec3 x, inout float t, inout float irradianceFactor, + const vec3 v, const vec3 s, out float r, out float mu, + out vec3 attenuation, const vec3 fragPosObj, + const double maxLength, const double pixelDepth, + const vec4 spaceColor, const float sunIntensity) { + vec3 radiance; + + r = length(x); + mu = dot(x, v) / r; + + float mu2 = mu * mu; + float r2 = r * r; + float Rt2 = Rt * Rt; + float Rg2 = Rg * Rg; + float nu = dot(v, s); + float muSun = dot(x, s) / r; + float rayleighPhase = rayleighPhaseFunction(nu); + float miePhase = miePhaseFunction(nu); + + // S[L](x,s,v) + // I.e. the next line has the scattering light for the "infinite" ray passing + // through the atmosphere. If this ray hits something inside the atmosphere, + // we will subtract the attenuated scattering light from that path in the + // current path. + vec4 inscatterRadiance = max(texture4D(inscatterTexture, r, mu, muSun, nu), 0.0); + + // After removing the initial path from camera pos to top of atmosphere (for an + // observer in the space) we test if the light ray is hitting the atmosphere + vec3 x0 = fragPosObj; + float r0 = length(fragPosObj); + float invr0 = 1.0/r0; + float muSun0 = dot(fragPosObj, s) * invr0; + //vec3 x0 = x + float(pixelDepth) * v; + float mu0 = dot(x0, v) * invr0; + + bool groundHit = false; + if ((pixelDepth > 0.0) && (pixelDepth < maxLength)) { + t = float(pixelDepth); + groundHit = true; + + // Transmittance from point r, direction mu, distance t + // By Analytical calculation + //attenuation = analyticTransmittance(r, mu, t); + // JCC: change from analytical to LUT transmittance to avoid + // acme on planet surface when looking from far away. (11/02/2017) + attenuation = transmittance(r, mu, t); + + // Here we use the idea of S[L](a->b) = S[L](b->a), and get the S[L](x0, v, s) + // Then we calculate S[L] = S[L]|x - T(x, x0)*S[L]|x0 + // The "infinite" ray hist something inside the atmosphere, so we need to remove + // the unsused contribution to the final radiance. + vec4 inscatterFromSurface = texture4D(inscatterTexture, r0, mu0, muSun0, nu); + inscatterRadiance = max(inscatterRadiance - attenuation.rgbr * inscatterFromSurface, 0.0); + + // We set the irradianceFactor to 1.0 so the reflected irradiance will be considered + // when calculating the reflected light on the ground. + irradianceFactor = 1.0; + } else { + attenuation = analyticTransmittance(r, mu, t); + //attenuation = transmittance(r, mu, t); + } + + // cos(PI-thetaH) = dist/r + // cos(thetaH) = - dist/r + // muHorizon = -sqrt(r^2-Rg^2)/r = -sqrt(1-(Rg/r)^2) + float muHorizon = -sqrt(1.0f - (Rg2 / r2)); + + // In order to avoid imprecision problems near horizon, + // we interpolate between two points: above and below horizon + const float INTERPOLATION_EPS = 0.004f; // precision const from Brunetton + if (abs(mu - muHorizon) < INTERPOLATION_EPS) { + // We want an interpolation value close to 1/2, so the + // contribution of each radiance value is almost the same + // or it has a havey weight if from above or below horizon + float interpolationValue = ((mu - muHorizon) + INTERPOLATION_EPS) / (2.0f * INTERPOLATION_EPS); + + float t2 = t * t; + + // Above Horizon + mu = muHorizon - INTERPOLATION_EPS; + //r0 = sqrt(r * r + t * t + 2.0f * r * t * mu); + // From cosine law where t = distance between x and x0 + // r0^2 = r^2 + t^2 - 2 * r * t * cos(PI-theta) + r0 = sqrt(r2 + t2 + 2.0f * r * t * mu); + // From the dot product: cos(theta0) = (x0 dot v)/(||ro||*||v||) + // mu0 = ((x + t) dot v) / r0 + // mu0 = (x dot v + t dot v) / r0 + // mu0 = (r*mu + t) / r0 + mu0 = (r * mu + t) / r0; + vec4 inScatterAboveX = texture4D(inscatterTexture, r, mu, muSun, nu); + vec4 inScatterAboveXs = texture4D(inscatterTexture, r0, mu0, muSun0, nu); + // Attention for the attenuation.r value applied to the S_Mie + vec4 inScatterAbove = max(inScatterAboveX - attenuation.rgbr * inScatterAboveXs, 0.0f); + + // Below Horizon + mu = muHorizon + INTERPOLATION_EPS; + r0 = sqrt(r2 + t2 + 2.0f * r * t * mu); + mu0 = (r * mu + t) / r0; + vec4 inScatterBelowX = texture4D(inscatterTexture, r, mu, muSun, nu); + vec4 inScatterBelowXs = texture4D(inscatterTexture, r0, mu0, muSun0, nu); + // Attention for the attenuation.r value applied to the S_Mie + vec4 inScatterBelow = max(inScatterBelowX - attenuation.rgbr * inScatterBelowXs, 0.0); + + // Interpolate between above and below inScattering radiance + inscatterRadiance = mix(inScatterAbove, inScatterBelow, interpolationValue); + } + + // The w component of inscatterRadiance has stored the Cm,r value (Cm = Sm[L0]) + // So, we must reintroduce the Mie inscatter by the proximity rule as described in the + // paper by Bruneton and Neyret in "Angular precision" paragraph: + + // Hermite interpolation between two values + // This step is done because imprecision problems happen when the Sun is slightly below + // the horizon. When this happen, we avoid the Mie scattering contribution. + inscatterRadiance.w *= smoothstep(0.0f, 0.02f, muSun); + vec3 inscatterMie = inscatterRadiance.rgb * inscatterRadiance.a / max(inscatterRadiance.r, 1e-4) * + (betaRayleigh.r / betaRayleigh); + + radiance = max(inscatterRadiance.rgb * rayleighPhase + inscatterMie * miePhase, 0.0f); + + // Finally we add the Lsun (all calculations are done with no Lsun so + // we can change it on the fly with no precomputations) + // return radiance * sunRadiance; + vec3 finalScatteringRadiance = radiance * sunIntensity; + if (groundHit) { + return finalScatteringRadiance; + } else { + return ((r-Rg)/(Rt-Rg))*spaceColor.rgb * backgroundConstant + finalScatteringRadiance; + } + +} + +/* + * Calculates the light reflected in the view direction comming from other + * light rays integrated over the hemispehre plus the direct light (L0) from Sun. + * Following the paper: R[L]= R[L0]+R[L*] + * The the ray is x + tv, v the view direction, s is the sun direction, + * r and mu the position and zenith cosine angle as in the paper. + * As for all calculations in the atmosphere, the center of the coordinate system + * is the planet's center of coordiante system, i.e., the planet's position is (0,0,0). + * Arguments: + * x := camera position + * t := ray displacement variable. Here, differently from the inScatter light calculation, + * the position of the camera is already offset (on top of atmosphere) or inside + * the atmosphere. + * v := view direction (ray's direction) (normalized) + * s := Sun direction (normalized) + * r := ||x|| inside atmosphere (or top of atmosphere). r <= Rt here. + * mu := cosine of the zenith view angle + * attenuationXtoX0 := transmittance T(x,x0) + */ +vec3 groundColor(const vec3 x, const float t, const vec3 v, const vec3 s, const float r, + const float mu, const vec3 attenuationXtoX0, const vec4 groundColor, + const vec3 normal, const float irradianceFactor, + const float waterReflectance, const float sunIntensity) +{ + vec3 reflectedRadiance = vec3(0.0f); + + // First we obtain the ray's end point on the surface + vec3 x0 = x + t * v; + float r0 = length(x0); + // Normal of intersection point. + vec3 n = normalize(normal); + //vec4 groundReflectance = groundColor * vec4(.37); + vec4 groundReflectance = groundColor * + vec4(groundRadianceEmittion, groundRadianceEmittion, groundRadianceEmittion, 1.0f); + + // L0 is not included in the irradiance texture. + // We first calculate the light attenuation from the top of the atmosphere + // to x0. + float dotNS = dot(n, s); + float muSun = max(dotNS, 0.0f); + + // Is direct Sun light arriving at x0? If not, there is no direct light from Sun (shadowed) + vec3 transmittanceL0 = muSun < -sqrt(1.0f - ((Rg * Rg) / (r0 * r0))) ? + vec3(0.0f) : transmittanceLUT(r0, muSun); + // E[L*] at x0 + vec3 irradianceReflected = irradiance(irradianceTexture, r0, muSun) * irradianceFactor; + + // R[L0] + R[L*] + // vec3 groundRadiance = (dotNS < -0.2f ? groundReflectance.rgb * 15 : groundReflectance.rgb) * + // (muSun * transmittanceL0 + irradianceReflected) * sunIntensity / M_PI; + + vec3 groundRadiance; + vec3 RLStar = (muSun * transmittanceL0 + irradianceReflected) * sunIntensity / M_PI; + if (dotNS < 0.05f) { + groundRadiance = groundReflectance.rgb * mix(30.0f, 1.0f, smoothstep(-1.0f, 0.05f, dotNS)) * RLStar; + } else { + groundRadiance = groundReflectance.rgb * RLStar; + } + + //groundRadiance = groundReflectance.rgb * RLStar; + + // Specular reflection from sun on oceans and rivers + if ((waterReflectance > 0.1) && /*(dotNS > -0.2f)*/(muSun > 0.0)) { + vec3 h = normalize(s - v); + // Fresnell Schlick's approximation + float fresnel = 0.02f + 0.98f * pow(1.0f - dot(-v, h), 5.0f); + // Walter BRDF approximation + float waterBrdf = fresnel * pow(max(dot(h, n), 0.0f), 150.0f); + // Adding Fresnell and Water BRDFs approximation to the final surface color + // (After adding the sunRadiance and the attenuation of the Sun through atmosphere) + groundRadiance += waterReflectance * max(waterBrdf, 0.0) * transmittanceL0 * sunIntensity; + } + //return groundRadiance; + // Finally, we attenuate the surface Radiance from the the point x0 to the camera location. + reflectedRadiance = attenuationXtoX0 * groundRadiance; + + // Returns reflectedRadiance = 0.0 if the ray doesn't hit the ground. + return reflectedRadiance; +} + +/* + * Calculates the Sun color. + * The the ray is x + tv, v the view direction, s is the sun direction, + * r and mu the position and zenith cosine angle as in the paper. + * As for all calculations in the atmosphere, the center of the coordinate system + * is the planet's center of coordiante system, i.e., the planet's position is (0,0,0). + * Arguments: + * x := camera position + * t := ray displacement variable. Here, differently from the inScatter light calculation, + * the position of the camera is already offset (on top of atmosphere) or inside + * the atmosphere. + * v := view direction (ray's direction) (normalized) + * s := Sun direction (normalized) + * r := ||x|| inside atmosphere (or top of atmosphere). r <= Rt here. + * mu := cosine of the zenith view angle + * attenuation := transmittance T(x,x0) + */ +vec3 sunColor(const vec3 x, const float t, const vec3 v, const vec3 s, const float r, + const float mu, const float irradianceFactor) { + vec3 transmittance = (r <= Rt) ? ( mu < -sqrt(1.0f - (Rg*Rg)/(r*r)) ? + vec3(0.0f) : transmittanceLUT(r, mu)) : vec3(1.0f); + // JCC: Change this function to a impostor texture with gaussian decay color weighted + // by tge sunRadiance, transmittance and irradianceColor (11/03/2017) + float sunFinalColor = step(cos(M_PI / 650.0), dot(v, s)) * sunRadiance * (1.0 - irradianceFactor); + + return transmittance * sunFinalColor; +} + +void main() { + if (cullAtmosphere == 0) { + vec4 atmosphereFinalColor = vec4(0.0f); + + // First we determine if the pixel is complex (different fragments on it) + bool complex = false; + vec4 oldColor, currentColor; + //vec4 colorArray[16]; + //int colorIndexArray[16]; + + oldColor = texelFetch(mainColorTexture, ivec2(gl_FragCoord), 0); + //colorArray[0] = oldColor; + //colorIndexArray[0] = 0; + for (int i = 1; i < nAaSamples; i++) { + //vec4 normal = texelFetch(mainNormalTexture, ivec2(gl_FragCoord), i); + vec4 currentColor = texelFetch(mainColorTexture, ivec2(gl_FragCoord), i); + //colorArray[i] = currentColor; + if (currentColor != oldColor) { + complex = true; + break; + // for (int c = 0; c < nAaSamples; c++) { + // if (currentColor == colorArray[c]) { + // colorIndexArray[i] = c; + // break; + // } + // } + } + //else { + // for (int c = 0; c < nAaSamples; c++) { + // if (currentColor == colorArray[c]) { + // colorIndexArray[i] = c; + // break; + // } + // } + // } + oldColor = currentColor; + } + + int nSamples = 1; + if (complex) { + //nSamples = nAaSamples; + nSamples = nAaSamples > 1 ? nAaSamples/2 : nAaSamples; + } + + for (int i = 0; i < nSamples; i++) { + vec4 normal = texelFetch(mainNormalTexture, ivec2(gl_FragCoord), i); + vec4 color = texelFetch(mainColorTexture, ivec2(gl_FragCoord), i); + // Data in the mainPositionTexture are written in view space (view plus camera rig) + vec4 position = texelFetch(mainPositionTexture, ivec2(gl_FragCoord), i); + vec4 otherData = texelFetch(otherDataTexture, ivec2(gl_FragCoord), i); + + // Ray in object space + dRay ray; + dvec4 planetPositionObjectCoords = dvec4(0.0); + dvec4 cameraPositionInObject = dvec4(0.0); + + // Get the ray from camera to atm in object space + dCalculateRayRenderableGlobe(i * 3, ray, planetPositionObjectCoords, + cameraPositionInObject); + + bool insideATM = false; + double offset = 0.0; + double maxLength = 0.0; + + bool intersectATM = false; + + // Instead of ray-ellipsoid intersection lets transform the ray to a sphere: + dRay transfRay; + transfRay.origin = ray.origin; + transfRay.direction = ray.direction; + + // transfRay.origin.z *= 1000.0/ellipsoidRadii.x; + // transfRay.direction.z *= 1000.0/ellipsoidRadii.x; + // transfRay.origin.x *= 1000.0/ellipsoidRadii.y; + // transfRay.direction.x *= 1000.0/ellipsoidRadii.y; + // transfRay.origin.y *= 1000.0/ellipsoidRadii.z; + // transfRay.direction.y *= 1000.0/ellipsoidRadii.z; + // transfRay.direction.xyz = normalize(transfRay.direction.xyz); + + intersectATM = dAtmosphereIntersection(planetPositionObjectCoords.xyz, transfRay, + Rt - ATM_EPSILON/100.0, insideATM, offset, maxLength ); + + if ( intersectATM ) { + // Now we check is if the atmosphere is occluded, i.e., if the distance to the pixel + // in the depth buffer is less than the distance to the atmosphere then the atmosphere + // is occluded + // Fragments positions into G-Buffer are written in OS Eye Space (Camera Rig Coords) + // when using their positions later, one must convert them to the planet's coords + + // OS Eye to World coords + dvec4 tmpRInvPos = dInverseCamRotTransform * dSgctEyeToOSEyeTranform * position; + dvec4 fragWorldCoords = dvec4(dvec3(tmpRInvPos) + dCampos, 1.0); + + // World to Object (Normal and Position in meters) + dvec4 fragObjectCoords = dInverseModelTransformMatrix * fragWorldCoords; + + // Distance of the pixel in the gBuffer to the observer + // JCC (12/12/2017): AMD distance function is buggy. + //double pixelDepth = distance(cameraPositionInObject.xyz, fragObjectCoords.xyz); + double pixelDepth = length(cameraPositionInObject.xyz - fragObjectCoords.xyz); + + // JCC (12/13/2017): TRick to remove floating error in texture. + // We see a squared noise on planet's surface when seeing the planet + // from far away. + float dC = float(length(cameraPositionInObject.xyz)); + float x1 = 1e8; + if (dC > x1) { + pixelDepth += 1000.0; + float alpha = 1000.0; + float beta = 1000000.0; + float x2 = 1e9; + float diffGreek = beta - alpha; + float diffDist = x2 - x1; + float varA = diffGreek/diffDist; + float varB = (alpha - varA * x1); + pixelDepth += double(varA * dC + varB); + } + + // All calculations are done in Km: + pixelDepth *= 0.001; + fragObjectCoords.xyz *= 0.001; + + if (position.xyz != vec3(0.0) && (pixelDepth < offset)) { + atmosphereFinalColor += vec4(HDR(color.xyz * backgroundConstant, atmExposure), color.a); + //discard; + } else { + // Following paper nomenclature + double t = offset; + vec3 attenuation; + + // Moving observer from camera location to top atmosphere + // If the observer is already inside the atm, offset = 0.0 + // and no changes at all. + vec3 x = vec3(ray.origin.xyz + t*ray.direction.xyz); + float r = 0.0;//length(x); + vec3 v = vec3(ray.direction.xyz); + float mu = 0.0;//dot(x, v) / r; + vec3 s = vec3(sunDirectionObj); + float tF = float(maxLength - t); + + // Because we may move the camera origin to the top of atmosphere + // we also need to adjust the pixelDepth for tdCalculateRayRenderableGlobehis offset so the + // next comparison with the planet's ground make sense: + pixelDepth -= offset; + + dvec4 onATMPos = dModelTransformMatrix * dvec4(x*1000.0, 1.0); + vec4 eclipseShadowATM = calcShadow(shadowDataArray, onATMPos.xyz, false); + vec4 eclipseShadowPlanet = calcShadow(shadowDataArray, fragWorldCoords.xyz, true); + + float sunIntensityInscatter = sunRadiance * eclipseShadowATM.x; + float sunIntensityGround = sunRadiance * eclipseShadowPlanet.x; + + float irradianceFactor = 0.0; + + vec3 inscatterColor = inscatterRadiance(x, tF, irradianceFactor, v, + s, r, mu, attenuation, + vec3(fragObjectCoords.xyz), + maxLength, pixelDepth, + color, sunIntensityInscatter); + vec3 groundColor = groundColor(x, tF, v, s, r, mu, attenuation, + color, normal.xyz, irradianceFactor, + otherData.r, sunIntensityGround); + vec3 sunColor = sunColor(x, tF, v, s, r, mu, irradianceFactor); + + // Final Color of ATM plus terrain: + vec4 finalRadiance = vec4(HDR(inscatterColor + groundColor + sunColor, atmExposure), 1.0); + + atmosphereFinalColor += finalRadiance; + } + } + else { // no intersection + //discard; + atmosphereFinalColor += vec4(HDR(color.xyz * backgroundConstant, atmExposure), color.a); + } + } + + renderTarget = atmosphereFinalColor / float(nSamples); + } + else { // culling + if (firstPaint) { + vec4 bColor = vec4(0.0f); + for (int f = 0; f < nAaSamples; f++) { + bColor += texelFetch(mainColorTexture, ivec2(gl_FragCoord), f); + } + bColor /= float(nAaSamples); + renderTarget = vec4(HDR(bColor.xyz * backgroundConstant, atmExposure), bColor.a); + } + else { + discard; + } + //renderTarget = vec4(1.0, 0.0, 0.0, 1.0); + + } +} + diff --git a/modules/atmosphere/shaders/atmosphere_deferred_vs.glsl b/modules/atmosphere/shaders/atmosphere_deferred_vs.glsl new file mode 100644 index 0000000000..9568c60136 --- /dev/null +++ b/modules/atmosphere/shaders/atmosphere_deferred_vs.glsl @@ -0,0 +1,35 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +layout(location = 0) in vec4 in_position; + +out vec3 interpolatedNDCPos; + +void main() +{ + interpolatedNDCPos = in_position.xyz; + gl_Position = in_position; +} diff --git a/modules/atmosphere/shaders/deltaE_calc_fs.glsl b/modules/atmosphere/shaders/deltaE_calc_fs.glsl new file mode 100644 index 0000000000..bacc9e0734 --- /dev/null +++ b/modules/atmosphere/shaders/deltaE_calc_fs.glsl @@ -0,0 +1,32 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ +#version __CONTEXT__ + +#include "atmosphere_common.glsl" + +out vec4 renderTableColor; + +void main(void) { + renderTableColor = vec4(0.0, 0.0, 0.0, 1.0); +} diff --git a/modules/atmosphere/shaders/deltaE_calc_vs.glsl b/modules/atmosphere/shaders/deltaE_calc_vs.glsl new file mode 100644 index 0000000000..578d7ab02f --- /dev/null +++ b/modules/atmosphere/shaders/deltaE_calc_vs.glsl @@ -0,0 +1,31 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +layout(location = 0) in vec3 in_position; + +void main() { + gl_Position = vec4(in_position, 1.0); +} \ No newline at end of file diff --git a/modules/atmosphere/shaders/deltaJ_calc_fs.glsl b/modules/atmosphere/shaders/deltaJ_calc_fs.glsl new file mode 100644 index 0000000000..9598e4d5c9 --- /dev/null +++ b/modules/atmosphere/shaders/deltaJ_calc_fs.glsl @@ -0,0 +1,209 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +#include "atmosphere_common.glsl" + +out vec4 renderTarget1; + +uniform float r; +uniform vec4 dhdH; + +uniform sampler2D deltaETexture; +uniform sampler3D deltaSRTexture; +uniform sampler3D deltaSMTexture; + +uniform int firstIteraction; + +// -- Spherical Coordinates Steps. phi e [0,2PI] and theta e [0, PI] +const float stepPhi = (2.0f * M_PI) / float(INSCATTER_SPHERICAL_INTEGRAL_SAMPLES); +const float stepTheta = M_PI / float(INSCATTER_SPHERICAL_INTEGRAL_SAMPLES); + +void inscatter(float r, float mu, float muSun, float nu, inout vec3 radianceJ) { + // Be sure to not get a cosine or height out of bounds + r = clamp(r, Rg, Rt); + mu = clamp(mu, -1.0f, 1.0f); + muSun = clamp(muSun, -1.0f, 1.0f); + + // s sigma | theta v + // \ | / + // \ | / + // \ | / + // \ | / theta + signam = ni + // \ | / cos(theta) = mu + // \ | / cos(sigma) = muSun + // \|/ cos(ni) = nu + float mu2 = mu * mu; + float muSun2 = muSun * muSun; + float sinThetaSinSigma = sqrt(1.0f - mu2) * sqrt(1.0f - muSun2); + // cos(sigma + theta) = cos(theta)cos(sigma)-sin(theta)sin(sigma) + // cos(ni) = nu = mu * muSun - sqrt(1.0f - mu*mu)*sqrt(1.0 - muSun*muSun) // sin(theta) = sqrt(1.0 - mu*mu) + // Now we make sure the angle between vec(s) and vec(v) is in the right range: + nu = clamp(nu, muSun * mu - sinThetaSinSigma, muSun * mu + sinThetaSinSigma); + + // Lets calculate the consine of the angle to the horizon: + // theta is the angle between vec(v) and x + // cos(PI-theta) = d/r + // -cos(theta) = sqrt(r*r-Rg*Rg)/r + float Rg2 = Rg * Rg; + float r2 = r * r; + float cosHorizon = -sqrt(r2 - Rg2)/r; + + // Now we get vec(v) and vec(s) from mu, muSun and nu: + // Assuming: + // z |theta + // |\ vec(v) ||vec(v)|| = 1 + // | \ + // |__\_____x + // sin(PI-theta) = x/||v|| => x = sin(theta) =? x = sqrt(1-mu*mu) + // cos(PI-theta) = z/||v|| => z = cos(theta) = mu + // v.y = 0 because ||v|| = 1 + vec3 v = vec3(sqrt(1.0 - mu2), 0.0, mu); + + // To obtain vec(s), we use the following properties: + // ||vec(s)|| = 1, ||vec(v)|| = 1 + // vec(s) dot vec(v) = cos(ni) = nu + // Following the same idea for vec(v), we now that s.z = cos(sigma) = muSun + // So, from vec(s) dot vec(v) = cos(ni) = nu we have, + // s.x*v.x +s.y*v.y + s.z*v.z = nu + // s.x = (nu - s.z*v.z)/v.x = (nu - mu*muSun)/v.x + float sx = (v.x == 0.0) ? 0.0 : (nu - muSun * mu) / v.x; + // Also, ||vec(s)|| = 1, so: + // 1 = sqrt(s.x*s.x + s.y*s.y + s.z*s.z) + // s.y = sqrt(1 - s.x*s.x - s.z*s.z) = sqrt(1 - s.x*s.x - muSun*muSun) + vec3 s = vec3(sx, sqrt(max(0.0, 1.0 - sx * sx - muSun2)), muSun); + + // In order to integrate over 4PI, we scan the sphere using the spherical coordinates + // previously defined + for ( int theta_i = 0; theta_i < INSCATTER_SPHERICAL_INTEGRAL_SAMPLES; ++theta_i ) { + float theta = (float(theta_i) + 0.5f) * stepTheta; + float cosineTheta = cos(theta); + float cosineTheta2 = cosineTheta * cosineTheta; + float distanceToGround = 0.0f; + float groundReflectance = 0.0f; + vec3 groundTransmittance = vec3(0.0f); + + // If the ray w can see the ground we must compute the transmittance + // effect from the starting point x to the ground point in direction -vec(v): + if ( cosineTheta < cosHorizon ) { // ray hits ground + // AverageGroundReflectance e [0,1] + groundReflectance = AverageGroundReflectance / M_PI; + // From cosine law: Rg*Rg = r*r + distanceToGround*distanceToGround - 2*r*distanceToGround*cos(PI-theta) + distanceToGround = -r * cosineTheta - sqrt(r2 * (cosineTheta2 - 1.0f) + Rg2); + // | + // | theta + // | + // |\ distGround + // r | \ alpha + // | \/ + // | / + // | / Rg + // |/ + // So cos(alpha) = ((vec(x)+vec(dg)) dot -vec(distG))/(||(vec(x)+vec(distG))|| * ||vec(distG)||) + // cos(alpha) = (-r*distG*cos(theta) - distG*distG)/(Rg*distG) + // muGround = -(r*cos(theta) + distG)/Rg + float muGround = -(r * cosineTheta + distanceToGround) / Rg; + // We can use the same triangle in calculate the distanceToGround to calculate the cosine of the + // angle between the ground touching point at height Rg and the zenith angle + //float muGround = (r2 - distanceToGround*distanceToGround - Rg2)/(2*distanceToGround*Rg); + // Acesss the Transmittance LUT in order to calculate the transmittance from the ground point Rg, + // thorugh the atmosphere, at a distance: distanceToGround + groundTransmittance = transmittance(Rg, muGround, distanceToGround); + } + //for ( int phi_i = 0; phi_i < 2*INSCATTER_SPHERICAL_INTEGRAL_SAMPLES; ++phi_i ) { + for ( int phi_i = 0; phi_i < INSCATTER_SPHERICAL_INTEGRAL_SAMPLES; ++phi_i ) { + float phi = (float(phi_i) + 0.5) * stepPhi; + // spherical coordinates: dw = dtheta*dphi*sin(theta)*rho^2 + // rho = 1, we are integrating over a unit sphere + float dw = stepTheta * stepPhi * sin(theta); + // w = (rho*sin(theta)*cos(phi), rho*sin(theta)*sin(phi), rho*cos(theta)) + float sinPhi = sin(phi); + float sinTheta = sin(theta); + float cosPhi = cos(phi); + vec3 w = vec3(sinTheta * cosPhi, sinTheta * sinPhi, cosineTheta); + + // We calculate the Rayleigh and Mie phase function for the new scattering angle: + // cos(angle between vec(v) and vec(w)), ||v|| = ||w|| = 1 + float nuWV = dot(v, w); + float phaseRayleighWV = rayleighPhaseFunction(nuWV); + float phaseMieWV = miePhaseFunction(nuWV); + + vec3 groundNormal = (vec3(0.0, 0.0, r) + distanceToGround * w) / Rg; + vec3 groundIrradiance = irradianceLUT(deltaETexture, dot(groundNormal, s), Rg); + + // We finally calculate the radiance from the reflected ray from ground (0.0 if not reflected) + vec3 radianceJ1 = groundTransmittance * groundReflectance * groundIrradiance; + + // We calculate the Rayleigh and Mie phase function for the new scattering angle: + // cos(angle between vec(s) and vec(w)), ||s|| = ||w|| = 1 + float nuSW = dot(s, w); + // The first iteraction is different from the others, that's because in the first + // iteraction all the light InScattered are coming from the initial pre-computed + // single InScattered light. We stored these values in the deltaS textures (Ray and Mie), + // and in order to avoid problems with the high angle dependency in the phase functions, + // we don't include the phase functions on those tables (that's why we calculate them now). + if ( firstIteraction == 1 ) { + float phaseRaySW = rayleighPhaseFunction(nuSW); + float phaseMieSW = miePhaseFunction(nuSW); + // We can now access the values for the single InScattering in the textures deltaS textures. + vec3 singleRay = texture4D(deltaSRTexture, r, w.z, muSun, nuSW).rgb; + vec3 singleMie = texture4D(deltaSMTexture, r, w.z, muSun, nuSW).rgb; + + // Initial InScattering including the phase functions + radianceJ1 += singleRay * phaseRaySW + singleMie * phaseMieSW; + } else { + // On line 9 of the algorithm, the texture table deltaSR is updated, so when we are not in the first + // iteraction, we are getting the updated result of deltaSR (not the single inscattered light but the + // accumulated (higher order) inscattered light. + // w.z is the cosine(theta) = mu for vec(w) + radianceJ1 += texture4D(deltaSRTexture, r, w.z, muSun, nuSW).rgb; + } + + // Finally, we add the atmospheric scale height (See: Radiation Transfer on the Atmosphere and Ocean from + // Thomas and Stamnes, pg 9-10. + radianceJ += radianceJ1 * (betaRayleigh * exp(-(r - Rg) / HR) * phaseRayleighWV + + betaMieScattering * exp(-(r - Rg) / HM) * phaseMieWV) * dw; + } + } +} + +void main(void) { + // cosine variables to access deltaS textures + float mu, muSun, nu; + // InScattering Radiance to be calculated at + // different points in the ray path + vec3 radianceJ = vec3(0.0f); + + // Unmapping the variables from texture texels coordinates + // to mapped coordinates + unmappingMuMuSunNu(r, dhdH, mu, muSun, nu); + + // Calculate the the light inScattered in direction + // -vec(v) for the point at height r (vec(y) following Bruneton and Neyret's paper + inscatter(r, mu, muSun, nu, radianceJ); + + // Write to texture detaJ + renderTarget1 = vec4(radianceJ, 1.0); +} diff --git a/modules/atmosphere/shaders/deltaJ_calc_gs.glsl b/modules/atmosphere/shaders/deltaJ_calc_gs.glsl new file mode 100644 index 0000000000..a4dd2d50b5 --- /dev/null +++ b/modules/atmosphere/shaders/deltaJ_calc_gs.glsl @@ -0,0 +1,41 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +uniform int layer; + +layout (triangles) in; +layout (triangle_strip, max_vertices = 3) out; + +void main() +{ + int n; + for (n = 0; n < gl_in.length(); ++n) { + gl_Position = gl_in[n].gl_Position; + gl_Layer = layer; + EmitVertex(); + } + EndPrimitive(); +} \ No newline at end of file diff --git a/modules/atmosphere/shaders/deltaJ_calc_vs.glsl b/modules/atmosphere/shaders/deltaJ_calc_vs.glsl new file mode 100644 index 0000000000..578d7ab02f --- /dev/null +++ b/modules/atmosphere/shaders/deltaJ_calc_vs.glsl @@ -0,0 +1,31 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +layout(location = 0) in vec3 in_position; + +void main() { + gl_Position = vec4(in_position, 1.0); +} \ No newline at end of file diff --git a/modules/atmosphere/shaders/deltaS_calc_fs.glsl b/modules/atmosphere/shaders/deltaS_calc_fs.glsl new file mode 100644 index 0000000000..014cd535fb --- /dev/null +++ b/modules/atmosphere/shaders/deltaS_calc_fs.glsl @@ -0,0 +1,49 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +#include "atmosphere_common.glsl" + +out vec4 renderTarget1; + +uniform int layer; + +uniform sampler3D deltaSRTexture; +uniform sampler3D deltaSMTexture; + +void main(void) { + // First we convert the window's fragment coordinate to + // texel coordinates + vec3 rst = vec3(gl_FragCoord.xy, float(layer) + 0.5f) / + vec3(ivec3(SAMPLES_MU_S * SAMPLES_NU, SAMPLES_MU, SAMPLES_R)); + + vec4 rayleighInscattering0 = texture(deltaSRTexture, rst); + vec4 mieInscattering0 = texture(deltaSMTexture, rst); + + // We are using only the red component of the Mie scattering + // See the Precomputed Atmosphere Scattering paper for details about + // the angular precision. + renderTarget1 = vec4(rayleighInscattering0.rgb, mieInscattering0.r); +} diff --git a/modules/atmosphere/shaders/deltaS_calc_gs.glsl b/modules/atmosphere/shaders/deltaS_calc_gs.glsl new file mode 100644 index 0000000000..a4dd2d50b5 --- /dev/null +++ b/modules/atmosphere/shaders/deltaS_calc_gs.glsl @@ -0,0 +1,41 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +uniform int layer; + +layout (triangles) in; +layout (triangle_strip, max_vertices = 3) out; + +void main() +{ + int n; + for (n = 0; n < gl_in.length(); ++n) { + gl_Position = gl_in[n].gl_Position; + gl_Layer = layer; + EmitVertex(); + } + EndPrimitive(); +} \ No newline at end of file diff --git a/modules/atmosphere/shaders/deltaS_calc_vs.glsl b/modules/atmosphere/shaders/deltaS_calc_vs.glsl new file mode 100644 index 0000000000..578d7ab02f --- /dev/null +++ b/modules/atmosphere/shaders/deltaS_calc_vs.glsl @@ -0,0 +1,31 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +layout(location = 0) in vec3 in_position; + +void main() { + gl_Position = vec4(in_position, 1.0); +} \ No newline at end of file diff --git a/modules/atmosphere/shaders/deltaS_sup_calc_fs.glsl b/modules/atmosphere/shaders/deltaS_sup_calc_fs.glsl new file mode 100644 index 0000000000..09cf5026b3 --- /dev/null +++ b/modules/atmosphere/shaders/deltaS_sup_calc_fs.glsl @@ -0,0 +1,45 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +#include "atmosphere_common.glsl" + +out vec4 renderTarget1; + +uniform int layer; + +uniform sampler3D deltaSTexture; + +void main(void) { + float x = gl_FragCoord.x - 0.5f; + float y = gl_FragCoord.y - 0.5f; + + float nu = -1.0f + floor(x / float(SAMPLES_MU_S)) / (float(SAMPLES_NU) - 1.0f) * 2.0f; + vec3 uvw = vec3(gl_FragCoord.xy, float(layer) + 0.5f) / vec3(ivec3(SAMPLES_MU_S * SAMPLES_NU, SAMPLES_MU, SAMPLES_R)); + + // See Bruneton and Neyret paper, "Angular Precision" paragraph to understanding why we are + // dividing the S[L*] by the Rayleigh phase function. + renderTarget1 = vec4(texture(deltaSTexture, uvw).rgb / rayleighPhaseFunction(nu), 0.0f); + } diff --git a/modules/atmosphere/shaders/deltaS_sup_calc_gs.glsl b/modules/atmosphere/shaders/deltaS_sup_calc_gs.glsl new file mode 100644 index 0000000000..8ca6044fd1 --- /dev/null +++ b/modules/atmosphere/shaders/deltaS_sup_calc_gs.glsl @@ -0,0 +1,41 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +uniform int layer; + +layout (triangles) in; +layout (triangle_strip, max_vertices = 3) out; + +void main() +{ + int n; + for (n = 0; n < gl_in.length(); ++n) { + gl_Position = gl_in[n].gl_Position; + gl_Layer = layer; + EmitVertex(); + } + EndPrimitive(); +} \ No newline at end of file diff --git a/modules/atmosphere/shaders/deltaS_sup_calc_vs.glsl b/modules/atmosphere/shaders/deltaS_sup_calc_vs.glsl new file mode 100644 index 0000000000..7e3574bd9d --- /dev/null +++ b/modules/atmosphere/shaders/deltaS_sup_calc_vs.glsl @@ -0,0 +1,31 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +layout(location = 0) in vec3 in_position; + +void main() { + gl_Position = vec4(in_position, 1.0); +} \ No newline at end of file diff --git a/modules/atmosphere/shaders/inScattering_calc_fs.glsl b/modules/atmosphere/shaders/inScattering_calc_fs.glsl new file mode 100644 index 0000000000..a55cbc78e1 --- /dev/null +++ b/modules/atmosphere/shaders/inScattering_calc_fs.glsl @@ -0,0 +1,137 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ +#version __CONTEXT__ + +#include "atmosphere_common.glsl" + +layout(location = 0) out vec4 renderTarget1; +layout(location = 1) out vec4 renderTarget2; + +uniform float r; +uniform vec4 dhdH; + +//uniform sampler2D transmittanceTexture; + +void integrand(const float r, const float mu, const float muSun, const float nu, + const float y, out vec3 S_R, out vec3 S_M) { + // The integral's integrand is the single inscattering radiance: + // S[L0] = P_M*S_M[L0] + P_R*S_R[L0] + // where S_M[L0] = T*(betaMScattering * exp(-h/H_M))*L0 and + // S_R[L0] = T*(betaRScattering * exp(-h/H_R))*L0. + // T = transmittance. + // One must remember that because the occlusion on L0, the integrand + // here will be equal to 0 in that cases. + // Also it is important to remember that the phase function for the + // Rayleigh and Mie scattering are added during the rendering time + // to increase the angular precision + S_R = vec3(0.0); + S_M = vec3(0.0); + + // cosine law + float ri = max(sqrt(r * r + y * y + 2.0 * r * mu * y), Rg); + + // Considering the Sun as a parallel light source, + // thew vector s_i = s. + // So muSun_i = (vec(y_i) dot vec(s))/r_i = ((vec(x) + vec(yi-x)) dot vec(s))/r_i + // muSun_i = (vec(x) dot vec(s) + vec(yi-x) dot vec(s))/r_i = (r*muSun + yi*nu)/r_i + float muSun_i = (nu * y + muSun * r) / ri; + + // If the muSun_i is smaller than the angle to horizon (no sun radiance + // hitting the point y), we return S_R = S_M = 0.0f. + if (muSun_i >= -sqrt(1.0 - Rg * Rg / (ri * ri))) { + // It's the transmittance from the point y (ri) to the top of atmosphere + // in direction of the sun (muSun_i) and the transmittance from the observer + // at x (r) to y (ri). + vec3 transmittanceY = transmittance(r, mu, y) * transmittanceLUT(ri, muSun_i); + // exp(-h/H)*T(x,v) + if (ozoneLayerEnabled) { + S_R = (exp(-(ri - Rg) / HO) + exp( -(ri - Rg) / HR )) * transmittanceY; + S_M = exp( -(ri - Rg) / HM ) * transmittanceY; + } else { + S_R = exp( -(ri - Rg) / HR ) * transmittanceY; + S_M = exp( -(ri - Rg) / HM ) * transmittanceY; + } + // The L0 (sun radiance) is added in real-time. + } +} + +void inscatter(const float r, const float mu, const float muSun, const float nu, + out vec3 S_R, out vec3 S_M) { + // Let's calculate S_M and S_R by integration along the eye ray path inside + // the atmosphere, given a position r, a view angle (cosine) mu, a sun + // position angle (cosine) muSun, and the angle (cosine) between the sun position + // and the view direction, nu. + // Integrating using the Trapezoidal rule: + // Integral(f(y)dy)(from a to b) = (b-a)/2n_steps*(Sum(f(y_i+1)+f(y_i))) + S_R = vec3(0.0f); + S_M = vec3(0.0f); + float rayDist = rayDistance(r, mu); + float dy = rayDist / float(INSCATTER_INTEGRAL_SAMPLES); + float yi = 0.0f; + vec3 S_Ri; + vec3 S_Mi; + integrand(r, mu, muSun, nu, 0.0, S_Ri, S_Mi); + for (int i = 1; i <= INSCATTER_INTEGRAL_SAMPLES; ++i) { + float yj = float(i) * dy; + vec3 S_Rj; + vec3 S_Mj; + integrand(r, mu, muSun, nu, yj, S_Rj, S_Mj); + S_R += (S_Ri + S_Rj); + S_M += (S_Mi + S_Mj); + yi = yj; + S_Ri = S_Rj; + S_Mi = S_Mj; + } + S_R *= betaRayleigh * (rayDist / (2.0f * float(INSCATTER_INTEGRAL_SAMPLES))); + S_M *= betaMieScattering * (rayDist / (2.0f * float(INSCATTER_INTEGRAL_SAMPLES))); +} + +void main(void) { + vec3 S_R; // First Order Rayleigh InScattering + vec3 S_M; // First Order Mie InScattering + float mu, muSun, nu; // parametrization angles + + // From the layer interpolation (see C++ code for layer to r) + // and the textures parameters (uv), we unmapping mu, muSun and nu. + unmappingMuMuSunNu(r, dhdH, mu, muSun, nu); + + // Here we calculate the single inScattered light. + // Because this is a single inscattering, the light + // that arrives at a point y in the path from the + // eye to the infinity (top of atmosphere or planet's + // ground), comes only from the light source, i.e., the + // sun. So, the there is no need to integrate over the + // whole solid angle (4pi), we need only to consider + // the Sun position (cosine of sun pos = muSun). + // Then, following the paper notation: + // S[L] = P_R*S_R[L0] + P_M*S_M[L0] + S[L*] + // For single inscattering only: + // S[L0] = P_R*S_R[L0] + P_M*S_M[L0] + // In order to save memory, we just store the red component + // of S_M[L0], and later we use the proportionality rule + // to calcule the other components. + inscatter(r, mu, muSun, nu, S_R, S_M); + renderTarget1 = vec4(S_R, 1.0); + renderTarget2 = vec4(S_M, 1.0); +} diff --git a/modules/atmosphere/shaders/inScattering_calc_gs.glsl b/modules/atmosphere/shaders/inScattering_calc_gs.glsl new file mode 100644 index 0000000000..aed3744bd2 --- /dev/null +++ b/modules/atmosphere/shaders/inScattering_calc_gs.glsl @@ -0,0 +1,41 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +uniform int layer; + +layout (triangles) in; +layout (triangle_strip, max_vertices=3) out; + +void main() +{ + int n; + for (n = 0; n < gl_in.length(); ++n) { + gl_Position = gl_in[n].gl_Position; + gl_Layer = layer; + EmitVertex(); + } + EndPrimitive(); +} \ No newline at end of file diff --git a/modules/atmosphere/shaders/inScattering_calc_vs.glsl b/modules/atmosphere/shaders/inScattering_calc_vs.glsl new file mode 100644 index 0000000000..578d7ab02f --- /dev/null +++ b/modules/atmosphere/shaders/inScattering_calc_vs.glsl @@ -0,0 +1,31 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +layout(location = 0) in vec3 in_position; + +void main() { + gl_Position = vec4(in_position, 1.0); +} \ No newline at end of file diff --git a/modules/atmosphere/shaders/inScattering_sup_calc_fs.glsl b/modules/atmosphere/shaders/inScattering_sup_calc_fs.glsl new file mode 100644 index 0000000000..c7c4f09561 --- /dev/null +++ b/modules/atmosphere/shaders/inScattering_sup_calc_fs.glsl @@ -0,0 +1,79 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +#include "atmosphere_common.glsl" + +out vec4 renderTarget1; + +uniform float r; +uniform vec4 dhdH; + +//uniform sampler2D transmittanceTexture; +uniform sampler3D deltaJTexture; + +// The integrand here is the f(y) of the trapezoidal rule: +vec3 integrand(const float r, const float mu, const float muSun, const float nu, const float dist) { + // We can calculate r_i by the cosine law: r_i^2=dist^2 + r^2 - 2*r*dist*cos(PI-theta) + float r_i = sqrt(r * r + dist * dist + 2.0f * r * dist * mu); + // r_i can be found using the dot product: + // vec(y_i) dot vec(dist) = cos(theta_i) * ||vec(y_i)|| * ||vec(dist)|| + // But vec(y_i) = vec(x) + vec(dist), also: vec(x) dot vec(dist) = cos(theta) = mu + // So, cos(theta_i) = mu_i = (r*dist**mu + dist*2)/(r_i*dist) + float mu_i = (r * mu + dist) / r_i; + // muSun_i can also be found by the dot product: + // cos(sigma_i) = muSun_i = (vec(s) dot vec(y_i))/(||vec(y_i)|| * ||vec(s)||) + // But vec(y_i) = vec(x) + vec(dist), and vec(x) dot vec(s) = muSun, cos(sigma_i + theta_i) = nu + float muSun_i = (r * muSun + dist * nu) / r_i; + // The irradiance attenuated from point r until y (y-x = dist) + return transmittance(r, mu, dist) * texture4D(deltaJTexture, r_i, mu_i, muSun_i, nu).rgb; +} + +vec3 inscatter(float r, float mu, float muSun, float nu) { + vec3 inScatteringRadiance = vec3(0.0f); + float dy = rayDistance(r, mu) / float(INSCATTER_INTEGRAL_SAMPLES); + vec3 inScatteringRadiance_i = integrand(r, mu, muSun, nu, 0.0); + + // In order to solve the integral from equation (11) we use the trapezoidal + // rule: Integral(f(y)dy)(from a to b) = ((b-a)/2n_steps)*(Sum(f(y_i+1)+f(y_i))) + // where y_i+1 = y_j + for (int i = 1; i <= INSCATTER_INTEGRAL_SAMPLES; ++i) { + float y_j = float(i) * dy; + vec3 inScatteringRadiance_j = integrand(r, mu, muSun, nu, y_j); + inScatteringRadiance += (inScatteringRadiance_i + inScatteringRadiance_j) / 2.0 * dy; + inScatteringRadiance_i = inScatteringRadiance_j; + } + return inScatteringRadiance; +} + +void main(void) { + float mu = 0.0f, muSunun = 0.0f, nu = 0.0f; + // Unmapping the variables from texture texels coordinates + // to mapped coordinates + unmappingMuMuSunNu(r, dhdH, mu, muSunun, nu); + + // Write to texture deltaSR + renderTarget1 = vec4(inscatter(r, mu, muSunun, nu), 1.0); +} diff --git a/modules/atmosphere/shaders/inScattering_sup_calc_gs.glsl b/modules/atmosphere/shaders/inScattering_sup_calc_gs.glsl new file mode 100644 index 0000000000..8ca6044fd1 --- /dev/null +++ b/modules/atmosphere/shaders/inScattering_sup_calc_gs.glsl @@ -0,0 +1,41 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +uniform int layer; + +layout (triangles) in; +layout (triangle_strip, max_vertices = 3) out; + +void main() +{ + int n; + for (n = 0; n < gl_in.length(); ++n) { + gl_Position = gl_in[n].gl_Position; + gl_Layer = layer; + EmitVertex(); + } + EndPrimitive(); +} \ No newline at end of file diff --git a/modules/atmosphere/shaders/inScattering_sup_calc_vs.glsl b/modules/atmosphere/shaders/inScattering_sup_calc_vs.glsl new file mode 100644 index 0000000000..7e3574bd9d --- /dev/null +++ b/modules/atmosphere/shaders/inScattering_sup_calc_vs.glsl @@ -0,0 +1,31 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +layout(location = 0) in vec3 in_position; + +void main() { + gl_Position = vec4(in_position, 1.0); +} \ No newline at end of file diff --git a/modules/atmosphere/shaders/irradiance_calc_fs.glsl b/modules/atmosphere/shaders/irradiance_calc_fs.glsl new file mode 100644 index 0000000000..48cc7ce40f --- /dev/null +++ b/modules/atmosphere/shaders/irradiance_calc_fs.glsl @@ -0,0 +1,43 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ +#version __CONTEXT__ + +#include "atmosphere_common.glsl" + +out vec4 renderTableColor; + +//uniform sampler2D transmittanceTexture; + +void main(void) { + float muSun, r; + unmappingRAndMuSun(r, muSun); + // We are calculating the Irradiance for L0, i.e., + // only the radiance comming from sun direction is accounted: + // E[L0](x,s) = L0*dot(w,n) or 0 (if v!=s or the sun is occluded). + // Because we consider the Planet as a perfect sphere and we are + // considering only single scattering here, the + // dot product dot(w,n) is equal to dot(s,n) that is equal to + // dot(s, r/||r||) = muSun. + renderTableColor = vec4(transmittanceLUT(r, muSun) * max(muSun, 0.0), 0.0); +} diff --git a/modules/atmosphere/shaders/irradiance_calc_vs.glsl b/modules/atmosphere/shaders/irradiance_calc_vs.glsl new file mode 100644 index 0000000000..578d7ab02f --- /dev/null +++ b/modules/atmosphere/shaders/irradiance_calc_vs.glsl @@ -0,0 +1,31 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +layout(location = 0) in vec3 in_position; + +void main() { + gl_Position = vec4(in_position, 1.0); +} \ No newline at end of file diff --git a/modules/atmosphere/shaders/irradiance_final_fs.glsl b/modules/atmosphere/shaders/irradiance_final_fs.glsl new file mode 100644 index 0000000000..47771e8898 --- /dev/null +++ b/modules/atmosphere/shaders/irradiance_final_fs.glsl @@ -0,0 +1,37 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ +#version __CONTEXT__ + +#include "atmosphere_common.glsl" + +out vec4 renderTableColor; + +uniform sampler2D deltaETexture; + +void main(void) { + vec2 uv = gl_FragCoord.xy / vec2(OTHER_TEXTURES_W, OTHER_TEXTURES_H); + + // Update texture E with E plus deltaE textures. + renderTableColor = texture(deltaETexture, uv); +} diff --git a/modules/atmosphere/shaders/irradiance_final_vs.glsl b/modules/atmosphere/shaders/irradiance_final_vs.glsl new file mode 100644 index 0000000000..f55a966566 --- /dev/null +++ b/modules/atmosphere/shaders/irradiance_final_vs.glsl @@ -0,0 +1,31 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +layout(location = 0) in vec3 in_position; + +void main() { + gl_Position = vec4(in_position, 1.0); +} diff --git a/modules/atmosphere/shaders/irradiance_sup_calc_fs.glsl b/modules/atmosphere/shaders/irradiance_sup_calc_fs.glsl new file mode 100644 index 0000000000..005e1db59a --- /dev/null +++ b/modules/atmosphere/shaders/irradiance_sup_calc_fs.glsl @@ -0,0 +1,93 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +#include "atmosphere_common.glsl" + +out vec4 renderTableColor; + +uniform int firstIteraction; +//uniform float firstIteraction; + +// -- Spherical Coordinates Steps. phi e [0,2PI] and theta e [0, PI/2] +const float stepPhi = (2.0f * M_PI) / float(IRRADIANCE_INTEGRAL_SAMPLES); +const float stepTheta = M_PI / (2.0f * float(IRRADIANCE_INTEGRAL_SAMPLES)); + +//uniform sampler2D transmittanceTexture; +uniform sampler3D deltaSRTexture; +uniform sampler3D deltaSMTexture; + +void main(void) { + + float r = 0.0f; + float muSun = 0.0f; + // Unmapping the variables from texture texels coordinates + // to mapped coordinates + unmappingRAndMuSunIrradiance(r, muSun); + + // We know that muSun = cos(sigma) = s.z/||s|| + // But, ||s|| = 1, so s.z = muSun. Also, + // ||s|| = 1, so s.x = sin(sigma) = sqrt(1-muSun^2) and s.y = 0.0f + vec3 s = vec3(max(sqrt(1.0f - muSun * muSun), 0.0f), 0.0f, muSun); + + // In order to solve the integral from equation (15) we use the trapezoidal + // rule: Integral(f(y)dy)(from a to b) = ((b-a)/2n_steps)*(Sum(f(y_i+1)+f(y_i))) + vec3 irradianceE = vec3(0.0f); + for (int iphi = 0; iphi < IRRADIANCE_INTEGRAL_SAMPLES; ++iphi) { + float phi = (float(iphi) + 0.5f) * stepPhi; + for (int itheta = 0; itheta < IRRADIANCE_INTEGRAL_SAMPLES; ++itheta) { + float theta = (float(itheta) + 0.5f) * stepTheta; + // spherical coordinates: dw = dtheta*dphi*sin(theta)*rho^2 + // rho = 1, we are integrating over a unit sphere + float dw = stepTheta * stepPhi * sin(theta); + // w = (cos(phi) * sin(theta) * rho, sin(phi) * sin(theta) * rho, cos(theta) * rho) + vec3 w = vec3(cos(phi) * sin(theta), sin(phi) * sin(theta), cos(theta)); + float nu = dot(s, w); + + // The first iteraction is different from the others, that's because in the first + // iteraction all the light arriving are coming from the initial pre-computed + // single scattered light. We stored these values in the deltaS textures (Ray and Mie), + // and in order to avoid problems with the high angle dependency in the phase functions, + // we don't include the phase functions on those tables (that's why we calculate them now). + if (firstIteraction == 1) { + float phaseRay = rayleighPhaseFunction(nu); + float phaseMie = miePhaseFunction(nu); + vec3 singleRay = texture4D(deltaSRTexture, r, w.z, muSun, nu).rgb; + vec3 singleMie = texture4D(deltaSMTexture, r, w.z, muSun, nu).rgb; + // w.z is the cosine(theta) = mu for vec(w) and also vec(w) dot vec(n(xo)) + irradianceE += (singleRay * phaseRay + singleMie * phaseMie) * w.z * dw; + } else { + // On line 10 of the algorithm, the texture table deltaE is updated, so when we are not in the first + // iteraction, we are getting the updated result of deltaE (not the single irradiance light but the + // accumulated (higher order) irradiance light. + // w.z is the cosine(theta) = mu for vec(w) and also vec(w) dot vec(n(xo)) + irradianceE += texture4D(deltaSRTexture, r, w.z, muSun, nu).rgb * w.z * dw; + } + } + } + + // Write the higher oder irradiance to texture deltaE + renderTableColor = vec4(irradianceE, 0.0); +} diff --git a/modules/atmosphere/shaders/irradiance_sup_calc_vs.glsl b/modules/atmosphere/shaders/irradiance_sup_calc_vs.glsl new file mode 100644 index 0000000000..578d7ab02f --- /dev/null +++ b/modules/atmosphere/shaders/irradiance_sup_calc_vs.glsl @@ -0,0 +1,31 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +layout(location = 0) in vec3 in_position; + +void main() { + gl_Position = vec4(in_position, 1.0); +} \ No newline at end of file diff --git a/modules/atmosphere/shaders/transmittance_calc_fs.glsl b/modules/atmosphere/shaders/transmittance_calc_fs.glsl new file mode 100644 index 0000000000..7f57a7e0b2 --- /dev/null +++ b/modules/atmosphere/shaders/transmittance_calc_fs.glsl @@ -0,0 +1,91 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ +#version __CONTEXT__ + +#include "atmosphere_common.glsl" + +//layout(location = 1) out vec4 renderTableColor; +out vec4 renderTableColor; + +//-- Optical depth by integration, from ray starting at point vec(x), i.e, +// height r and angle mu (cosine of vec(v)) until top of atmosphere +// or planet's ground. -- +// r := height of starting point vect(x) +// mu := cosine of the zeith angle of vec(v). Or mu = (vec(x) * vec(v))/r +// H := Thickness of atmosphere if its density were uniform (can be used +// for Rayleigh and Mie. +float opticalDepth(const float r, const float mu, const float H) { + float r2 = r*r; + // Is ray below horizon? The transmittance table will have only + // the values for transmittance starting at r (x) until the + // light ray touches the atmosphere or the ground and only for + // view angles v between 0 and pi/2 + eps. That's because we + // can calculate the transmittance for angles bigger than pi/2 + // just inverting the ray direction and starting and ending points. + + // cosine law for triangles: y_i^2 = a^2 + b^2 - 2abcos(alpha) + float cosZenithHorizon = -sqrt( 1.0f - ( ( Rg * Rg ) / r2 ) ); + if (mu < cosZenithHorizon) + return 1e9; + + // Integrating using the Trapezoidal rule: + // Integral(f(y)dy)(from a to b) = ((b-a)/2n_steps)*(Sum(f(y_i+1)+f(y_i))) + float b_a = rayDistance(r, mu); + float deltaStep = b_a / float(TRANSMITTANCE_STEPS); + // cosine law + float y_i = exp(-(r - Rg) / H); + + float x_step = 0.0f; + float accumulation = 0.0f; + for (int i = 1; i <= TRANSMITTANCE_STEPS; ++i) { + float x_i = float(i) * deltaStep; + // cosine law for triangles: y_i^2 = a^2 + b^2 - 2abcos(alpha) + // In this case, a = r, b = x_i and cos(alpha) = cos(PI-zenithView) = mu + float y_ii = exp(-(sqrt(r2 + x_i * x_i + 2.0 * x_i * r * mu) - Rg) / H); + accumulation += (y_ii + y_i); + //x_step = x_i; + y_i = y_ii; + } + return accumulation * ( b_a / ( 2 * TRANSMITTANCE_STEPS ) ); +} + + +void main(void) { + float r, muSun; + + unmappingRAndMu(r, muSun); + + vec3 opDepth = vec3(0.0); + + if (ozoneLayerEnabled) { + opDepth = betaOzoneExtinction * (0.0000006) * opticalDepth(r, muSun, HO) + + betaMieExtinction * opticalDepth(r, muSun, HM) + + betaRayleigh * opticalDepth(r, muSun, HR); + } else { + opDepth = betaMieExtinction * opticalDepth(r, muSun, HM) + + betaRayleigh * opticalDepth(r, muSun, HR); + } + + renderTableColor = vec4( exp( -opDepth ), 0.0f ); +} diff --git a/modules/atmosphere/shaders/transmittance_calc_vs.glsl b/modules/atmosphere/shaders/transmittance_calc_vs.glsl new file mode 100644 index 0000000000..d9ea954427 --- /dev/null +++ b/modules/atmosphere/shaders/transmittance_calc_vs.glsl @@ -0,0 +1,31 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2016 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +layout(location = 0) in vec4 in_position; + +void main() { + gl_Position = in_position; +} diff --git a/modules/base/rendering/renderableplane.cpp b/modules/base/rendering/renderableplane.cpp index 62701f1256..c4309072f5 100644 --- a/modules/base/rendering/renderableplane.cpp +++ b/modules/base/rendering/renderableplane.cpp @@ -243,6 +243,9 @@ void RenderablePlane::render(const RenderData& data, RendererTasks&) { _shader->setUniform("modelViewProjectionTransform", data.camera.projectionMatrix() * glm::mat4(modelViewTransform)); + _shader->setUniform("modelViewTransform", + glm::mat4(data.camera.combinedViewMatrix() * glm::dmat4(modelViewTransform))); + ghoul::opengl::TextureUnit unit; unit.activate(); _texture->bind(); diff --git a/modules/base/rendering/renderablesphere.cpp b/modules/base/rendering/renderablesphere.cpp index 39fbba6d09..c65e1afda3 100644 --- a/modules/base/rendering/renderablesphere.cpp +++ b/modules/base/rendering/renderablesphere.cpp @@ -84,6 +84,19 @@ namespace { "This value determines percentage of the sphere is visible before starting " "fading-out it." }; + + static const openspace::properties::Property::PropertyInfo FadeInThreshouldInfo = { + "FadeInThreshould", + "Fade-In Threshould", + "Distance from center of MilkyWay from where the astronomical object starts to " + "fade in." + }; + + static const openspace::properties::Property::PropertyInfo DisableFadeInOuInfo = { + "DisableFadeInOu", + "Disable Fade-In/Fade-Out effects", + "Enables/Disables the Fade-In/Out effects." + }; } // namespace namespace openspace { @@ -129,7 +142,19 @@ documentation::Documentation RenderableSphere::Documentation() { new DoubleInRangeVerifier(0.0, 1.0), Optional::Yes, FadeOutThreshouldInfo.description - } + }, + { + FadeInThreshouldInfo.identifier, + new DoubleVerifier, + Optional::Yes, + FadeInThreshouldInfo.description + }, + { + DisableFadeInOuInfo.identifier, + new BoolVerifier, + Optional::Yes, + DisableFadeInOuInfo.description + }, } }; } @@ -142,7 +167,9 @@ RenderableSphere::RenderableSphere(const ghoul::Dictionary& dictionary) , _size(SizeInfo, 1.f, 0.f, 1e35f) , _segments(SegmentsInfo, 8, 4, 1000) , _transparency(TransparencyInfo, 1.f, 0.f, 1.f) + , _disableFadeInDistance(DisableFadeInOuInfo, true) , _fadeOutThreshold(-1.0) + , _fadeInThreshold(0.0) , _shader(nullptr) , _texture(nullptr) , _sphere(nullptr) @@ -211,7 +238,19 @@ RenderableSphere::RenderableSphere(const ghoul::Dictionary& dictionary) if (dictionary.hasKey(FadeOutThreshouldInfo.identifier)) { _fadeOutThreshold = static_cast( dictionary.value(FadeOutThreshouldInfo.identifier) - ); + ); + } + + if (dictionary.hasKey(FadeInThreshouldInfo.identifier)) { + _fadeInThreshold = static_cast( + dictionary.value(FadeInThreshouldInfo.identifier) + ); + } + + if (dictionary.hasKey(FadeOutThreshouldInfo.identifier) || + dictionary.hasKey(FadeInThreshouldInfo.identifier)) { + _disableFadeInDistance.set(false); + addProperty(_disableFadeInDistance); } } @@ -260,23 +299,35 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) { setPscUniforms(*_shader.get(), data.camera, data.position); + float adjustedTransparency = _transparency; + + if (_fadeInThreshold > 0.0) { + float distCamera = glm::length(data.camera.positionVec3()); + float funcValue = static_cast( + (1.0 / double(_fadeInThreshold/1E24))*(distCamera / 1E24) + ); + + adjustedTransparency *= funcValue > 1.0 ? 1.0 : funcValue; + } + if (_fadeOutThreshold > -1.0) { - double distCamera = glm::distance( + float distCamera = glm::distance( data.camera.positionVec3(), data.position.dvec3() ); double term = std::exp( (-distCamera + _size * _fadeOutThreshold) / (_size * _fadeOutThreshold) ); + + adjustedTransparency *= static_cast(term / (term + 1.0)); + } + + // Performance wise + if (adjustedTransparency < 0.01) { + return; + } - _shader->setUniform( - "alpha", - _transparency * static_cast(term / (term + 1.0)) - ); - } - else { - _shader->setUniform("alpha", _transparency); - } + _shader->setUniform("alpha", adjustedTransparency); ghoul::opengl::TextureUnit unit; unit.activate(); diff --git a/modules/base/rendering/renderablesphere.h b/modules/base/rendering/renderablesphere.h index e5a5226c36..3da5a5c6de 100644 --- a/modules/base/rendering/renderablesphere.h +++ b/modules/base/rendering/renderablesphere.h @@ -70,7 +70,10 @@ private: properties::FloatProperty _transparency; + properties::BoolProperty _disableFadeInDistance; + float _fadeOutThreshold; + float _fadeInThreshold; std::unique_ptr _shader; std::unique_ptr _texture; diff --git a/modules/base/rendering/renderabletrail.cpp b/modules/base/rendering/renderabletrail.cpp index 7a0ddd9954..812fa6ed39 100644 --- a/modules/base/rendering/renderabletrail.cpp +++ b/modules/base/rendering/renderabletrail.cpp @@ -250,7 +250,7 @@ void RenderableTrail::render(const RenderData& data, RendererTasks&) { glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale)); _programObject->setUniform("projectionTransform", data.camera.projectionMatrix()); - + _programObject->setUniform("color", _lineColor); _programObject->setUniform("useLineFade", _useLineFade); if (_useLineFade) { @@ -270,7 +270,7 @@ void RenderableTrail::render(const RenderData& data, RendererTasks&) { if (usingFramebufferRenderer) { glDepthMask(false); - glBlendFunc(GL_SRC_ALPHA, GL_ONE); + //glBlendFunc(GL_SRC_ALPHA, GL_ONE); } bool renderLines = diff --git a/modules/base/shaders/grid_fs.glsl b/modules/base/shaders/grid_fs.glsl index ae1a552211..8e36efffba 100644 --- a/modules/base/shaders/grid_fs.glsl +++ b/modules/base/shaders/grid_fs.glsl @@ -26,12 +26,16 @@ #include "PowerScaling/powerScaling_fs.hglsl" in float vs_screenSpaceDepth; +in vec4 vs_positionViewSpace; uniform vec4 gridColor; Fragment getFragment() { Fragment frag; - frag.color = gridColor; - frag.depth = vs_screenSpaceDepth; + frag.color = gridColor; + frag.depth = vs_screenSpaceDepth; + frag.gPosition = vs_positionViewSpace; + frag.gOtherData = vec4(0.0, 0.0, 0.0, 1.0); + frag.gNormal = vec4(0.0, 0.0, 0.0, 1.0); return frag; } diff --git a/modules/base/shaders/grid_vs.glsl b/modules/base/shaders/grid_vs.glsl index 878ac109cd..e70a6ad49d 100644 --- a/modules/base/shaders/grid_vs.glsl +++ b/modules/base/shaders/grid_vs.glsl @@ -29,14 +29,17 @@ layout(location = 0) in vec3 in_position; out float vs_screenSpaceDepth; +out vec4 vs_positionViewSpace; uniform mat4 modelViewTransform; uniform mat4 projectionTransform; void main() { - vec4 positionClipSpace = projectionTransform * modelViewTransform * vec4(in_position, 1.0); + vec4 positionViewSpace = modelViewTransform * vec4(in_position, 1.0); + vec4 positionClipSpace = projectionTransform * positionViewSpace; vec4 positionScreenSpace = z_normalization(positionClipSpace); - vs_screenSpaceDepth = positionScreenSpace.w; - + vs_screenSpaceDepth = positionScreenSpace.w; + vs_positionViewSpace = positionViewSpace; + gl_Position = positionScreenSpace; } diff --git a/modules/base/shaders/plane_fs.glsl b/modules/base/shaders/plane_fs.glsl index f0711af866..bd5aca7084 100644 --- a/modules/base/shaders/plane_fs.glsl +++ b/modules/base/shaders/plane_fs.glsl @@ -26,6 +26,8 @@ in float vs_screenSpaceDepth; in vec2 vs_st; +in vec4 vs_gPosition; +in vec3 vs_gNormal; uniform sampler2D texture1; uniform bool additiveBlending; @@ -49,5 +51,11 @@ Fragment getFragment() { if (additiveBlending) { frag.blend = BLEND_MODE_ADDITIVE; } + + // G-Buffer + frag.gOtherData = vec4(frag.color.xyz, 1.0); + frag.gPosition = vs_gPosition; + frag.gNormal = vec4(vs_gNormal, 1.0); + return frag; } diff --git a/modules/base/shaders/plane_vs.glsl b/modules/base/shaders/plane_vs.glsl index 10a044d23d..477821a10a 100644 --- a/modules/base/shaders/plane_vs.glsl +++ b/modules/base/shaders/plane_vs.glsl @@ -32,9 +32,12 @@ layout(location = 1) in vec2 in_st; out vec2 vs_st; out float vs_screenSpaceDepth; out vec4 vs_positionScreenSpace; +// G-Buffer +out vec4 vs_gPosition; +out vec3 vs_gNormal; uniform mat4 modelViewProjectionTransform; - +uniform mat4 modelViewTransform; void main() { vec4 position = vec4(in_position.xyz * pow(10, in_position.w), 1); @@ -43,6 +46,10 @@ void main() { gl_Position = positionScreenSpace; + // G-Buffer + vs_gNormal = vec3(0.0); + vs_gPosition = vec4(modelViewTransform * position); // Must be in SGCT eye space; + vs_st = in_st; vs_screenSpaceDepth = positionScreenSpace.w; } diff --git a/modules/base/shaders/renderabletrail_fs.glsl b/modules/base/shaders/renderabletrail_fs.glsl index 810e90f956..d52a1dfec9 100644 --- a/modules/base/shaders/renderabletrail_fs.glsl +++ b/modules/base/shaders/renderabletrail_fs.glsl @@ -25,6 +25,7 @@ #include "fragment.glsl" in vec4 vs_positionScreenSpace; +in vec4 vs_gPosition; in float fade; uniform vec3 color; @@ -50,5 +51,12 @@ Fragment getFragment() { frag.color.a *= 1.0 - smoothstep(1.0 - Delta, 1.0, dot(circCoord, circCoord)); } + // G-Buffer + frag.gOtherData = vec4(frag.color.xyz, 1.0); + frag.gPosition = vs_gPosition; + // There is no normal here + // TODO: Add the correct normal if necessary (JCC) + frag.gNormal = vec4(0.0, 0.0, 0.0, 1.0); + return frag; } diff --git a/modules/base/shaders/renderabletrail_vs.glsl b/modules/base/shaders/renderabletrail_vs.glsl index 28aa915a9f..d7c901d622 100644 --- a/modules/base/shaders/renderabletrail_vs.glsl +++ b/modules/base/shaders/renderabletrail_vs.glsl @@ -29,6 +29,7 @@ layout(location = 0) in vec3 in_point_position; out vec4 vs_positionScreenSpace; +out vec4 vs_gPosition; out float fade; uniform dmat4 modelViewTransform; @@ -70,9 +71,8 @@ void main() { fade = 1.0; } - vs_positionScreenSpace = z_normalization( - projectionTransform * vec4(modelViewTransform * dvec4(in_point_position, 1)) - ); + vs_gPosition = vec4(modelViewTransform * dvec4(in_point_position, 1)); + vs_positionScreenSpace = z_normalization(projectionTransform * vs_gPosition); gl_PointSize = (stride == 1 || int(modId) % stride == 0) ? float(pointSize) : float(pointSize) / 2; gl_Position = vs_positionScreenSpace; diff --git a/modules/base/shaders/sphere_fs.glsl b/modules/base/shaders/sphere_fs.glsl index 88237269e4..43aea222ef 100644 --- a/modules/base/shaders/sphere_fs.glsl +++ b/modules/base/shaders/sphere_fs.glsl @@ -27,6 +27,7 @@ in vec2 vs_st; in vec4 vs_position; +in vec4 vs_gPosition; uniform float time; uniform sampler2D texture1; @@ -35,7 +36,6 @@ uniform float alpha; Fragment getFragment() { vec4 position = vs_position; - vec2 texCoord = vs_st; // Why is this here? ---abock texCoord.s = 1 - texCoord.s; @@ -43,6 +43,14 @@ Fragment getFragment() { Fragment frag; frag.color = texture(texture1, texCoord) * vec4(1.0, 1.0, 1.0, alpha); - frag.depth = pscDepth(position);; + frag.depth = pscDepth(position); + + // G-Buffer + frag.gOtherData = vec4(frag.color.xyz, 1.0); + frag.gPosition = vs_gPosition; + // There is no normal here + // TODO: Add the correct normal (JCC) + frag.gNormal = vec4(0.0, 0.0, 0.0, 1.0); + return frag; -} + } diff --git a/modules/base/shaders/sphere_vs.glsl b/modules/base/shaders/sphere_vs.glsl index bfd1cb83c9..62f55bc54e 100644 --- a/modules/base/shaders/sphere_vs.glsl +++ b/modules/base/shaders/sphere_vs.glsl @@ -32,6 +32,7 @@ layout(location = 1) in vec2 in_st; out vec2 vs_st; out vec4 vs_position; out float s; +out vec4 vs_gPosition; uniform mat4 ViewProjection; uniform mat4 ModelTransform; @@ -45,11 +46,13 @@ void main() { 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 1.0) * ModelTransform; + vec4 position = pscTransform(tmp, mt); vs_position = tmp; vs_st = in_st; - - vec4 position = pscTransform(tmp, mt); + vs_gPosition = position; + position = ViewProjection * position; gl_Position = z_normalization(position); + } diff --git a/modules/base/shaders/texture_clean_fs.glsl b/modules/base/shaders/texture_clean_fs.glsl new file mode 100644 index 0000000000..6d152a195c --- /dev/null +++ b/modules/base/shaders/texture_clean_fs.glsl @@ -0,0 +1,31 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +out vec4 renderTableColor; + +void main() { + renderTableColor = vec4(0.0); +} diff --git a/modules/base/shaders/texture_clean_vs.glsl b/modules/base/shaders/texture_clean_vs.glsl new file mode 100644 index 0000000000..99dea0b9a6 --- /dev/null +++ b/modules/base/shaders/texture_clean_vs.glsl @@ -0,0 +1,31 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +layout(location = 0) in vec3 in_position; + +void main() { + gl_Position = vec4(in_position, 1.0); +} diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp index 8765b8b393..24bf2e0515 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp @@ -161,11 +161,47 @@ namespace { "astronomical objects." }; + static const openspace::properties::Property::PropertyInfo TransformationMatrixInfo = + { + "TransformationMatrix", + "Transformation Matrix", + "Transformation matrix to be applied to each astronomical object." + }; + static const openspace::properties::Property::PropertyInfo RenderOptionInfo = { "RenderOptionInfo", "Render Option", "Debug option for rendering of billboards and texts." }; + + static const openspace::properties::Property::PropertyInfo FadeInDistancesInfo = { + "FadeInDistances", + "Fade-In Start and End Distances", + "These values determine the initial and final distances from the center of " + "our galaxy from which the astronomical object will start and end " + "fading-in." + }; + + static const openspace::properties::Property::PropertyInfo DisableFadeInInfo = { + "DisableFadeIn", + "Disable Fade-in effect", + "Enables/Disables the Fade-in effect." + }; + + static const openspace::properties::Property::PropertyInfo BillboardMaxSizeInfo = { + "BillboardMaxSize", + "Billboard Max Size in Pixels", + "The max size (in pixels) for the billboard representing the astronomical " + "object." + }; + + static const openspace::properties::Property::PropertyInfo BillboardMinSizeInfo = { + "BillboardMinSize", + "Billboard Min Size in Pixels", + "The min size (in pixels) for the billboard representing the astronomical " + "object." + }; + } // namespace namespace openspace { @@ -271,6 +307,36 @@ documentation::Documentation RenderableBillboardsCloud::Documentation() { new Vector2ListVerifier, Optional::Yes, ColorRangeInfo.description + }, + { + TransformationMatrixInfo.identifier, + new Matrix4x4Verifier, + Optional::Yes, + TransformationMatrixInfo.description + }, + { + FadeInDistancesInfo.identifier, + new Vector2Verifier, + Optional::Yes, + FadeInDistancesInfo.description + }, + { + DisableFadeInInfo.identifier, + new BoolVerifier, + Optional::Yes, + DisableFadeInInfo.description + }, + { + BillboardMaxSizeInfo.identifier, + new DoubleVerifier, + Optional::Yes, + BillboardMaxSizeInfo.description + }, + { + BillboardMinSizeInfo.identifier, + new DoubleVerifier, + Optional::Yes, + BillboardMinSizeInfo.description } } }; @@ -306,6 +372,10 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di , _drawElements(DrawElementsInfo, true) , _drawLabels(DrawLabelInfo, false) , _colorOption(ColorOptionInfo, properties::OptionProperty::DisplayType::Dropdown) + , _fadeInDistance(FadeInDistancesInfo, glm::vec2(0.0f), glm::vec2(0.0), glm::vec2(100.0)) + , _disableFadeInDistance(DisableFadeInInfo, true) + , _billboardMaxSize(BillboardMaxSizeInfo, 400.0, 0.0, 1000.0) + , _billboardMinSize(BillboardMinSizeInfo, 0.0, 0.0, 100.0) , _renderOption(RenderOptionInfo, properties::OptionProperty::DisplayType::Dropdown) , _polygonTexture(nullptr) , _spriteTexture(nullptr) @@ -317,6 +387,7 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di , _labelFile("") , _colorOptionString("") , _unit(Parsec) + , _transformationMatrix(glm::dmat4(1.0)) , _nValuesPerAstronomicalObject(0) , _vao(0) , _vbo(0) @@ -460,7 +531,7 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di _labelFile = absPath(dictionary.value( LabelFileInfo.identifier - )); + )); _hasLabel = true; if (dictionary.hasKey(TextColorInfo.identifier)) { @@ -479,7 +550,7 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di if (dictionary.hasKey(LabelMinSizeInfo.identifier)) { _textMinSize = static_cast(dictionary.value(LabelMinSizeInfo.identifier)); - } + } addProperty(_textMinSize); if (dictionary.hasKey(LabelMaxSizeInfo.identifier)) { @@ -487,6 +558,37 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di } addProperty(_textMaxSize); } + + if (dictionary.hasKey(TransformationMatrixInfo.identifier)) { + _transformationMatrix = dictionary.value( + TransformationMatrixInfo.identifier + ); + } + + if (dictionary.hasKey(FadeInDistancesInfo.identifier)) { + glm::vec2 fadeInValue = dictionary.value( + FadeInDistancesInfo.identifier + ); + _fadeInDistance.set(fadeInValue); + _disableFadeInDistance.set(false); + addProperty(_fadeInDistance); + addProperty(_disableFadeInDistance); + } + + if (dictionary.hasKey(BillboardMaxSizeInfo.identifier)) { + _billboardMaxSize = static_cast( + dictionary.value(BillboardMaxSizeInfo.identifier) + ); + addProperty(_billboardMaxSize); + } + + if (dictionary.hasKey(BillboardMinSizeInfo.identifier)) { + _billboardMinSize = static_cast( + dictionary.value(BillboardMinSizeInfo.identifier) + ); + addProperty(_billboardMinSize); + } + } bool RenderableBillboardsCloud::isReady() const { @@ -554,8 +656,13 @@ void RenderableBillboardsCloud::deinitializeGL() { } } -void RenderableBillboardsCloud::renderBillboards(const RenderData& data, const glm::dmat4& modelViewMatrix, - const glm::dmat4& projectionMatrix, const glm::vec3& orthoRight, const glm::vec3& orthoUp) { +void RenderableBillboardsCloud::renderBillboards(const RenderData& data, + const glm::dmat4& modelViewMatrix, + const glm::dmat4& worldToModelTransform, + const glm::dvec3& orthoRight, + const glm::dvec3& orthoUp, + float fadeInVariable) +{ glDepthMask(false); // Saving current OpenGL state @@ -583,18 +690,28 @@ void RenderableBillboardsCloud::renderBillboards(const RenderData& data, const g using IgnoreError = ghoul::opengl::ProgramObject::IgnoreError; _program->setIgnoreUniformLocationError(IgnoreError::Yes); + glm::dmat4 projMatrix = glm::dmat4(data.camera.projectionMatrix()); _program->setUniform("screenSize", glm::vec2(OsEng.renderEngine().renderingResolution())); - _program->setUniform("projection", projectionMatrix); + _program->setUniform("projection", projMatrix); _program->setUniform("modelViewTransform", modelViewMatrix); - _program->setUniform("modelViewProjectionTransform", glm::dmat4(projectionMatrix) * modelViewMatrix); + _program->setUniform("modelViewProjectionTransform", projMatrix * modelViewMatrix); + _program->setUniform("cameraPosition", glm::dvec3(worldToModelTransform * + glm::dvec4(data.camera.positionVec3(), 1.0))); + _program->setUniform("cameraLookUp", glm::dvec3(worldToModelTransform * + glm::dvec4(data.camera.lookUpVectorWorldSpace(), 1.0))); + + //_program->setUniform("cameraPosition", data.camera.positionVec3()); + //_program->setUniform("cameraLookUp", data.camera.lookUpVectorWorldSpace()); + - _program->setUniform("cameraPosition", data.camera.positionVec3()); - _program->setUniform("cameraLookUp", data.camera.lookUpVectorWorldSpace()); _program->setUniform("renderOption", _renderOption.value()); - glm::dvec4 centerScreenWorld = glm::inverse(data.camera.combinedViewMatrix()) * glm::dvec4(0.0, 0.0, 0.0, 1.0); + glm::dvec4 centerScreenWorld = glm::inverse(data.camera.combinedViewMatrix()) * + glm::dvec4(0.0, 0.0, 0.0, 1.0); + _program->setUniform("centerScreenInWorldPosition", centerScreenWorld); - _program->setUniform("minBillboardSize", 1.f); // in pixels + _program->setUniform("minBillboardSize", _billboardMinSize); // in pixels + _program->setUniform("maxBillboardSize", _billboardMaxSize); // in pixels _program->setUniform("color", _pointColor); _program->setUniform("sides", 4); _program->setUniform("alphaValue", _alphaValue); @@ -603,6 +720,13 @@ void RenderableBillboardsCloud::renderBillboards(const RenderData& data, const g _program->setUniform("up", orthoUp); _program->setUniform("right", orthoRight); + _program->setUniform("fadeInValue", fadeInVariable); + + GLint viewport[4]; + glGetIntegerv(GL_VIEWPORT, viewport); + _program->setUniform("screenSize", glm::vec2(viewport[2], viewport[3])); + + ghoul::opengl::TextureUnit spriteTextureUnit; if (_hasSpriteTexture) { spriteTextureUnit.activate(); @@ -647,8 +771,12 @@ void RenderableBillboardsCloud::renderBillboards(const RenderData& data, const g } -void RenderableBillboardsCloud::renderLabels(const RenderData& data, const glm::dmat4& modelViewProjectionMatrix, - const glm::vec3& orthoRight, const glm::vec3& orthoUp) { +void RenderableBillboardsCloud::renderLabels(const RenderData& data, + const glm::dmat4& modelViewProjectionMatrix, + const glm::dvec3& orthoRight, + const glm::dvec3& orthoUp, + float fadeInVariable) +{ RenderEngine& renderEngine = OsEng.renderEngine(); _fontRenderer->setFramebufferSize(renderEngine.renderingResolution()); @@ -678,6 +806,8 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data, const glm:: break; } + glm::vec4 textColor = _textColor; + textColor.a *= fadeInVariable; for (const std::pair& pair : _labelData) { //glm::vec3 scaledPos(_transformationMatrix * glm::dvec4(pair.first, 1.0)); glm::vec3 scaledPos(pair.first); @@ -685,7 +815,7 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data, const glm:: _fontRenderer->render( *_font, scaledPos, - _textColor, + textColor, pow(10.0, _textSize.value()), _textMinSize, _textMaxSize, @@ -701,6 +831,58 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data, const glm:: } void RenderableBillboardsCloud::render(const RenderData& data, RendererTasks&) { + + float scale = 0.0; + switch (_unit) { + case Meter: + scale = 1.0; + break; + case Kilometer: + scale = 1e3; + break; + case Parsec: + scale = PARSEC; + break; + case Kiloparsec: + scale = 1e3 * PARSEC; + break; + case Megaparsec: + scale = 1e6 * PARSEC; + break; + case Gigaparsec: + scale = 1e9 * PARSEC; + break; + case GigalightYears: + scale = 306391534.73091 * PARSEC; + break; + } + + float fadeInVariable = 1.0f; + if (!_disableFadeInDistance) { + float distCamera = glm::length(data.camera.positionVec3()); + + /* + // Linear Fading + float funcValue = static_cast((1.0 / double(_fadeInDistance*scale))*(distCamera)); + fadeInVariable *= funcValue > 1.0 ? 1.0 : funcValue; + + if (funcValue < 0.01) { + return; + } + */ + + glm::vec2 fadeRange = _fadeInDistance; + float a = 1.0f / ((fadeRange.y - fadeRange.x) * scale); + float b = -(fadeRange.x / (fadeRange.y - fadeRange.x)); + float funcValue = a * distCamera + b; + fadeInVariable *= funcValue > 1.0 ? 1.0 : funcValue; + + if (funcValue < 0.01) { + return; + } + } + + glm::dmat4 modelMatrix = glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * // Translation glm::dmat4(data.modelTransform.rotation) * // Spice rotation @@ -709,24 +891,59 @@ void RenderableBillboardsCloud::render(const RenderData& data, RendererTasks&) { glm::dmat4 modelViewMatrix = data.camera.combinedViewMatrix() * modelMatrix; glm::mat4 viewMatrix = data.camera.viewMatrix(); glm::mat4 projectionMatrix = data.camera.projectionMatrix(); - glm::dmat4 modelViewProjectionMatrix = glm::dmat4(projectionMatrix) * modelViewMatrix; - glm::vec3 lookup = data.camera.lookUpVectorWorldSpace(); - glm::vec3 viewDirection = data.camera.viewDirectionWorldSpace(); + glm::dmat4 modelViewProjectionMatrix = glm::dmat4(projectionMatrix) * + modelViewMatrix; + + glm::dmat4 worldToModelTransform = glm::inverse(modelMatrix); + + /*glm::dmat4 internalCameraMatrix = data.camera.viewRotationMatrix() * + glm::inverse(glm::translate(glm::dmat4(1.0), data.camera.positionVec3())); + glm::dmat4 invInternalCameraMatrix = glm::inverse(internalCameraMatrix); + glm::vec3 lookup = worldToModelTransform * invInternalCameraMatrix * glm::dvec4(data.camera.lookUpVectorWorldSpace(), 0.0); + glm::vec3 viewDirection = worldToModelTransform * invInternalCameraMatrix * glm::dvec4(data.camera.viewDirectionWorldSpace(), 0.0); + + glm::vec3 right = glm::cross(viewDirection, lookup); glm::vec3 up = glm::cross(right, viewDirection); - glm::dmat4 worldToModelTransform = glm::inverse(modelMatrix); - glm::vec3 orthoRight = glm::normalize(glm::vec3(worldToModelTransform * glm::vec4(right, 0.0))); - glm::vec3 orthoUp = glm::normalize(glm::vec3(worldToModelTransform * glm::vec4(up, 0.0))); + glm::vec3 orthoRight = glm::normalize(right); + glm::vec3 orthoUp = glm::normalize(up);*/ + + /* + glm::dmat4 internalCameraMatrix = data.camera.viewRotationMatrix() * + glm::inverse(glm::translate(glm::dmat4(1.0), data.camera.positionVec3())); + glm::dmat4 invInternalCameraMatrix = glm::inverse(internalCameraMatrix); + glm::dvec4 lookup = worldToModelTransform * glm::dvec4(data.camera.lookUpVectorWorldSpace(), 0.0); + glm::dvec4 viewDirection = worldToModelTransform * glm::dvec4(data.camera.viewDirectionWorldSpace(), 0.0); + glm::vec3 right = glm::cross(glm::vec3(viewDirection), glm::vec3(lookup)); + glm::vec3 up = glm::cross(right, glm::vec3(viewDirection)); + + glm::vec3 orthoRight = glm::normalize(right); + glm::vec3 orthoUp = glm::normalize(up); + */ + + + // Almost Working + glm::dmat4 invMVPParts = worldToModelTransform * glm::inverse(data.camera.combinedViewMatrix()) * + glm::inverse(glm::dmat4(projectionMatrix)); + glm::dvec3 orthoRight = glm::dvec3(glm::normalize(glm::dvec3(invMVPParts * glm::dvec4(1.0, 0.0, 0.0, 0.0)))); + glm::dvec3 orthoUp = glm::dvec3(glm::normalize(glm::dvec3(invMVPParts * glm::dvec4(0.0, 1.0, 0.0, 0.0)))); if (_hasSpeckFile) { - renderBillboards(data, modelViewMatrix, projectionMatrix, orthoRight, orthoUp); + renderBillboards( + data, + modelViewMatrix, + worldToModelTransform, + orthoRight, + orthoUp, + fadeInVariable + ); } if (_drawLabels && _hasLabel) { - renderLabels(data, modelViewProjectionMatrix, orthoRight, orthoUp); + renderLabels(data, modelViewProjectionMatrix, orthoRight, orthoUp, fadeInVariable); } } @@ -1119,12 +1336,18 @@ bool RenderableBillboardsCloud::readLabelFile() { dummy.clear(); while (str >> dummy) { + if (dummy == "#") { + break; + } + label += " " + dummy; dummy.clear(); } - _labelData.push_back(std::make_pair(position, label)); - + glm::vec3 transformedPos = glm::vec3( + _transformationMatrix * glm::dvec4(position, 1.0) + ); + _labelData.push_back(std::make_pair(transformedPos, label)); } while (!file.eof()); return true; @@ -1247,13 +1470,20 @@ void RenderableBillboardsCloud::createDataSlice() { } } - for (size_t i = 0; i < _fullData.size(); i += _nValuesPerAstronomicalObject) { - glm::dvec4 transformedPos = glm::dvec4(_fullData[i + 0], _fullData[i + 1], _fullData[i + 2], 1.0); + float biggestCoord = -1.0f; + for (size_t i = 0; i < _fullData.size(); i += _nValuesPerAstronomicalObject) { + glm::dvec4 transformedPos = _transformationMatrix * glm::dvec4( + _fullData[i + 0], + _fullData[i + 1], + _fullData[i + 2], + 1.0 + ); glm::vec4 position(glm::vec3(transformedPos), static_cast(_unit)); if (_hasColorMapFile) { for (auto j = 0; j < 4; ++j) { _slicedData.push_back(position[j]); + biggestCoord = biggestCoord < position[j] ? position[j] : biggestCoord; } // Finds from which bin to get the color. // Note: the first color in the colormap file @@ -1279,6 +1509,7 @@ void RenderableBillboardsCloud::createDataSlice() { } } } + _fadeInDistance.setMaxValue(glm::vec2(10.0f * biggestCoord)); } void RenderableBillboardsCloud::createPolygonTexture() { @@ -1363,7 +1594,8 @@ void RenderableBillboardsCloud::renderPolygonGeometry(GLuint vao) { ghoul::opengl::ProgramObject::Build("RenderableBillboardsCloud_Polygon", absPath("${MODULE_DIGITALUNIVERSE}/shaders/billboardpolygon_vs.glsl"), absPath("${MODULE_DIGITALUNIVERSE}/shaders/billboardpolygon_fs.glsl"), - absPath("${MODULE_DIGITALUNIVERSE}/shaders/billboardpolygon_gs.glsl")); + absPath("${MODULE_DIGITALUNIVERSE}/shaders/billboardpolygon_gs.glsl") + ); program->activate(); static const float black[] = { 0.0f, 0.0f, 0.0f, 0.0f }; diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.h b/modules/digitaluniverse/rendering/renderablebillboardscloud.h index f24ac284cf..708e9530aa 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.h +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.h @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -90,9 +91,10 @@ private: void loadPolygonGeometryForRendering(); void renderPolygonGeometry(GLuint vao); void renderBillboards(const RenderData& data, const glm::dmat4& modelViewMatrix, - const glm::dmat4& projectionMatrix, const glm::vec3& orthoRight, const glm::vec3& orthoUp); + const glm::dmat4& worldToModelTransform, const glm::dvec3& orthoRight, + const glm::dvec3& orthoUp, float fadeInVariable); void renderLabels(const RenderData& data, const glm::dmat4& modelViewProjectionMatrix, - const glm::vec3& orthoRight, const glm::vec3& orthoUp); + const glm::dvec3& orthoRight, const glm::dvec3& orthoUp, float fadeInVariable); bool loadData(); bool readSpeckFile(); @@ -126,6 +128,10 @@ private: properties::BoolProperty _drawElements; properties::BoolProperty _drawLabels; properties::OptionProperty _colorOption; + properties::Vec2Property _fadeInDistance; + properties::BoolProperty _disableFadeInDistance; + properties::FloatProperty _billboardMaxSize; + properties::FloatProperty _billboardMinSize; // DEBUG: properties::OptionProperty _renderOption; @@ -152,9 +158,11 @@ private: std::unordered_map _variableDataPositionMap; std::unordered_map _optionConversionMap; std::vector _colorRangeData; - + int _nValuesPerAstronomicalObject; + glm::dmat4 _transformationMatrix; + GLuint _vao; GLuint _vbo; diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.cpp b/modules/digitaluniverse/rendering/renderabledumeshes.cpp index 6ff5a5b7a5..b34ea13d04 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.cpp +++ b/modules/digitaluniverse/rendering/renderabledumeshes.cpp @@ -127,7 +127,8 @@ namespace { "Determines whether labels should be drawn or hidden." }; - static const openspace::properties::Property::PropertyInfo TransformationMatrixInfo = { + static const openspace::properties::Property::PropertyInfo TransformationMatrixInfo = + { "TransformationMatrix", "Transformation Matrix", "Transformation matrix to be applied to each astronomical object." @@ -163,8 +164,8 @@ documentation::Documentation RenderableDUMeshes::Documentation() { KeyFile, new StringVerifier, Optional::No, - "The path to the SPECK file that contains information about the astronomical " - "object being rendered." + "The path to the SPECK file that contains information about the " + "astronomical object being rendered." }, { keyColor, @@ -243,12 +244,9 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) , _dataIsDirty(true) , _textColorIsDirty(true) , _hasLabel(false) - , _labelDataIsDirty(true) - , _textMinSize(0) - , _textMaxSize(200) + , _labelDataIsDirty(true) , _alphaValue(TransparencyInfo, 1.f, 0.f, 1.f) , _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 64.f) - //, _pointColor(ColorInfo, glm::vec3(1.f, 0.4f, 0.2f), glm::vec3(0.f, 0.f, 0.f), glm::vec3(1.0f, 1.0f, 1.0f)) , _textColor( TextColorInfo, glm::vec4(1.0f, 1.0, 1.0f, 1.f), @@ -258,6 +256,8 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) , _textSize(TextSizeInfo, 8.0, 0.5, 24.0) , _drawElements(DrawElementsInfo, true) , _drawLabels(DrawLabelInfo, false) + , _textMinSize(LabelMinSizeInfo, 8.0, 0.5, 24.0) + , _textMaxSize(LabelMaxSizeInfo, 500.0, 0.0, 1000.0) , _renderOption(RenderOptionInfo, properties::OptionProperty::DisplayType::Dropdown) , _program(nullptr) , _fontRenderer(nullptr) @@ -361,22 +361,30 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) addProperty(_textSize); if (dictionary.hasKey(LabelMinSizeInfo.identifier)) { - _textMinSize = static_cast(dictionary.value(LabelMinSizeInfo.identifier)); + _textMinSize = static_cast( + dictionary.value(LabelMinSizeInfo.identifier) + ); } + addProperty(_textMinSize); if (dictionary.hasKey(LabelMaxSizeInfo.identifier)) { - _textMaxSize = static_cast(dictionary.value(LabelMaxSizeInfo.identifier)); + _textMaxSize = static_cast( + dictionary.value(LabelMaxSizeInfo.identifier) + ); } + addProperty(_textMaxSize); } if (dictionary.hasKey(TransformationMatrixInfo.identifier)) { - _transformationMatrix = dictionary.value(TransformationMatrixInfo.identifier); + _transformationMatrix = dictionary.value( + TransformationMatrixInfo.identifier + ); } if (dictionary.hasKey(MeshColorInfo.identifier)) { ghoul::Dictionary colorDic = dictionary.value( MeshColorInfo.identifier - ); + ); for (int i = 0; i < static_cast(colorDic.size()); ++i) { _meshColorMap.insert({ i + 1, colorDic.value(std::to_string(i + 1)) }); @@ -386,7 +394,8 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) } bool RenderableDUMeshes::isReady() const { - return (_program != nullptr) && (!_renderingMeshesMap.empty() || (!_labelData.empty())); + return (_program != nullptr) && + (!_renderingMeshesMap.empty() || (!_labelData.empty())); } void RenderableDUMeshes::initializeGL() { @@ -409,9 +418,13 @@ void RenderableDUMeshes::initializeGL() { _fontRenderer = std::unique_ptr( ghoul::fontrendering::FontRenderer::createProjectionSubjectText()); if (_font == nullptr) { - size_t _fontSize = 30; - _font = OsEng.fontManager().font("Mono", static_cast(_fontSize), - ghoul::fontrendering::FontManager::Outline::Yes, ghoul::fontrendering::FontManager::LoadGlyphs::No); + size_t _fontSize = 50; + _font = OsEng.fontManager().font( + "Mono", + static_cast(_fontSize), + ghoul::fontrendering::FontManager::Outline::Yes, + ghoul::fontrendering::FontManager::LoadGlyphs::No + ); } } } @@ -436,6 +449,9 @@ void RenderableDUMeshes::renderMeshes(const RenderData&, const glm::dmat4& projectionMatrix) { // Saving current OpenGL state + GLfloat lineWidth = 1.0f; + glGetFloatv(GL_LINE_WIDTH, &lineWidth); + GLboolean blendEnabled = glIsEnabled(GL_BLEND); GLenum blendEquationRGB; GLenum blendEquationAlpha; @@ -461,7 +477,8 @@ void RenderableDUMeshes::renderMeshes(const RenderData&, using IgnoreError = ghoul::opengl::ProgramObject::IgnoreError; _program->setIgnoreUniformLocationError(IgnoreError::Yes); - _program->setUniform("modelViewProjectionTransform", glm::dmat4(projectionMatrix) * modelViewMatrix); + _program->setUniform("modelViewTransform", modelViewMatrix); + _program->setUniform("projectionTransform", projectionMatrix); _program->setUniform("alphaValue", _alphaValue); _program->setUniform("scaleFactor", _scaleFactor); @@ -474,7 +491,9 @@ void RenderableDUMeshes::renderMeshes(const RenderData&, case Solid: break; case Wire: + glLineWidth(2.0); glDrawArrays(GL_LINE_STRIP, 0, pair.second.numV); + glLineWidth(lineWidth); break; case Point: glDrawArrays(GL_POINTS, 0, pair.second.numV); @@ -502,8 +521,11 @@ void RenderableDUMeshes::renderMeshes(const RenderData&, } } -void RenderableDUMeshes::renderLabels(const RenderData& data, const glm::dmat4& modelViewProjectionMatrix, - const glm::vec3& orthoRight, const glm::vec3& orthoUp) { +void RenderableDUMeshes::renderLabels(const RenderData& data, + const glm::dmat4& modelViewProjectionMatrix, + const glm::vec3& orthoRight, + const glm::vec3& orthoUp) +{ RenderEngine& renderEngine = OsEng.renderEngine(); _fontRenderer->setFramebufferSize(renderEngine.renderingResolution()); @@ -562,8 +584,8 @@ void RenderableDUMeshes::render(const RenderData& data, RendererTasks&) { glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale)); glm::dmat4 modelViewMatrix = data.camera.combinedViewMatrix() * modelMatrix; - glm::mat4 projectionMatrix = data.camera.projectionMatrix(); - glm::dmat4 modelViewProjectionMatrix = glm::dmat4(projectionMatrix) * modelViewMatrix; + glm::dmat4 projectionMatrix = data.camera.projectionMatrix(); + glm::dmat4 modelViewProjectionMatrix = projectionMatrix * modelViewMatrix; glm::vec3 lookup = data.camera.lookUpVectorWorldSpace(); glm::vec3 viewDirection = data.camera.viewDirectionWorldSpace(); @@ -571,8 +593,12 @@ void RenderableDUMeshes::render(const RenderData& data, RendererTasks&) { glm::vec3 up = glm::cross(right, viewDirection); glm::dmat4 worldToModelTransform = glm::inverse(modelMatrix); - glm::vec3 orthoRight = glm::normalize(glm::vec3(worldToModelTransform * glm::vec4(right, 0.0))); - glm::vec3 orthoUp = glm::normalize(glm::vec3(worldToModelTransform * glm::vec4(up, 0.0))); + glm::vec3 orthoRight = glm::normalize( + glm::vec3(worldToModelTransform * glm::vec4(right, 0.0)) + ); + glm::vec3 orthoUp = glm::normalize( + glm::vec3(worldToModelTransform * glm::vec4(up, 0.0)) + ); if (_hasSpeckFile) { renderMeshes(data, modelViewMatrix, projectionMatrix); @@ -858,7 +884,9 @@ bool RenderableDUMeshes::readLabelFile() { dummy.clear(); } - glm::vec3 transformedPos = glm::vec3(_transformationMatrix * glm::dvec4(position, 1.0)); + glm::vec3 transformedPos = glm::vec3( + _transformationMatrix * glm::dvec4(position, 1.0) + ); _labelData.push_back(std::make_pair(transformedPos, label)); } while (!file.eof()); @@ -880,7 +908,10 @@ bool RenderableDUMeshes::loadCachedFile(const std::string& file) { int32_t nValues = 0; fileStream.read(reinterpret_cast(&nValues), sizeof(int32_t)); - fileStream.read(reinterpret_cast(&_nValuesPerAstronomicalObject), sizeof(int32_t)); + fileStream.read( + reinterpret_cast(&_nValuesPerAstronomicalObject), + sizeof(int32_t) + ); _fullData.resize(nValues); fileStream.read(reinterpret_cast(&_fullData[0]), @@ -908,8 +939,13 @@ bool RenderableDUMeshes::saveCachedFile(const std::string& file) const { } fileStream.write(reinterpret_cast(&nValues), sizeof(int32_t)); - int32_t nValuesPerAstronomicalObject = static_cast(_nValuesPerAstronomicalObject); - fileStream.write(reinterpret_cast(&nValuesPerAstronomicalObject), sizeof(int32_t)); + int32_t nValuesPerAstronomicalObject = static_cast( + _nValuesPerAstronomicalObject + ); + fileStream.write( + reinterpret_cast(&nValuesPerAstronomicalObject), + sizeof(int32_t) + ); size_t nBytes = nValues * sizeof(_fullData[0]); fileStream.write(reinterpret_cast(&_fullData[0]), nBytes); @@ -927,34 +963,34 @@ void RenderableDUMeshes::createMeshes() { if (_dataIsDirty && _hasSpeckFile) { LDEBUG("Creating planes"); - std::unordered_map::iterator it = _renderingMeshesMap.begin(); - std::unordered_map::iterator itEnd = _renderingMeshesMap.end(); + std::unordered_map::iterator itEnd = + _renderingMeshesMap.end(); for (; it != itEnd; ++it) { float scale = 0.0; switch (_unit) { - case Meter: - scale = 1.0; - break; - case Kilometer: - scale = 1e3; - break; - case Parsec: - scale = PARSEC; - break; - case Kiloparsec: - scale = 1e3 * PARSEC; - break; - case Megaparsec: - scale = 1e6 * PARSEC; - break; - case Gigaparsec: - scale = 1e9 * PARSEC; - break; - case GigalightYears: - scale = 306391534.73091 * PARSEC; - break; + case Meter: + scale = 1.0; + break; + case Kilometer: + scale = 1e3; + break; + case Parsec: + scale = PARSEC; + break; + case Kiloparsec: + scale = 1e3 * PARSEC; + break; + case Megaparsec: + scale = 1e6 * PARSEC; + break; + case Gigaparsec: + scale = 1e9 * PARSEC; + break; + case GigalightYears: + scale = 306391534.73091 * PARSEC; + break; } for (int v = 0; v < static_cast(it->second.vertices.size()); ++v) { @@ -971,12 +1007,17 @@ void RenderableDUMeshes::createMeshes() { glBindVertexArray(vao); glBindBuffer(GL_ARRAY_BUFFER, vbo); //glBufferData(GL_ARRAY_BUFFER, it->second.numV * sizeof(GLfloat), - glBufferData(GL_ARRAY_BUFFER, it->second.vertices.size() * sizeof(GLfloat), - &it->second.vertices[0], GL_STATIC_DRAW); + glBufferData( + GL_ARRAY_BUFFER, + it->second.vertices.size() * sizeof(GLfloat), + &it->second.vertices[0], + GL_STATIC_DRAW + ); // in_position glEnableVertexAttribArray(0); // U and V may not be given by the user - if (it->second.vertices.size() / (it->second.numU * it->second.numV) > 3) { + if (it->second.vertices.size() / (it->second.numU * it->second.numV) > 3) + { glVertexAttribPointer( 0, 3, @@ -994,7 +1035,9 @@ void RenderableDUMeshes::createMeshes() { GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 7, - reinterpret_cast(sizeof(GLfloat) * 3 * i * it->second.numV) + reinterpret_cast( + sizeof(GLfloat) * 3 * i * it->second.numV + ) ); } else { // no U and V: @@ -1004,7 +1047,9 @@ void RenderableDUMeshes::createMeshes() { GL_FLOAT, GL_FALSE, 0, - reinterpret_cast(sizeof(GLfloat) * 3 * i * it->second.numV) + reinterpret_cast( + sizeof(GLfloat) * 3 * i * it->second.numV + ) ); } } @@ -1020,12 +1065,18 @@ void RenderableDUMeshes::createMeshes() { glBindVertexArray(cvao); glBindBuffer(GL_ARRAY_BUFFER, cvbo); - glBufferData(GL_ARRAY_BUFFER, it->second.vertices.size() * sizeof(GLfloat), - &it->second.vertices[0], GL_STATIC_DRAW); + glBufferData( + GL_ARRAY_BUFFER, + it->second.vertices.size() * sizeof(GLfloat), + &it->second.vertices[0], + GL_STATIC_DRAW + ); // in_position glEnableVertexAttribArray(0); // U and V may not be given by the user - if (it->second.vertices.size() / (it->second.numU * it->second.numV) > 3) { + if (it->second.vertices.size() / + (it->second.numU * it->second.numV) > 3) + { glVertexAttribPointer( 0, 3, @@ -1067,7 +1118,7 @@ void RenderableDUMeshes::createMeshes() { if (_hasLabel && _labelDataIsDirty) { _labelDataIsDirty = false; - } + } } } // namespace openspace diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.h b/modules/digitaluniverse/rendering/renderabledumeshes.h index a1446490a8..405a69c878 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.h +++ b/modules/digitaluniverse/rendering/renderabledumeshes.h @@ -122,10 +122,7 @@ private: bool _textColorIsDirty; bool _hasLabel; bool _labelDataIsDirty; - - int _textMinSize; - int _textMaxSize; - + properties::FloatProperty _alphaValue; properties::FloatProperty _scaleFactor; //properties::Vec3Property _pointColor; @@ -134,6 +131,8 @@ private: properties::BoolProperty _drawElements; properties::BoolProperty _drawLabels; //properties::OptionProperty _blendMode; + properties::FloatProperty _textMinSize; + properties::FloatProperty _textMaxSize; // DEBUG: properties::OptionProperty _renderOption; diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.cpp b/modules/digitaluniverse/rendering/renderableplanescloud.cpp index c27a5380c0..d735e82c93 100644 --- a/modules/digitaluniverse/rendering/renderableplanescloud.cpp +++ b/modules/digitaluniverse/rendering/renderableplanescloud.cpp @@ -40,7 +40,7 @@ #include #include -#include +#include #include #include @@ -121,7 +121,8 @@ namespace { "Enables/Disables the drawing of the astronomical objects." }; - static const openspace::properties::Property::PropertyInfo TransformationMatrixInfo = { + static const openspace::properties::Property::PropertyInfo TransformationMatrixInfo = + { "TransformationMatrix", "Transformation Matrix", "Transformation matrix to be applied to each astronomical object." @@ -157,6 +158,26 @@ namespace { "Debug option for rendering of billboards and texts." }; + static const openspace::properties::Property::PropertyInfo FadeInDistancesInfo = { + "FadeInDistances", + "Fade-In Start and End Distances", + "These values determine the initial and final distances from the center of " + "our galaxy from which the astronomical object will start and end " + "fading-in." + }; + + static const openspace::properties::Property::PropertyInfo DisableFadeInInfo = { + "DisableFadeIn", + "Disable Fade-in effect", + "Enables/Disables the Fade-in effect." + }; + + static const openspace::properties::Property::PropertyInfo PlaneMinSizeInfo = { + "PlaneMinSize", + "Plane Min Size in Pixels", + "The min size (in pixels) for the plane representing the astronomical " + "object." + }; } // namespace @@ -177,8 +198,8 @@ documentation::Documentation RenderablePlanesCloud::Documentation() { KeyFile, new StringVerifier, Optional::Yes, - "The path to the SPECK file that contains information about the astronomical " - "object being rendered." + "The path to the SPECK file that contains information about the " + "astronomical object being rendered." }, { TransparencyInfo.identifier, @@ -252,6 +273,24 @@ documentation::Documentation RenderablePlanesCloud::Documentation() { Optional::Yes, ScaleFactorInfo.description, }, + { + FadeInDistancesInfo.identifier, + new Vector2Verifier, + Optional::Yes, + FadeInDistancesInfo.description + }, + { + DisableFadeInInfo.identifier, + new BoolVerifier, + Optional::Yes, + DisableFadeInInfo.description + }, + { + PlaneMinSizeInfo.identifier, + new DoubleVerifier, + Optional::Yes, + PlaneMinSizeInfo.description + }, } }; } @@ -279,6 +318,14 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary , _textSize(TextSizeInfo, 8.0, 0.5, 24.0) , _drawElements(DrawElementsInfo, true) , _blendMode(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown) + , _fadeInDistance( + FadeInDistancesInfo, + glm::vec2(0.f), + glm::vec2(0.f), + glm::vec2(200000.f) + ) + , _disableFadeInDistance(DisableFadeInInfo, true) + , _planeMinSize(PlaneMinSizeInfo, 0.5, 0.0, 500.0) , _renderOption(RenderOptionInfo, properties::OptionProperty::DisplayType::Dropdown) , _program(nullptr) , _fontRenderer(nullptr) @@ -311,6 +358,7 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary _renderOption.addOption(1, "Camera Position Normal"); _renderOption.addOption(2, "Screen center Position Normal"); addProperty(_renderOption); + //_renderOption.set(1); if (dictionary.hasKey(keyUnit)) { std::string unit = dictionary.value(keyUnit); @@ -383,16 +431,22 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary addProperty(_textSize); if (dictionary.hasKey(LabelMinSizeInfo.identifier)) { - _textMinSize = static_cast(dictionary.value(LabelMinSizeInfo.identifier)); - } + _textMinSize = static_cast( + dictionary.value(LabelMinSizeInfo.identifier) + ); + } if (dictionary.hasKey(LabelMaxSizeInfo.identifier)) { - _textMaxSize = static_cast(dictionary.value(LabelMaxSizeInfo.identifier)); + _textMaxSize = static_cast( + dictionary.value(LabelMaxSizeInfo.identifier) + ); } } if (dictionary.hasKey(TransformationMatrixInfo.identifier)) { - _transformationMatrix = dictionary.value(TransformationMatrixInfo.identifier); + _transformationMatrix = dictionary.value( + TransformationMatrixInfo.identifier + ); } _blendMode.addOptions({ @@ -429,7 +483,26 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary } if (dictionary.hasKey(ScaleLuminosityInfo.identifier)) { - _sluminosity = static_cast(dictionary.value(ScaleLuminosityInfo.identifier)); + _sluminosity = static_cast( + dictionary.value(ScaleLuminosityInfo.identifier) + ); + } + + if (dictionary.hasKey(FadeInDistancesInfo.identifier)) { + glm::vec2 fadeInValue = dictionary.value( + FadeInDistancesInfo.identifier + ); + _fadeInDistance.set(fadeInValue); + _disableFadeInDistance.set(false); + addProperty(_fadeInDistance); + addProperty(_disableFadeInDistance); + } + + if (dictionary.hasKey(PlaneMinSizeInfo.identifier)) { + _planeMinSize = static_cast( + dictionary.value(PlaneMinSizeInfo.identifier) + ); + addProperty(_planeMinSize); } } @@ -463,17 +536,21 @@ void RenderablePlanesCloud::initializeGL() { ghoul::fontrendering::FontRenderer::createProjectionSubjectText()); if (_font == nullptr) { size_t _fontSize = 30; - _font = OsEng.fontManager().font("Mono", static_cast(_fontSize), - ghoul::fontrendering::FontManager::Outline::Yes, ghoul::fontrendering::FontManager::LoadGlyphs::No); + _font = OsEng.fontManager().font( + "Mono", + static_cast(_fontSize), + ghoul::fontrendering::FontManager::Outline::Yes, + ghoul::fontrendering::FontManager::LoadGlyphs::No + ); } } } void RenderablePlanesCloud::deleteDataGPU() { - for (auto pair : _renderingPlanesMap) { - glDeleteVertexArrays(1, &pair.second.vao); - glDeleteBuffers(1, &pair.second.vbo); + for (auto renderingPlane : _renderingPlanesArray) { + glDeleteVertexArrays(1, &renderingPlane.vao); + glDeleteBuffers(1, &renderingPlane.vbo); } } @@ -489,7 +566,8 @@ void RenderablePlanesCloud::deinitializeGL() { void RenderablePlanesCloud::renderPlanes(const RenderData&, const glm::dmat4& modelViewMatrix, - const glm::dmat4& projectionMatrix) + const glm::dmat4& projectionMatrix, + const float fadeInVariable) { // Saving current OpenGL state GLboolean blendEnabled = glIsEnabled(GL_BLEND); @@ -517,34 +595,56 @@ void RenderablePlanesCloud::renderPlanes(const RenderData&, using IgnoreError = ghoul::opengl::ProgramObject::IgnoreError; _program->setIgnoreUniformLocationError(IgnoreError::Yes); - _program->setUniform("modelViewProjectionTransform", glm::dmat4(projectionMatrix) * modelViewMatrix); + glm::dmat4 modelViewProjectionMatrix = glm::dmat4(projectionMatrix) * modelViewMatrix; + _program->setUniform("modelViewProjectionTransform", modelViewProjectionMatrix); _program->setUniform("alphaValue", _alphaValue); _program->setUniform("scaleFactor", _scaleFactor); - //_program->setUniform("minPlaneSize", 1.f); // in pixels + _program->setUniform("fadeInValue", fadeInVariable); - //bool usingFramebufferRenderer = - // OsEng.renderEngine().rendererImplementation() == RenderEngine::RendererImplementation::Framebuffer; - - //bool usingABufferRenderer = - // OsEng.renderEngine().rendererImplementation() == RenderEngine::RendererImplementation::ABuffer; - - //if (usingABufferRenderer) { - // _program->setUniform("additiveBlending", _blendMode == BlendModeAdditive); - //} - - //bool additiveBlending = _blendMode == BlendModeAdditive && usingFramebufferRenderer; - //if (additiveBlending) { - // //glDepthMask(false); - // glBlendFunc(GL_SRC_ALPHA, GL_ONE); - //} + GLint viewport[4]; + glGetIntegerv(GL_VIEWPORT, viewport); - for (auto pair : _renderingPlanesMap) { - ghoul::opengl::TextureUnit unit; - unit.activate(); - _textureMap[pair.second.planeIndex]->bind(); - _program->setUniform("galaxyTexture", unit); + ghoul::opengl::TextureUnit unit; + unit.activate(); + _program->setUniform("galaxyTexture", unit); + int currentTextureIndex = -1; + for (auto renderingPlane : _renderingPlanesArray) { + // For planes with undefined textures references + if (renderingPlane.planeIndex == -1) { + continue; + } - glBindVertexArray(pair.second.vao); + glm::dvec4 vertex0(renderingPlane.vertexData[0], renderingPlane.vertexData[1], + renderingPlane.vertexData[2], renderingPlane.vertexData[3]); + glm::dvec4 vertex1(renderingPlane.vertexData[6], renderingPlane.vertexData[7], + renderingPlane.vertexData[8], renderingPlane.vertexData[9]); + + vertex0 = modelViewProjectionMatrix * vertex0; + vertex1 = modelViewProjectionMatrix * vertex1; + + // Testing size: + glm::vec4 topRight = vertex1 / vertex1.w; + topRight = ((topRight + glm::vec4(1.0)) / glm::vec4(2.0)) * + glm::vec4(viewport[2], viewport[3], 1.0, 1.0); + glm::vec4 bottomLeft = vertex0 / vertex0.w; + bottomLeft = ((bottomLeft + glm::vec4(1.0)) / glm::vec4(2.0)) * + glm::vec4(viewport[2], viewport[3], 1.0, 1.0); + + float lengthY = std::fabs(topRight.y - bottomLeft.y); + float lengthX = std::fabs(topRight.x - bottomLeft.x); + float lengthXY = glm::length(glm::vec2(topRight) - glm::vec2(bottomLeft)); + float biggestAxis = + lengthY > lengthX ? (lengthY > lengthXY ? lengthY : lengthXY) : + (lengthX > lengthXY ? lengthX : lengthXY); + if (biggestAxis < _planeMinSize ) { + continue; + } + + if (currentTextureIndex != renderingPlane.planeIndex) { + _textureMap[renderingPlane.planeIndex]->bind(); + currentTextureIndex = renderingPlane.planeIndex; + } + glBindVertexArray(renderingPlane.vao); glDrawArrays(GL_TRIANGLES, 0, 6); } @@ -570,37 +670,42 @@ void RenderablePlanesCloud::renderPlanes(const RenderData&, } } -void RenderablePlanesCloud::renderLabels(const RenderData& data, const glm::dmat4& modelViewProjectionMatrix, - const glm::vec3& orthoRight, const glm::vec3& orthoUp) { +void RenderablePlanesCloud::renderLabels(const RenderData& data, + const glm::dmat4& modelViewProjectionMatrix, + const glm::dvec3& orthoRight, + const glm::dvec3& orthoUp, float fadeInVariable) +{ RenderEngine& renderEngine = OsEng.renderEngine(); _fontRenderer->setFramebufferSize(renderEngine.renderingResolution()); float scale = 0.0; switch (_unit) { - case Meter: - scale = 1.0; - break; - case Kilometer: - scale = 1e3; - break; - case Parsec: - scale = PARSEC; - break; - case Kiloparsec: - scale = 1e3 * PARSEC; - break; - case Megaparsec: - scale = 1e6 * PARSEC; - break; - case Gigaparsec: - scale = 1e9 * PARSEC; - break; - case GigalightYears: - scale = 306391534.73091 * PARSEC; - break; + case Meter: + scale = 1.0; + break; + case Kilometer: + scale = 1e3; + break; + case Parsec: + scale = PARSEC; + break; + case Kiloparsec: + scale = 1e3 * PARSEC; + break; + case Megaparsec: + scale = 1e6 * PARSEC; + break; + case Gigaparsec: + scale = 1e9 * PARSEC; + break; + case GigalightYears: + scale = 306391534.73091 * PARSEC; + break; } + glm::vec4 textColor = _textColor; + textColor.a *= fadeInVariable; for (const std::pair& pair : _labelData) { //glm::vec3 scaledPos(_transformationMatrix * glm::dvec4(pair.first, 1.0)); glm::vec3 scaledPos(pair.first); @@ -608,7 +713,8 @@ void RenderablePlanesCloud::renderLabels(const RenderData& data, const glm::dmat _fontRenderer->render( *_font, scaledPos, - _textColor, + //_textColor, + textColor, pow(10.0, _textSize.value()), _textMinSize, _textMaxSize, @@ -625,6 +731,56 @@ void RenderablePlanesCloud::renderLabels(const RenderData& data, const glm::dmat } void RenderablePlanesCloud::render(const RenderData& data, RendererTasks&) { + double scale = 0.0; + switch (_unit) { + case Meter: + scale = 1.0; + break; + case Kilometer: + scale = 1e3; + break; + case Parsec: + scale = PARSEC; + break; + case Kiloparsec: + scale = 1e3 * PARSEC; + break; + case Megaparsec: + scale = 1e6 * PARSEC; + break; + case Gigaparsec: + scale = 1e9 * PARSEC; + break; + case GigalightYears: + scale = 306391534.73091 * PARSEC; + break; + } + + float fadeInVariable = 1.0f; + if (!_disableFadeInDistance) { + double distCamera = glm::length(data.camera.positionVec3()); + //float funcValue = static_cast( + //(1.0 / double(_fadeInDistance))*(distCamera / scale) + //); + // + //// Let's not waste performance + //if (funcValue < 0.01) { + // return; + //} + + //fadeInVariable = funcValue > 1.0 ? 1.0 : funcValue; + + glm::vec2 fadeRange = _fadeInDistance; + float a = 1.0f / ((fadeRange.y - fadeRange.x) * scale); + float b = -(fadeRange.x / (fadeRange.y - fadeRange.x)); + float funcValue = a * distCamera + b; + fadeInVariable *= funcValue > 1.0 ? 1.0 : funcValue; + + if (funcValue < 0.01) { + return; + } + } + glm::dmat4 modelMatrix = glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * // Translation glm::dmat4(data.modelTransform.rotation) * // Spice rotation @@ -634,22 +790,36 @@ void RenderablePlanesCloud::render(const RenderData& data, RendererTasks&) { glm::mat4 projectionMatrix = data.camera.projectionMatrix(); glm::dmat4 modelViewProjectionMatrix = glm::dmat4(projectionMatrix) * modelViewMatrix; - glm::vec3 lookup = data.camera.lookUpVectorWorldSpace(); - glm::vec3 viewDirection = data.camera.viewDirectionWorldSpace(); - glm::vec3 right = glm::cross(viewDirection, lookup); - glm::vec3 up = glm::cross(right, viewDirection); + //glm::vec3 lookup = data.camera.lookUpVectorWorldSpace(); + //glm::vec3 viewDirection = data.camera.viewDirectionWorldSpace(); + //glm::vec3 right = glm::cross(viewDirection, lookup); + //glm::vec3 up = glm::cross(right, viewDirection); - glm::dmat4 worldToModelTransform = glm::inverse(modelMatrix); - glm::vec3 orthoRight = glm::normalize(glm::vec3(worldToModelTransform * glm::vec4(right, 0.0))); - glm::vec3 orthoUp = glm::normalize(glm::vec3(worldToModelTransform * glm::vec4(up, 0.0))); + //glm::dmat4 worldToModelTransform = glm::inverse(modelMatrix); + //glm::vec3 orthoRight = glm::normalize( + // glm::vec3(worldToModelTransform * glm::vec4(right, 0.0)) + //); + //glm::vec3 orthoUp = glm::normalize( + // glm::vec3(worldToModelTransform * glm::vec4(up, 0.0)) + //); + + //glm::dmat4 invMVP = glm::inverse(modelViewProjectionMatrix); + glm::dmat4 invMVPParts = glm::inverse(modelMatrix) * + glm::inverse(data.camera.combinedViewMatrix()) * + glm::inverse(glm::dmat4(projectionMatrix)); + glm::dvec3 orthoRight = glm::dvec3( + glm::normalize(glm::dvec3(invMVPParts * glm::dvec4(1.0, 0.0, 0.0, 0.0))) + ); + glm::dvec3 orthoUp = glm::dvec3( + glm::normalize(glm::dvec3(invMVPParts * glm::dvec4(0.0, 1.0, 0.0, 0.0))) + ); - if (_hasSpeckFile) { - renderPlanes(data, modelViewMatrix, projectionMatrix); + renderPlanes(data, modelViewMatrix, projectionMatrix, fadeInVariable); } if (_hasLabel) { - renderLabels(data, modelViewProjectionMatrix, orthoRight, orthoUp); + renderLabels(data, modelViewProjectionMatrix, orthoRight, orthoUp, fadeInVariable); } } @@ -810,11 +980,13 @@ bool RenderablePlanesCloud::readSpeckFile() { // +3 because of the x, y and z at the begining of each line. _variableDataPositionMap.insert({ dummy, _nValuesPerAstronomicalObject + 3}); - if (dummy == "orientation") { // 3d vectors u and v - _nValuesPerAstronomicalObject += 6; // We want the number, but the index is 0 based + if ((dummy == "orientation") || (dummy == "ori")) { // 3d vectors u and v + // We want the number, but the index is 0 based + _nValuesPerAstronomicalObject += 6; } else { - _nValuesPerAstronomicalObject += 1; // We want the number, but the index is 0 based + // We want the number, but the index is 0 based + _nValuesPerAstronomicalObject += 1; } } @@ -841,10 +1013,18 @@ bool RenderablePlanesCloud::readSpeckFile() { if (line.substr(0, 8) == "texture ") { std::stringstream str(line); + std::size_t found = line.find("-"); + int textureIndex = 0; std::string dummy; str >> dummy; // command + + if (found != std::string::npos) { + std::string option; // Not being used right now. + str >> option; + } + str >> textureIndex; str >> dummy; // texture file name @@ -879,7 +1059,7 @@ bool RenderablePlanesCloud::readSpeckFile() { for (int i = 0; i < _nValuesPerAstronomicalObject; ++i) { str >> values[i]; if ((i >= _planeStartingIndexPos) && - (i <= _planeStartingIndexPos+6)) { // vectors u and v + (i <= _planeStartingIndexPos + 6)) { // vectors u and v int index = i - _planeStartingIndexPos; switch (index) { case 0: @@ -993,7 +1173,9 @@ bool RenderablePlanesCloud::readLabelFile() { dummy.clear(); } - glm::vec3 transformedPos = glm::vec3(_transformationMatrix * glm::dvec4(position, 1.0)); + glm::vec3 transformedPos = glm::vec3( + _transformationMatrix * glm::dvec4(position, 1.0) + ); _labelData.push_back(std::make_pair(transformedPos, label)); } while (!file.eof()); @@ -1015,7 +1197,10 @@ bool RenderablePlanesCloud::loadCachedFile(const std::string& file) { int32_t nValues = 0; fileStream.read(reinterpret_cast(&nValues), sizeof(int32_t)); - fileStream.read(reinterpret_cast(&_nValuesPerAstronomicalObject), sizeof(int32_t)); + fileStream.read(reinterpret_cast( + &_nValuesPerAstronomicalObject), + sizeof(int32_t) + ); _fullData.resize(nValues); fileStream.read(reinterpret_cast(&_fullData[0]), @@ -1043,8 +1228,13 @@ bool RenderablePlanesCloud::saveCachedFile(const std::string& file) const { } fileStream.write(reinterpret_cast(&nValues), sizeof(int32_t)); - int32_t nValuesPerAstronomicalObject = static_cast(_nValuesPerAstronomicalObject); - fileStream.write(reinterpret_cast(&nValuesPerAstronomicalObject), sizeof(int32_t)); + int32_t nValuesPerAstronomicalObject = static_cast( + _nValuesPerAstronomicalObject + ); + fileStream.write(reinterpret_cast( + &nValuesPerAstronomicalObject), + sizeof(int32_t) + ); size_t nBytes = nValues * sizeof(_fullData[0]); fileStream.write(reinterpret_cast(&_fullData[0]), nBytes); @@ -1061,7 +1251,7 @@ bool RenderablePlanesCloud::saveCachedFile(const std::string& file) const { void RenderablePlanesCloud::createPlanes() { if (_dataIsDirty && _hasSpeckFile) { LDEBUG("Creating planes"); - + float maxSize = 0.0f; int planeNumber = 0; for (int p = 0; p < _fullData.size(); p += _nValuesPerAstronomicalObject) { glm::vec4 transformedPos = glm::vec4(_transformationMatrix * @@ -1086,7 +1276,8 @@ void RenderablePlanesCloud::createPlanes() { v.w = 0.0; if (!_luminosityVar.empty()) { - float lumS = _fullData[p + _variableDataPositionMap[_luminosityVar]] * _sluminosity; + float lumS = _fullData[p + _variableDataPositionMap[_luminosityVar]] * + _sluminosity; u *= lumS; v *= lumS; } @@ -1099,8 +1290,7 @@ void RenderablePlanesCloud::createPlanes() { // JCC: Ask Abbott about these points refeering to a non-existing texture. if (plane.planeIndex == 30) { - //std::cout << "--- Creating planes - index: " << plane.planeIndex << std::endl; - plane.planeIndex = 0; + plane.planeIndex = -1; } glGenVertexArrays(1, &plane.vao); @@ -1136,11 +1326,18 @@ void RenderablePlanesCloud::createPlanes() { break; } + for (int i = 0; i < 3; ++i) { + maxSize = maxSize > vertex0[i] ? maxSize : vertex0[i]; + maxSize = maxSize > vertex1[i] ? maxSize : vertex1[i]; + maxSize = maxSize > vertex2[i] ? maxSize : vertex2[i]; + maxSize = maxSize > vertex4[i] ? maxSize : vertex4[i]; + } + vertex0 *= static_cast(scale); vertex1 *= static_cast(scale); vertex2 *= static_cast(scale); - vertex4 *= static_cast(scale); - + vertex4 *= static_cast(scale); + GLfloat vertexData[] = { // x y z w s t vertex0.x, vertex0.y, vertex0.z, 1.f, 0.f, 0.f, @@ -1155,7 +1352,12 @@ void RenderablePlanesCloud::createPlanes() { glBindVertexArray(plane.vao); glBindBuffer(GL_ARRAY_BUFFER, plane.vbo); - glBufferData(GL_ARRAY_BUFFER, sizeof(plane.vertexData), plane.vertexData, GL_STATIC_DRAW); + glBufferData( + GL_ARRAY_BUFFER, + sizeof(plane.vertexData), + plane.vertexData, + GL_STATIC_DRAW + ); // in_position glEnableVertexAttribArray(0); glVertexAttribPointer( @@ -1178,18 +1380,29 @@ void RenderablePlanesCloud::createPlanes() { reinterpret_cast(sizeof(GLfloat) * 4) ); - _renderingPlanesMap.insert({planeNumber++, plane}); + _renderingPlanesArray.push_back(plane); } glBindVertexArray(0); _dataIsDirty = false; + + _fadeInDistance.setMaxValue(glm::vec2(10.0f * maxSize)); } if (_hasLabel && _labelDataIsDirty) { _labelDataIsDirty = false; } + + // Sort planes by texture index + if (!_renderingPlanesArray.empty()) { + std::sort(_renderingPlanesArray.begin(), _renderingPlanesArray.end(), + [](const RenderingPlane& planeA, const RenderingPlane& planeB) { + return planeA.planeIndex < planeB.planeIndex; + }); + + } } } // namespace openspace diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.h b/modules/digitaluniverse/rendering/renderableplanescloud.h index 21369983bb..d82c6d05b4 100644 --- a/modules/digitaluniverse/rendering/renderableplanescloud.h +++ b/modules/digitaluniverse/rendering/renderableplanescloud.h @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -93,9 +94,9 @@ namespace openspace { void deleteDataGPU(); void createPlanes(); void renderPlanes(const RenderData& data, const glm::dmat4& modelViewMatrix, - const glm::dmat4& projectionMatrix); + const glm::dmat4& projectionMatrix, float fadeInVariable); void renderLabels(const RenderData& data, const glm::dmat4& modelViewProjectionMatrix, - const glm::vec3& orthoRight, const glm::vec3& orthoUp); + const glm::dvec3& orthoRight, const glm::dvec3& orthoUp, float fadeInVarible); bool loadData(); bool loadTextures(); @@ -121,6 +122,9 @@ namespace openspace { properties::FloatProperty _textSize; properties::BoolProperty _drawElements; properties::OptionProperty _blendMode; + properties::Vec2Property _fadeInDistance; + properties::BoolProperty _disableFadeInDistance; + properties::FloatProperty _planeMinSize; // DEBUG: properties::OptionProperty _renderOption; @@ -145,10 +149,10 @@ namespace openspace { int _nValuesPerAstronomicalObject; float _sluminosity; - + glm::dmat4 _transformationMatrix; - std::unordered_map _renderingPlanesMap; + std::vector _renderingPlanesArray; }; diff --git a/modules/digitaluniverse/shaders/billboard2_fs.glsl b/modules/digitaluniverse/shaders/billboard2_fs.glsl index e1841e02b6..523142bbb7 100644 --- a/modules/digitaluniverse/shaders/billboard2_fs.glsl +++ b/modules/digitaluniverse/shaders/billboard2_fs.glsl @@ -27,6 +27,7 @@ in vec4 gs_colorMap; in float vs_screenSpaceDepth; in vec2 texCoord; +in float ta; uniform float alphaValue; uniform vec3 color; @@ -34,6 +35,7 @@ uniform sampler2D spriteTexture; uniform sampler2D polygonTexture; uniform bool hasColorMap; uniform bool hasPolygon; +uniform float fadeInValue; Fragment getFragment() { @@ -50,13 +52,19 @@ Fragment getFragment() { fullColor = vec4(color.rgb * textureColor.rgb, textureColor.a * alphaValue); } + fullColor.a *= fadeInValue * ta; + if (fullColor.a == 0.f) { discard; } Fragment frag; - frag.color = fullColor; - frag.depth = vs_screenSpaceDepth; + frag.color = fullColor; + frag.depth = vs_screenSpaceDepth; + frag.gPosition = vec4(1e32, 1e32, 1e32, 1.0); + frag.gOtherData = vec4(0.0, 0.0, 0.0, 1.0); + frag.gNormal = vec4(0.0, 0.0, 0.0, 1.0); + return frag; } diff --git a/modules/digitaluniverse/shaders/billboard2_gs.glsl b/modules/digitaluniverse/shaders/billboard2_gs.glsl index 082a76a004..53b778fae6 100644 --- a/modules/digitaluniverse/shaders/billboard2_gs.glsl +++ b/modules/digitaluniverse/shaders/billboard2_gs.glsl @@ -32,19 +32,22 @@ layout(triangle_strip, max_vertices = 6) out; //uniform dmat4 transformMatrix; uniform dmat4 modelViewProjectionTransform; uniform float scaleFactor; -uniform vec3 up; -uniform vec3 right; +uniform dvec3 up; +uniform dvec3 right; uniform dvec3 cameraPosition; uniform dvec3 cameraLookUp; uniform dvec4 centerScreenInWorldPosition; uniform int renderOption; - +uniform vec2 screenSize; +uniform float maxBillboardSize; +uniform float minBillboardSize; in vec4 colorMap[]; out vec4 gs_colorMap; out vec2 texCoord; out float vs_screenSpaceDepth; +out float ta; const double PARSEC = 0.308567756e17LF; @@ -57,27 +60,29 @@ const vec2 corners[4] = vec2[4]( void main() { - vec4 pos = gl_in[0].gl_Position; + ta = 1.0f; + vec4 pos = gl_in[0].gl_Position; gs_colorMap = colorMap[0]; double scaleMultiply = exp(scaleFactor/10); - dvec3 scaledRight = dvec3(0.0); - dvec3 scaledUp = dvec3(0.0); + dvec3 scaledRight = dvec3(0.0); + dvec3 scaledUp = dvec3(0.0); + if (renderOption == 0) { scaledRight = scaleMultiply * right/2.0f; - scaledUp = scaleMultiply * up/2.0f; + scaledUp = scaleMultiply * up/2.0f; } else if (renderOption == 1) { - dvec3 normal = normalize(cameraPosition - dvec3(pos.xyz)); + dvec3 normal = normalize(cameraPosition - dvec3(pos.xyz)); dvec3 newRight = normalize(cross(cameraLookUp, normal)); - dvec3 newUp = cross(normal, newRight); - scaledRight = scaleMultiply * newRight/2.0f; - scaledUp = scaleMultiply * newUp/2.0f; + dvec3 newUp = cross(normal, newRight); + scaledRight = scaleMultiply * newRight/2.0f; + scaledUp = scaleMultiply * newUp/2.0f; } else if (renderOption == 2) { - dvec3 normal = normalize(centerScreenInWorldPosition.xyz - dvec3(pos.xyz)); + dvec3 normal = normalize(centerScreenInWorldPosition.xyz - dvec3(pos.xyz)); dvec3 newRight = normalize(cross(cameraLookUp, normal)); - dvec3 newUp = cross(normal, newRight); - scaledRight = scaleMultiply * newRight/2.0f; - scaledUp = scaleMultiply * newUp/2.0f; + dvec3 newUp = cross(normal, newRight); + scaledRight = scaleMultiply * newRight/2.0f; + scaledUp = scaleMultiply * newUp/2.0f; } double unit = PARSEC; @@ -100,32 +105,87 @@ void main() { //dvec4 dpos = transformMatrix * dvec4(dvec3(pos.xyz) * unit, 1.0); dvec4 dpos = dvec4(dvec3(pos.xyz) * unit, 1.0); - texCoord = corners[0]; - vec4 initialPosition = z_normalization(vec4(modelViewProjectionTransform * dvec4(dpos.xyz - scaledRight - scaledUp, dpos.w))); - vs_screenSpaceDepth = initialPosition.w; + // texCoord = corners[0]; + vec4 initialPosition = z_normalization(vec4(modelViewProjectionTransform * + dvec4(dpos.xyz - scaledRight - scaledUp, dpos.w))); + vs_screenSpaceDepth = initialPosition.w; + + // texCoord = corners[1]; + vec4 secondPosition = z_normalization(vec4(modelViewProjectionTransform * + dvec4(dpos.xyz + scaledRight - scaledUp, dpos.w))); + + //texCoord = corners[2]; + vec4 crossCorner = z_normalization(vec4(modelViewProjectionTransform * + dvec4(dpos.xyz + scaledUp + scaledRight, dpos.w))); + + // texCoord = corners[3]; + vec4 thirdPosition = z_normalization(vec4(modelViewProjectionTransform * + dvec4(dpos.xyz + scaledUp - scaledRight, dpos.w))); + + // Testing size: + vec4 topRight = secondPosition/secondPosition.w; + topRight = ((topRight + vec4(1.0)) / vec4(2.0)) * vec4(screenSize.x, screenSize.y, 1.0, 1.0); + vec4 bottomLeft = initialPosition/initialPosition.w; + bottomLeft = ((bottomLeft + vec4(1.0)) / vec4(2.0)) * vec4(screenSize.x, screenSize.y, 1.0, 1.0); + + float height = abs(topRight.y - bottomLeft.y); + float width = abs(topRight.x - bottomLeft.x); + float var = (height + width); + + if ((height > maxBillboardSize) || + (width > maxBillboardSize)) { + + // Set maximum size as Carter's instructions + float correctionScale = height > maxBillboardSize ? maxBillboardSize / (topRight.y - bottomLeft.y) : + maxBillboardSize / (topRight.x - bottomLeft.x); + + scaledRight = correctionScale * scaleMultiply * right/2.0f; + scaledUp = correctionScale * scaleMultiply * up/2.0f; + initialPosition = z_normalization(vec4(modelViewProjectionTransform * + dvec4(dpos.xyz - scaledRight - scaledUp, dpos.w))); + vs_screenSpaceDepth = initialPosition.w; + secondPosition = z_normalization(vec4(modelViewProjectionTransform * + dvec4(dpos.xyz + scaledRight - scaledUp, dpos.w))); + crossCorner = z_normalization(vec4(modelViewProjectionTransform * + dvec4(dpos.xyz + scaledUp + scaledRight, dpos.w))); + thirdPosition = z_normalization(vec4(modelViewProjectionTransform * + dvec4(dpos.xyz + scaledUp - scaledRight, dpos.w))); + + // Fade-out + // float maxVar = 2.0f * maxBillboardSize; + // float minVar = maxBillboardSize; + // ta = 1.0f - ( (var - minVar)/(maxVar - minVar) ); + // if (ta == 0.0f) + // return; + } + else if (width < 2.0f * minBillboardSize) { + //return; + float maxVar = 2.0f * minBillboardSize; + float minVar = minBillboardSize; + ta = ( (var - minVar)/(maxVar - minVar) ); + if (ta == 0.0f) + return; + } + + // Build primitive + texCoord = corners[0]; gl_Position = initialPosition; EmitVertex(); - - texCoord = corners[1]; - gl_Position = z_normalization(vec4(modelViewProjectionTransform * dvec4(dpos.xyz + scaledRight - scaledUp, dpos.w))); + texCoord = corners[1]; + gl_Position = secondPosition; EmitVertex(); - - texCoord = corners[2]; - vec4 crossCorner = z_normalization(vec4(modelViewProjectionTransform * dvec4(dpos.xyz + scaledUp + scaledRight, dpos.w))); + texCoord = corners[2]; gl_Position = crossCorner; EmitVertex(); EndPrimitive(); // First Triangle - - texCoord = corners[0]; + texCoord = corners[0]; gl_Position = initialPosition; EmitVertex(); - - texCoord = corners[2]; + texCoord = corners[2]; gl_Position = crossCorner; EmitVertex(); - - texCoord = corners[3]; - gl_Position = z_normalization(vec4(modelViewProjectionTransform * dvec4(dpos.xyz + scaledUp - scaledRight, dpos.w))); + texCoord = corners[3]; + gl_Position = thirdPosition; EmitVertex(); - EndPrimitive(); // Second Triangle + EndPrimitive(); // Second Triangle } diff --git a/modules/digitaluniverse/shaders/billboard_fs.glsl b/modules/digitaluniverse/shaders/billboard_fs.glsl index cdac0826bd..a319a23511 100644 --- a/modules/digitaluniverse/shaders/billboard_fs.glsl +++ b/modules/digitaluniverse/shaders/billboard_fs.glsl @@ -57,6 +57,9 @@ Fragment getFragment() { Fragment frag; frag.color = fullColor; frag.depth = gs_screenSpaceDepth; - + frag.gPosition = vec4(1e27, 1e27, 1e27, 1.0); + frag.gOtherData = vec4(0.0, 0.0, 0.0, 1.0); + frag.gNormal = vec4(0.0, 0.0, 0.0, 1.0); + return frag; } diff --git a/modules/digitaluniverse/shaders/dumesh_fs.glsl b/modules/digitaluniverse/shaders/dumesh_fs.glsl index 8c2106f67a..3f9a3db836 100644 --- a/modules/digitaluniverse/shaders/dumesh_fs.glsl +++ b/modules/digitaluniverse/shaders/dumesh_fs.glsl @@ -25,6 +25,7 @@ #include "fragment.glsl" in float vs_screenSpaceDepth; +in vec4 vs_positionViewSpace; uniform vec3 color; uniform float alphaValue; @@ -39,5 +40,10 @@ Fragment getFragment() { frag.color = vec4(color, alphaValue); frag.depth = vs_screenSpaceDepth; + // JCC: Need to change the position to camera space + frag.gPosition = vs_positionViewSpace; + frag.gOtherData = vec4(0.0, 0.0, 0.0, 1.0); + frag.gNormal = vec4(0.0, 0.0, 0.0, 1.0); + return frag; } diff --git a/modules/digitaluniverse/shaders/dumesh_vs.glsl b/modules/digitaluniverse/shaders/dumesh_vs.glsl index 36809f85f6..b61a39d9b4 100644 --- a/modules/digitaluniverse/shaders/dumesh_vs.glsl +++ b/modules/digitaluniverse/shaders/dumesh_vs.glsl @@ -28,16 +28,20 @@ in vec3 in_position; -uniform dmat4 modelViewProjectionTransform; +uniform dmat4 modelViewTransform; +uniform dmat4 projectionTransform; uniform float scaleFactor; out float vs_screenSpaceDepth; +out vec4 vs_positionViewSpace; void main() { - vec4 positionClipSpace = vec4(modelViewProjectionTransform * dvec4(in_position, 1.0)); + dvec4 positionViewSpace = modelViewTransform * dvec4(in_position, 1.0); + vec4 positionClipSpace = vec4(projectionTransform * positionViewSpace); vec4 positionScreenSpace = vec4(z_normalization(positionClipSpace)); - vs_screenSpaceDepth = positionScreenSpace.w; + vs_screenSpaceDepth = positionScreenSpace.w; + vs_positionViewSpace = vec4(positionViewSpace); gl_Position = positionScreenSpace; } diff --git a/modules/digitaluniverse/shaders/plane2_fs.glsl b/modules/digitaluniverse/shaders/plane2_fs.glsl index 79947606f3..a5e15c8e8d 100644 --- a/modules/digitaluniverse/shaders/plane2_fs.glsl +++ b/modules/digitaluniverse/shaders/plane2_fs.glsl @@ -30,6 +30,7 @@ in vec2 vs_st; uniform sampler2D galaxyTexture; //uniform bool additiveBlending; uniform float alphaValue; +uniform float fadeInValue; Fragment getFragment() { @@ -44,6 +45,8 @@ Fragment getFragment() { frag.color = texture(galaxyTexture, vs_st); frag.color *= alphaValue; + frag.color *= fadeInValue; + if (frag.color.a == 0.0) { discard; } @@ -52,8 +55,11 @@ Fragment getFragment() { // frag.blend = BLEND_MODE_ADDITIVE; // } - frag.color = texture(galaxyTexture, vs_st); + //frag.color = texture(galaxyTexture, vs_st); frag.depth = vs_screenSpaceDepth; + frag.gPosition = vec4(1e27, 1e27, 1e27, 1.0); + frag.gOtherData = vec4(0.0, 0.0, 0.0, 1.0); + frag.gNormal = vec4(0.0, 0.0, 0.0, 1.0); return frag; } diff --git a/modules/digitaluniverse/shaders/points_fs.glsl b/modules/digitaluniverse/shaders/points_fs.glsl index ec8e442eb0..b27f617600 100644 --- a/modules/digitaluniverse/shaders/points_fs.glsl +++ b/modules/digitaluniverse/shaders/points_fs.glsl @@ -47,6 +47,9 @@ Fragment getFragment() { //frag.depth = gs_screenSpaceDepth; frag.depth = vs_screenSpaceDepth; + frag.gPosition = vec4(1e27, 1e27, 1e27, 1.0); + frag.gOtherData = vec4(0.0, 0.0, 0.0, 1.0); + frag.gNormal = vec4(0.0, 0.0, 0.0, 1.0); return frag; } diff --git a/modules/globebrowsing/CMakeLists.txt b/modules/globebrowsing/CMakeLists.txt index c4dd1f619d..2c82f7e11e 100644 --- a/modules/globebrowsing/CMakeLists.txt +++ b/modules/globebrowsing/CMakeLists.txt @@ -212,7 +212,7 @@ set(SHADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/shaders/pointglobe_fs.glsl ${CMAKE_CURRENT_SOURCE_DIR}/shaders/texturetilemapping.hglsl ${CMAKE_CURRENT_SOURCE_DIR}/shaders/tile.hglsl - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/tilefragcolor.hglsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/tilefragment.hglsl ${CMAKE_CURRENT_SOURCE_DIR}/shaders/tileheight.hglsl ${CMAKE_CURRENT_SOURCE_DIR}/shaders/tilevertexskirt.hglsl ${CMAKE_CURRENT_SOURCE_DIR}/shaders/globeshading.hglsl diff --git a/modules/globebrowsing/geometry/ellipsoid.cpp b/modules/globebrowsing/geometry/ellipsoid.cpp index a3bff9491e..60a45e4332 100644 --- a/modules/globebrowsing/geometry/ellipsoid.cpp +++ b/modules/globebrowsing/geometry/ellipsoid.cpp @@ -166,4 +166,18 @@ glm::dvec3 Ellipsoid::cartesianPosition(const Geodetic3& geodetic3) const { return rSurface + geodetic3.height * normal; } +void Ellipsoid::setShadowConfigurationArray( + const std::vector& shadowConfArray) +{ + _shadowConfArray = shadowConfArray; +} + +std::vector Ellipsoid::shadowConfigurationArray() const { + return _shadowConfArray; +} + +bool Ellipsoid::hasEclipseShadows() const { + return !_shadowConfArray.empty(); +} + } // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/geometry/ellipsoid.h b/modules/globebrowsing/geometry/ellipsoid.h index de16801b09..f802aedb3d 100644 --- a/modules/globebrowsing/geometry/ellipsoid.h +++ b/modules/globebrowsing/geometry/ellipsoid.h @@ -30,6 +30,8 @@ #include +#include + namespace openspace::globebrowsing { /** @@ -43,6 +45,12 @@ namespace openspace::globebrowsing { */ class Ellipsoid { public: + // Shadow configuration structure + struct ShadowConfiguration { + std::pair source; + std::pair caster; + }; + /** * \param radii defines three radii for the Ellipsoid */ @@ -84,6 +92,12 @@ public: glm::dvec3 cartesianSurfacePosition(const Geodetic2& geodetic2) const; glm::dvec3 cartesianPosition(const Geodetic3& geodetic3) const; + void setShadowConfigurationArray( + const std::vector& shadowConfArray + ); + std::vector shadowConfigurationArray() const; + bool hasEclipseShadows() const; + private: struct EllipsoidCache { glm::dvec3 _radiiSquared; @@ -97,6 +111,9 @@ private: void updateInternalCache(); glm::dvec3 _radii; + + // Eclipse shadows conf + std::vector _shadowConfArray; }; } // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/globes/renderableglobe.cpp b/modules/globebrowsing/globes/renderableglobe.cpp index 0e57dc3442..68ea6e4d88 100644 --- a/modules/globebrowsing/globes/renderableglobe.cpp +++ b/modules/globebrowsing/globes/renderableglobe.cpp @@ -29,11 +29,15 @@ #include #include + namespace { const char* keyFrame = "Frame"; const char* keyRadii = "Radii"; const char* keySegmentsPerPatch = "SegmentsPerPatch"; const char* keyLayers = "Layers"; + const char* keyShadowGroup = "ShadowGroup"; + const char* keyShadowSource = "Source"; + const char* keyShadowCaster = "Caster"; static const openspace::properties::Property::PropertyInfo SaveOrThrowInfo = { "SaveOrThrowCamera", @@ -131,6 +135,18 @@ namespace { "" // @TODO Missing documentation }; + static const openspace::properties::Property::PropertyInfo EclipseInfo = { + "Eclipse", + "Eclipse", + "Enables/Disable Eclipse shadows" + }; + + static const openspace::properties::Property::PropertyInfo EclipseHardShadowsInfo = { + "EclipseHardShadows", + "Eclipse Hard Shadows", + "Enables the rendering of eclipse shadows using hard shadows" + }; + static const openspace::properties::Property::PropertyInfo LodScaleFactorInfo = { "LodScaleFactor", "Level of Detail Scale Factor", @@ -175,6 +191,8 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary) BoolProperty(PerformShadingInfo, true), BoolProperty(AtmosphereInfo, false), BoolProperty(AccurateNormalsInfo, false), + BoolProperty(EclipseInfo, false), + BoolProperty(EclipseHardShadowsInfo, false), FloatProperty(LodScaleFactorInfo, 10.f, 1.f, 50.f), FloatProperty(CameraMinHeightInfo, 100.f, 0.f, 1000.f), FloatProperty(OrenNayarRoughnessInfo, 0.f, 0.f, 1.f) @@ -223,6 +241,8 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary) addProperty(_generalProperties.atmosphereEnabled); addProperty(_generalProperties.performShading); addProperty(_generalProperties.useAccurateNormals); + addProperty(_generalProperties.eclipseShadowsEnabled); + addProperty(_generalProperties.eclipseHardShadows); addProperty(_generalProperties.lodScaleFactor); addProperty(_generalProperties.cameraMinHeight); addProperty(_generalProperties.orenNayarRoughness); @@ -248,6 +268,8 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary) }; _generalProperties.atmosphereEnabled.onChange(notifyShaderRecompilation); _generalProperties.useAccurateNormals.onChange(notifyShaderRecompilation); + _generalProperties.eclipseShadowsEnabled.onChange(notifyShaderRecompilation); + _generalProperties.eclipseHardShadows.onChange(notifyShaderRecompilation); _generalProperties.performShading.onChange(notifyShaderRecompilation); _debugProperties.showChunkEdges.onChange(notifyShaderRecompilation); _debugProperties.showHeightResolution.onChange(notifyShaderRecompilation); @@ -259,6 +281,78 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary) addPropertySubOwner(_layerManager.get()); //addPropertySubOwner(_pointGlobe.get()); + //================================================================ + //======== Reads Shadow (Eclipses) Entries in mod file =========== + //================================================================ + ghoul::Dictionary shadowDictionary; + bool success = dictionary.getValue(keyShadowGroup, shadowDictionary); + bool disableShadows = false; + if (success) { + std::vector> sourceArray; + unsigned int sourceCounter = 1; + while (success) { + std::string sourceName; + success = shadowDictionary.getValue(keyShadowSource + + std::to_string(sourceCounter) + ".Name", sourceName); + if (success) { + double sourceRadius; + success = shadowDictionary.getValue(keyShadowSource + + std::to_string(sourceCounter) + ".Radius", sourceRadius); + if (success) { + sourceArray.emplace_back(sourceName, sourceRadius); + } + else { + //LWARNING("No Radius value expecified for Shadow Source Name " + // << sourceName << " from " << name + // << " planet.\nDisabling shadows for this planet."); + disableShadows = true; + break; + } + } + sourceCounter++; + } + + if (!disableShadows && !sourceArray.empty()) { + success = true; + std::vector> casterArray; + unsigned int casterCounter = 1; + while (success) { + std::string casterName; + success = shadowDictionary.getValue(keyShadowCaster + + std::to_string(casterCounter) + ".Name", casterName); + if (success) { + double casterRadius; + success = shadowDictionary.getValue(keyShadowCaster + + std::to_string(casterCounter) + ".Radius", casterRadius); + if (success) { + casterArray.emplace_back(casterName, casterRadius); + } + else { + //LWARNING("No Radius value expecified for Shadow Caster Name " + // << casterName << " from " << name + // << " planet.\nDisabling shadows for this planet."); + disableShadows = true; + break; + } + } + + casterCounter++; + } + + std::vector shadowConfArray; + if (!disableShadows && (!sourceArray.empty() && !casterArray.empty())) { + for (const auto & source : sourceArray) { + for (const auto & caster : casterArray) { + Ellipsoid::ShadowConfiguration sc; + sc.source = source; + sc.caster = caster; + shadowConfArray.push_back(sc); + } + } + _ellipsoid.setShadowConfigurationArray(shadowConfArray); + } + } + } } void RenderableGlobe::initializeGL() { @@ -283,7 +377,7 @@ bool RenderableGlobe::isReady() const { return true; } -void RenderableGlobe::render(const RenderData& data, RendererTasks& tasks) { +void RenderableGlobe::render(const RenderData& data, RendererTasks& renderTask) { bool statsEnabled = _debugProperties.collectStats.value(); _chunkedLodGlobe->stats.setEnabled(statsEnabled); @@ -298,7 +392,7 @@ void RenderableGlobe::render(const RenderData& data, RendererTasks& tasks) { setSaveCamera(nullptr); } } - _distanceSwitch.render(data, tasks); + _distanceSwitch.render(data, renderTask); } if (_savedCamera != nullptr) { DebugRenderer::ref().renderCameraFrustum(data, *_savedCamera); diff --git a/modules/globebrowsing/globes/renderableglobe.h b/modules/globebrowsing/globes/renderableglobe.h index f4e0ad28b3..c7206dd169 100644 --- a/modules/globebrowsing/globes/renderableglobe.h +++ b/modules/globebrowsing/globes/renderableglobe.h @@ -34,6 +34,12 @@ #include #include +#ifdef OPENSPACE_MODULE_ATMOSPHERE_ENABLED +namespace openspace { + class AtmosphereDeferredcaster; +} +#endif + namespace openspace::globebrowsing { class ChunkedLodGlobe; @@ -73,11 +79,24 @@ public: properties::BoolProperty performShading; properties::BoolProperty atmosphereEnabled; properties::BoolProperty useAccurateNormals; + properties::BoolProperty eclipseShadowsEnabled; + properties::BoolProperty eclipseHardShadows; properties::FloatProperty lodScaleFactor; properties::FloatProperty cameraMinHeight; properties::FloatProperty orenNayarRoughness; }; + // Shadow structure + struct ShadowRenderingStruct { + double xu, + xp; + double rs, + rc; + glm::dvec3 sourceCasterVec; + glm::dvec3 casterPositionVec; + bool isShadowing; + }; + RenderableGlobe(const ghoul::Dictionary& dictionary); ~RenderableGlobe() = default; diff --git a/modules/globebrowsing/rendering/chunkrenderer.cpp b/modules/globebrowsing/rendering/chunkrenderer.cpp index bb712a6fee..313996971b 100644 --- a/modules/globebrowsing/rendering/chunkrenderer.cpp +++ b/modules/globebrowsing/rendering/chunkrenderer.cpp @@ -32,6 +32,11 @@ #include #include #include +#include + +namespace { + const double KM_TO_M = 1000.0; +} namespace openspace::globebrowsing { @@ -111,6 +116,93 @@ ghoul::opengl::ProgramObject* ChunkRenderer::getActivatedProgramWithTileData( return programObject; } +void ChunkRenderer::calculateEclipseShadows(const Chunk& chunk, ghoul::opengl::ProgramObject* programObject, + const RenderData& data) { + // Shadow calculations.. + if (chunk.owner().ellipsoid().hasEclipseShadows()) { + std::vector shadowDataArray; + std::vector shadowConfArray = chunk.owner().ellipsoid().shadowConfigurationArray(); + shadowDataArray.reserve(shadowConfArray.size()); + double lt; + for (const auto & shadowConf : shadowConfArray) { + // TO REMEMBER: all distances and lengths in world coordinates are in meters!!! We need to move this to view space... + // Getting source and caster: + glm::dvec3 sourcePos = SpiceManager::ref().targetPosition(shadowConf.source.first, "SUN", "GALACTIC", {}, + data.time.j2000Seconds(), lt); + sourcePos *= KM_TO_M; // converting to meters + glm::dvec3 casterPos = SpiceManager::ref().targetPosition(shadowConf.caster.first, "SUN", "GALACTIC", {}, + data.time.j2000Seconds(), lt); + casterPos *= KM_TO_M; // converting to meters + psc caster_pos = PowerScaledCoordinate::CreatePowerScaledCoordinate(casterPos.x, casterPos.y, casterPos.z); + + + // First we determine if the caster is shadowing the current planet (all calculations in World Coordinates): + glm::dvec3 planetCasterVec = casterPos - data.position.dvec3(); + glm::dvec3 sourceCasterVec = casterPos - sourcePos; + double sc_length = glm::length(sourceCasterVec); + glm::dvec3 planetCaster_proj = (glm::dot(planetCasterVec, sourceCasterVec) / (sc_length*sc_length)) * sourceCasterVec; + double d_test = glm::length(planetCasterVec - planetCaster_proj); + double xp_test = shadowConf.caster.second * sc_length / (shadowConf.source.second + shadowConf.caster.second); + double rp_test = shadowConf.caster.second * (glm::length(planetCaster_proj) + xp_test) / xp_test; + + glm::dvec3 sunPos = SpiceManager::ref().targetPosition("SUN", "SUN", "GALACTIC", {}, data.time.j2000Seconds(), lt); + double casterDistSun = glm::length(casterPos - sunPos); + double planetDistSun = glm::length(data.position.dvec3() - sunPos); + + RenderableGlobe::ShadowRenderingStruct shadowData; + shadowData.isShadowing = false; + + // Eclipse shadows considers planets and moons as spheres + if (((d_test - rp_test) < (chunk.owner().ellipsoid().radii().x * KM_TO_M)) && + (casterDistSun < planetDistSun)) { + // The current caster is shadowing the current planet + shadowData.isShadowing = true; + shadowData.rs = shadowConf.source.second; + shadowData.rc = shadowConf.caster.second; + shadowData.sourceCasterVec = glm::normalize(sourceCasterVec); + shadowData.xp = xp_test; + shadowData.xu = shadowData.rc * sc_length / (shadowData.rs - shadowData.rc); + shadowData.casterPositionVec = casterPos; + } + shadowDataArray.push_back(shadowData); + } + + const std::string uniformVarName("shadowDataArray["); + unsigned int counter = 0; + for (const auto & sd : shadowDataArray) { + std::stringstream ss; + ss << uniformVarName << counter << "].isShadowing"; + programObject->setUniform(ss.str(), sd.isShadowing); + if (sd.isShadowing) { + ss.str(std::string()); + ss << uniformVarName << counter << "].xp"; + programObject->setUniform(ss.str(), sd.xp); + ss.str(std::string()); + ss << uniformVarName << counter << "].xu"; + programObject->setUniform(ss.str(), sd.xu); + /*ss.str(std::string()); + ss << uniformVarName << counter << "].rs"; + programObject->setUniform(ss.str(), sd.rs);*/ + ss.str(std::string()); + ss << uniformVarName << counter << "].rc"; + programObject->setUniform(ss.str(), sd.rc); + ss.str(std::string()); + ss << uniformVarName << counter << "].sourceCasterVec"; + programObject->setUniform(ss.str(), sd.sourceCasterVec); + ss.str(std::string()); + ss << uniformVarName << counter << "].casterPositionVec"; + programObject->setUniform(ss.str(), sd.casterPositionVec); + } + counter++; + } + + programObject->setUniform("inverseViewTransform", glm::inverse(data.camera.combinedViewMatrix())); + programObject->setUniform("modelTransform", chunk.owner().modelTransform()); + programObject->setUniform("hardShadows", chunk.owner().generalProperties().eclipseHardShadows); + programObject->setUniform("calculateEclipseShadows", true); + } +} + void ChunkRenderer::setCommonUniforms(ghoul::opengl::ProgramObject& programObject, const Chunk& chunk, const RenderData& data) { @@ -177,6 +269,12 @@ void ChunkRenderer::setCommonUniforms(ghoul::opengl::ProgramObject& programObjec programObject.setUniform("deltaPhi0", glm::length(deltaPhi0)); programObject.setUniform("deltaPhi1", glm::length(deltaPhi1)); programObject.setUniform("tileDelta", tileDelta); + + // This should not be needed once the light calculations for the atmosphere + // is performed in view space.. + programObject.setUniform("invViewModelTransform", + glm::inverse(glm::mat4(data.camera.combinedViewMatrix()) * + glm::mat4(chunk.owner().modelTransform()))); } } @@ -190,7 +288,7 @@ void ChunkRenderer::renderChunkGlobally(const Chunk& chunk, const RenderData& da } const Ellipsoid& ellipsoid = chunk.owner().ellipsoid(); - + if (_layerManager->hasAnyBlendingLayersEnabled()) { // Calculations are done in the reference frame of the globe. Hence, the // camera position needs to be transformed with the inverse model matrix @@ -220,6 +318,7 @@ void ChunkRenderer::renderChunkGlobally(const Chunk& chunk, const RenderData& da "modelViewProjectionTransform", modelViewProjectionTransform); programObject->setUniform("minLatLon", glm::vec2(swCorner.toLonLatVec2())); programObject->setUniform("lonLatScalingFactor", glm::vec2(patchSize.toLonLatVec2())); + // Ellipsoid Radius (Model Space) programObject->setUniform("radiiSquared", glm::vec3(ellipsoid.radiiSquared())); if (_layerManager->layerGroup( @@ -242,6 +341,10 @@ void ChunkRenderer::renderChunkGlobally(const Chunk& chunk, const RenderData& da setCommonUniforms(*programObject, chunk, data); + if (chunk.owner().ellipsoid().hasEclipseShadows()) { + calculateEclipseShadows(chunk, programObject, data); + } + // OpenGL rendering settings glEnable(GL_DEPTH_TEST); glEnable(GL_CULL_FACE); @@ -282,20 +385,24 @@ void ChunkRenderer::renderChunkLocally(const Chunk& chunk, const RenderData& dat } // Calculate other uniform variables needed for rendering + // Send the matrix inverse to the fragment for the global and local shader (JCC) dmat4 modelTransform = chunk.owner().modelTransform(); dmat4 viewTransform = data.camera.combinedViewMatrix(); dmat4 modelViewTransform = viewTransform * modelTransform; std::vector cornerNames = { "p01", "p11", "p00", "p10" }; std::vector cornersCameraSpace(4); + std::vector cornersModelSpace(4); for (int i = 0; i < 4; ++i) { Quad q = static_cast(i); Geodetic2 corner = chunk.surfacePatch().getCorner(q); glm::dvec3 cornerModelSpace = ellipsoid.cartesianSurfacePosition(corner); + cornersModelSpace[i] = cornerModelSpace; glm::dvec3 cornerCameraSpace = glm::dvec3(modelViewTransform * glm::dvec4(cornerModelSpace, 1)); cornersCameraSpace[i] = cornerCameraSpace; programObject->setUniform(cornerNames[i], vec3(cornerCameraSpace)); + } // TODO: Patch normal can be calculated for all corners and then linearly @@ -306,6 +413,15 @@ void ChunkRenderer::renderChunkLocally(const Chunk& chunk, const RenderData& dat cornersCameraSpace[Quad::NORTH_EAST] - cornersCameraSpace[Quad::SOUTH_WEST])); + // In order to improve performance, lets use the normal in object space (model space) + // for deferred rendering. + vec3 patchNormalModelSpace = normalize( + cross(cornersModelSpace[Quad::SOUTH_EAST] - + cornersModelSpace[Quad::SOUTH_WEST], + cornersModelSpace[Quad::NORTH_EAST] - + cornersModelSpace[Quad::SOUTH_WEST])); + + programObject->setUniform("patchNormalModelSpace", patchNormalModelSpace); programObject->setUniform("patchNormalCameraSpace", patchNormalCameraSpace); programObject->setUniform( "projectionTransform", @@ -319,6 +435,10 @@ void ChunkRenderer::renderChunkLocally(const Chunk& chunk, const RenderData& dat } setCommonUniforms(*programObject, chunk, data); + + if (chunk.owner().ellipsoid().hasEclipseShadows()) { + calculateEclipseShadows(chunk, programObject, data); + } // OpenGL rendering settings glEnable(GL_DEPTH_TEST); diff --git a/modules/globebrowsing/rendering/chunkrenderer.h b/modules/globebrowsing/rendering/chunkrenderer.h index 37149c26df..6af1a518c9 100644 --- a/modules/globebrowsing/rendering/chunkrenderer.h +++ b/modules/globebrowsing/rendering/chunkrenderer.h @@ -83,6 +83,9 @@ private: std::shared_ptr gpuLayerManager, const Chunk& chunk); + void calculateEclipseShadows(const Chunk& chunk, ghoul::opengl::ProgramObject* programObject, + const RenderData& data); + void setCommonUniforms(ghoul::opengl::ProgramObject& programObject, const Chunk& chunk, const RenderData& data); diff --git a/modules/globebrowsing/rendering/layershadermanager.cpp b/modules/globebrowsing/rendering/layershadermanager.cpp index 4c2c0710b8..3ed4f9abaa 100644 --- a/modules/globebrowsing/rendering/layershadermanager.cpp +++ b/modules/globebrowsing/rendering/layershadermanager.cpp @@ -112,6 +112,8 @@ LayerShaderManager::LayerShaderPreprocessingData ); pairs.emplace_back("useAtmosphere", std::to_string(generalProps.atmosphereEnabled)); pairs.emplace_back("performShading", std::to_string(generalProps.performShading)); + pairs.emplace_back("useEclipseShadows", std::to_string(generalProps.eclipseShadowsEnabled)); + pairs.emplace_back("useEclipseHardShadows", std::to_string(generalProps.eclipseHardShadows)); pairs.emplace_back("showChunkEdges", std::to_string(debugProps.showChunkEdges)); pairs.emplace_back("showHeightResolution", std::to_string(debugProps.showHeightResolution) @@ -234,6 +236,7 @@ void LayerShaderManager::recompileShaderProgram( ghoul_assert(_programObject != nullptr, "Failed to initialize programObject!"); using IgnoreError = ghoul::opengl::ProgramObject::ProgramObject::IgnoreError; _programObject->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); + _programObject->setIgnoreUniformLocationError(IgnoreError::Yes); _updatedOnLastCall = true; } diff --git a/modules/globebrowsing/shaders/globalchunkedlodpatch_fs.glsl b/modules/globebrowsing/shaders/globalchunkedlodpatch_fs.glsl index 86a48014d4..b7344e2973 100644 --- a/modules/globebrowsing/shaders/globalchunkedlodpatch_fs.glsl +++ b/modules/globebrowsing/shaders/globalchunkedlodpatch_fs.glsl @@ -22,17 +22,16 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include <${MODULE_GLOBEBROWSING}/shaders/tilefragcolor.hglsl> +#include <${MODULE_GLOBEBROWSING}/shaders/tilefragment.hglsl> #include "fragment.glsl" Fragment getFragment() { Fragment frag; - frag.color = getTileFragColor(); + frag = getTileFragment(); #if SHOW_CHUNK_EDGES frag.color += patchBorderOverlay(fs_uv, vec3(0.0, 1.0, 0.0), 0.02); #endif // SHOW_CHUNK_EDGES - - frag.depth = fs_position.w; + return frag; } diff --git a/modules/globebrowsing/shaders/globalchunkedlodpatch_vs.glsl b/modules/globebrowsing/shaders/globalchunkedlodpatch_vs.glsl index b67b2e5890..52e02a7936 100644 --- a/modules/globebrowsing/shaders/globalchunkedlodpatch_vs.glsl +++ b/modules/globebrowsing/shaders/globalchunkedlodpatch_vs.glsl @@ -35,6 +35,7 @@ layout(location = 1) in vec2 in_uv; out vec2 fs_uv; out vec4 fs_position; +out vec3 fs_normal; out vec3 ellipsoidNormalCameraSpace; out LevelWeights levelWeights; out vec3 positionCameraSpace; @@ -44,6 +45,11 @@ out vec3 ellipsoidTangentThetaCameraSpace; out vec3 ellipsoidTangentPhiCameraSpace; #endif //USE_ACCURATE_NORMALS +#if USE_ECLIPSE_SHADOWS +out vec3 positionWorldSpace; +uniform dmat4 modelTransform; +#endif + uniform mat4 modelViewProjectionTransform; uniform mat4 modelViewTransform; uniform vec3 radiiSquared; @@ -109,12 +115,17 @@ void main() { // Add the height in the direction of the normal pair.position += pair.normal * height; vec4 positionClippingSpace = - modelViewProjectionTransform * vec4(pair.position, 1); + modelViewProjectionTransform * vec4(pair.position, 1.0); // Write output fs_uv = in_uv; fs_position = z_normalization(positionClippingSpace); gl_Position = fs_position; ellipsoidNormalCameraSpace = mat3(modelViewTransform) * pair.normal; - positionCameraSpace = vec3(modelViewTransform * vec4(pair.position, 1)); + fs_normal = pair.normal; + positionCameraSpace = vec3(modelViewTransform * vec4(pair.position, 1.0)); + +#if USE_ECLIPSE_SHADOWS + positionWorldSpace = vec3(modelTransform * dvec4(pair.position, 1.0)); +#endif } diff --git a/modules/globebrowsing/shaders/localchunkedlodpatch_fs.glsl b/modules/globebrowsing/shaders/localchunkedlodpatch_fs.glsl index a4be415295..89d486b8bb 100644 --- a/modules/globebrowsing/shaders/localchunkedlodpatch_fs.glsl +++ b/modules/globebrowsing/shaders/localchunkedlodpatch_fs.glsl @@ -22,17 +22,16 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include <${MODULE_GLOBEBROWSING}/shaders/tilefragcolor.hglsl> +#include <${MODULE_GLOBEBROWSING}/shaders/tilefragment.hglsl> #include "fragment.glsl" Fragment getFragment() { Fragment frag; - frag.color = getTileFragColor(); + frag = getTileFragment(); #if SHOW_CHUNK_EDGES frag.color += patchBorderOverlay(fs_uv, vec3(1,0,0), 0.005); #endif // SHOW_CHUNK_EDGES - frag.depth = fs_position.w; return frag; } diff --git a/modules/globebrowsing/shaders/localchunkedlodpatch_vs.glsl b/modules/globebrowsing/shaders/localchunkedlodpatch_vs.glsl index db535a6b20..b974d76501 100644 --- a/modules/globebrowsing/shaders/localchunkedlodpatch_vs.glsl +++ b/modules/globebrowsing/shaders/localchunkedlodpatch_vs.glsl @@ -35,6 +35,7 @@ layout(location = 1) in vec2 in_uv; out vec2 fs_uv; out vec4 fs_position; +out vec3 fs_normal; out vec3 ellipsoidNormalCameraSpace; out LevelWeights levelWeights; out vec3 positionCameraSpace; @@ -44,6 +45,11 @@ out vec3 ellipsoidTangentThetaCameraSpace; out vec3 ellipsoidTangentPhiCameraSpace; #endif // USE_ACCURATE_NORMALS +#if USE_ECLIPSE_SHADOWS +out vec3 positionWorldSpace; +uniform dmat4 inverseViewTransform; +#endif + uniform mat4 projectionTransform; // Input points in camera space uniform vec3 p00; @@ -51,12 +57,12 @@ uniform vec3 p10; uniform vec3 p01; uniform vec3 p11; uniform vec3 patchNormalCameraSpace; +uniform vec3 patchNormalModelSpace; uniform float chunkMinHeight; uniform float distanceScaleFactor; uniform int chunkLevel; - vec3 bilinearInterpolation(vec2 uv) { vec3 p0 = (1 - uv.x) * p00 + uv.x * p10; vec3 p1 = (1 - uv.x) * p01 + uv.x * p11; @@ -101,5 +107,10 @@ void main() { fs_position = z_normalization(positionClippingSpace); gl_Position = fs_position; ellipsoidNormalCameraSpace = patchNormalCameraSpace; + fs_normal = patchNormalModelSpace; positionCameraSpace = p; + +#if USE_ECLIPSE_SHADOWS + positionWorldSpace = vec3(inverseViewTransform * dvec4(p, 1.0)); +#endif } diff --git a/modules/globebrowsing/shaders/texturetilemapping.hglsl b/modules/globebrowsing/shaders/texturetilemapping.hglsl index 395d219bab..81b500a43e 100644 --- a/modules/globebrowsing/shaders/texturetilemapping.hglsl +++ b/modules/globebrowsing/shaders/texturetilemapping.hglsl @@ -61,6 +61,8 @@ #define USE_ATMOSPHERE #{useAtmosphere} #define USE_ACCURATE_NORMALS #{useAccurateNormals} #define PERFORM_SHADING #{performShading} +#define USE_ECLIPSE_SHADOWS #{useEclipseShadows} +#define USE_ECLIPSE_HARD_SHADOWS #{useEclipseHardShadows} #define SHOW_CHUNK_EDGES #{showChunkEdges} #define SHOW_HEIGHT_RESOLUTION #{showHeightResolution} #define SHOW_HEIGHT_INTENSITIES #{showHeightIntensities} @@ -321,7 +323,7 @@ vec4 calculateNight(vec4 currentColor, vec2 uv, LevelWeights levelWeights, vec3 n = normalize(ellipsoidNormalCameraSpace); vec3 l = lightDirectionCameraSpace; - float cosineFactor = clamp(dot(l, normalize(n + 0.15 * l)) * 3 , 0, 1); + float cosineFactor = clamp(dot(l, normalize(n + 0.20 * l)) * 3 , 0, 1); #for i in 0..#{lastLayerIndexNightLayers} { @@ -390,7 +392,8 @@ vec4 calculateOverlay(vec4 currentColor, vec2 uv, LevelWeights levelWeights, vec4 calculateWater(vec4 currentColor, vec2 uv, LevelWeights levelWeights, Layer WaterMasks[NUMLAYERS_WATERMASK], vec3 ellipsoidNormalCameraSpace, - vec3 lightDirectionCameraSpace, vec3 positionCameraSpace) + vec3 lightDirectionCameraSpace, vec3 positionCameraSpace, + out float reflectance) { vec4 waterColor = vec4(0.0); @@ -422,8 +425,10 @@ vec4 calculateWater(vec4 currentColor, vec2 uv, LevelWeights levelWeights, vec3 specularTotal = specularColor * cosineFactor * specularIntensity * waterColor.a; + reflectance = waterColor.a; //return blendNormal(currentColor, waterColor); - return currentColor + vec4(specularTotal, 1); + //return currentColor + vec4(specularTotal, 1); + return currentColor; } #endif // TEXTURETILEMAPPING_HGLSL diff --git a/modules/globebrowsing/shaders/tilefragcolor.hglsl b/modules/globebrowsing/shaders/tilefragment.hglsl similarity index 54% rename from modules/globebrowsing/shaders/tilefragcolor.hglsl rename to modules/globebrowsing/shaders/tilefragment.hglsl index 8d639fd7c6..5715345d96 100644 --- a/modules/globebrowsing/shaders/tilefragcolor.hglsl +++ b/modules/globebrowsing/shaders/tilefragment.hglsl @@ -29,6 +29,7 @@ #include <${MODULE_GLOBEBROWSING}/shaders/texturetilemapping.hglsl> #include <${MODULE_GLOBEBROWSING}/shaders/tileheight.hglsl> #include "PowerScaling/powerScaling_fs.hglsl" +#include "fragment.glsl" // Below are all the tiles that are used for contributing the actual fragment color @@ -46,6 +47,7 @@ uniform Layer Overlays[NUMLAYERS_OVERLAY]; #if USE_WATERMASK uniform Layer WaterMasks[NUMLAYERS_WATERMASK]; +float waterReflectance = 0.0; #endif // USE_WATERMASK #if SHOW_HEIGHT_RESOLUTION @@ -64,7 +66,77 @@ uniform vec3 lightDirectionCameraSpace; uniform float orenNayarRoughness; #endif +#if USE_ECLIPSE_SHADOWS +in vec3 positionWorldSpace; + +/******************************************************************************* + ***** ALL CALCULATIONS FOR ECLIPSE ARE IN METERS AND IN WORLD SPACE SYSTEM **** + *******************************************************************************/ +// JCC: Remove and use dictionary to +// decides the number of shadows +const uint numberOfShadows = 1; + +struct ShadowRenderingStruct { + double xu, xp; + double rs, rc; + dvec3 sourceCasterVec; + dvec3 casterPositionVec; + bool isShadowing; +}; + +// Eclipse shadow data +// JCC: Remove and use dictionary to +// decides the number of shadows +uniform ShadowRenderingStruct shadowDataArray[numberOfShadows]; +uniform int shadows; +uniform bool hardShadows; + +vec4 butterworthFunc(const float d, const float r, const float n) { + return vec4(vec3(sqrt(r/(r + pow(d, 2*n)))), 1.0); +} + +vec4 calcShadow(const ShadowRenderingStruct shadowInfoArray[numberOfShadows], const dvec3 position, + const bool ground) { + if (shadowInfoArray[0].isShadowing) { + dvec3 pc = shadowInfoArray[0].casterPositionVec - position; + dvec3 sc_norm = shadowInfoArray[0].sourceCasterVec; + dvec3 pc_proj = dot(pc, sc_norm) * sc_norm; + dvec3 d = pc - pc_proj; + + float length_d = float(length(d)); + double length_pc_proj = length(pc_proj); + + float r_p_pi = float(shadowInfoArray[0].rc * (length_pc_proj + shadowInfoArray[0].xp) / shadowInfoArray[0].xp); + float r_u_pi = float(shadowInfoArray[0].rc * (shadowInfoArray[0].xu - length_pc_proj) / shadowInfoArray[0].xu); + + if ( length_d < r_u_pi ) { // umbra + if (ground) { +#if USE_ECLIPSE_HARD_SHADOWS + return vec4(0.2, 0.2, 0.2, 1.0); +#endif + return butterworthFunc(length_d, r_u_pi, 4.0); + } + else { +#if USE_ECLIPSE_HARD_SHADOWS + return vec4(0.5, 0.5, 0.5, 1.0); +#endif + return vec4(vec3(length_d/r_p_pi), 1.0); + } + } + else if ( length_d < r_p_pi ) {// penumbra +#if USE_ECLIPSE_HARD_SHADOWS + return vec4(0.5, 0.5, 0.5, 1.0); +#endif + return vec4(vec3(length_d/r_p_pi), 1.0); + } + } + + return vec4(1.0); +} +#endif + in vec4 fs_position; +in vec3 fs_normal; in vec2 fs_uv; in vec3 ellipsoidNormalCameraSpace; in vec3 positionCameraSpace; @@ -72,6 +144,10 @@ in vec3 positionCameraSpace; #if USE_ACCURATE_NORMALS in vec3 ellipsoidTangentThetaCameraSpace; in vec3 ellipsoidTangentPhiCameraSpace; + +// Once deferred light calculations are done in view space this can be removed +// so that we only need one normal; in view space. +uniform mat4 invViewModelTransform; #endif // USE_ACCURATE_NORMALS // levelInterpolationParameter is used to interpolate between a tile and its parent tiles @@ -83,10 +159,12 @@ in LevelWeights levelWeights; * the local and global chunk rendering. * */ -vec4 getTileFragColor() { - vec4 color = vec4(0.3, 0.3, 0.3, 1.0); +Fragment getTileFragment() { + Fragment frag; + frag.color = vec4(0.3, 0.3, 0.3, 1.0); vec3 normal = normalize(ellipsoidNormalCameraSpace); + vec3 normalModelSpace = normalize(fs_normal); #if USE_ACCURATE_NORMALS normal = getTileNormal( fs_uv, @@ -95,11 +173,14 @@ vec4 getTileFragColor() { normalize(ellipsoidTangentThetaCameraSpace), normalize(ellipsoidTangentPhiCameraSpace) ); + // Once deferred light calculations are done in view space this can be removed + // so that we only need one normal; in view space. + normalModelSpace = mat3(invViewModelTransform) * normal; #endif /// USE_ACCURATE_NORMALS #if USE_COLORTEXTURE - color = calculateColor( - color, + frag.color = calculateColor( + frag.color, fs_uv, levelWeights, ColorLayers @@ -107,21 +188,22 @@ vec4 getTileFragColor() { #endif // USE_COLORTEXTURE #if USE_WATERMASK - color = calculateWater( - color, + frag.color = calculateWater( + frag.color, fs_uv, levelWeights, WaterMasks, normal, lightDirectionCameraSpace, // Should already be normalized - positionCameraSpace + positionCameraSpace, + waterReflectance ); #endif // USE_WATERMASK #if USE_NIGHTTEXTURE - color = calculateNight( - color, + frag.color = calculateNight( + frag.color, fs_uv, levelWeights, NightLayers, @@ -132,8 +214,8 @@ vec4 getTileFragColor() { #endif // USE_NIGHTTEXTURE #if PERFORM_SHADING - color = calculateShadedColor( - color, + frag.color = calculateShadedColor( + frag.color, normal, lightDirectionCameraSpace, normalize(positionCameraSpace), @@ -143,10 +225,10 @@ vec4 getTileFragColor() { #if USE_ATMOSPHERE // Temporary until the real atmosphere code is here - //color = color + vec4(0.5,0.5,1,0) * 0.3; // Just to see something for now - vec3 n = normalize(ellipsoidNormalCameraSpace); - vec3 l = lightDirectionCameraSpace; - vec3 c = normalize(positionCameraSpace); + //frag.color = frag.color + vec4(0.5,0.5,1,0) * 0.3; // Just to see something for now + const vec3 n = normalize(ellipsoidNormalCameraSpace); + const vec3 l = lightDirectionCameraSpace; + const vec3 c = normalize(positionCameraSpace); float cosFactor = 1 - clamp(dot(-n * 0.9, c), 0, 1); cosFactor *= 1.1; cosFactor -= 0.1; @@ -159,13 +241,17 @@ vec4 getTileFragColor() { //float cosFactorLight = max(dot(-lightDirectionCameraSpace, normalize(ellipsoidNormalCameraSpace)), 0); //vec3 r = reflect(l, n); //float scatteredLight = pow(clamp(dot(-r,c), 0, 1), 20); - vec3 atmosphereColor = vec3(0.5, 0.5, 1.0) * 2.0; - color += vec4(atmosphereColor,0) * cosFactor * cosFactorLight * 0.5; + const vec3 atmosphereColor = vec3(0.5, 0.5, 1.0) * 2.0; + frag.color += vec4(atmosphereColor,0) * cosFactor * cosFactorLight * 0.5; #endif // USE_ATMOSPHERE +#if USE_ECLIPSE_SHADOWS + frag.color *= calcShadow(shadowDataArray, dvec3(positionWorldSpace), true); +#endif + #if USE_OVERLAY - color = calculateOverlay( - color, + frag.color = calculateOverlay( + frag.color, fs_uv, levelWeights, Overlays @@ -173,25 +259,40 @@ vec4 getTileFragColor() { #endif // USE_OVERLAY #if SHOW_HEIGHT_INTENSITIES - color.r *= 0.1; - color.g *= 0.1; - color.b *= 0.1; + frag.color.r *= 0.1; + frag.color.g *= 0.1; + frag.color.b *= 0.1; float untransformedHeight = getUntransformedTileVertexHeight(fs_uv, levelWeights); float contourLine = fract(10.0 * untransformedHeight) > 0.98 ? 1.0 : 0.0; - color.r += untransformedHeight; - color.b = contourLine; + frag.color.r += untransformedHeight; + frag.color.b = contourLine; #endif #if SHOW_HEIGHT_RESOLUTION - color += 0.0001*calculateDebugColor(fs_uv, fs_position, vertexResolution); + frag.color += 0.0001*calculateDebugColor(fs_uv, fs_position, vertexResolution); #if USE_HEIGHTMAP - color.r = min(color.r, 0.8); - color.r += tileResolution(fs_uv, HeightLayers[0].pile.chunkTile0) > 0.9 ? 1 : 0; + frag.color.r = min(frag.color.r, 0.8); + frag.color.r += tileResolution(fs_uv, HeightLayers[0].pile.chunkTile0) > 0.9 ? 1 : 0; #endif #endif - return color; + // Other data +#if USE_WATERMASK + // Water reflectance is added to the G-Buffer. + frag.gOtherData = vec4(waterReflectance, waterReflectance, waterReflectance, 1.0); +#else + frag.gOtherData = vec4(0.0, 0.0, 0.0, 1.0); +#endif + // Normal is written Object Space. + // Right now the only renderable using this info is the atm and, + // because all calculation for light interactions are done in Object + // Space, we avoid a new computation saving the normals in Object Space. + frag.gNormal = vec4(normalModelSpace, 1.0); + frag.gPosition = vec4(positionCameraSpace, 1.0); // in Camera Rig Space + + frag.depth = fs_position.w; + return frag; } #endif ///TILE_FRAG_COLOR_HGLSL diff --git a/modules/globebrowsing/shaders/tileheight.hglsl b/modules/globebrowsing/shaders/tileheight.hglsl index df7cb9673d..92acc4c10e 100644 --- a/modules/globebrowsing/shaders/tileheight.hglsl +++ b/modules/globebrowsing/shaders/tileheight.hglsl @@ -97,7 +97,9 @@ vec3 getTileNormal(vec2 uv, LevelWeights levelWeights, vec3 ellipsoidNormalCamer vec3 ellipsoidTangentThetaCameraSpace, vec3 ellipsoidTangentPhiCameraSpace) { -#if USE_ACCURATE_NORMALS && USE_HEIGHTMAP + vec3 normal = ellipsoidNormalCameraSpace; + +#if USE_ACCURATE_NORMALS float deltaPhi = mix(deltaPhi0, deltaPhi1, uv.x); float deltaTheta = mix(deltaTheta0, deltaTheta1, uv.y); @@ -111,10 +113,9 @@ vec3 getTileNormal(vec2 uv, LevelWeights levelWeights, vec3 ellipsoidNormalCamer vec3 diffTheta = deltaThetaVec + ellipsoidNormalCameraSpace * (height10 - height00); vec3 diffPhi = deltaPhiVec + ellipsoidNormalCameraSpace * (height01 - height00); - return normalize(cross(diffTheta, diffPhi)); -#else // USE_ACCURATE_NORMALS && USE_HEIGHTMAP - return ellipsoidNormalCameraSpace; -#endif + normal = normalize(cross(diffTheta, diffPhi)); +#endif // USE_ACCURATE_NORMALS + return normal; } #endif // TILE_HEIGHT_HGLSL diff --git a/modules/imgui/src/guiorigincomponent.cpp b/modules/imgui/src/guiorigincomponent.cpp new file mode 100644 index 0000000000..32f42a7d95 --- /dev/null +++ b/modules/imgui/src/guiorigincomponent.cpp @@ -0,0 +1,79 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#include + +#include + +#include +#include +#include +#include +#include + +#include + +namespace openspace::gui { + +GuiOriginComponent::GuiOriginComponent() + : GuiComponent("Origin") +{} + +void GuiOriginComponent::render() { + SceneGraphNode* currentFocus = OsEng.navigationHandler().focusNode(); + + std::vector nodes = + OsEng.renderEngine().scene()->allSceneGraphNodes(); + + std::sort( + nodes.begin(), + nodes.end(), + [](SceneGraphNode* lhs, SceneGraphNode* rhs) { + return lhs->name() < rhs->name(); + } + ); + std::string nodeNames = ""; + for (SceneGraphNode* n : nodes) { + nodeNames += n->name() + '\0'; + } + + auto iCurrentFocus = std::find(nodes.begin(), nodes.end(), currentFocus); + if (!nodes.empty()) { + // Only check if we found the current focus node if we have any nodes at all + // only then it would be a real error + ghoul_assert(iCurrentFocus != nodes.end(), "Focus node not found"); + } + int currentPosition = static_cast(std::distance(nodes.begin(), iCurrentFocus)); + + bool hasChanged = ImGui::Combo("Origin", ¤tPosition, nodeNames.c_str()); + if (hasChanged) { + OsEng.scriptEngine().queueScript( + "openspace.setPropertyValue('NavigationHandler.Origin', '" + + nodes[currentPosition]->name() + "');", + scripting::ScriptEngine::RemoteScripting::Yes + ); + } +} + +} // namespace openspace::gui diff --git a/modules/imgui/src/renderproperties.cpp b/modules/imgui/src/renderproperties.cpp index c5bb33aadf..8b224cfff2 100644 --- a/modules/imgui/src/renderproperties.cpp +++ b/modules/imgui/src/renderproperties.cpp @@ -37,8 +37,10 @@ #include #include +#include #include +#include #include namespace openspace { diff --git a/modules/space/rendering/renderableplanet.cpp b/modules/space/rendering/renderableplanet.cpp index 61c5e88f15..d352d62559 100644 --- a/modules/space/rendering/renderableplanet.cpp +++ b/modules/space/rendering/renderableplanet.cpp @@ -27,13 +27,12 @@ #include #include -#include -#include -#include #include #include #include #include +#include +#include #include #include @@ -46,15 +45,17 @@ #include #include +#define _USE_MATH_DEFINES +#include + namespace { - constexpr const char* KeyGeometry = "Geometry"; - constexpr const char* KeyRadius = "Radius"; + constexpr const char* KeyGeometry = "Geometry"; + constexpr const char* KeyRadius = "Radius"; + constexpr const char* _loggerCat = "RenderablePlanet"; - constexpr const char* _loggerCat = "RenderablePlanet"; - - constexpr const char* keyShadowGroup = "Shadow_Group"; - constexpr const char* keyShadowSource = "Source"; - constexpr const char* keyShadowCaster = "Caster"; + constexpr const char* keyShadowGroup = "Shadow_Group"; + constexpr const char* keyShadowSource = "Source"; + constexpr const char* keyShadowCaster = "Caster"; static const openspace::properties::Property::PropertyInfo ColorTextureInfo = { "ColorTexture", @@ -173,6 +174,7 @@ RenderablePlanet::RenderablePlanet(const ghoul::Dictionary& dictionary) , _hasNightTexture(false) , _hasHeightTexture(false) , _shadowEnabled(false) + , _time(0.f) { ghoul_precondition( dictionary.hasKeyAndValue(SceneGraphNode::KeyName), @@ -257,26 +259,25 @@ RenderablePlanet::RenderablePlanet(const ghoul::Dictionary& dictionary) } addProperty(_performShading); - // Shadow data: + //================================================================ + //======== Reads Shadow (Eclipses) Entries in mod file =========== + //================================================================ ghoul::Dictionary shadowDictionary; bool success = dictionary.getValue(keyShadowGroup, shadowDictionary); bool disableShadows = false; if (success) { - std::vector< std::pair > sourceArray; + std::vector> sourceArray; unsigned int sourceCounter = 1; while (success) { std::string sourceName; - std::stringstream ss; - ss << keyShadowSource << sourceCounter << ".Name"; - success = shadowDictionary.getValue(ss.str(), sourceName); + success = shadowDictionary.getValue(keyShadowSource + + std::to_string(sourceCounter) + ".Name", sourceName); if (success) { float sourceRadius; - ss.str(std::string()); - ss << keyShadowSource << sourceCounter << ".Radius"; - success = shadowDictionary.getValue(ss.str(), sourceRadius); + success = shadowDictionary.getValue(keyShadowSource + + std::to_string(sourceCounter) + ".Radius", sourceRadius); if (success) { - sourceArray.push_back(std::pair< std::string, float>( - sourceName, sourceRadius)); + sourceArray.emplace_back(sourceName, sourceRadius); } else { LWARNING( @@ -297,17 +298,14 @@ RenderablePlanet::RenderablePlanet(const ghoul::Dictionary& dictionary) unsigned int casterCounter = 1; while (success) { std::string casterName; - std::stringstream ss; - ss << keyShadowCaster << casterCounter << ".Name"; - success = shadowDictionary.getValue(ss.str(), casterName); + success = shadowDictionary.getValue(keyShadowCaster + + std::to_string(casterCounter) + ".Name", casterName); if (success) { float casterRadius; - ss.str(std::string()); - ss << keyShadowCaster << casterCounter << ".Radius"; - success = shadowDictionary.getValue(ss.str(), casterRadius); + success = shadowDictionary.getValue(keyShadowCaster + + std::to_string(casterCounter) + ".Radius", casterRadius); if (success) { - casterArray.push_back(std::pair< std::string, float>( - casterName, casterRadius)); + casterArray.emplace_back(casterName, casterRadius); } else { LWARNING("No Radius value expecified for Shadow Caster Name " @@ -322,13 +320,14 @@ RenderablePlanet::RenderablePlanet(const ghoul::Dictionary& dictionary) } if (!disableShadows && (!sourceArray.empty() && !casterArray.empty())) { - for (const auto & source : sourceArray) - for (const auto & caster : casterArray) { - ShadowConf sc; + for (auto & source : sourceArray) { + for (auto & caster : casterArray) { + ShadowConfiguration sc; sc.source = source; sc.caster = caster; _shadowConfArray.push_back(sc); } + } _shadowEnabled = true; } } @@ -370,12 +369,14 @@ void RenderablePlanet::initializeGL() { absPath("${MODULE_SPACE}/shaders/renderableplanet_fs.glsl") ); } + using IgnoreError = ghoul::opengl::ProgramObject::IgnoreError; _programObject->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); _programObject->setIgnoreUniformLocationError(IgnoreError::Yes); _geometry->initialize(this); + // Deactivate any previously activated shader program. _programObject->deactivate(); loadTexture(); @@ -406,14 +407,12 @@ bool RenderablePlanet::isReady() const { return ready; } -void RenderablePlanet::render(const RenderData& data, RendererTasks&) { - // activate shader - _programObject->activate(); - +glm::dmat4 RenderablePlanet::computeModelTransformMatrix(const openspace::TransformData & transformData) { + // scale the planet to appropriate size since the planet is a unit sphere glm::dmat4 modelTransform = - glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * // Translation - glm::dmat4(data.modelTransform.rotation) * // Spice rotation - glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale)); + glm::translate(glm::dmat4(1.0), transformData.translation) * // Translation + glm::dmat4(transformData.rotation) * // Spice rotation + glm::dmat4(glm::scale(glm::dmat4(1.0), glm::dvec3(transformData.scale))); // scale the planet to appropriate size since the planet is a unit sphere //glm::mat4 transform = glm::mat4(1); @@ -433,14 +432,22 @@ void RenderablePlanet::render(const RenderData& data, RendererTasks&) { // glm::dmat4(1.0), // glm::radians(static_cast(_rotation)), glm::dvec3(0, 1, 0) //); - modelTransform = modelTransform * rot * roty /** rotProp*/; + + return modelTransform = modelTransform * rot * roty /** rotProp*/; +} + +void RenderablePlanet::render(const RenderData& data, RendererTasks& renderTask) { + // activate shader + _programObject->activate(); + + glm::dmat4 modelTransform = computeModelTransformMatrix(data.modelTransform); glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelTransform; - + _programObject->setUniform("transparency", _alpha); - _programObject->setUniform( - "modelViewProjectionTransform", - data.camera.projectionMatrix() * glm::mat4(modelViewTransform) + _programObject->setUniform("modelViewTransform", modelViewTransform); + _programObject->setUniform("modelViewProjectionTransform", + data.camera.sgctInternal.projectionMatrix() * glm::mat4(modelViewTransform) ); _programObject->setUniform("ModelTransform", glm::mat4(modelTransform)); @@ -459,7 +466,6 @@ void RenderablePlanet::render(const RenderData& data, RendererTasks&) { setPscUniforms(*_programObject.get(), data.camera, data.position); _programObject->setUniform("_performShading", _performShading); - _programObject->setUniform("_hasHeightMap", _hasHeightTexture); _programObject->setUniform("_heightExaggeration", _heightExaggeration); @@ -488,10 +494,11 @@ void RenderablePlanet::render(const RenderData& data, RendererTasks&) { glEnable(GL_CULL_FACE); glCullFace(GL_BACK); - // TODO: Move Calculations to VIEW SPACE (precision problems avoidance...) - + //============================================================================= + //============= Eclipse Shadow Calculations and Uniforms Loading ============== + //============================================================================= + // TODO: Move Calculations to VIEW SPACE (let's avoid precision problems...) double lt; - // Shadow calculations.. if (!_shadowConfArray.empty()) { std::vector shadowDataArray; shadowDataArray.reserve(_shadowConfArray.size()); @@ -546,8 +553,8 @@ void RenderablePlanet::render(const RenderData& data, RendererTasks&) { ShadowRenderingStruct shadowData; shadowData.isShadowing = false; - if (((d_test - rp_test) < _planetRadius) && - (casterDistSun < planetDistSun) ) { + if ( ((d_test - rp_test) < _planetRadius) && + (casterDistSun < planetDistSun) ) { // The current caster is shadowing the current planet shadowData.isShadowing = true; shadowData.rs = shadowConf.source.second; @@ -602,12 +609,10 @@ void RenderablePlanet::render(const RenderData& data, RendererTasks&) { void RenderablePlanet::update(const UpdateData& data) { // set spice-orientation in accordance to timestamp _stateMatrix = data.modelTransform.rotation; - //_stateMatrix = SpiceManager::ref().positionTransformMatrix( - // _frame, - // "GALACTIC", - // data.time - //); _time = data.time.j2000Seconds(); + + if (_programObject && _programObject->isDirty()) + _programObject->rebuildFromFile(); } void RenderablePlanet::loadTexture() { diff --git a/modules/space/rendering/renderableplanet.h b/modules/space/rendering/renderableplanet.h index f63156cfee..177a61cebe 100644 --- a/modules/space/rendering/renderableplanet.h +++ b/modules/space/rendering/renderableplanet.h @@ -46,26 +46,33 @@ namespace ghoul::opengl { namespace openspace { +struct TransformData; + +namespace planetgeometry { +class PlanetGeometry; +} + namespace documentation { struct Documentation; } namespace planetgeometry { class PlanetGeometry; } class RenderablePlanet : public Renderable { public: // Shadow structure - typedef struct { + struct ShadowConfiguration { std::pair source; std::pair caster; - } ShadowConf; + }; struct ShadowRenderingStruct { - float xu, xp; - float rs, rc; + float xu, + xp; + float rs, + rc; glm::vec3 sourceCasterVec; glm::vec3 casterPositionVec; bool isShadowing; }; -public: RenderablePlanet(const ghoul::Dictionary& dictionary); void initializeGL() override; @@ -80,7 +87,9 @@ public: protected: void loadTexture(); -private: +private: + glm::dmat4 computeModelTransformMatrix(const openspace::TransformData & transformData); + properties::StringProperty _colorTexturePath; properties::StringProperty _nightTexturePath; properties::StringProperty _heightMapTexturePath; @@ -95,15 +104,17 @@ private: std::unique_ptr _geometry; properties::BoolProperty _performShading; - float _alpha; - std::vector< ShadowConf > _shadowConfArray; - float _planetRadius; - glm::dmat3 _stateMatrix; + float _alpha; + float _planetRadius; bool _hasNightTexture; bool _hasHeightTexture; bool _shadowEnabled; double _time; + + glm::dmat3 _stateMatrix; + + std::vector _shadowConfArray; }; } // namespace openspace diff --git a/modules/space/rendering/renderablestars.cpp b/modules/space/rendering/renderablestars.cpp index f755186d54..5bfe57451d 100644 --- a/modules/space/rendering/renderablestars.cpp +++ b/modules/space/rendering/renderablestars.cpp @@ -645,8 +645,17 @@ bool RenderableStars::readSpeckFile() { for (int i = 0; i < _nValuesPerStar; ++i) { str >> values[i]; } - - _fullData.insert(_fullData.end(), values.begin(), values.end()); + bool nullArray = true; + for (int i = 0; i < values.size(); ++i) { + if (values[i] != 0.0) { + nullArray = false; + break; + } + } + if (!nullArray) { + _fullData.insert(_fullData.end(), values.begin(), values.end()); + } + } while (!file.eof()); return true; diff --git a/modules/space/rendering/simplespheregeometry.cpp b/modules/space/rendering/simplespheregeometry.cpp index d8dc910d1c..c0ea665bdc 100644 --- a/modules/space/rendering/simplespheregeometry.cpp +++ b/modules/space/rendering/simplespheregeometry.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * diff --git a/modules/space/shaders/nighttexture_fs.glsl b/modules/space/shaders/nighttexture_fs.glsl index 1a3b6a33ab..c79e11a083 100644 --- a/modules/space/shaders/nighttexture_fs.glsl +++ b/modules/space/shaders/nighttexture_fs.glsl @@ -29,6 +29,8 @@ in vec2 vs_st; in vec2 vs_nightTex; in vec4 vs_normal; in vec4 vs_position; +in vec4 vs_gPosition; +in vec3 vs_gNormal; uniform vec4 objpos; @@ -67,6 +69,10 @@ Fragment getFragment() { frag.color = vec4(diffuse.rgb, transparency); frag.depth = vs_position.w; + frag.gOtherData = vec4(diffuse.xyz, 1.0); + frag.gPosition = vs_gPosition; + frag.gNormal = vec4(vs_gNormal, 1.0); + return frag; } diff --git a/modules/space/shaders/nighttexture_vs.glsl b/modules/space/shaders/nighttexture_vs.glsl index 0f9dbf922e..6c1941dc7b 100644 --- a/modules/space/shaders/nighttexture_vs.glsl +++ b/modules/space/shaders/nighttexture_vs.glsl @@ -33,8 +33,11 @@ layout(location = 2) in vec3 in_normal; out vec2 vs_st; out vec4 vs_normal; out vec4 vs_position; +out vec4 vs_gPosition; +out vec3 vs_gNormal; uniform mat4 ModelTransform; +uniform dmat4 modelViewTransform; uniform mat4 modelViewProjectionTransform; uniform sampler2D heightTex; @@ -44,14 +47,16 @@ uniform float _heightExaggeration; void main() { // set variables vs_st = in_st; - vec4 tmp = in_position; - + // this is wrong for the normal. The normal transform is the transposed inverse of the model transform vs_normal = normalize(ModelTransform * vec4(in_normal,0)); // vs_normal = vec4(in_normal, 0.0); - - vec4 position = vec4(tmp.xyz * pow(10, tmp. w), 1.0); + // G-Buffer + vs_gNormal = in_normal; + + vec4 position = vec4(in_position.xyz * pow(10, in_position.w), 1.0); + if (_hasHeightMap) { float height = texture(heightTex, in_st).r; vec3 displacementDirection = abs(normalize(in_normal.xyz)); @@ -59,6 +64,9 @@ void main() { position.xyz = position.xyz + displacementDirection * displacementFactor; } + // G-Buffer + vs_gPosition = vec4(modelViewTransform * position); // Must be in SGCT eye space + position = modelViewProjectionTransform * position; vs_position = z_normalization(position); diff --git a/modules/space/shaders/renderableplanet_fs.glsl b/modules/space/shaders/renderableplanet_fs.glsl index dd617b49d7..4a2223087a 100644 --- a/modules/space/shaders/renderableplanet_fs.glsl +++ b/modules/space/shaders/renderableplanet_fs.glsl @@ -28,6 +28,8 @@ in vec2 vs_st; in vec4 vs_normal; in vec4 vs_position; +in vec4 vs_gPosition; +in vec3 vs_gNormal; uniform vec4 objpos; uniform vec3 sun_pos; @@ -35,7 +37,6 @@ uniform bool _performShading = true; uniform float transparency; uniform sampler2D texture1; - Fragment getFragment() { vec4 diffuse = texture(texture1, vs_st); @@ -52,5 +53,9 @@ Fragment getFragment() { frag.color = vec4(diffuse.rgb, transparency); frag.depth = vs_position.w; + frag.gOtherData = vec4(diffuse.xyz, 1.0); + frag.gPosition = vs_gPosition; + frag.gNormal = vec4(vs_gNormal, 1.0); + return frag; } diff --git a/modules/space/shaders/renderableplanet_vs.glsl b/modules/space/shaders/renderableplanet_vs.glsl index d16df31b74..cb982619a8 100644 --- a/modules/space/shaders/renderableplanet_vs.glsl +++ b/modules/space/shaders/renderableplanet_vs.glsl @@ -33,20 +33,29 @@ layout(location = 2) in vec3 in_normal; out vec2 vs_st; out vec4 vs_normal; out vec4 vs_position; +out vec4 vs_gPosition; +out vec3 vs_gNormal; uniform mat4 ModelTransform; +uniform dmat4 modelViewTransform; uniform mat4 modelViewProjectionTransform; void main() { vs_st = in_st; - vec4 tmp = in_position; + + // G-Buffer + vs_gNormal = in_normal; // this is wrong for the normal. The normal transform is the transposed inverse of the model transform vs_normal = normalize(ModelTransform * vec4(in_normal,0)); // vs_normal = vec4(in_normal, 0.0); - vec4 position = vec4(tmp.xyz * pow(10, tmp.w), 1.0); + vec4 position = vec4(in_position.xyz * pow(10, in_position.w), 1.0); + + // G-Buffer + vs_gPosition = vec4(modelViewTransform * position); // Must be in SGCT eye space; + position = modelViewProjectionTransform * position; vs_position = z_normalization(position); diff --git a/modules/space/shaders/rings_fs.glsl b/modules/space/shaders/rings_fs.glsl index 615a413c62..e382497fe5 100644 --- a/modules/space/shaders/rings_fs.glsl +++ b/modules/space/shaders/rings_fs.glsl @@ -27,6 +27,8 @@ in vec2 vs_st; in vec4 vs_position; +//in vec4 vs_gPosition; +//in vec3 vs_gNormal; uniform sampler1D texture1; uniform vec2 textureOffset; @@ -86,5 +88,10 @@ Fragment getFragment() { Fragment frag; frag.color = diffuse; frag.depth = vs_position.w; + + //frag.gOtherData = diffuse; + //frag.gPosition = vs_gPosition; + //frag.gNormal = vs_gNormal; + return frag; } diff --git a/modules/space/shaders/rings_vs.glsl b/modules/space/shaders/rings_vs.glsl index 654d204deb..944bd6d390 100644 --- a/modules/space/shaders/rings_vs.glsl +++ b/modules/space/shaders/rings_vs.glsl @@ -31,6 +31,8 @@ layout(location = 1) in vec2 in_st; out vec2 vs_st; out vec4 vs_position; +//out vec4 vs_gPosition; +//out vec3 vs_gNormal; uniform mat4 modelViewProjectionTransform; diff --git a/modules/space/shaders/shadow_fs.glsl b/modules/space/shaders/shadow_fs.glsl index ae8c1cd819..91b6f7fdfb 100644 --- a/modules/space/shaders/shadow_fs.glsl +++ b/modules/space/shaders/shadow_fs.glsl @@ -29,6 +29,8 @@ in vec2 vs_st; in vec4 vs_normal; in vec4 vs_position; in vec4 vs_posWorld; +in vec4 vs_gPosition; +in vec3 vs_gNormal; const uint numberOfShadows = 1; @@ -51,8 +53,7 @@ uniform float transparency; uniform sampler2D texture1; - -vec4 butterworthFunc(float d, float r, float n) { +vec4 butterworthFunc(const float d, const float r, const float n) { return vec4(vec3(sqrt(r / (r + pow(d, 2 * n)))), 1.0); } @@ -109,6 +110,10 @@ Fragment getFragment() { frag.color = vec4(diffuse.rgb, transparency); frag.depth = depth; - + + frag.gOtherData = vec4(diffuse.xyz, 1.0); + frag.gPosition = vs_gPosition; + frag.gNormal = vec4(vs_gNormal, 1.0); + return frag; } diff --git a/modules/space/shaders/shadow_nighttexture_fs.glsl b/modules/space/shaders/shadow_nighttexture_fs.glsl index 1916c49606..35b619537c 100644 --- a/modules/space/shaders/shadow_nighttexture_fs.glsl +++ b/modules/space/shaders/shadow_nighttexture_fs.glsl @@ -30,6 +30,8 @@ in vec2 vs_nightTex; in vec4 vs_normal; in vec4 vs_position; in vec4 vs_posWorld; +in vec4 vs_gPosition; +in vec3 vs_gNormal; const uint numberOfShadows = 1; @@ -56,8 +58,7 @@ uniform float time; uniform sampler2D texture1; uniform sampler2D nightTex; - -vec4 butterworthFunc(float d, float r, float n) { +vec4 butterworthFunc(const float d, const float r, const float n) { return vec4(vec3(sqrt(r/(r + pow(d, 2*n)))), 1.0); } @@ -117,5 +118,9 @@ Fragment getFragment() { frag.color = vec4(diffuse.rgb, transparency); frag.depth = depth; + frag.gOtherData = vec4(diffuse.xyz, 1.0); + frag.gPosition = vs_gPosition; + frag.gNormal = vec4(vs_gNormal, 1.0); + return frag; } diff --git a/modules/space/shaders/shadow_nighttexture_vs.glsl b/modules/space/shaders/shadow_nighttexture_vs.glsl index 99cd458f47..32ce664f28 100644 --- a/modules/space/shaders/shadow_nighttexture_vs.glsl +++ b/modules/space/shaders/shadow_nighttexture_vs.glsl @@ -34,6 +34,8 @@ out vec2 vs_st; out vec4 vs_normal; out vec4 vs_position; out vec4 vs_posWorld; +out vec4 vs_gPosition; +out vec3 vs_gNormal; uniform mat4 ViewProjection; uniform mat4 ModelTransform; @@ -47,10 +49,18 @@ void main() { // this is wrong for the normal. The normal transform is the transposed inverse of the model transform vs_normal = normalize(ModelTransform * vec4(in_normal,0)); - // The things is not in world coordinates, they are in - // regular view/eye coordinates. + // G-Buffer + vs_gNormal = in_normal; + + // The tmp is now in the OS eye space (camera rig space) + // and wrtitten using PSC coords. + // position is in the same space, i.e., OS eye space but + // in meters (no PSC coords). vec4 position = pscTransform(tmp, ModelTransform); + // G-Buffer + vs_gPosition = position; + vec3 local_vertex_pos = mat3(ModelTransform) * in_position.xyz; vec4 vP = psc_addition(vec4(local_vertex_pos, in_position.w), objpos); vs_posWorld = vec4(vP.xyz * pow(10, vP.w), 1.0); diff --git a/modules/space/shaders/shadow_vs.glsl b/modules/space/shaders/shadow_vs.glsl index 060608c25e..577dad6dee 100644 --- a/modules/space/shaders/shadow_vs.glsl +++ b/modules/space/shaders/shadow_vs.glsl @@ -30,15 +30,19 @@ layout(location = 0) in vec4 in_position; layout(location = 1) in vec2 in_st; layout(location = 2) in vec3 in_normal; +uniform mat4 ViewProjection; +uniform mat4 ModelTransform; +uniform bool _hasHeightMap; +uniform float _heightExaggeration; +uniform sampler2D heightTex; + out vec2 vs_st; out vec4 vs_normal; out vec4 vs_position; out vec4 vs_posWorld; out float s; - -uniform mat4 ViewProjection; -uniform mat4 ModelTransform; - +out vec4 vs_gPosition; +out vec3 vs_gNormal; void main() { // set variables @@ -49,15 +53,31 @@ void main() { // this is wrong for the normal. The normal transform is the transposed inverse of the model transform vs_normal = normalize(ModelTransform * vec4(in_normal,0)); - // The things is not in world coordinates, they are in - // regular view/eye coordinates. + // We are using the normal in Object (model) space in G-Buffer (because of atm). + vs_gNormal = in_normal; + + // The tmp is now in the OS eye space (camera rig space) + // and wrtitten using PSC coords. + // position is in the same space, i.e., OS eye space but + // in meters (no PSC coords). vec4 position = pscTransform(tmp, ModelTransform); + // G-Buffer + vs_gPosition = position; + vec3 local_vertex_pos = mat3(ModelTransform) * in_position.xyz; vec4 vP = psc_addition(vec4(local_vertex_pos,in_position.w),objpos); vs_posWorld = vec4(vP.xyz * pow(10,vP.w), 1.0); vs_position = tmp; + + if (_hasHeightMap) { + float height = texture(heightTex, in_st).r; + vec3 displacementDirection = abs(normalize(in_normal.xyz)); + float displacementFactor = height * _heightExaggeration; + position.xyz = position.xyz + displacementDirection * displacementFactor; + } + // Now is transforming from view position to SGCT projection // coordinates. position = ViewProjection * position; diff --git a/modules/space/shaders/star_fs.glsl b/modules/space/shaders/star_fs.glsl index 42f2c492a0..ab89adfed3 100644 --- a/modules/space/shaders/star_fs.glsl +++ b/modules/space/shaders/star_fs.glsl @@ -25,14 +25,6 @@ #include "fragment.glsl" #include "PowerScaling/powerScaling_fs.hglsl" -in vec4 vs_position; -in vec3 ge_brightness; -in vec3 ge_velocity; -in float ge_speed; -in vec2 texCoord; -in float billboardSize; - - // keep in sync with renderablestars.h:ColorOption enum const int COLOROPTION_COLOR = 0; const int COLOROPTION_VELOCITY = 1; @@ -45,6 +37,17 @@ uniform float minBillboardSize; uniform float alphaValue; uniform int colorOption; +in vec4 vs_position; +in vec4 ge_gPosition; +in vec3 ge_brightness; +in vec3 ge_velocity; +in float ge_speed; +in vec2 texCoord; +in float billboardSize; + +#include "fragment.glsl" +//#include "PowerScaling/powerScaling_fs.hglsl" + uniform vec2 magnitudeClamp; @@ -84,6 +87,12 @@ Fragment getFragment() { frag.color = fullColor; frag.depth = pscDepth(position); + // G-Buffer + frag.gOtherData = vec4(fullColor.xyz, 1.0); + frag.gPosition = ge_gPosition; + // There is no normal here + frag.gNormal = vec4(0.0, 0.0, 0.0, 1.0); + if (fullColor.a == 0) { discard; } diff --git a/modules/space/shaders/star_ge.glsl b/modules/space/shaders/star_ge.glsl index ee1184684e..41d04f5e14 100644 --- a/modules/space/shaders/star_ge.glsl +++ b/modules/space/shaders/star_ge.glsl @@ -30,11 +30,14 @@ layout(points) in; in vec4 psc_position[]; in vec3 vs_brightness[]; in vec3 vs_velocity[]; +in vec4 vs_gPosition[]; in float vs_speed[]; in vec4 cam_position[]; layout(triangle_strip, max_vertices = 4) out; + out vec4 vs_position; +out vec4 ge_gPosition; out vec3 ge_brightness; out vec3 ge_velocity; out float ge_speed; @@ -56,12 +59,13 @@ const vec2 corners[4] = vec2[4]( void main() { - if ((psc_position[0].x == 0.0) && - (psc_position[0].y == 0.0) && - (psc_position[0].z == 0.0)) - { - return; - } + // JCC: We want to display the Sun. + // if ((psc_position[0].x == 0.0) && + // (psc_position[0].y == 0.0) && + // (psc_position[0].z == 0.0)) + // { + // return; + // } ge_brightness = vs_brightness[0]; ge_velocity = vs_velocity[0]; @@ -92,9 +96,13 @@ void main() { for (int i = 0; i < 4; i++) { vs_position = gl_in[0].gl_Position; gl_Position = projPos[i]; - texCoord = corners[i]; + texCoord = corners[i]; + + // G-Buffer + ge_gPosition = vs_gPosition[0]; billboardSize = sizeInPixels; - EmitVertex(); + EmitVertex(); } + EndPrimitive(); } diff --git a/modules/space/shaders/star_vs.glsl b/modules/space/shaders/star_vs.glsl index 458c5e4dae..0aef210b39 100644 --- a/modules/space/shaders/star_vs.glsl +++ b/modules/space/shaders/star_vs.glsl @@ -35,7 +35,7 @@ out vec4 psc_position; out vec3 vs_brightness; out vec3 vs_velocity; out float vs_speed; -out vec4 cam_position; +out vec4 vs_gPosition; uniform mat4 model; uniform mat4 view; @@ -48,8 +48,14 @@ void main() { vs_brightness = in_brightness; vs_velocity = in_velocity; vs_speed = in_speed; - cam_position = campos; vec4 tmp = p; - gl_Position = view * pscTransform(tmp, mat4(1.0)); -} \ No newline at end of file + vec4 position = pscTransform(tmp, mat4(1.0)); + + // G-Buffer + vs_gPosition = position; + + position = view * position; + + gl_Position = position; +} diff --git a/openspace.cfg b/openspace.cfg index 35f6083d21..03c66afc74 100644 --- a/openspace.cfg +++ b/openspace.cfg @@ -7,16 +7,20 @@ return { -- occurs in a single window, a fisheye projection, or a dome cluster system -- A regular 1280x720 window - SGCTConfig = sgct.config.single{}, + SGCTConfig = sgct.config.single{1280, 720}, + -- SGCTConfig = sgct.config.single{1280, 720, scene={orientation = { yaw = 120, pitch = 15, roll = 0.0 }}}, + --SGCTConfig = "${CONFIG}/single_two_win.xml", + + --SGCTConfig = "${CONFIG}/spout_output.xml", -- A regular 1920x1080 window - -- SGCTConfig = sgct.config.single{1920, 1080}, + --SGCTConfig = sgct.config.single{1920, 1080}, -- A windowed 1920x1080 fullscreen -- SGCTConfig = sgct.config.single{1920, 1080, border=false, windowPos={0,0}, shared=true, name="WV_OBS_SPOUT1"}, -- A 1k fisheye rendering - -- SGCTConfig = sgct.config.fisheye{1024, 1024}, + --SGCTConfig = sgct.config.fisheye{1024, 1024}, -- A 4k fisheye rendering in a 1024x1024 window -- SGCTConfig = sgct.config.fisheye{1024, 1024, res={4096, 4096}, quality="2k", tilt=27}, @@ -33,6 +37,7 @@ return { -- Scene = "${SCENE}/newhorizons.scene", -- Scene = "${SCENE}/rosetta.scene", -- Scene = "${SCENE}/osirisrex.scene", + -- Scene = "${SCENE}/satellites.scene", -- Scene = "${SCENE}/voyager.scene", TasksRoot = "${OPENSPACE_DATA}/tasks", @@ -68,6 +73,7 @@ return { LogDir = "${LOGS}", -- LogLevel = "Trace", LogLevel = "Debug", + --LogLevel = "None", ImmediateFlush = true, Logs = { { Type = "html", File = "${LOGS}/log.html", Append = false } @@ -104,7 +110,7 @@ return { DownloadRequestURL = "http://data.openspaceproject.com/request.cgi", RenderingMethod = "Framebuffer", OpenGLDebugContext = { - Activate = true, + Activate = false, FilterIdentifier = { { Type = "Other", Source = "API", Identifier = 131185 }, { Type = "Performance", Source = "API", Identifier = 131186 }, --Buffer performance warning: "copied/moved from VIDEO memory to HOST memory" diff --git a/shaders/PowerScaling/powerScalingMath.hglsl b/shaders/PowerScaling/powerScalingMath.hglsl index cf1f53ca34..65f488b1d3 100644 --- a/shaders/PowerScaling/powerScalingMath.hglsl +++ b/shaders/PowerScaling/powerScalingMath.hglsl @@ -77,6 +77,10 @@ vec2 psc_subtraction(vec2 v1, vec2 v2) { vec4 z_normalization(vec4 v_in) { vec4 v_out = v_in; v_out.z = 0; + //if ( v_out.z < -v_out.w ) + // v_out.z = -v_out.w; + //else if (v_out.z > v_out.w) + // v_out.z = v_out.w; return v_out; } diff --git a/shaders/PowerScaling/powerScaling_vs.hglsl b/shaders/PowerScaling/powerScaling_vs.hglsl index d0f6d91efd..465f0bd8d7 100644 --- a/shaders/PowerScaling/powerScaling_vs.hglsl +++ b/shaders/PowerScaling/powerScaling_vs.hglsl @@ -54,7 +54,7 @@ vec4 pscTransform(inout vec4 vertexPosition, mat4 modelTransform) { vertexPosition = psc_addition(vec4(local_vertex_pos,vertexPosition.w),objpos); //position = psc_addition(lvp,objpos); - // PSC addition; rotated and viewscaled vertex and the cmaeras negative position + // PSC addition; rotated and viewscaled vertex and the cameras negative position vertexPosition = psc_addition(vertexPosition,vec4(-campos.xyz,campos.w)); // rotate the camera @@ -78,4 +78,4 @@ vec4 pscTransform(inout vec4 vertexPosition, mat4 modelTransform) { return tmp; } -#endif \ No newline at end of file +#endif diff --git a/shaders/abuffer/resolveabuffer.vert b/shaders/abuffer/resolveabuffer.vert index 9e84d20c35..475db8540c 100644 --- a/shaders/abuffer/resolveabuffer.vert +++ b/shaders/abuffer/resolveabuffer.vert @@ -29,5 +29,5 @@ out vec2 texCoord; void main() { gl_Position = position; - texCoord = 0.5 + position.xy / 2.0; + texCoord = 0.5 + position.xy * 0.5; } diff --git a/shaders/floatoperations.glsl b/shaders/floatoperations.glsl index 8af84ce78c..4936a14ac9 100644 --- a/shaders/floatoperations.glsl +++ b/shaders/floatoperations.glsl @@ -35,7 +35,7 @@ */ float normalizeFloat(float inpt) { if (inpt > 1.0) { - return inpt / pow(10, 27); + return inpt / pow(10, 30); } else { return inpt - 1.0; } @@ -45,7 +45,7 @@ float denormalizeFloat(float inpt) { if (inpt < 0.0) { return inpt + 1.0; } else { - return inpt * pow(10, 27); + return inpt * pow(10, 30); } } diff --git a/shaders/fragment.glsl b/shaders/fragment.glsl index c2127dfc5b..29f50fee34 100644 --- a/shaders/fragment.glsl +++ b/shaders/fragment.glsl @@ -30,6 +30,9 @@ struct Fragment { vec4 color; + vec4 gOtherData; + vec4 gPosition; + vec4 gNormal; float depth; uint blend; bool forceFboRendering; diff --git a/shaders/framebuffer/hdrBackground.frag b/shaders/framebuffer/hdrBackground.frag new file mode 100644 index 0000000000..d2f6b7082e --- /dev/null +++ b/shaders/framebuffer/hdrBackground.frag @@ -0,0 +1,46 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014 - 2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +#include "hdr.glsl" + +layout (location = 0) out vec4 finalColor; + +uniform int nAaSamples; +uniform float backgroundConstant; +uniform float backgroundExposure; +uniform sampler2DMS mainColorTexture; + +void main() { + vec4 color = vec4(0.0); + for (int i = 0; i < nAaSamples; i++) { + color += texelFetch(mainColorTexture, ivec2(gl_FragCoord), i); + } + + color /= nAaSamples; + //color.rgb *= blackoutFactor; + + finalColor = vec4(HDR(color.rgb * backgroundConstant, backgroundExposure), 1.0); +} diff --git a/shaders/framebuffer/hdrBackground.vert b/shaders/framebuffer/hdrBackground.vert new file mode 100644 index 0000000000..e974344115 --- /dev/null +++ b/shaders/framebuffer/hdrBackground.vert @@ -0,0 +1,39 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014 - 2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +in vec4 position; + +out vec2 texCoord; +out vec3 vPosition; +out vec4 worldPosition; + +void main() { + gl_Position = position; + texCoord = 0.5 + position.xy * 0.5; + + vPosition = position.xyz; + worldPosition = position; +} diff --git a/shaders/framebuffer/nOneStripMSAA.frag b/shaders/framebuffer/nOneStripMSAA.frag new file mode 100644 index 0000000000..5b1403f8e0 --- /dev/null +++ b/shaders/framebuffer/nOneStripMSAA.frag @@ -0,0 +1,39 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014 - 2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +layout (location = 0) out vec4 finalColor; + +in vec2 vTexCoord; +flat in vec3 vPosition; + +uniform int currentSample; +uniform sampler2DMS pixelSizeTexture; + +void main() { + finalColor = vec4(texelFetch(pixelSizeTexture, ivec2(vTexCoord), currentSample).rgb, 1.0); + //finalColor = vec4(0.5*vPosition.xy + 0.5, 1.0, 1.0); + //finalColor = vec4(vPosition.xy, 0.0, 1.0); +} diff --git a/shaders/framebuffer/nOneStripMSAA.vert b/shaders/framebuffer/nOneStripMSAA.vert new file mode 100644 index 0000000000..7f272c457d --- /dev/null +++ b/shaders/framebuffer/nOneStripMSAA.vert @@ -0,0 +1,38 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014 - 2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +layout(location = 0) in vec4 position; +layout(location = 1) in vec2 texCoord; + +out vec2 vTexCoord; +out vec3 vPosition; + +void main() { + vTexCoord = texCoord; + vPosition = position.xyz; + + gl_Position = position; +} diff --git a/shaders/framebuffer/pixelSizeMSAA.frag b/shaders/framebuffer/pixelSizeMSAA.frag new file mode 100644 index 0000000000..6a08e5ce3e --- /dev/null +++ b/shaders/framebuffer/pixelSizeMSAA.frag @@ -0,0 +1,33 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014 - 2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +layout (location = 0) out vec4 finalColor; + +flat in vec3 vPosition; + +void main() { + finalColor = vec4(0.5 * vPosition + 0.5, 1.0); +} diff --git a/shaders/framebuffer/pixelSizeMSAA.vert b/shaders/framebuffer/pixelSizeMSAA.vert new file mode 100644 index 0000000000..090bd7a492 --- /dev/null +++ b/shaders/framebuffer/pixelSizeMSAA.vert @@ -0,0 +1,34 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014 - 2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +layout(location = 0) in vec4 position; + +flat out vec3 vPosition; + +void main() { + gl_Position = position; + vPosition = position.xyz; +} diff --git a/shaders/framebuffer/renderframebuffer.frag b/shaders/framebuffer/renderframebuffer.frag index 340d9e2b98..26fca23aa0 100644 --- a/shaders/framebuffer/renderframebuffer.frag +++ b/shaders/framebuffer/renderframebuffer.frag @@ -25,10 +25,16 @@ #include "floatoperations.glsl" #include <#{fragmentPath}> -out vec4 _out_color_; +layout(location = 0) out vec4 _out_color_; +layout(location = 1) out vec4 gOtherData; +layout(location = 2) out vec4 gPosition; +layout(location = 3) out vec4 gNormal; void main() { - Fragment f = getFragment(); - _out_color_ = f.color; + Fragment f = getFragment(); + _out_color_ = f.color; + gPosition = f.gPosition; + gNormal = f.gNormal; + gOtherData = f.gOtherData; gl_FragDepth = normalizeFloat(f.depth); } diff --git a/shaders/framebuffer/resolveframebuffer.vert b/shaders/framebuffer/resolveframebuffer.vert index d35fd2acab..e974344115 100644 --- a/shaders/framebuffer/resolveframebuffer.vert +++ b/shaders/framebuffer/resolveframebuffer.vert @@ -32,7 +32,7 @@ out vec4 worldPosition; void main() { gl_Position = position; - texCoord = 0.5 + position.xy / 2.0; + texCoord = 0.5 + position.xy * 0.5; vPosition = position.xyz; worldPosition = position; diff --git a/shaders/hdr.glsl b/shaders/hdr.glsl new file mode 100644 index 0000000000..ccee84cf8e --- /dev/null +++ b/shaders/hdr.glsl @@ -0,0 +1,118 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +//uniform float exposure; +uniform float gamma; + +vec3 exponentialToneMapping(vec3 color, const float exposure) { + color *= exposure; + + color.r = color.r < 1.413 ? pow(color.r * 0.38317, 1.0 / gamma) : 1.0 - exp(-color.r); + color.g = color.g < 1.413 ? pow(color.g * 0.38317, 1.0 / gamma) : 1.0 - exp(-color.g); + color.b = color.b < 1.413 ? pow(color.b * 0.38317, 1.0 / gamma) : 1.0 - exp(-color.b); + + return color; +} + +vec3 linearToneMapping(vec3 color, const float exposure) { + float tExposure = 0.08f; + color = clamp(tExposure * color, 0.0f, 1.0f); + color = pow(color, vec3(1.0f / gamma)); + return color; +} + +vec3 simpleReinhardToneMapping(vec3 color, const float exposure) { + float tExposure = 1.5f; + color *= tExposure/(1.0f + color / tExposure); + color = pow(color, vec3(1. / gamma)); + return color; +} + +vec3 lumaBasedReinhardToneMapping(vec3 color, const float exposure) +{ + float luma = dot(color, vec3(0.2126f, 0.7152f, 0.0722f)); + float toneMappedLuma = luma / (1.0f + luma); + color *= toneMappedLuma / luma; + color = pow(color, vec3(1.0f / gamma)); + return color; +} + +vec3 whitePreservingLumaBasedReinhardToneMapping(vec3 color, const float exposure) +{ + float white = 4.0f; + //float luma = dot(color, vec3(0.2126f, 0.7152f, 0.0722f)); + float luma = dot(color, vec3(0.4126f, 0.9152f, 0.2722f)); + float toneMappedLuma = luma * (1.0f + luma / (white * white)) / (1.0f + luma); + color *= toneMappedLuma / luma; + color = pow(color, vec3(1.0f / gamma)); + return color; +} + +vec3 RomBinDaHouseToneMapping(vec3 color, const float exposure) +{ + color = exp( -1.0f / ( 2.72f * color + 0.15f ) ); + color = pow(color, vec3(1.7 / gamma)); + return color; +} + +vec3 filmicToneMapping(vec3 color, const float exposure) +{ + color = max(vec3(0.0f), color - vec3(0.04f)); + color = (color * (6.2f * color + 0.5f)) / (color * (6.2f * color + 20.0f) + 0.06f); + return color; +} + +vec3 Uncharted2ToneMapping(vec3 color, const float exposure) +{ + float A = 0.15f; + float B = 0.50f; + float C = 0.10f; + float D = 0.20f; + float E = 0.02f; + float F = 0.30f; + float W = 11.2f; + float tExposure = 0.4f; + color *= tExposure; + color = ((color * (A * color + C * B) + D * E) / (color * (A * color + B) + D * F)) - E / F; + float white = ((W * (A * W + C * B) + D * E) / (W * (A * W + B) + D * F)) - E / F; + color /= white; + color = pow(color, vec3(1.0f / gamma)); + return color; +} + +vec3 jToneMapping(const vec3 color, const float exposure) { + return 1.0 - exp(-exposure * color); +} + +vec3 HDR(vec3 color, float exposure) { + //return exponentialToneMapping(color, exposure); + //return linearToneMapping(color, exposure); + //return simpleReinhardToneMapping(color, exposure); + //return lumaBasedReinhardToneMapping(color, exposure); + //return whitePreservingLumaBasedReinhardToneMapping(color, exposure); + //return RomBinDaHouseToneMapping(color, exposure); + //return filmicToneMapping(color, exposure); + //return Uncharted2ToneMapping(color, exposure); + return jToneMapping(color, exposure); +} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 652be337c4..8211de259c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -124,6 +124,7 @@ set(OPENSPACE_SOURCE ${OPENSPACE_BASE_DIR}/src/rendering/dashboard_lua.inl ${OPENSPACE_BASE_DIR}/src/rendering/dashboarditem.cpp ${OPENSPACE_BASE_DIR}/src/rendering/framebufferrenderer.cpp + ${OPENSPACE_BASE_DIR}/src/rendering/deferredcastermanager.cpp ${OPENSPACE_BASE_DIR}/src/rendering/loadingscreen.cpp ${OPENSPACE_BASE_DIR}/src/rendering/raycastermanager.cpp ${OPENSPACE_BASE_DIR}/src/rendering/renderable.cpp @@ -292,6 +293,8 @@ set(OPENSPACE_HEADER ${OPENSPACE_BASE_DIR}/include/openspace/rendering/dashboard.h ${OPENSPACE_BASE_DIR}/include/openspace/rendering/dashboarditem.h ${OPENSPACE_BASE_DIR}/include/openspace/rendering/framebufferrenderer.h + ${OPENSPACE_BASE_DIR}/include/openspace/rendering/deferredcasterlistener.h + ${OPENSPACE_BASE_DIR}/include/openspace/rendering/deferredcastermanager.h ${OPENSPACE_BASE_DIR}/include/openspace/rendering/loadingscreen.h ${OPENSPACE_BASE_DIR}/include/openspace/rendering/raycasterlistener.h ${OPENSPACE_BASE_DIR}/include/openspace/rendering/raycastermanager.h @@ -300,6 +303,7 @@ set(OPENSPACE_HEADER ${OPENSPACE_BASE_DIR}/include/openspace/rendering/renderengine.h ${OPENSPACE_BASE_DIR}/include/openspace/rendering/volume.h ${OPENSPACE_BASE_DIR}/include/openspace/rendering/screenspacerenderable.h + ${OPENSPACE_BASE_DIR}/include/openspace/rendering/deferredcaster.h ${OPENSPACE_BASE_DIR}/include/openspace/rendering/volumeraycaster.h ${OPENSPACE_BASE_DIR}/include/openspace/rendering/transferfunction.h ${OPENSPACE_BASE_DIR}/include/openspace/scene/translation.h diff --git a/src/rendering/abufferrenderer.cpp b/src/rendering/abufferrenderer.cpp index 2ffc7b37d4..f7129af333 100644 --- a/src/rendering/abufferrenderer.cpp +++ b/src/rendering/abufferrenderer.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -66,6 +67,9 @@ ABufferRenderer::ABufferRenderer() , _dirtyRaycastData(true) , _dirtyResolveDictionary(true) , _resolveProgram(nullptr) + , _hdrExposure(0.4) + , _hdrBackground(2.8) + , _gamma(2.2) {} ABufferRenderer::~ABufferRenderer() {} @@ -120,6 +124,7 @@ void ABufferRenderer::initialize() { updateRendererData(); updateRaycastData(); updateResolveDictionary(); + updateMSAASamplingPattern(); glBindFramebuffer(GL_FRAMEBUFFER, _mainFramebuffer); glFramebufferTexture2D( @@ -160,6 +165,7 @@ void ABufferRenderer::initialize() { } OsEng.renderEngine().raycasterManager().addListener(*this); + } void ABufferRenderer::deinitialize() { @@ -188,6 +194,7 @@ void ABufferRenderer::update() { // according to the output render buffer size if (_dirtyResolution) { updateResolution(); + updateMSAASamplingPattern(); } // Make sure that the renderengine gets the correct render data @@ -236,6 +243,329 @@ void ABufferRenderer::update() { } } +void ABufferRenderer::updateMSAASamplingPattern() { + LINFO("Updating MSAA Sampling Pattern"); + + const int GRIDSIZE = 32; + GLfloat step = 2.0f / static_cast(GRIDSIZE); + GLfloat sizeX = -1.0f, + sizeY = 1.0f; + + const int NVERTEX = 4 * 6; + GLfloat openPixelSizeVertexData[GRIDSIZE * GRIDSIZE * NVERTEX]; + + for (int y = 0; y < GRIDSIZE; ++y) { + for (int x = 0; x < GRIDSIZE; ++x) { + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX] = sizeX; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 1] = sizeY - step; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 2] = 0.0f; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 3] = 1.0f; + + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 4] = sizeX + step; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 5] = sizeY; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 6] = 0.0f; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 7] = 1.0f; + + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 8] = sizeX; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 9] = sizeY; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 10] = 0.0f; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 11] = 1.0f; + + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 12] = sizeX; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 13] = sizeY - step; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 14] = 0.0f; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 15] = 1.0f; + + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 16] = sizeX + step; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 17] = sizeY - step; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 18] = 0.0f; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 19] = 1.0f; + + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 20] = sizeX + step; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 21] = sizeY; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 22] = 0.0f; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 23] = 1.0f; + + sizeX += step; + } + sizeX = -1.0f; + sizeY -= step; + } + + GLuint pixelSizeQuadVAO = 0, + pixelSizeQuadVBO = 0; + + glGenVertexArrays(1, &pixelSizeQuadVAO); + glBindVertexArray(pixelSizeQuadVAO); + + glGenBuffers(1, &pixelSizeQuadVBO); + glBindBuffer(GL_ARRAY_BUFFER, pixelSizeQuadVBO); + + glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * GRIDSIZE * GRIDSIZE * NVERTEX, openPixelSizeVertexData, GL_STATIC_DRAW); + + // Position + glVertexAttribPointer( + 0, + 4, + GL_FLOAT, + GL_FALSE, + 0, + nullptr + ); + glEnableVertexAttribArray(0); + + // Saves current state + GLint defaultFbo; + glGetIntegerv(GL_FRAMEBUFFER_BINDING, &defaultFbo); + GLint viewport[4]; + glGetIntegerv(GL_VIEWPORT, viewport); + + // Main framebuffer + GLuint pixelSizeTexture = 0; + GLuint pixelSizeFramebuffer = 0; + + glGenTextures(1, &pixelSizeTexture); + glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, pixelSizeTexture); + + const GLsizei ONEPIXEL = 1; + glTexImage2DMultisample( + GL_TEXTURE_2D_MULTISAMPLE, + _nAaSamples, + GL_RGBA32F, + ONEPIXEL, + ONEPIXEL, + true + ); + + glViewport(0, 0, ONEPIXEL, ONEPIXEL); + + glGenFramebuffers(1, &pixelSizeFramebuffer); + glBindFramebuffer(GL_FRAMEBUFFER, pixelSizeFramebuffer); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, pixelSizeTexture, 0); + + GLenum textureBuffers[1] = { GL_COLOR_ATTACHMENT0 }; + glDrawBuffers(1, textureBuffers); + + glClearColor(0.0f, 0.0f, 0.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); + + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) { + LERROR("MSAA Sampling pattern framebuffer is not complete"); + return; + } + + std::unique_ptr pixelSizeProgram = nullptr; + try { + pixelSizeProgram = ghoul::opengl::ProgramObject::Build( + "OnePixel MSAA", + "${SHADERS}/framebuffer/pixelSizeMSAA.vert", + "${SHADERS}/framebuffer/pixelSizeMSAA.frag" + ); + } + catch (const ghoul::RuntimeError& e) { + LERRORC(e.component, e.message); + } + + pixelSizeProgram->activate(); + + // Draw sub-pixel grid + glEnable(GL_SAMPLE_SHADING); + glBindVertexArray(pixelSizeQuadVAO); + glDisable(GL_DEPTH_TEST); + glDepthMask(false); + glDrawArrays(GL_TRIANGLES, 0, GRIDSIZE * GRIDSIZE * 6); + glBindVertexArray(0); + glDepthMask(true); + glEnable(GL_DEPTH_TEST); + glDisable(GL_SAMPLE_SHADING); + + pixelSizeProgram->deactivate(); + + // Now we render the Nx1 quad strip + GLuint nOneStripFramebuffer = 0, + nOneStripVAO = 0, + nOneStripVBO = 0, + nOneStripTexture = 0; + + sizeX = -1.0f; + step = 2.0f / static_cast(_nAaSamples); + + GLfloat * nOneStripVertexData = new GLfloat[_nAaSamples * (NVERTEX + 12)]; + + for (int x = 0; x < _nAaSamples; ++x) { + nOneStripVertexData[x * (NVERTEX + 12)] = sizeX; + nOneStripVertexData[x * (NVERTEX + 12) + 1] = -1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 2] = 0.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 3] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 4] = 0.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 5] = 0.0f; + + nOneStripVertexData[x * (NVERTEX + 12) + 6] = sizeX + step; + nOneStripVertexData[x * (NVERTEX + 12) + 7] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 8] = 0.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 9] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 10] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 11] = 1.0f; + + nOneStripVertexData[x * (NVERTEX + 12) + 12] = sizeX; + nOneStripVertexData[x * (NVERTEX + 12) + 13] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 14] = 0.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 15] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 16] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 17] = 0.0f; + + nOneStripVertexData[x * (NVERTEX + 12) + 18] = sizeX; + nOneStripVertexData[x * (NVERTEX + 12) + 19] = -1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 20] = 0.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 21] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 22] = 0.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 23] = 0.0f; + + nOneStripVertexData[x * (NVERTEX + 12) + 24] = sizeX + step; + nOneStripVertexData[x * (NVERTEX + 12) + 25] = -1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 26] = 0.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 27] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 28] = 0.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 29] = 1.0f; + + nOneStripVertexData[x * (NVERTEX + 12) + 30] = sizeX + step; + nOneStripVertexData[x * (NVERTEX + 12) + 31] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 32] = 0.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 33] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 34] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 35] = 1.0f; + + sizeX += step; + } + + glGenVertexArrays(1, &nOneStripVAO); + glBindVertexArray(nOneStripVAO); + glGenBuffers(1, &nOneStripVBO); + glBindBuffer(GL_ARRAY_BUFFER, nOneStripVBO); + glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * _nAaSamples * (NVERTEX + 12), nOneStripVertexData, GL_STATIC_DRAW); + + // position + glVertexAttribPointer( + 0, + 4, + GL_FLOAT, + GL_FALSE, + sizeof(GLfloat) * 6, + nullptr + ); + glEnableVertexAttribArray(0); + + // texture coords + glVertexAttribPointer( + 1, + 2, + GL_FLOAT, + GL_FALSE, + sizeof(GLfloat) * 6, + reinterpret_cast(sizeof(GLfloat) * 4) + ); + glEnableVertexAttribArray(1); + delete[] nOneStripVertexData; + + // fbo texture buffer + glGenTextures(1, &nOneStripTexture); + glBindTexture(GL_TEXTURE_2D, nOneStripTexture); + glTexImage2D( + GL_TEXTURE_2D, + 0, + GL_RGBA32F, + _nAaSamples, + ONEPIXEL, + 0, + GL_RGBA, + GL_FLOAT, + nullptr + ); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + + glGenFramebuffers(1, &nOneStripFramebuffer); + glBindFramebuffer(GL_FRAMEBUFFER, nOneStripFramebuffer); + glFramebufferTexture2D( + GL_FRAMEBUFFER, + GL_COLOR_ATTACHMENT0, + GL_TEXTURE_2D, + nOneStripTexture, + 0 + ); + + status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) { + LERROR("nOneStrip framebuffer is not complete"); + } + + glViewport(0, 0, _nAaSamples, ONEPIXEL); + + std::unique_ptr nOneStripProgram = nullptr; + try { + nOneStripProgram = ghoul::opengl::ProgramObject::Build( + "OneStrip MSAA", + "${SHADERS}/framebuffer/nOneStripMSAA.vert", + "${SHADERS}/framebuffer/nOneStripMSAA.frag" + ); + } + catch (const ghoul::RuntimeError& e) { + LERRORC(e.component, e.message); + } + + nOneStripProgram->activate(); + + ghoul::opengl::TextureUnit pixelSizeTextureUnit; + pixelSizeTextureUnit.activate(); + glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, pixelSizeTexture); + nOneStripProgram->setUniform("pixelSizeTexture", pixelSizeTextureUnit); + + // render strip + glDrawBuffers(1, textureBuffers); + + glClearColor(0.0f, 1.0f, 0.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); + glBindVertexArray(nOneStripVAO); + glDisable(GL_DEPTH_TEST); + glDepthMask(false); + for (int sample = 0; sample < _nAaSamples; ++sample) { + nOneStripProgram->setUniform("currentSample", sample); + glDrawArrays(GL_TRIANGLES, sample * 6, 6); + } + /*nOneStripProgram->setUniform("currentSample", 0); + glDrawArrays(GL_TRIANGLES, 0, 6 * _nAaSamples);*/ + glDepthMask(true); + glEnable(GL_DEPTH_TEST); + glBindVertexArray(0); + + saveTextureToMemory(GL_COLOR_ATTACHMENT0, _nAaSamples, 1, _mSAAPattern); + // Convert back to [-1, 1] range and then scales to the current viewport size: + for (int d = 0; d < _nAaSamples; ++d) { + _mSAAPattern[d * 3] = (2.0 * _mSAAPattern[d * 3] - 1.0) / static_cast(viewport[2]); + _mSAAPattern[(d * 3) + 1] = (2.0 * _mSAAPattern[(d * 3) + 1] - 1.0) / static_cast(viewport[3]); + _mSAAPattern[(d * 3) + 2] = 0.0; + } + + nOneStripProgram->deactivate(); + + // Restores default state + glBindFramebuffer(GL_FRAMEBUFFER, defaultFbo); + glViewport(viewport[0], viewport[1], viewport[2], viewport[3]); + + // Deletes unused buffers + glDeleteFramebuffers(1, &pixelSizeFramebuffer); + glDeleteTextures(1, &pixelSizeTexture); + glDeleteBuffers(1, &pixelSizeQuadVBO); + glDeleteVertexArrays(1, &pixelSizeQuadVAO); + + glDeleteFramebuffers(1, &nOneStripFramebuffer); + glDeleteTextures(1, &nOneStripTexture); + glDeleteBuffers(1, &nOneStripVBO); + glDeleteVertexArrays(1, &nOneStripVAO); +} + void ABufferRenderer::render(float blackoutFactor, bool doPerformanceMeasurements) { PerfMeasure("ABufferRenderer::render"); @@ -412,6 +742,43 @@ void ABufferRenderer::setNAaSamples(int nAaSamples) { _dirtyResolution = true; } +void ABufferRenderer::setHDRExposure(float hdrExposure) { + _hdrExposure = hdrExposure; + if (_hdrExposure < 0.0) { + LERROR("HDR Exposure constant must be greater than zero."); + _hdrExposure = 1.0; + } +} + +void ABufferRenderer::setHDRBackground(float hdrBackground) { + _hdrBackground = hdrBackground; + if (_hdrBackground < 0.0) { + LERROR("HDR Background constant must be greater than zero."); + _hdrBackground = 1.0; + } +} + + +void ABufferRenderer::setGamma(float gamma) { + _gamma = gamma; + if (_gamma < 0.0f) { + LERROR("Gamma value must be greater than zero."); + _gamma = 2.2f; + } +} + +float ABufferRenderer::hdrBackground() const { + return _hdrBackground; +} + +int ABufferRenderer::nAaSamples() const { + return _nAaSamples; +} + +std::vector ABufferRenderer::mSSAPattern() const { + return _mSAAPattern; +} + void ABufferRenderer::clear() { glBindBuffer(GL_PIXEL_UNPACK_BUFFER, _anchorPointerTextureInitializer); glBindTexture(GL_TEXTURE_2D, _anchorPointerTexture); @@ -639,4 +1006,30 @@ void ABufferRenderer::updateRendererData() { _dirtyRendererData = false; } +void ABufferRenderer::saveTextureToMemory(const GLenum color_buffer_attachment, + const int width, const int height, std::vector & memory) const { + + if (!memory.empty()) { + memory.clear(); + } + + memory.reserve(width * height * 3); + float * tempMemory = new float[width * height * 3]; + + if (color_buffer_attachment != GL_DEPTH_ATTACHMENT) { + glReadBuffer(color_buffer_attachment); + glReadPixels(0, 0, width, height, GL_RGB, GL_FLOAT, tempMemory); + + } + else { + glReadPixels(0, 0, width, height, GL_DEPTH_COMPONENT, GL_FLOAT, tempMemory); + } + + for (auto i = 0; i < width*height * 3; ++i) { + memory[i] = static_cast(tempMemory[i]); + } + + delete[] tempMemory; +} + } diff --git a/src/rendering/deferredcastermanager.cpp b/src/rendering/deferredcastermanager.cpp new file mode 100644 index 0000000000..8ab8b75615 --- /dev/null +++ b/src/rendering/deferredcastermanager.cpp @@ -0,0 +1,82 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2017 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#include +#include +#include +#include + +namespace { + const char* _loggerCat = "DeferredcasterManager"; +} + +namespace openspace { + +DeferredcasterManager::DeferredcasterManager() = default; + +DeferredcasterManager::~DeferredcasterManager() = default; + +void DeferredcasterManager::attachDeferredcaster(Deferredcaster& deferredcaster) { + if (!isAttached(deferredcaster)) { + _deferredcasters.push_back(&deferredcaster); + } + for (auto &listener : _listeners) { + listener->deferredcastersChanged(deferredcaster, ghoul::Boolean::Yes); + } +} + +void DeferredcasterManager::detachDeferredcaster(Deferredcaster& deferredcaster) { + auto it = std::find(_deferredcasters.begin(), _deferredcasters.end(), &deferredcaster); + if (it != _deferredcasters.end()) { + _deferredcasters.erase(it); + for (auto &listener : _listeners) { + listener->deferredcastersChanged(deferredcaster, ghoul::Boolean::No); + } + } +} + +bool DeferredcasterManager::isAttached(Deferredcaster& deferredcaster) { + auto it = std::find(_deferredcasters.begin(), _deferredcasters.end(), &deferredcaster); + return it != _deferredcasters.end(); +} + +void DeferredcasterManager::addListener(DeferredcasterListener& listener) { + auto it = std::find(_listeners.begin(), _listeners.end(), &listener); + if (it == _listeners.end()) { + _listeners.push_back(&listener); + } +} + +void DeferredcasterManager::removeListener(DeferredcasterListener& listener) { + auto it = std::find(_listeners.begin(), _listeners.end(), &listener); + if (it != _listeners.end()) { + _listeners.erase(it); + } +} + +const std::vector& DeferredcasterManager::deferredcasters() { + return _deferredcasters; +} + +} diff --git a/src/rendering/framebufferrenderer.cpp b/src/rendering/framebufferrenderer.cpp index fd9debc830..7e782510b0 100644 --- a/src/rendering/framebufferrenderer.cpp +++ b/src/rendering/framebufferrenderer.cpp @@ -34,6 +34,14 @@ #include #include #include +#include +#include +#include +#include +#include +#include + +#include #include #include @@ -42,6 +50,8 @@ #include #include +#include +#include namespace { constexpr const char* _loggerCat = "FramebufferRenderer"; @@ -56,11 +66,21 @@ namespace { } // namespace namespace openspace { +void saveTextureToPPMFile(const GLenum color_buffer_attachment, + const std::string & fileName, + const int width, const int height); + +void saveTextureToMemory(const GLenum color_buffer_attachment, + const int width, const int height, std::vector & memory); + FramebufferRenderer::FramebufferRenderer() : _camera(nullptr) , _scene(nullptr) , _resolution(glm::vec2(0)) + , _hdrExposure(0.4f) + , _hdrBackground(2.8f) + , _gamma(2.2f) {} FramebufferRenderer::~FramebufferRenderer() {} @@ -109,25 +129,29 @@ void FramebufferRenderer::initialize() { glGenTextures(1, &_exitDepthTexture); glGenFramebuffers(1, &_exitFramebuffer); + // Deferred framebuffer + glGenTextures(1, &_deferredColorTexture); + glGenTextures(1, &_mainOtherDataTexture); + glGenTextures(1, &_mainPositionTexture); + glGenTextures(1, &_mainNormalTexture); + glGenFramebuffers(1, &_deferredFramebuffer); + updateResolution(); updateRendererData(); updateRaycastData(); - + glBindFramebuffer(GL_FRAMEBUFFER, _mainFramebuffer); - glFramebufferTexture2D( - GL_FRAMEBUFFER, - GL_COLOR_ATTACHMENT0, - GL_TEXTURE_2D_MULTISAMPLE, - _mainColorTexture, - 0 - ); - glFramebufferTexture2D( - GL_FRAMEBUFFER, - GL_DEPTH_ATTACHMENT, - GL_TEXTURE_2D_MULTISAMPLE, - _mainDepthTexture, - 0 - ); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, _mainColorTexture, 0); + // G-buffer + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_TEXTURE_2D_MULTISAMPLE, _mainOtherDataTexture, 0); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2, GL_TEXTURE_2D_MULTISAMPLE, _mainPositionTexture, 0); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT3, GL_TEXTURE_2D_MULTISAMPLE, _mainNormalTexture, 0); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D_MULTISAMPLE, _mainDepthTexture, 0); + + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) { + LERROR("Main framebuffer is not complete"); + } glBindFramebuffer(GL_FRAMEBUFFER, _exitFramebuffer); glFramebufferTexture2D( @@ -145,11 +169,24 @@ void FramebufferRenderer::initialize() { 0 ); - GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + status = glCheckFramebufferStatus(GL_FRAMEBUFFER); if (status != GL_FRAMEBUFFER_COMPLETE) { - LERROR("Main framebuffer is not complete"); + LERROR("Exit framebuffer is not complete"); } + glBindFramebuffer(GL_FRAMEBUFFER, _deferredFramebuffer); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, _deferredColorTexture, 0); + + status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) { + LERROR("Deferred framebuffer is not complete"); + } + + // JCC: Moved to here to avoid NVidia: "Program/shader state performance warning" + updateHDRData(); + updateDeferredcastData(); + updateMSAASamplingPattern(); + glBindFramebuffer(GL_FRAMEBUFFER, defaultFbo); try { @@ -163,6 +200,7 @@ void FramebufferRenderer::initialize() { } OsEng.renderEngine().raycasterManager().addListener(*this); + OsEng.renderEngine().deferredcasterManager().addListener(*this); } void FramebufferRenderer::deinitialize() { @@ -170,37 +208,63 @@ void FramebufferRenderer::deinitialize() { glDeleteFramebuffers(1, &_mainFramebuffer); glDeleteFramebuffers(1, &_exitFramebuffer); + glDeleteFramebuffers(1, &_deferredFramebuffer); glDeleteTextures(1, &_mainColorTexture); glDeleteTextures(1, &_mainDepthTexture); + + // DEBUG: deferred g-buffer + glDeleteTextures(1, &_deferredColorTexture); + glDeleteTextures(1, &_mainOtherDataTexture); + glDeleteTextures(1, &_mainPositionTexture); + glDeleteTextures(1, &_mainNormalTexture); + glDeleteTextures(1, &_exitColorTexture); glDeleteTextures(1, &_exitDepthTexture); + glDeleteBuffers(1, &_vertexPositionBuffer); glDeleteVertexArrays(1, &_screenQuad); OsEng.renderEngine().raycasterManager().removeListener(*this); + OsEng.renderEngine().deferredcasterManager().removeListener(*this); } void FramebufferRenderer::raycastersChanged(VolumeRaycaster&, bool) { _dirtyRaycastData = true; } +void FramebufferRenderer::deferredcastersChanged(Deferredcaster& deferredcaster, ghoul::Boolean isAttached) { + (void) deferredcaster; + (void) isAttached; + _dirtyDeferredcastData = true; +} + void FramebufferRenderer::update() { if (_dirtyResolution) { updateResolution(); + updateMSAASamplingPattern(); } if (_dirtyRaycastData) { updateRaycastData(); } + if (_dirtyDeferredcastData) { + updateDeferredcastData(); + } + // If the resolve dictionary changed (or a file changed on disk) // then rebuild the resolve program. + if (_hdrBackGroundProgram && _hdrBackGroundProgram->isDirty()) { + _hdrBackGroundProgram->rebuildFromFile(); + } + if (_resolveProgram->isDirty()) { try { _resolveProgram->rebuildFromFile(); - } catch (const ghoul::RuntimeError& error) { + } + catch (const ghoul::RuntimeError& error) { LERRORC(error.component, error.message); } } @@ -235,6 +299,12 @@ void FramebufferRenderer::update() { } } } + + for (auto &program : _deferredcastPrograms) { + if (program.second && program.second->isDirty()) { + program.second->rebuildFromFile(); + } + } } void FramebufferRenderer::updateResolution() { @@ -249,6 +319,53 @@ void FramebufferRenderer::updateResolution() { true ); + // G-buffer + glBindTexture(GL_TEXTURE_2D, _deferredColorTexture); + + glTexImage2D( + GL_TEXTURE_2D, + 0, + GL_RGBA32F, + GLsizei(_resolution.x), + GLsizei(_resolution.y), + 0, + GL_RGBA, + GL_FLOAT, + nullptr); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + + glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _mainOtherDataTexture); + + glTexImage2DMultisample( + GL_TEXTURE_2D_MULTISAMPLE, + _nAaSamples, + GL_RGBA32F, + GLsizei(_resolution.x), + GLsizei(_resolution.y), + true); + + glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _mainPositionTexture); + + glTexImage2DMultisample( + GL_TEXTURE_2D_MULTISAMPLE, + _nAaSamples, + GL_RGBA32F, + GLsizei(_resolution.x), + GLsizei(_resolution.y), + true); + + glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _mainNormalTexture); + + glTexImage2DMultisample( + GL_TEXTURE_2D_MULTISAMPLE, + _nAaSamples, + GL_RGBA32F, + GLsizei(_resolution.x), + GLsizei(_resolution.y), + true); + glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _mainDepthTexture); glTexImage2DMultisample( GL_TEXTURE_2D_MULTISAMPLE, @@ -341,8 +458,8 @@ void FramebufferRenderer::updateRaycastData() { outsideDict.setValue("getEntryPath", GetEntryOutsidePath); _raycastPrograms[raycaster] = ghoul::opengl::ProgramObject::Build( "Volume " + std::to_string(data.id) + " raycast", - vsPath, - RaycastFragmentShaderPath, + absPath(vsPath), + absPath(RaycastFragmentShaderPath), outsideDict ); } catch (ghoul::RuntimeError e) { @@ -353,8 +470,8 @@ void FramebufferRenderer::updateRaycastData() { insideDict.setValue("getEntryPath", GetEntryInsidePath); _insideRaycastPrograms[raycaster] = ghoul::opengl::ProgramObject::Build( "Volume " + std::to_string(data.id) + " inside raycast", - "${SHADERS}/framebuffer/resolveframebuffer.vert", - RaycastFragmentShaderPath, + absPath("${SHADERS}/framebuffer/resolveframebuffer.vert"), + absPath(RaycastFragmentShaderPath), insideDict ); } @@ -365,6 +482,392 @@ void FramebufferRenderer::updateRaycastData() { _dirtyRaycastData = false; } +void FramebufferRenderer::updateDeferredcastData() { + _deferredcastData.clear(); + _deferredcastPrograms.clear(); + + const std::vector& deferredcasters = OsEng.renderEngine().deferredcasterManager().deferredcasters(); + int nextId = 0; + for (auto &deferredcaster : deferredcasters) { + DeferredcastData data; + data.id = nextId++; + data.namespaceName = "HELPER"; + + std::string vsPath = deferredcaster->deferredcastVSPath(); + std::string fsPath = deferredcaster->deferredcastFSPath(); + std::string deferredShaderPath = deferredcaster->deferredcastPath(); + + ghoul::Dictionary dict; + dict.setValue("rendererData", _rendererData); + //dict.setValue("fragmentPath", fsPath); + dict.setValue("id", data.id); + std::string helperPath = deferredcaster->helperPath(); + ghoul::Dictionary helpersDict; + if (helperPath != "") { + helpersDict.setValue("0", helperPath); + } + dict.setValue("helperPaths", helpersDict); + //dict.setValue("deferredcastPath", deferredcaster->getDeferredcastPath()); + + _deferredcastData[deferredcaster] = data; + + try { + ghoul::Dictionary deferredDict = dict; + //deferredDict.setValue("getEntryPath", GetEntryOutsidePath); + _deferredcastPrograms[deferredcaster] = ghoul::opengl::ProgramObject::Build( + "Deferred " + std::to_string(data.id) + " raycast", + absPath(vsPath), + absPath(deferredShaderPath), + deferredDict); + using IgnoreError = ghoul::opengl::ProgramObject::IgnoreError; + _deferredcastPrograms[deferredcaster]->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); + _deferredcastPrograms[deferredcaster]->setIgnoreUniformLocationError(IgnoreError::Yes); + } + catch (ghoul::RuntimeError e) { + LERROR(e.message); + } + + } + _dirtyDeferredcastData = false; +} + +void FramebufferRenderer::updateHDRData() { + try { + _hdrBackGroundProgram = ghoul::opengl::ProgramObject::Build( + "HDR Background Control", + absPath("${SHADERS}/framebuffer/hdrBackground.vert"), + absPath("${SHADERS}/framebuffer/hdrBackground.frag") + ); + using IgnoreError = ghoul::opengl::ProgramObject::IgnoreError; + _hdrBackGroundProgram->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); + _hdrBackGroundProgram->setIgnoreUniformLocationError(IgnoreError::Yes); + } + catch (const ghoul::RuntimeError& e) { + LERRORC(e.component, e.message); + } +} + +void FramebufferRenderer::updateMSAASamplingPattern() { + LINFO("Updating MSAA Sampling Pattern"); + + const int GRIDSIZE = 32; + GLfloat step = 2.0f / static_cast(GRIDSIZE); + GLfloat sizeX = -1.0f, + sizeY = 1.0f; + + const int NVERTEX = 4 * 6; + GLfloat openPixelSizeVertexData[GRIDSIZE * GRIDSIZE * NVERTEX]; + + for (int y = 0; y < GRIDSIZE; ++y) { + for (int x = 0; x < GRIDSIZE; ++x) { + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX] = sizeX; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 1] = sizeY - step; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 2] = 0.0f; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 3] = 1.0f; + + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 4] = sizeX + step; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 5] = sizeY; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 6] = 0.0f; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 7] = 1.0f; + + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 8] = sizeX; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 9] = sizeY; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 10] = 0.0f; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 11] = 1.0f; + + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 12] = sizeX; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 13] = sizeY - step; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 14] = 0.0f; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 15] = 1.0f; + + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 16] = sizeX + step; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 17] = sizeY - step; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 18] = 0.0f; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 19] = 1.0f; + + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 20] = sizeX + step; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 21] = sizeY; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 22] = 0.0f; + openPixelSizeVertexData[y * GRIDSIZE * NVERTEX + x * NVERTEX + 23] = 1.0f; + + sizeX += step; + } + sizeX = -1.0f; + sizeY -= step; + } + + GLuint pixelSizeQuadVAO = 0, + pixelSizeQuadVBO = 0; + + glGenVertexArrays(1, &pixelSizeQuadVAO); + glBindVertexArray(pixelSizeQuadVAO); + + glGenBuffers(1, &pixelSizeQuadVBO); + glBindBuffer(GL_ARRAY_BUFFER, pixelSizeQuadVBO); + + glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * GRIDSIZE * GRIDSIZE * NVERTEX, openPixelSizeVertexData, GL_STATIC_DRAW); + + // Position + glVertexAttribPointer( + 0, + 4, + GL_FLOAT, + GL_FALSE, + 0, + nullptr + ); + glEnableVertexAttribArray(0); + + // Saves current state + GLint defaultFbo; + glGetIntegerv(GL_FRAMEBUFFER_BINDING, &defaultFbo); + GLint viewport[4]; + glGetIntegerv(GL_VIEWPORT, viewport); + + // Main framebuffer + GLuint pixelSizeTexture = 0; + GLuint pixelSizeFramebuffer = 0; + + glGenTextures(1, &pixelSizeTexture); + glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, pixelSizeTexture); + + const GLsizei ONEPIXEL = 1; + glTexImage2DMultisample( + GL_TEXTURE_2D_MULTISAMPLE, + _nAaSamples, + GL_RGBA32F, + ONEPIXEL, + ONEPIXEL, + true + ); + + glViewport(0, 0, ONEPIXEL, ONEPIXEL); + + glGenFramebuffers(1, &pixelSizeFramebuffer); + glBindFramebuffer(GL_FRAMEBUFFER, pixelSizeFramebuffer); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, pixelSizeTexture, 0); + + GLenum textureBuffers[1] = { GL_COLOR_ATTACHMENT0 }; + glDrawBuffers(1, textureBuffers); + + glClearColor(0.0f, 0.0f, 0.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); + + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) { + LERROR("MSAA Sampling pattern framebuffer is not complete"); + return; + } + + std::unique_ptr pixelSizeProgram = nullptr; + try { + pixelSizeProgram = ghoul::opengl::ProgramObject::Build( + "OnePixel MSAA", + absPath("${SHADERS}/framebuffer/pixelSizeMSAA.vert"), + absPath("${SHADERS}/framebuffer/pixelSizeMSAA.frag") + ); + } + catch (const ghoul::RuntimeError& e) { + LERRORC(e.component, e.message); + } + + pixelSizeProgram->activate(); + + // Draw sub-pixel grid + glEnable(GL_SAMPLE_SHADING); + glBindVertexArray(pixelSizeQuadVAO); + glDisable(GL_DEPTH_TEST); + glDepthMask(false); + glDrawArrays(GL_TRIANGLES, 0, GRIDSIZE * GRIDSIZE * 6); + glBindVertexArray(0); + glDepthMask(true); + glEnable(GL_DEPTH_TEST); + glDisable(GL_SAMPLE_SHADING); + + pixelSizeProgram->deactivate(); + + // Now we render the Nx1 quad strip + GLuint nOneStripFramebuffer = 0, + nOneStripVAO = 0, + nOneStripVBO = 0, + nOneStripTexture = 0; + + sizeX = -1.0f; + step = 2.0f / static_cast(_nAaSamples); + + GLfloat * nOneStripVertexData = new GLfloat[_nAaSamples * (NVERTEX + 12)]; + + for (int x = 0; x < _nAaSamples; ++x) { + nOneStripVertexData[x * (NVERTEX + 12)] = sizeX; + nOneStripVertexData[x * (NVERTEX + 12) + 1] = -1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 2] = 0.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 3] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 4] = 0.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 5] = 0.0f; + + nOneStripVertexData[x * (NVERTEX + 12) + 6] = sizeX + step; + nOneStripVertexData[x * (NVERTEX + 12) + 7] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 8] = 0.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 9] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 10] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 11] = 1.0f; + + nOneStripVertexData[x * (NVERTEX + 12) + 12] = sizeX; + nOneStripVertexData[x * (NVERTEX + 12) + 13] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 14] = 0.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 15] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 16] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 17] = 0.0f; + + nOneStripVertexData[x * (NVERTEX + 12) + 18] = sizeX; + nOneStripVertexData[x * (NVERTEX + 12) + 19] = -1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 20] = 0.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 21] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 22] = 0.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 23] = 0.0f; + + nOneStripVertexData[x * (NVERTEX + 12) + 24] = sizeX + step; + nOneStripVertexData[x * (NVERTEX + 12) + 25] = -1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 26] = 0.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 27] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 28] = 0.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 29] = 1.0f; + + nOneStripVertexData[x * (NVERTEX + 12) + 30] = sizeX + step; + nOneStripVertexData[x * (NVERTEX + 12) + 31] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 32] = 0.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 33] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 34] = 1.0f; + nOneStripVertexData[x * (NVERTEX + 12) + 35] = 1.0f; + + sizeX += step; + } + + glGenVertexArrays(1, &nOneStripVAO); + glBindVertexArray(nOneStripVAO); + glGenBuffers(1, &nOneStripVBO); + glBindBuffer(GL_ARRAY_BUFFER, nOneStripVBO); + glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * _nAaSamples * (NVERTEX + 12), nOneStripVertexData, GL_STATIC_DRAW); + + // position + glVertexAttribPointer( + 0, + 4, + GL_FLOAT, + GL_FALSE, + sizeof(GLfloat) * 6, + nullptr + ); + glEnableVertexAttribArray(0); + + // texture coords + glVertexAttribPointer( + 1, + 2, + GL_FLOAT, + GL_FALSE, + sizeof(GLfloat) * 6, + reinterpret_cast(sizeof(GLfloat) * 4) + ); + glEnableVertexAttribArray(1); + delete[] nOneStripVertexData; + + // fbo texture buffer + glGenTextures(1, &nOneStripTexture); + glBindTexture(GL_TEXTURE_2D, nOneStripTexture); + glTexImage2D( + GL_TEXTURE_2D, + 0, + GL_RGBA32F, + _nAaSamples, + ONEPIXEL, + 0, + GL_RGBA, + GL_FLOAT, + nullptr + ); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + + glGenFramebuffers(1, &nOneStripFramebuffer); + glBindFramebuffer(GL_FRAMEBUFFER, nOneStripFramebuffer); + glFramebufferTexture2D( + GL_FRAMEBUFFER, + GL_COLOR_ATTACHMENT0, + GL_TEXTURE_2D, + nOneStripTexture, + 0 + ); + + status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) { + LERROR("nOneStrip framebuffer is not complete"); + } + + glViewport(0, 0, _nAaSamples, ONEPIXEL); + + std::unique_ptr nOneStripProgram = nullptr; + try { + nOneStripProgram = ghoul::opengl::ProgramObject::Build( + "OneStrip MSAA", + absPath("${SHADERS}/framebuffer/nOneStripMSAA.vert"), + absPath("${SHADERS}/framebuffer/nOneStripMSAA.frag") + ); + } + catch (const ghoul::RuntimeError& e) { + LERRORC(e.component, e.message); + } + + nOneStripProgram->activate(); + + ghoul::opengl::TextureUnit pixelSizeTextureUnit; + pixelSizeTextureUnit.activate(); + glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, pixelSizeTexture); + nOneStripProgram->setUniform("pixelSizeTexture", pixelSizeTextureUnit); + + // render strip + glDrawBuffers(1, textureBuffers); + + glClearColor(0.0f, 1.0f, 0.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); + glBindVertexArray(nOneStripVAO); + glDisable(GL_DEPTH_TEST); + glDepthMask(false); + for (int sample = 0; sample < _nAaSamples; ++sample) { + nOneStripProgram->setUniform("currentSample", sample); + glDrawArrays(GL_TRIANGLES, sample * 6, 6); + } + glDepthMask(true); + glEnable(GL_DEPTH_TEST); + glBindVertexArray(0); + + saveTextureToMemory(GL_COLOR_ATTACHMENT0, _nAaSamples, 1, _mSAAPattern); + // Convert back to [-1, 1] range and then scale for the current viewport size: + for (int d = 0; d < _nAaSamples; ++d) { + _mSAAPattern[d * 3] = (2.0 * _mSAAPattern[d * 3] - 1.0) / static_cast(viewport[2]); + _mSAAPattern[(d * 3) + 1] = (2.0 * _mSAAPattern[(d * 3) + 1] - 1.0) / static_cast(viewport[3]); + _mSAAPattern[(d * 3) + 2] = 0.0; + } + + nOneStripProgram->deactivate(); + + // Restores default state + glBindFramebuffer(GL_FRAMEBUFFER, defaultFbo); + glViewport(viewport[0], viewport[1], viewport[2], viewport[3]); + + // Deletes unused buffers + glDeleteFramebuffers(1, &pixelSizeFramebuffer); + glDeleteTextures(1, &pixelSizeTexture); + glDeleteBuffers(1, &pixelSizeQuadVBO); + glDeleteVertexArrays(1, &pixelSizeQuadVAO); + + glDeleteFramebuffers(1, &nOneStripFramebuffer); + glDeleteTextures(1, &nOneStripTexture); + glDeleteBuffers(1, &nOneStripVBO); + glDeleteVertexArrays(1, &nOneStripVAO); +} + void FramebufferRenderer::render(float blackoutFactor, bool doPerformanceMeasurements) { std::unique_ptr perf; if (doPerformanceMeasurements) { @@ -392,6 +895,9 @@ void FramebufferRenderer::render(float blackoutFactor, bool doPerformanceMeasure glGetIntegerv(GL_FRAMEBUFFER_BINDING, &defaultFbo); glBindFramebuffer(GL_FRAMEBUFFER, _mainFramebuffer); + // deferred g-buffer + GLenum textureBuffers[4] = { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2, GL_COLOR_ATTACHMENT3 }; + glDrawBuffers(4, textureBuffers); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); data.renderBinMask = static_cast(Renderable::RenderBin::Background); @@ -429,11 +935,18 @@ void FramebufferRenderer::render(float blackoutFactor, bool doPerformanceMeasure if (raycastProgram) { raycastProgram->activate(); raycastProgram->setUniform("cameraPosInRaycaster", cameraPosition); + } else { + raycastProgram = _insideRaycastPrograms[raycaster].get(); + raycastProgram->activate(); + raycastProgram->setUniform("cameraPosInRaycaster", cameraPosition); } } else { raycastProgram = _raycastPrograms[raycaster].get(); if (raycastProgram) { raycastProgram->activate(); + } else { + raycastProgram = _raycastPrograms[raycaster].get(); + raycastProgram->activate(); } } @@ -478,21 +991,121 @@ void FramebufferRenderer::render(float blackoutFactor, bool doPerformanceMeasure } } - glBindFramebuffer(GL_FRAMEBUFFER, defaultFbo); - _resolveProgram->activate(); + // g-buffer + if (!tasks.deferredcasterTasks.empty()) { + //glBindFramebuffer(GL_DRAW_FRAMEBUFFER, _deferredFramebuffer); + glBindFramebuffer(GL_FRAMEBUFFER, defaultFbo); + GLenum dBuffer[1] = { GL_COLOR_ATTACHMENT0 }; + glDrawBuffers(1, dBuffer); + glClear(GL_COLOR_BUFFER_BIT); + + bool firstPaint = true; - ghoul::opengl::TextureUnit mainColorTextureUnit; - mainColorTextureUnit.activate(); - glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _mainColorTexture); + for (const DeferredcasterTask& deferredcasterTask : tasks.deferredcasterTasks) { - _resolveProgram->setUniform("mainColorTexture", mainColorTextureUnit); - _resolveProgram->setUniform("blackoutFactor", blackoutFactor); - _resolveProgram->setUniform("nAaSamples", _nAaSamples); - glBindVertexArray(_screenQuad); - glDrawArrays(GL_TRIANGLES, 0, 6); - glBindVertexArray(0); + Deferredcaster* deferredcaster = deferredcasterTask.deferredcaster; - _resolveProgram->deactivate(); + ghoul::opengl::ProgramObject* deferredcastProgram = nullptr; + + if (deferredcastProgram != _deferredcastPrograms[deferredcaster].get() + || deferredcastProgram == nullptr) { + deferredcastProgram = _deferredcastPrograms[deferredcaster].get(); + } + + if (deferredcastProgram) { + + deferredcastProgram->activate(); + + // adding G-Buffer + ghoul::opengl::TextureUnit mainDColorTextureUnit; + mainDColorTextureUnit.activate(); + glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _mainColorTexture); + deferredcastProgram->setUniform("mainColorTexture", mainDColorTextureUnit); + + ghoul::opengl::TextureUnit otherDataTextureUnit; + otherDataTextureUnit.activate(); + glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _mainOtherDataTexture); + deferredcastProgram->setUniform("otherDataTexture", otherDataTextureUnit); + + ghoul::opengl::TextureUnit mainPositionTextureUnit; + mainPositionTextureUnit.activate(); + glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _mainPositionTexture); + deferredcastProgram->setUniform("mainPositionTexture", mainPositionTextureUnit); + + ghoul::opengl::TextureUnit mainNormalTextureUnit; + mainNormalTextureUnit.activate(); + glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _mainNormalTexture); + deferredcastProgram->setUniform("mainNormalTexture", mainNormalTextureUnit); + + + deferredcastProgram->setUniform("nAaSamples", _nAaSamples); + // 48 = 16 samples * 3 coords + deferredcastProgram->setUniform("msaaSamplePatter", &_mSAAPattern[0], 48); + + deferredcastProgram->setUniform("firstPaint", firstPaint); + deferredcastProgram->setUniform("atmExposure", _hdrExposure); + deferredcastProgram->setUniform("backgroundConstant", _hdrBackground); + + deferredcaster->preRaycast(deferredcasterTask.renderData, + _deferredcastData[deferredcaster], + *deferredcastProgram); + + glDisable(GL_DEPTH_TEST); + glDepthMask(false); + + glBindVertexArray(_screenQuad); + glDrawArrays(GL_TRIANGLES, 0, 6); + glBindVertexArray(0); + + glDepthMask(true); + glEnable(GL_DEPTH_TEST); + + deferredcaster->postRaycast(deferredcasterTask.renderData, + _deferredcastData[deferredcaster], + *deferredcastProgram); + + deferredcastProgram->deactivate(); + + if (firstPaint) { + firstPaint = false; + } + } + else { + LWARNING("Deferredcaster is not attached when trying to perform deferred task"); + } + } + } + + if (!tasks.deferredcasterTasks.empty()) { + + // JCC: Temporarily disabled. Need to test it on mac and linux before final merging. + /*glBindFramebuffer(GL_READ_FRAMEBUFFER, _deferredFramebuffer); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, defaultFbo); + GLenum dBuffer[] = { GL_COLOR_ATTACHMENT0 }; + glDrawBuffers(1, dBuffer); + glReadBuffer(GL_COLOR_ATTACHMENT0); + glBlitFramebuffer(0, 0, GLsizei(_resolution.x), GLsizei(_resolution.y), + 0, 0, GLsizei(_resolution.x), GLsizei(_resolution.y), + GL_COLOR_BUFFER_BIT, GL_NEAREST); + */ + //glBindFramebuffer(GL_FRAMEBUFFER, defaultFbo); + } else { + glBindFramebuffer(GL_FRAMEBUFFER, defaultFbo); + _resolveProgram->activate(); + + ghoul::opengl::TextureUnit mainColorTextureUnit; + mainColorTextureUnit.activate(); + + glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _mainColorTexture); + _resolveProgram->setUniform("mainColorTexture", mainColorTextureUnit); + _resolveProgram->setUniform("blackoutFactor", blackoutFactor); + _resolveProgram->setUniform("nAaSamples", _nAaSamples); + glBindVertexArray(_screenQuad); + glDrawArrays(GL_TRIANGLES, 0, 6); + glBindVertexArray(0); + + _resolveProgram->deactivate(); + } } void FramebufferRenderer::setScene(Scene* scene) { @@ -520,6 +1133,42 @@ void FramebufferRenderer::setNAaSamples(int nAaSamples) { _dirtyResolution = true; } +void FramebufferRenderer::setHDRExposure(float hdrExposure) { + _hdrExposure = hdrExposure; + if (_hdrExposure < 0.0f) { + LERROR("HDR Exposure constant must be greater than zero."); + _hdrExposure = 1.0f; + } +} + +void FramebufferRenderer::setHDRBackground(float hdrBackground) { + _hdrBackground = hdrBackground; + if (_hdrBackground < 0.0f) { + LERROR("HDR Background constant must be greater than zero."); + _hdrBackground = 1.0f; + } +} + +void FramebufferRenderer::setGamma(float gamma) { + _gamma = gamma; + if (_gamma < 0.0f) { + LERROR("Gamma value must be greater than zero."); + _gamma = 2.2f; + } +} + +float FramebufferRenderer::hdrBackground() const { + return _hdrBackground; +} + +int FramebufferRenderer::nAaSamples() const { + return _nAaSamples; +} + +std::vector FramebufferRenderer::mSSAPattern() const { + return _mSAAPattern; +} + void FramebufferRenderer::updateRendererData() { ghoul::Dictionary dict; dict.setValue("fragmentRendererPath", std::string(RenderFragmentShaderPath)); @@ -529,4 +1178,70 @@ void FramebufferRenderer::updateRendererData() { OsEng.renderEngine().setRendererData(dict); } +void saveTextureToPPMFile(const GLenum color_buffer_attachment, + const std::string & fileName, + const int width, const int height) { + std::fstream ppmFile; + + ppmFile.open(fileName.c_str(), std::fstream::out); + if (ppmFile.is_open()) { + unsigned char * pixels = new unsigned char[width*height * 3]; + for (int t = 0; t < width*height * 3; ++t) + pixels[t] = 255; + + if (color_buffer_attachment != GL_DEPTH_ATTACHMENT) { + glReadBuffer(color_buffer_attachment); + glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, pixels); + + } + else { + glReadPixels(0, 0, width, height, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, pixels); + } + + ppmFile << "P3" << std::endl; + ppmFile << width << " " << height << std::endl; + ppmFile << "255" << std::endl; + + std::cout << "\n\nFILE\n\n"; + int k = 0; + for (int i = 0; i < width; i++) { + for (int j = 0; j < height; j++) { + ppmFile << (unsigned int)pixels[k] << " " << (unsigned int)pixels[k + 1] << " " << (unsigned int)pixels[k + 2] << " "; + k += 3; + } + ppmFile << std::endl; + } + delete[] pixels; + + ppmFile.close(); + } +} + +void saveTextureToMemory(const GLenum color_buffer_attachment, + const int width, const int height, std::vector & memory) { + + if (!memory.empty()) { + memory.clear(); + } + memory.reserve(width * height * 3); + + float *tempMemory = new float[width*height * 3]; + + if (color_buffer_attachment != GL_DEPTH_ATTACHMENT) { + glReadBuffer(color_buffer_attachment); + glReadPixels(0, 0, width, height, GL_RGB, GL_FLOAT, tempMemory); + + } + else { + glReadPixels(0, 0, width, height, GL_DEPTH_COMPONENT, GL_FLOAT, tempMemory); + } + + for (auto i = 0; i < width*height * 3; ++i) { + memory[i] = static_cast(tempMemory[i]); + } + + delete[] tempMemory; +} + + } // namespace openspace diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index cf762298df..6f59840598 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -1,26 +1,26 @@ /***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2017 * - * * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this * - * software and associated documentation files (the "Software"), to deal in the Software * - * without restriction, including without limitation the rights to use, copy, modify, * - * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * - * permit persons to whom the Software is furnished to do so, subject to the following * - * conditions: * - * * - * The above copyright notice and this permission notice shall be included in all copies * - * or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - ****************************************************************************************/ +* * +* OpenSpace * +* * +* Copyright (c) 2014-2017 * +* * +* Permission is hereby granted, free of charge, to any person obtaining a copy of this * +* software and associated documentation files (the "Software"), to deal in the Software * +* without restriction, including without limitation the rights to use, copy, modify, * +* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * +* permit persons to whom the Software is furnished to do so, subject to the following * +* conditions: * +* * +* The above copyright notice and this permission notice shall be included in all copies * +* or substantial portions of the Software. * +* * +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * +* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * +* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * +* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * +* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * +* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +****************************************************************************************/ #include @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -188,6 +189,26 @@ namespace { "This value determines the number of anti-aliasing samples to be used in the " "rendering for the MSAA method." }; + + static const openspace::properties::Property::PropertyInfo HDRExposureInfo = { + "HDRExposure", + "HDR Exposure", + "This value determines the amount of light per unit area reaching the " + "equivalent of an electronic image sensor." + }; + + static const openspace::properties::Property::PropertyInfo BackgroundExposureInfo = { + "Background Exposure", + "BackgroundExposure", + "This value determines the amount of light per unit area reaching the " + "equivalent of an electronic image sensor for the background image." + }; + + static const openspace::properties::Property::PropertyInfo GammaInfo = { + "Gamma", + "Gamma Correction", + "Gamma, is the nonlinear operation used to encode and decode luminance or tristimulus values in the image." + }; } // namespace @@ -198,6 +219,7 @@ RenderEngine::RenderEngine() , _camera(nullptr) , _scene(nullptr) , _raycasterManager(nullptr) + , _deferredcasterManager(nullptr) , _doPerformanceMeasurements(PerformanceInfo) , _performanceManager(nullptr) , _renderer(nullptr) @@ -216,7 +238,10 @@ RenderEngine::RenderEngine() , _fadeDuration(2.f) , _currentFadeTime(0.f) , _fadeDirection(0) - , _nAaSamples(AaSamplesInfo, 8, 1, 16) + , _hdrExposure(HDRExposureInfo, 0.4f, 0.01f, 10.0f) + , _hdrBackground(BackgroundExposureInfo, 2.8f, 0.01f, 10.0f) + , _gamma(GammaInfo, 2.2f, 0.01f, 10.0f) + , _nAaSamples(AaSamplesInfo, 4, 1, 16) , _frameNumber(0) { _doPerformanceMeasurements.onChange([this](){ @@ -259,7 +284,26 @@ RenderEngine::RenderEngine() _renderer->setNAaSamples(_nAaSamples); } }); + _hdrExposure.onChange([this]() { + if (_renderer) { + _renderer->setHDRExposure(_hdrExposure); + } + }); + _hdrBackground.onChange([this]() { + if (_renderer) { + _renderer->setHDRBackground(_hdrBackground); + } + }); + _gamma.onChange([this]() { + if (_renderer) { + _renderer->setGamma(_gamma); + } + }); + addProperty(_nAaSamples); + addProperty(_hdrExposure); + addProperty(_hdrBackground); + addProperty(_gamma); addProperty(_applyWarping); _takeScreenshot.onChange([this](){ @@ -302,7 +346,8 @@ void RenderEngine::initialize() { ConfigurationManager& confManager = OsEng.configurationManager(); if (confManager.hasKeyAndValue(KeyRenderingMethod)) { renderingMethod = confManager.value(KeyRenderingMethod); - } else { + } + else { using Version = ghoul::systemcapabilities::Version; // The default rendering method has a requirement of OpenGL 4.3, so if we are @@ -316,16 +361,17 @@ void RenderEngine::initialize() { if (confManager.hasKey(ConfigurationManager::KeyDisableMasterRendering)) { _disableMasterRendering = confManager.value( ConfigurationManager::KeyDisableMasterRendering - ); + ); } if (confManager.hasKey(ConfigurationManager::KeyDisableSceneOnMaster)) { _disableSceneTranslationOnMaster = confManager.value( ConfigurationManager::KeyDisableSceneOnMaster - ); + ); } _raycasterManager = std::make_unique(); + _deferredcasterManager = std::make_unique(); _nAaSamples = OsEng.windowWrapper().currentNumberOfAaSamples(); LINFO("Setting renderer from string: " << renderingMethod); @@ -392,7 +438,7 @@ void RenderEngine::initializeGL() { LINFO("Finished initializing GL"); LTRACE("RenderEngine::initializeGL(end)"); } - + void RenderEngine::deinitialize() { for (std::shared_ptr& ssr : _screenSpaceRenderables) { ssr->deinitialize(); @@ -498,7 +544,8 @@ void RenderEngine::updateFade() { 0.f, _currentFadeTime / _fadeDuration ); - } else { + } + else { _globalBlackOutFactor = glm::smoothstep( 0.f, 1.f, @@ -507,13 +554,13 @@ void RenderEngine::updateFade() { } _currentFadeTime += static_cast( OsEng.windowWrapper().averageDeltaTime() - ); + ); } } } void RenderEngine::render(const glm::mat4& sceneMatrix, const glm::mat4& viewMatrix, - const glm::mat4& projectionMatrix) + const glm::mat4& projectionMatrix) { LTRACE("RenderEngine::render(begin)"); WindowWrapper& wrapper = OsEng.windowWrapper(); @@ -523,6 +570,7 @@ void RenderEngine::render(const glm::mat4& sceneMatrix, const glm::mat4& viewMat } else { _camera->sgctInternal.setViewMatrix(viewMatrix * sceneMatrix); + _camera->sgctInternal.setSceneMatrix(sceneMatrix); } _camera->sgctInternal.setProjectionMatrix(projectionMatrix); @@ -628,6 +676,10 @@ RaycasterManager& RenderEngine::raycasterManager() { return *_raycasterManager; } +DeferredcasterManager& RenderEngine::deferredcasterManager() { + return *_deferredcasterManager; +} + void RenderEngine::setScene(Scene* scene) { _scene = scene; if (_renderer) { @@ -669,11 +721,11 @@ void RenderEngine::startFading(int direction, float fadeDuration) { } /** - * Build a program object for rendering with the used renderer - */ +* Build a program object for rendering with the used renderer +*/ std::unique_ptr RenderEngine::buildRenderProgram( - std::string name, std::string vsPath, - std::string fsPath, const ghoul::Dictionary& data) + std::string name, std::string vsPath, + std::string fsPath, const ghoul::Dictionary& data) { ghoul::Dictionary dict = data; @@ -700,12 +752,12 @@ std::unique_ptr RenderEngine::buildRenderProgram( } /** - * Build a program object for rendering with the used renderer - */ +* Build a program object for rendering with the used renderer +*/ std::unique_ptr RenderEngine::buildRenderProgram( - std::string name, std::string vsPath, - std::string fsPath, std::string csPath, - const ghoul::Dictionary& data) + std::string name, std::string vsPath, + std::string fsPath, std::string csPath, + const ghoul::Dictionary& data) { ghoul::Dictionary dict = data; dict.setValue("rendererData", _rendererData); @@ -731,7 +783,7 @@ std::unique_ptr RenderEngine::buildRenderProgram( } void RenderEngine::removeRenderProgram( - const std::unique_ptr& program) + const std::unique_ptr& program) { if (!program) { return; @@ -749,10 +801,10 @@ void RenderEngine::removeRenderProgram( } /** - * Set renderer data - * Called from the renderer, whenever it needs to update - * the dictionary of all rendering programs. - */ +* Set renderer data +* Called from the renderer, whenever it needs to update +* the dictionary of all rendering programs. +*/ void RenderEngine::setRendererData(const ghoul::Dictionary& data) { _rendererData = data; for (ghoul::opengl::ProgramObject* program : _programs) { @@ -791,8 +843,8 @@ void RenderEngine::postRaycast(ghoul::opengl::ProgramObject& programObject) { } /** - * Set renderer - */ +* Set renderer +*/ void RenderEngine::setRenderer(std::unique_ptr renderer) { if (_renderer) { _renderer->deinitialize(); @@ -801,13 +853,14 @@ void RenderEngine::setRenderer(std::unique_ptr renderer) { _renderer = std::move(renderer); _renderer->setResolution(renderingResolution()); _renderer->setNAaSamples(_nAaSamples); + _renderer->setHDRExposure(_hdrExposure); _renderer->initialize(); _renderer->setCamera(_camera); _renderer->setScene(_scene); } scripting::LuaLibrary RenderEngine::luaLibrary() { - return { + return{ "", { { @@ -931,7 +984,432 @@ RenderEngine::RendererImplementation RenderEngine::rendererFromString( return RendererImplementation::Invalid; } } +/* +<<<<<<< HEAD +std::string RenderEngine::progressToStr(int size, double t) { + std::string progress = "|"; + int g = static_cast((t * (size - 1)) + 1); + g = std::max(g, 0); + for (int i = 0; i < g; i++) { + progress.append("-"); + } + progress.append(">"); + for (int i = 0; i < size - g; i++) { + progress.append(" "); + } + progress.append("|"); + return progress; +} +void RenderEngine::renderInformation() { + using ghoul::fontrendering::RenderFont; + + glm::vec2 penPosition = glm::vec2( + 10.f, + fontResolution().y + ); + + // If the console is opened, move all text downwards + penPosition.y -= OsEng.console().currentHeight(); + + if (_showDate && _fontDate) { + penPosition.y -= _fontDate->height(); + RenderFontCr( + *_fontDate, + penPosition, + "Date: %s", + OsEng.timeManager().time().UTC().c_str() + ); + } + else { + penPosition.y -= _fontInfo->height(); + } + + if (_showInfo && _fontInfo) { + std::pair deltaTime = simplifyTime( + OsEng.timeManager().time().deltaTime() + ); + RenderFontCr( + *_fontInfo, + penPosition, + "Simulation increment: %.1f %s / second", + deltaTime.first, + deltaTime.second.c_str() + ); + + double distance = glm::length( + _camera->positionVec3() - + OsEng.navigationHandler().focusNode()->worldPosition() + ); + std::pair dist = simplifyDistance(distance); + RenderFontCr( + *_fontInfo, + penPosition, + "Distance from focus: %f %s", + dist.first, + dist.second.c_str() + ); + + FrametimeType frametimeType = FrametimeType(_frametimeType.value()); + switch (frametimeType) { + case FrametimeType::DtTimeAvg: + RenderFontCr( + *_fontInfo, + penPosition, + "Avg. Frametime: %.5f", + OsEng.windowWrapper().averageDeltaTime() + ); + break; + case FrametimeType::FPS: + RenderFontCr( + *_fontInfo, + penPosition, + "FPS: %3.2f", + 1.0 / OsEng.windowWrapper().deltaTime() + ); + break; + case FrametimeType::FPSAvg: + RenderFontCr( + *_fontInfo, + penPosition, + "Avg. FPS: %3.2f", + 1.0 / OsEng.windowWrapper().averageDeltaTime() + ); + break; + case FrametimeType::None: + break; + } + + ParallelConnection::Status status = OsEng.parallelConnection().status(); + size_t nConnections = OsEng.parallelConnection().nConnections(); + const std::string& hostName = OsEng.parallelConnection().hostName(); + + std::string connectionInfo = ""; + int nClients = static_cast(nConnections); + if (status == ParallelConnection::Status::Host) { + nClients--; + if (nClients == 1) { + connectionInfo = "Hosting session with 1 client"; + } + else { + connectionInfo = + "Hosting session with " + std::to_string(nClients) + " clients"; + } + } + else if (status == ParallelConnection::Status::ClientWithHost) { + nClients--; + connectionInfo = "Session hosted by '" + hostName + "'"; + } + else if (status == ParallelConnection::Status::ClientWithoutHost) { + connectionInfo = "Host is disconnected"; + } + + if (status == ParallelConnection::Status::ClientWithHost || + status == ParallelConnection::Status::ClientWithoutHost) { + connectionInfo += "\n"; + if (nClients > 2) { + std::string c = std::to_string(nClients - 1); + connectionInfo += "You and " + c + " more clients are tuned in"; + } + else if (nClients == 2) { + std::string c = std::to_string(nClients - 1); + connectionInfo += "You and " + c + " more client are tuned in"; + } + else if (nClients == 1) { + connectionInfo += "You are the only client"; + } + } + + + if (!connectionInfo.empty()) { + RenderFontCr( + *_fontInfo, + penPosition, + connectionInfo.c_str() + ); + } + + +#ifdef OPENSPACE_MODULE_SPACECRAFTINSTRUMENTS_ENABLED + bool hasNewHorizons = scene()->sceneGraphNode("NewHorizons"); + double currentTime = OsEng.timeManager().time().j2000Seconds(); + + //if (MissionManager::ref().hasCurrentMission()) { + + // const Mission& mission = MissionManager::ref().currentMission(); + + // if (mission.phases().size() > 0) { + // static const glm::vec4 nextMissionColor(0.7, 0.3, 0.3, 1); + // //static const glm::vec4 missionProgressColor(0.4, 1.0, 1.0, 1); + // static const glm::vec4 currentMissionColor(0.0, 0.5, 0.5, 1); + // static const glm::vec4 missionProgressColor = currentMissionColor; + // // static const glm::vec4 currentLeafMissionColor = missionProgressColor; + // static const glm::vec4 nonCurrentMissionColor(0.3, 0.3, 0.3, 1); + + // // Add spacing + // RenderFontCr(*_fontInfo, penPosition, nonCurrentMissionColor, " "); + + // auto phaseTrace = mission.phaseTrace(currentTime); + + // if (phaseTrace.size()) { + // const MissionPhase& phase = phaseTrace.back().get(); + // std::string title = "Current Mission Phase: " + phase.name(); + // RenderFontCr( + // *_fontInfo, + // penPosition, + // missionProgressColor, + // title.c_str() + // ); + // double remaining = phase.timeRange().end - currentTime; + // float t = static_cast( + // 1.0 - remaining / phase.timeRange().duration() + // ); + // std::string progress = progressToStr(25, t); + // //RenderFontCr(*_fontInfo, penPosition, missionProgressColor, + // // "%.0f s %s %.1f %%", remaining, progress.c_str(), t * 100); + // } + // else { + // RenderFontCr( + // *_fontInfo, + // penPosition, + // nextMissionColor, + // "Next Mission:" + // ); + // double remaining = mission.timeRange().start - currentTime; + // RenderFontCr(*_fontInfo, penPosition, nextMissionColor, + // "%.0f s", remaining); + // } + + // bool showAllPhases = false; + + // typedef std::pair PhaseWithDepth; + // std::stack S; + // int pixelIndentation = 20; + // S.push({ &mission, 0 }); + // while (!S.empty()) { + // const MissionPhase* phase = S.top().first; + // int depth = S.top().second; + // S.pop(); + + // bool isCurrentPhase = phase->timeRange().includes(currentTime); + + // penPosition.x += depth * pixelIndentation; + // if (isCurrentPhase) { + // double remaining = phase->timeRange().end - currentTime; + // float t = static_cast( + // 1.0 - remaining / phase->timeRange().duration() + // ); + // std::string progress = progressToStr(25, t); + // RenderFontCr(*_fontInfo, penPosition, currentMissionColor, + // "%s %s %.1f %%", + // phase->name().c_str(), + // progress.c_str(), + // t * 100 + // ); + // } + // else { + // RenderFontCr( + // *_fontInfo, + // penPosition, + // nonCurrentMissionColor, + // phase->name().c_str() + // ); + // } + // penPosition.x -= depth * pixelIndentation; + + // if (isCurrentPhase || showAllPhases) { + // // phases are sorted increasingly by start time, and will be + // // popped last-in-first-out from the stack, so add them in + // // reversed order. + // int indexLastPhase = static_cast( + // phase->phases().size() + // ) - 1; + // for (int i = indexLastPhase; 0 <= i; --i) { + // S.push({ &phase->phases()[i], depth + 1 }); + // } + // } + // } + // } + // } + + + + if (openspace::ImageSequencer::ref().isReady()) { + penPosition.y -= 25.f; + + glm::vec4 targetColor(0.00, 0.75, 1.00, 1); + + if (hasNewHorizons) { + try { + double lt; + glm::dvec3 p = SpiceManager::ref().targetPosition( + "PLUTO", + "NEW HORIZONS", + "GALACTIC", + {}, + currentTime, + lt + ); + psc nhPos = PowerScaledCoordinate::CreatePowerScaledCoordinate( + p.x, + p.y, + p.z + ); + float a, b; + glm::dvec3 radii; + SpiceManager::ref().getValue("PLUTO", "RADII", radii); + a = static_cast(radii.x); + b = static_cast(radii.y); + float radius = (a + b) / 2.f; + float distToSurf = glm::length(nhPos.vec3()) - radius; + + RenderFont(*_fontInfo, + penPosition, + "Distance to Pluto: % .1f (KM)", + distToSurf + ); + penPosition.y -= _fontInfo->height(); + } + catch (...) { + // @CLEANUP: This is bad as it will discard all exceptions + // without telling us about it! ---abock + } + } + + double remaining = openspace::ImageSequencer::ref().getNextCaptureTime() - + currentTime; + float t = static_cast( + 1.0 - remaining / openspace::ImageSequencer::ref().getIntervalLength() + ); + + std::string str = SpiceManager::ref().dateFromEphemerisTime( + ImageSequencer::ref().getNextCaptureTime(), + "YYYY MON DD HR:MN:SC" + ); + + glm::vec4 active(0.6, 1, 0.00, 1); + glm::vec4 brigther_active(0.9, 1, 0.75, 1); + + if (remaining > 0) { + std::string progress = progressToStr(25, t); + brigther_active *= (1 - t); + + RenderFontCr(*_fontInfo, + penPosition, + active * t + brigther_active, + "Next instrument activity:" + ); + + RenderFontCr(*_fontInfo, + penPosition, + active * t + brigther_active, + "%.0f s %s %.1f %%", + remaining, progress.c_str(), t * 100 + ); + + RenderFontCr(*_fontInfo, + penPosition, + active, + "Data acquisition time: %s", + str.c_str() + ); + } + std::pair nextTarget = + ImageSequencer::ref().getNextTarget(); + std::pair currentTarget = + ImageSequencer::ref().getCurrentTarget(); + + if (currentTarget.first > 0.0) { + int timeleft = static_cast(nextTarget.first - currentTime); + + int hour = timeleft / 3600; + int second = timeleft % 3600; + int minute = second / 60; + second = second % 60; + + std::string hh, mm, ss; + + if (hour < 10) + hh.append("0"); + if (minute < 10) + mm.append("0"); + if (second < 10) + ss.append("0"); + + hh.append(std::to_string(hour)); + mm.append(std::to_string(minute)); + ss.append(std::to_string(second)); + + RenderFontCr(*_fontInfo, + penPosition, + targetColor, + "Data acquisition adjacency: [%s:%s:%s]", + hh.c_str(), mm.c_str(), ss.c_str() + ); + + penPosition.y -= _fontInfo->height(); + + std::map activeMap = + ImageSequencer::ref().getActiveInstruments(); + glm::vec4 firing(0.58 - t, 1 - t, 1 - t, 1); + glm::vec4 notFiring(0.5, 0.5, 0.5, 1); + + RenderFontCr(*_fontInfo, + penPosition, + active, + "Active Instruments:" + ); + + for (auto m : activeMap) { + if (m.second == false) { + RenderFont(*_fontInfo, + penPosition, + glm::vec4(0.3, 0.3, 0.3, 1), + "| |" + ); + RenderFontCr(*_fontInfo, + penPosition, + glm::vec4(0.3, 0.3, 0.3, 1), + " %5s", + m.first.c_str() + ); + + } + else { + RenderFont(*_fontInfo, + penPosition, + glm::vec4(0.3, 0.3, 0.3, 1), + "|" + ); + if (m.first == "NH_LORRI") { + RenderFont(*_fontInfo, + penPosition, + firing, + " + " + ); + } + RenderFont(*_fontInfo, + penPosition, + glm::vec4(0.3, 0.3, 0.3, 1), + " |" + ); + RenderFontCr(*_fontInfo, + penPosition, + active, + " %5s", + m.first.c_str() + ); + } + } + } + } +#endif + } +} + +======= +>>>>>>> master +*/ void RenderEngine::renderCameraInformation() { if (!_showCameraInfo) { return; @@ -1059,8 +1537,8 @@ void RenderEngine::renderScreenLog() { const std::vector& entries = _log->entries(); auto lastEntries = entries.size() > max ? - std::make_pair(entries.rbegin(), entries.rbegin() + max) : - std::make_pair(entries.rbegin(), entries.rend()); + std::make_pair(entries.rbegin(), entries.rbegin() + max) : + std::make_pair(entries.rbegin(), entries.rend()); size_t nr = 1; auto now = std::chrono::steady_clock::now(); diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index 7679274519..01cf9357ec 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * diff --git a/src/util/camera.cpp b/src/util/camera.cpp index f86cbacfe2..47b539b8c8 100644 --- a/src/util/camera.cpp +++ b/src/util/camera.cpp @@ -228,10 +228,18 @@ namespace openspace { // SGCT INTERNAL // ////////////////////////////////////////////////////////////////////////////////////// Camera::SgctInternal::SgctInternal() - : _viewMatrix() + : _sceneMatrix() + , _viewMatrix() , _projectionMatrix() { } + void Camera::SgctInternal::setSceneMatrix(glm::mat4 sceneMatrix) { + std::lock_guard _lock(_mutex); + + _sceneMatrix = std::move(sceneMatrix); + //_cachedViewProjectionMatrix.isDirty = true; + } + void Camera::SgctInternal::setViewMatrix(glm::mat4 viewMatrix) { std::lock_guard _lock(_mutex); @@ -246,6 +254,10 @@ namespace openspace { _cachedViewProjectionMatrix.isDirty = true; } + const glm::mat4& Camera::SgctInternal::sceneMatrix() const { + return _sceneMatrix; + } + const glm::mat4& Camera::SgctInternal::viewMatrix() const { return _viewMatrix; } diff --git a/src/util/powerscaledcoordinate.cpp b/src/util/powerscaledcoordinate.cpp index 9315a0fb20..27cb28135b 100644 --- a/src/util/powerscaledcoordinate.cpp +++ b/src/util/powerscaledcoordinate.cpp @@ -118,8 +118,9 @@ glm::dvec4 PowerScaledCoordinate::dvec4() const glm::dvec3 PowerScaledCoordinate::dvec3() const { - return glm::dvec3(_vec[0] * pow(k, _vec[3]), _vec[1] * pow(k, _vec[3]), - _vec[2] * pow(k, _vec[3])); + double p = pow(static_cast(k), static_cast(_vec[3])); + return glm::dvec3( static_cast(_vec[0]) * p, static_cast(_vec[1]) * p, + static_cast(_vec[2]) * p); } PowerScaledScalar PowerScaledCoordinate::length() const