local globe = asset.require("../../venus")



local texturesPath = asset.syncedResource({
  Name = "Venus Textures",
  Type = "HttpSynchronization",
  Identifier = "venus_textures",
  Version = 2
})


local Clouds = {
  Identifier = "Clouds",
  FilePath = texturesPath .. "venus_clouds.jpg",
  Enabled = asset.enabled,
  CacheSettings = { Enabled = false }
}

local Layer = {
  Identifier = "Texture",
  FilePath = texturesPath .. "venus.jpg",
  Enabled = asset.enabled,
  Settings = {
    Opacity = 0.48,
    Gamma = 0.48
  },
  CacheSettings = { Enabled = false }
}


asset.onInitialize(function()
  openspace.globebrowsing.addLayer(globe.Venus.Identifier, "ColorLayers", Clouds)
  openspace.globebrowsing.addLayer(globe.Venus.Identifier, "ColorLayers", Layer)
end)

asset.onDeinitialize(function()
  openspace.globebrowsing.deleteLayer(globe.Venus.Identifier, "ColorLayers", Layer)
  openspace.globebrowsing.deleteLayer(globe.Venus.Identifier, "ColorLayers", Clouds)
end)

asset.export(Layer)
asset.export(Clouds)



asset.meta = {
  Name = "Venus Texture",
  Version = "2.0",
  Description = "This asset supplies a default texture for Venus",
  Author = "OpenSpace Team",
  URL = "http://openspaceproject.com",
  License = "MIT license"
}
