local textures = asset.syncedResource({
  Name = "ESO Milky Way Textures",
  Type = "HttpSynchronization",
  Identifier = "milkyway-eso_textures",
  Version = 1
})


local Object = {
  Identifier = "MilkyWay-ESO",
  Transform = {
    Rotation = {
      Type = "StaticRotation",
      Rotation = { 0, 0, math.pi }
    }
  },
  Renderable = {
    Type = "RenderableSphere",
    Size = 9.2E20,
    Segments = 40,
    Opacity = 0.4,
    Texture = textures .. "eso0932a_blend.png",
    Orientation = "Inside",
    MirrorTexture = true,
    FadeOutThreshold = 0.01,
    Background = true
  },
  GUI = {
    Name = "Milky Way (ESO)",
    Path = "/Milky Way/Milky Way",
    Description = "Milky Way Galaxy image (alternate)"
  }
}


asset.onInitialize(function()
  openspace.addSceneGraphNode(Object)
end)

asset.onDeinitialize(function()
  openspace.removeSceneGraphNode(Object)
end)

asset.export(Object)



asset.meta = {
  Name = "MilkyWay Galaxy (ESO)",
  Version = "1.0",
  Description = [[This asset contains an alternate to the Digital Universe image for the
    Milky Way from ESO]],
  Author = "ESO/S. Brunier",
  URL = "https://www.eso.org/public/usa/images/eso0932a/",
  License = "Creative Commons Attribution 4.0 International License"
}
