local textures = asset.syncedResource({
  Name = "Supernova Remnants Textures",
  Type = "HttpSynchronization",
  Identifier = "digitaluniverse_supernovaremnants_textures",
  Version = 1
})

local speck = asset.syncedResource({
  Name = "Supernova Remnants Speck Files",
  Type = "HttpSynchronization",
  Identifier = "digitaluniverse_supernovaremnants_speck",
  Version = 2
})


local Object = {
  Identifier = "SupernovaRemnants",
  Renderable = {
    Type = "RenderableBillboardsCloud",
    Enabled = false,
    Labels = {
      File = speck .. "snr.label",
      Color = { 0.6, 0.46, 0.0 },
      Size = 16.44,
      MinMaxSize = { 4, 100 },
      Unit = "pc"
    },
    Color = { 1.0, 0.5, 0.0 },
    Opacity = 0.32,
    File = speck .. "snr.speck",
    Texture = textures .. "point4.png",
    PolygonSides = 7,
    Unit = "pc",
    ScaleFactor = 424.0,
    --CorrectionSizeEndDistance = 17.5,
    --CorrectionSizeFactor = 13.96,
    BillboardMinMaxSize = { 0.0, 500.0 },
    EnablePixelSizeControl = true
  },
  GUI = {
    Name = "Supernova Remnants",
    Path = "/Milky Way",
    Description = [[Census: 112 supernova remnants.<br> DU Version 3.7. A supernova
      remnant is the ejected gas that results from a supernova. It glows for a
      cosmically short period of time before mixing with the interstellar medium.
      (Description from URL) <br><br> Data Reference: The First Fermi LAT SNR
      Catalog (Acero+, 2016)]]
  }
}

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

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

asset.export(Object)



asset.meta = {
  Name = "Supernova Remnants",
  Version = "2.1",
  Description = "Digital Universe asset for Supernova Remnants",
  Author = "Brian Abbott (AMNH)",
  URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe",
  License = "AMNH Digital Universe"
}
