diff --git a/data/assets/examples/volume/toyvolume.asset b/data/assets/examples/volume/toyvolume.asset index 93730536f1..a52f4d879d 100644 --- a/data/assets/examples/volume/toyvolume.asset +++ b/data/assets/examples/volume/toyvolume.asset @@ -8,10 +8,10 @@ local ToyVolume = { Parent = transforms.SolarSystemBarycenter.Identifier, Renderable = { Type = "RenderableToyVolume", - Size = {5, 5, 5}, + Size = { 5, 5, 5 }, ScalingExponent = 11, StepSize = 0.01, - Color = {1, 0, 0, 1} + Color = { 1, 0, 0 } }, GUI = { Path = "/Examples" diff --git a/data/assets/scene/digitaluniverse/abell.asset b/data/assets/scene/digitaluniverse/abell.asset index 287eab6c52..80b5bbbe94 100644 --- a/data/assets/scene/digitaluniverse/abell.asset +++ b/data/assets/scene/digitaluniverse/abell.asset @@ -27,7 +27,7 @@ local object = { File = speck .. "/abell.speck", Texture = textures .. "/point3A.png", LabelFile = speck .. "/abell.label", - TextColor = { 0.0, 0.8, 0.0, 1.0 }, + TextColor = { 0.0, 0.8, 0.0 }, TextSize = 22, TextMinSize = 10.0, Unit = "Mpc", diff --git a/data/assets/scene/digitaluniverse/alternatestarlabels.asset b/data/assets/scene/digitaluniverse/alternatestarlabels.asset index 2289f24eae..dcef9924a2 100644 --- a/data/assets/scene/digitaluniverse/alternatestarlabels.asset +++ b/data/assets/scene/digitaluniverse/alternatestarlabels.asset @@ -17,7 +17,7 @@ local object = { Color = { 1.0, 1.0, 1.0 }, Opacity = 0.65, LabelFile = speck .. "/stars-altlbl.label", - TextColor = { 0.4, 0.4, 0.4, 1.0 }, + TextColor = { 0.4, 0.4, 0.4 }, DrawLabels = true, TextSize = 14.7, TextMinSize = 6.0, diff --git a/data/assets/scene/digitaluniverse/clusters.asset b/data/assets/scene/digitaluniverse/clusters.asset index f0bb7ac5ea..3f0475d98b 100644 --- a/data/assets/scene/digitaluniverse/clusters.asset +++ b/data/assets/scene/digitaluniverse/clusters.asset @@ -17,7 +17,7 @@ local object = { Color = { 1.0, 1.0, 1.0 }, Opacity = 0.65, LabelFile = speck .. "/galclust.label", - TextColor = { 1.0, 0.44, 0.0, 1.0 }, + TextColor = { 1.0, 0.44, 0.0 }, DrawLabels = true, TextSize = 22, TextMinSize = 8.0, diff --git a/data/assets/scene/digitaluniverse/constellations.asset b/data/assets/scene/digitaluniverse/constellations.asset index d7aea41f79..216a320283 100644 --- a/data/assets/scene/digitaluniverse/constellations.asset +++ b/data/assets/scene/digitaluniverse/constellations.asset @@ -14,12 +14,11 @@ local constellationsExtragalactic = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 0.4, 0.2 }, - Transparency = 0.4, - ScaleFactor = 1.0, + Opacity = 0.4, File = speck .. "/constellationsEXGAL.speck", LabelFile = speck .. "/constellationsEXGAL.label", - TextColor = { 0.8, 0.8, 0.8, 0.4 }, + TextColor = { 0.8, 0.8, 0.8 }, + TextOpacity = 0.4, TextSize = 20.0, TextMinSize = 20.0, TextMaxSize = 30.0, @@ -37,12 +36,11 @@ local constellations = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 0.4, 0.2 }, - Transparency = 0.3, - ScaleFactor = 1.0, + Opacity = 0.3, File = speck .. "/constellations.speck", LabelFile = speck .. "/constellations.label", - TextColor = { 0.8, 0.8, 0.8, 0.3 }, + TextColor = { 0.8, 0.8, 0.8 }, + TextOpacity = 0.3, TextSize = 14.5, TextMaxSize = 170.0, TextMinSize = 8.0, diff --git a/data/assets/scene/digitaluniverse/deepsky.asset b/data/assets/scene/digitaluniverse/deepsky.asset index 66793c377f..4789551408 100644 --- a/data/assets/scene/digitaluniverse/deepsky.asset +++ b/data/assets/scene/digitaluniverse/deepsky.asset @@ -30,7 +30,7 @@ local deepSkyPoints = { --ColorOption = { "prox5Mpc" }, --ColorRange = { { 1.0, 30.0 } }, LabelFile = speck .. "/dso.label", - TextColor = { 0.1, 0.4, 0.6, 1.0 }, + TextColor = { 0.1, 0.4, 0.6 }, TextSize = 20.50, TextMinSize = 16.0, Unit = "Mpc", @@ -61,7 +61,7 @@ local deepSkyImages = { Type = "RenderablePlanesCloud", Enabled = false, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.99, + Opacity = 0.99, ScaleFactor = 1.0, File = speck .. "/dso.speck", TexturePath = textures, diff --git a/data/assets/scene/digitaluniverse/dwarfs.asset b/data/assets/scene/digitaluniverse/dwarfs.asset index 507fd039d3..a302fd9154 100644 --- a/data/assets/scene/digitaluniverse/dwarfs.asset +++ b/data/assets/scene/digitaluniverse/dwarfs.asset @@ -29,7 +29,7 @@ local object = { ColorMap = speck .. "/dwarfs.cmap", ColorOption = { "typeindex" }, --ColorRange = { { 1.0, 4.0} }, - TextColor = { 0.5, 0.1, 0.2, 1.0 }, + TextColor = { 0.5, 0.1, 0.2 }, TextSize = 14.6, TextMinSize = 10.0, ScaleFactor = 370, diff --git a/data/assets/scene/digitaluniverse/exoplanets.asset b/data/assets/scene/digitaluniverse/exoplanets.asset index cd1d29aae3..7915477f17 100644 --- a/data/assets/scene/digitaluniverse/exoplanets.asset +++ b/data/assets/scene/digitaluniverse/exoplanets.asset @@ -28,7 +28,7 @@ local object = { File = speck .. "/expl.speck", LabelFile = speck .. "/expl.label", ScaleFactor = 392.5, - TextColor = { 0.3, 0.3, 0.8, 1.0 }, + TextColor = { 0.3, 0.3, 0.8 }, TextSize = 14.8, TextMaxSize = 200.0, TextMinSize = 10.0, diff --git a/data/assets/scene/digitaluniverse/globularclusters.asset b/data/assets/scene/digitaluniverse/globularclusters.asset index d7e26b6829..035052eea1 100644 --- a/data/assets/scene/digitaluniverse/globularclusters.asset +++ b/data/assets/scene/digitaluniverse/globularclusters.asset @@ -27,7 +27,7 @@ local object = { Texture = textures .. "/point4.png", PolygonSides = 5, LabelFile = speck .. "/gc.label", - TextColor = { 0.5, 0.5, 0.0, 1.0 }, + TextColor = { 0.5, 0.5, 0.0 }, ScaleFactor = 431.0, TextSize = 16.7, TextMinSize = 4.0, diff --git a/data/assets/scene/digitaluniverse/grids.asset b/data/assets/scene/digitaluniverse/grids.asset index ecddec43cf..dcb069250a 100644 --- a/data/assets/scene/digitaluniverse/grids.asset +++ b/data/assets/scene/digitaluniverse/grids.asset @@ -114,10 +114,10 @@ local eclipticLabels = { Type = "RenderableBillboardsCloud", Enabled = false, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.65, + Opacity = 0.65, LabelFile = speck .. "/eclip.label", DrawLabels = true, - TextColor = { 0.5, 0.5, 0.5, 1.0 }, + TextColor = { 0.5, 0.5, 0.5 }, TextSize = 14.75, TextMinSize = 1.3, TextMaxSize = 50.0, @@ -168,10 +168,10 @@ local equatorialLabels = { Type = "RenderableBillboardsCloud", Enabled = false, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.65, + Opacity = 0.65, LabelFile = speck .. "/radec.label", DrawLabels = true, - TextColor = { 0.5, 0.5, 0.5, 1.0 }, + TextColor = { 0.5, 0.5, 0.5 }, TextSize = 14.5, TextMinSize = 1.7, TextMaxSize = 70.0, @@ -212,10 +212,10 @@ local galacticLabels = { Type = "RenderableBillboardsCloud", Enabled = false, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.65, + Opacity = 0.65, LabelFile = speck .. "/galac.label", DrawLabels = true, - TextColor = { 0.5, 0.5, 0.5, 1.0 }, + TextColor = { 0.5, 0.5, 0.5 }, TextSize = 15.8, TextMinSize = 0.5, TextMaxSize = 100.0, @@ -239,13 +239,11 @@ local plane1ld = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, - ScaleFactor = 1.0, + Opacity = 0.4, File = speck .. "/1ld.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/1ld.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 10.3, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -269,13 +267,11 @@ local plane1lm = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, - ScaleFactor = 1.0, + Opacity = 0.4, File = speck .. "/1lm.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/1lm.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 11.8, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -299,13 +295,11 @@ local plane1ly = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, - ScaleFactor = 1.0, + Opacity = 0.4, File = speck .. "/1ly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/1ly.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 13.0, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -329,13 +323,11 @@ local plane10ly = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, - ScaleFactor = 1.0, + Opacity = 0.4, File = speck .. "/10ly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/10ly.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 14.17, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -359,13 +351,11 @@ local plane100ly = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, - ScaleFactor = 1.0, + Opacity = 0.4, File = speck .. "/100ly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/100ly.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 15.0, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -389,13 +379,11 @@ local plane1kly = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, - ScaleFactor = 1.0, + Opacity = 0.4, File = speck .. "/1kly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/1kly.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 16.0, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -419,13 +407,11 @@ local plane10kly = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, - ScaleFactor = 1.0, + Opacity = 0.4, File = speck .. "/10kly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/10kly.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 17.25, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -442,13 +428,11 @@ local plane100kly = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, - ScaleFactor = 1.0, + Opacity = 0.4, File = speck .. "/100kly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/100kly.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 18.6, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -465,13 +449,11 @@ local plane1Mly = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, - ScaleFactor = 1.0, + Opacity = 0.4, File = speck .. "/1Mly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/1Mly.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 19.6, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -488,13 +470,11 @@ local plane10Mly = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, - ScaleFactor = 1.0, + Opacity = 0.4, File = speck .. "/10Mly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/10Mly.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 20.6, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -511,13 +491,11 @@ local plane100Mly = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, - ScaleFactor = 1.0, + Opacity = 0.4, File = speck .. "/100Mly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/100Mly.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 21.6, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -534,13 +512,11 @@ local plane20Gly = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, - ScaleFactor = 1.0, + Opacity = 0.4, File = speck .. "/20Gly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/20Gly.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 23.6, TextMinSize = 0.5, TextMaxSize = 30.0, diff --git a/data/assets/scene/digitaluniverse/groups.asset b/data/assets/scene/digitaluniverse/groups.asset index 745f054baf..682f7fb65b 100644 --- a/data/assets/scene/digitaluniverse/groups.asset +++ b/data/assets/scene/digitaluniverse/groups.asset @@ -18,7 +18,7 @@ local object = { Opacity = 0.65, --ScaleFactor = 10.0, LabelFile = speck .. "/groups.label", - TextColor = { 0.1, 0.6, 0.2, 1.0 }, + TextColor = { 0.1, 0.6, 0.2 }, TextSize = 21.5, TextMinSize = 8.0, Unit = "Mpc", diff --git a/data/assets/scene/digitaluniverse/h2regions.asset b/data/assets/scene/digitaluniverse/h2regions.asset index aee342d6e2..db9cf215c6 100644 --- a/data/assets/scene/digitaluniverse/h2regions.asset +++ b/data/assets/scene/digitaluniverse/h2regions.asset @@ -27,7 +27,7 @@ local object = { Texture = textures .."/point4.png", PolygonSides = 6, LabelFile = speck .. "/h2.label", - TextColor = { 0.5, 0.5, 0.5, 1.0 }, + TextColor = { 0.5, 0.5, 0.5 }, ScaleFactor = 420, TextSize = 16.24, TextMinSize = 4.0, diff --git a/data/assets/scene/digitaluniverse/localdwarfs.asset b/data/assets/scene/digitaluniverse/localdwarfs.asset index bd9c6ccfd7..df011129ee 100644 --- a/data/assets/scene/digitaluniverse/localdwarfs.asset +++ b/data/assets/scene/digitaluniverse/localdwarfs.asset @@ -29,7 +29,7 @@ local object = { Texture = textures .. "/point4.png", PolygonSides = 12, LabelFile = speck .. "/localgroup.label", - TextColor = { 0.3, 0.3, 1.0, 1.0 }, + TextColor = { 0.3, 0.3, 1.0 }, ScaleFactor = 465, TextSize = 18.3, TextMinSize = 7.3, diff --git a/data/assets/scene/digitaluniverse/milkyway.asset b/data/assets/scene/digitaluniverse/milkyway.asset index ee2261e5f1..814ce42fe2 100644 --- a/data/assets/scene/digitaluniverse/milkyway.asset +++ b/data/assets/scene/digitaluniverse/milkyway.asset @@ -63,7 +63,7 @@ local plane = { Type = "RenderablePlanesCloud", Enabled = true, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.99, + Opacity = 0.99, ScaleFactor = 2.8, File = planeSpeck .. "/galaxy.speck", TexturePath = planeTextures, @@ -92,7 +92,7 @@ local homeLabel = { -- Texture = textures .. "/point3.png", DrawLabels = true, LabelFile = homespeck .. "/home.label", - TextColor = { 0.8, 0.8, 0.8, 1.0 }, + TextColor = { 0.8, 0.8, 0.8 }, TextSize = 20.50, TextMinSize = 16.0, TransformationMatrix = { diff --git a/data/assets/scene/digitaluniverse/obassociations.asset b/data/assets/scene/digitaluniverse/obassociations.asset index dd62c55c97..ad25602989 100644 --- a/data/assets/scene/digitaluniverse/obassociations.asset +++ b/data/assets/scene/digitaluniverse/obassociations.asset @@ -31,7 +31,7 @@ local object = { Texture = textures .. "/point4.png", PolygonSides = 7, LabelFile = speck .. "/ob.label", - TextColor = { 0.4, 0.5, 1.0, 1.0 }, + TextColor = { 0.4, 0.5, 1.0 }, ScaleFactor = 390.0, TextSize = 16.24, TextMinSize = 4.50, diff --git a/data/assets/scene/digitaluniverse/openclusters.asset b/data/assets/scene/digitaluniverse/openclusters.asset index a37fe37335..d060f744db 100644 --- a/data/assets/scene/digitaluniverse/openclusters.asset +++ b/data/assets/scene/digitaluniverse/openclusters.asset @@ -26,7 +26,7 @@ local object = { File = speck .. "/oc.speck", Texture = textures .. "/point4.png", PolygonSides = 12, - TextColor = { 0.05, 0.4, 0.2, 1.0 }, + TextColor = { 0.05, 0.4, 0.2 }, LabelFile = speck .. "/oc.label", ScaleFactor = 405.75, TextSize = 15.5, diff --git a/data/assets/scene/digitaluniverse/planetarynebulae.asset b/data/assets/scene/digitaluniverse/planetarynebulae.asset index 5c178355d9..685cd6d21a 100644 --- a/data/assets/scene/digitaluniverse/planetarynebulae.asset +++ b/data/assets/scene/digitaluniverse/planetarynebulae.asset @@ -27,7 +27,7 @@ local object = { Texture = textures .. "/point4.png", PolygonSides = 3, LabelFile = speck .. "/pn.label", - TextColor = { 0.25, 0.25, 0.65, 1.0 }, + TextColor = { 0.25, 0.25, 0.65 }, ScaleFactor = 425.0, TextSize = 16.24, TextMinSize = 4.5, diff --git a/data/assets/scene/digitaluniverse/pulsars.asset b/data/assets/scene/digitaluniverse/pulsars.asset index fa87280a4c..bd58260f22 100644 --- a/data/assets/scene/digitaluniverse/pulsars.asset +++ b/data/assets/scene/digitaluniverse/pulsars.asset @@ -27,7 +27,7 @@ local object = { Texture = textures .. "/point4.png", PolygonSides = 4, LabelFile = speck .. "/pulsar.label", - TextColor = { 0.7, 0.2, 0.2, 1.0 }, + TextColor = { 0.7, 0.2, 0.2 }, ScaleFactor = 424, TextSize = 15.77, TextMinSize = 4, diff --git a/data/assets/scene/digitaluniverse/starlabels.asset b/data/assets/scene/digitaluniverse/starlabels.asset index 5576bb4a9f..6e12b8e7eb 100644 --- a/data/assets/scene/digitaluniverse/starlabels.asset +++ b/data/assets/scene/digitaluniverse/starlabels.asset @@ -17,7 +17,7 @@ local object = { Color = { 1.0, 1.0, 1.0 }, Opacity = 0.65, LabelFile = speck .. "/stars.label", - TextColor = { 0.4, 0.4, 0.4, 1.0 }, + TextColor = { 0.4, 0.4, 0.4 }, DrawLabels = true, TextSize = 14.7, TextMinSize = 6.0, diff --git a/data/assets/scene/digitaluniverse/starorbits.asset b/data/assets/scene/digitaluniverse/starorbits.asset index b240a57024..212d2a9b3f 100644 --- a/data/assets/scene/digitaluniverse/starorbits.asset +++ b/data/assets/scene/digitaluniverse/starorbits.asset @@ -16,13 +16,11 @@ local sunOrbit = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 0.65, 0.0 }, - Transparency = 1.0, - ScaleFactor = 1.0, + Opacity = 1.0, File = speck .. "/starorbits-Sun.speck", MeshColor = {{ 1.0, 0.65, 0.0 }}, --LabelFile = speck .. "/1ld.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 10.3, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -40,13 +38,11 @@ local barnardsOrbit = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = {1.0, 1.0, 1.0}, - Transparency = 1.0, - ScaleFactor = 1.0, + Opacity = 1.0, File = speck .. "/starorbits-BarnardsStar.speck", MeshColor = {{0.39, 0.58, 0.93}}, --LabelFile = speck .. "/1ld.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 10.3, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -64,13 +60,11 @@ local kapteynsOrbit = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = {1.0, 1.0, 1.0}, - Transparency = 1.0, - ScaleFactor = 1.0, + Opacity = 1.0, File = speck .. "/starorbits-KapteynsStar.speck", MeshColor = {{0.6, 0.6, 0.6}}, --LabelFile = speck .. "/1ld.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 10.3, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -88,13 +82,11 @@ local lacaille9352Orbit = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = {1.0, 1.0, 1.0}, - Transparency = 1.0, - ScaleFactor = 1.0, + Opacity = 1.0, File = speck .. "/starorbits-Lacaille9352.speck", MeshColor = {{0.58, 0.0, 0.83}}, --LabelFile = speck .. "/1ld.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 10.3, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -112,13 +104,11 @@ local lSR1826Orbit = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = {1.0, 1.0, 1.0}, - Transparency = 1.0, - ScaleFactor = 1.0, + Opacity = 1.0, File = speck .. "/starorbits-LSR1826+3014.speck", MeshColor = {{0.0, 0.39, 0.0}}, --LabelFile = speck .. "/1ld.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 10.3, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -136,13 +126,11 @@ local lSRJ0822Orbit = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = {1.0, 1.0, 1.0}, - Transparency = 1.0, - ScaleFactor = 1.0, + Opacity = 1.0, File = speck .. "/starorbits-LSRJ0822+1700.speck", MeshColor = {{0.5, 1.0, 0.0}}, --LabelFile = speck .. "/1ld.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 10.3, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -160,13 +148,11 @@ local pM_J13420Orbit = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = {1.0, 1.0, 1.0}, - Transparency = 1.0, - ScaleFactor = 1.0, + Opacity = 1.0, File = speck .. "/starorbits-PM_J13420-3415.speck", MeshColor = {{0.70, 0.13, 0.13}}, --LabelFile = speck .. "/1ld.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 10.3, TextMinSize = 0.5, TextMaxSize = 30.0, diff --git a/data/assets/scene/digitaluniverse/superclusters.asset b/data/assets/scene/digitaluniverse/superclusters.asset index 5ce754caa7..6ebbb1f488 100644 --- a/data/assets/scene/digitaluniverse/superclusters.asset +++ b/data/assets/scene/digitaluniverse/superclusters.asset @@ -27,7 +27,7 @@ local object = { File = speck .. "/superclust.speck", Texture = textures .. "/point3A.png", LabelFile = speck .. "/superclust.label", - TextColor = { 0.9, 0.9, 0.9, 1.0 }, + TextColor = { 0.9, 0.9, 0.9 }, ScaleFactor = 531.0, TextSize = 22.44, TextMinSize = 8.0, diff --git a/data/assets/scene/digitaluniverse/supernovaremnants.asset b/data/assets/scene/digitaluniverse/supernovaremnants.asset index 56b841a2e3..c821080e65 100644 --- a/data/assets/scene/digitaluniverse/supernovaremnants.asset +++ b/data/assets/scene/digitaluniverse/supernovaremnants.asset @@ -27,7 +27,7 @@ local object = { Texture = textures .. "/point4.png", PolygonSides = 7, LabelFile = speck .. "/snr.label", - TextColor = { 0.6, 0.46, 0.0, 1.0 }, + TextColor = { 0.6, 0.46, 0.0 }, ScaleFactor = 424, TextSize = 16.44, TextMinSize = 4.0, diff --git a/data/assets/scene/digitaluniverse/tully.asset b/data/assets/scene/digitaluniverse/tully.asset index d169e0c815..45ce730432 100644 --- a/data/assets/scene/digitaluniverse/tully.asset +++ b/data/assets/scene/digitaluniverse/tully.asset @@ -33,7 +33,7 @@ local tullyPoints = { ColorRange = { { 1.0, 30.0 } }, LabelFile = speck .. "/tully.label", DrawLabels = true, - TextColor = { 0.7, 0.7, 0.7, 1.0 }, + TextColor = { 0.7, 0.7, 0.7 }, TextSize = 19.36, TextMinSize = 8.2, TransformationMatrix = { @@ -64,7 +64,7 @@ local tullyImages = { Type = "RenderablePlanesCloud", Enabled = true, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.99, + Opacity = 0.99, ScaleFactor = 1.0, File = speck .. "/tully.speck", TexturePath = textures, diff --git a/data/assets/scene/digitaluniverse/voids.asset b/data/assets/scene/digitaluniverse/voids.asset index 64ca8bb4ad..420ebe54b7 100644 --- a/data/assets/scene/digitaluniverse/voids.asset +++ b/data/assets/scene/digitaluniverse/voids.asset @@ -19,7 +19,7 @@ local object = { Color = { 1.0, 1.0, 1.0 }, Opacity = 0.65, LabelFile = speck .. "/voids.label", - TextColor = { 0.296, 0.629, 1.0, 1.0 }, + TextColor = { 0.296, 0.629, 1.0 }, TextSize = 20.9, TextMinSize = 8.0, Unit = "Mpc" diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon.asset index 87139c2b9e..21b55af0f3 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon.asset @@ -50,7 +50,7 @@ local Charon = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "planet_solarSystem", "planet_terrestrial" }, diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset index ce98ef30f8..461228389c 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset @@ -50,7 +50,7 @@ local Pluto = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "planet_solarSystem", "planet_terrestrial" }, diff --git a/data/assets/scene/solarsystem/missions/newhorizons/charon.asset b/data/assets/scene/solarsystem/missions/newhorizons/charon.asset index 3929571670..8f2c7d5910 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/charon.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/charon.asset @@ -100,6 +100,7 @@ local CharonShadow = { Parent = CharonProjection .Identifier, Renderable = { Type = "RenderableShadowCylinder", + Opacity = 0.25, TerminatorType = "PENUMBRAL", LightSource = "SUN", Observer = "NEW HORIZONS", diff --git a/data/assets/scene/solarsystem/missions/newhorizons/pluto.asset b/data/assets/scene/solarsystem/missions/newhorizons/pluto.asset index 72eb98db1e..3a963722e2 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/pluto.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/pluto.asset @@ -226,6 +226,7 @@ local PlutoShadow = { Parent = PlutoProjection.Identifier, Renderable = { Type = "RenderableShadowCylinder", + Opacity = 0.25, TerminatorType = "PENUMBRAL", LightSource = "SUN", Observer = "NEW HORIZONS", diff --git a/data/assets/scene/solarsystem/planets/earth/earth.asset b/data/assets/scene/solarsystem/planets/earth/earth.asset index 1693d8ad15..3a86e2dab4 100644 --- a/data/assets/scene/solarsystem/planets/earth/earth.asset +++ b/data/assets/scene/solarsystem/planets/earth/earth.asset @@ -291,7 +291,7 @@ local Earth = { FadeOutStartingDistance = 80000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1500000.0, - LabelsColor = {1.0, 0.0, 0.0, 1.0} + LabelsColor = { 1.0, 0.0, 0.0 } } }, Tag = { "planet_solarSystem", "planet_terrestrial" }, diff --git a/data/assets/scene/solarsystem/planets/earth/moon/moon.asset b/data/assets/scene/solarsystem/planets/earth/moon/moon.asset index 642e0a0e90..0fb4c42957 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/moon.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/moon.asset @@ -162,7 +162,7 @@ local Moon = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, GUI = { diff --git a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset b/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset index d0b2496e52..a0aeaa4b69 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset @@ -58,7 +58,7 @@ local Callisto = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "moon_solarSystem", "moon_giants", "moon_jupiter" }, diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset index d5e455bb9f..aa71361517 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset @@ -67,7 +67,7 @@ local Europa = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "moon_solarSystem", "moon_giants", "moon_jupiter" }, diff --git a/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset b/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset index 513136ef98..d53036f909 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset @@ -58,7 +58,7 @@ local Ganymede = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = {1.0, 1.0, 0.0} } }, Tag = { "moon_solarSystem", "moon_giants", "moon_jupiter" }, diff --git a/data/assets/scene/solarsystem/planets/jupiter/io/io.asset b/data/assets/scene/solarsystem/planets/jupiter/io/io.asset index fb10f0b3a8..802c862dcc 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/io/io.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/io/io.asset @@ -58,7 +58,7 @@ local Io = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "moon_solarSystem", "moon_giants", "moon_jupiter" }, diff --git a/data/assets/scene/solarsystem/planets/mars/mars.asset b/data/assets/scene/solarsystem/planets/mars/mars.asset index f6d9b9d188..cdd1a58f33 100644 --- a/data/assets/scene/solarsystem/planets/mars/mars.asset +++ b/data/assets/scene/solarsystem/planets/mars/mars.asset @@ -196,7 +196,7 @@ local Mars = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "planet_solarSystem", "planet_terrestrial" }, diff --git a/data/assets/scene/solarsystem/planets/mercury/mercury.asset b/data/assets/scene/solarsystem/planets/mercury/mercury.asset index 8eda6c5eb9..9bba1841fb 100644 --- a/data/assets/scene/solarsystem/planets/mercury/mercury.asset +++ b/data/assets/scene/solarsystem/planets/mercury/mercury.asset @@ -214,7 +214,7 @@ local Mercury = { FadeOutStartingDistance = 80000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1500000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "planet_solarSystem", "planet_terrestrial" }, diff --git a/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset b/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset index ded4b6ae73..9e6c7e980a 100644 --- a/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset +++ b/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset @@ -56,7 +56,7 @@ local Dione = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" }, diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset b/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset index 8a66735198..8e0f929c1d 100644 --- a/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset +++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset @@ -63,7 +63,7 @@ local Enceladus = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" }, diff --git a/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset b/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset index 892cc2c13e..e858a866fd 100644 --- a/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset +++ b/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset @@ -56,7 +56,7 @@ local Iapetus = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" }, diff --git a/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset b/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset index 53d9b7da21..1cc2009017 100644 --- a/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset +++ b/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset @@ -56,7 +56,7 @@ local Mimas = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" }, diff --git a/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset b/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset index 008663ecf5..5ce62dc9e6 100644 --- a/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset +++ b/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset @@ -56,7 +56,7 @@ local Rhea = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" }, diff --git a/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset b/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset index fea8618180..61c0b44d83 100644 --- a/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset +++ b/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset @@ -56,7 +56,7 @@ local Tethys = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" }, diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset b/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset index a086c9eecb..785f62691d 100644 --- a/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset +++ b/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset @@ -63,7 +63,7 @@ local Titan = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" }, diff --git a/data/assets/scene/solarsystem/planets/venus/venus.asset b/data/assets/scene/solarsystem/planets/venus/venus.asset index 486f2d2cab..8ccab1e13a 100644 --- a/data/assets/scene/solarsystem/planets/venus/venus.asset +++ b/data/assets/scene/solarsystem/planets/venus/venus.asset @@ -87,7 +87,7 @@ local Venus = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 3500000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "planet_solarSystem", "planet_terrestrial" }, diff --git a/data/assets/util/debug_helper.asset b/data/assets/util/debug_helper.asset index 90e80893e2..f01d50824d 100644 --- a/data/assets/util/debug_helper.asset +++ b/data/assets/util/debug_helper.asset @@ -61,8 +61,8 @@ local addCartesianAxes = function (specification) local name = specification.Name or specification.Identifier local parent = specification.Parent or "Root" local scale = specification.Scale or 1.0 - local position = specification.Position or {0.0, 0.0, 0.0} - local rotation = specification.Rotation or {0.0, 0.0, 0.0} + local position = specification.Position or { 0.0, 0.0, 0.0 } + local rotation = specification.Rotation or { 0.0, 0.0, 0.0 } local axes = { Identifier = identifier, @@ -84,9 +84,9 @@ local addCartesianAxes = function (specification) Renderable = { Type = "RenderableCartesianAxes", Enabled = true, - XColor = {1.0, 0.0, 0.0, 1.0}, - YColor = {0.0, 1.0, 0.0, 1.0}, - ZColor = {0.0, 0.0, 1.0, 1.0} + XColor = { 1.0, 0.0, 0.0 }, + YColor = { 0.0, 1.0, 0.0 }, + ZColor = { 0.0, 0.0, 1.0 } }, GUI = { Name = name, diff --git a/data/assets/util/generate_bookmarks.asset b/data/assets/util/generate_bookmarks.asset index 8c02268e83..2e3da2a9e3 100644 --- a/data/assets/util/generate_bookmarks.asset +++ b/data/assets/util/generate_bookmarks.asset @@ -35,7 +35,8 @@ local getBookmarks = function (guiPath, bookmarkfile) Renderable = { Type = 'RenderableSphericalGrid', Enabled = false, - GridColor = { 0.3, 0.84, 1.0, 0.3}, + Opacity = 0.3, + GridColor = { 0.3, 0.84, 1.0}, LineWidth = linewidth }, GUI = { diff --git a/modules/base/rendering/renderablecartesianaxes.cpp b/modules/base/rendering/renderablecartesianaxes.cpp index ced04ad50e..fe2a07a6db 100644 --- a/modules/base/rendering/renderablecartesianaxes.cpp +++ b/modules/base/rendering/renderablecartesianaxes.cpp @@ -67,19 +67,19 @@ documentation::Documentation RenderableCartesianAxes::Documentation() { { { XColorInfo.identifier, - new DoubleVector4Verifier, + new DoubleVector3Verifier, Optional::Yes, XColorInfo.description }, { YColorInfo.identifier, - new DoubleVector4Verifier, + new DoubleVector3Verifier, Optional::Yes, YColorInfo.description }, { ZColorInfo.identifier, - new DoubleVector4Verifier, + new DoubleVector3Verifier, Optional::Yes, ZColorInfo.description } @@ -93,21 +93,21 @@ RenderableCartesianAxes::RenderableCartesianAxes(const ghoul::Dictionary& dictio , _program(nullptr) , _xColor( XColorInfo, - glm::vec4(0.f, 0.f, 0.f, 1.f), - glm::vec4(0.f), - glm::vec4(1.f) + glm::vec3(1.f, 0.f, 0.f), + glm::vec3(0.f), + glm::vec3(1.f) ) , _yColor( YColorInfo, - glm::vec4(0.f, 1.f, 0.f, 1.f), - glm::vec4(0.f), - glm::vec4(1.f) + glm::vec3(0.f, 1.f, 0.f), + glm::vec3(0.f), + glm::vec3(1.f) ) , _zColor( ZColorInfo, - glm::vec4(0.f, 0.f, 1.f, 1.f), - glm::vec4(0.f), - glm::vec4(1.f) + glm::vec3(0.f, 0.f, 1.f), + glm::vec3(0.f), + glm::vec3(1.f) ) { documentation::testSpecificationAndThrow( @@ -117,19 +117,19 @@ RenderableCartesianAxes::RenderableCartesianAxes(const ghoul::Dictionary& dictio ); if (dictionary.hasKey(XColorInfo.identifier)) { - _xColor = dictionary.value(XColorInfo.identifier); + _xColor = dictionary.value(XColorInfo.identifier); } _xColor.setViewOption(properties::Property::ViewOptions::Color); addProperty(_xColor); if (dictionary.hasKey(XColorInfo.identifier)) { - _yColor = dictionary.value(YColorInfo.identifier); + _yColor = dictionary.value(YColorInfo.identifier); } _yColor.setViewOption(properties::Property::ViewOptions::Color); addProperty(_yColor); if (dictionary.hasKey(ZColorInfo.identifier)) { - _zColor = dictionary.value(ZColorInfo.identifier); + _zColor = dictionary.value(ZColorInfo.identifier); } _zColor.setViewOption(properties::Property::ViewOptions::Color); addProperty(_zColor); diff --git a/modules/base/rendering/renderablecartesianaxes.h b/modules/base/rendering/renderablecartesianaxes.h index 600770100b..99741b9fb6 100644 --- a/modules/base/rendering/renderablecartesianaxes.h +++ b/modules/base/rendering/renderablecartesianaxes.h @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include namespace ghoul::opengl { class ProgramObject; } @@ -61,9 +61,9 @@ protected: ghoul::opengl::ProgramObject* _program; - properties::Vec4Property _xColor; - properties::Vec4Property _yColor; - properties::Vec4Property _zColor; + properties::Vec3Property _xColor; + properties::Vec3Property _yColor; + properties::Vec3Property _zColor; GLuint _vaoId = 0; GLuint _vBufferId = 0; diff --git a/modules/base/rendering/renderablelabels.cpp b/modules/base/rendering/renderablelabels.cpp index 5cb4152506..87f64a2a3f 100644 --- a/modules/base/rendering/renderablelabels.cpp +++ b/modules/base/rendering/renderablelabels.cpp @@ -201,7 +201,7 @@ documentation::Documentation RenderableLabels::Documentation() { }, { LabelColorInfo.identifier, - new DoubleVector4Verifier, + new DoubleVector3Verifier, Optional::Yes, LabelColorInfo.description, }, @@ -304,9 +304,9 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary) , _blendMode(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown) , _labelColor( LabelColorInfo, - glm::vec4(1.f, 1.f, 1.f, 1.f), - glm::vec4(0.f), - glm::vec4(1.f) + glm::vec3(1.f, 1.f, 1.f), + glm::vec3(0.f), + glm::vec3(1.f) ) , _labelSize(LabelSizeInfo, 8.f, 0.5f, 30.f) , _fontSize(FontSizeInfo, 50.f, 1.f, 100.f) @@ -338,6 +338,7 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary) "RenderableLabels" ); + addProperty(_opacity); registerUpdateRenderBinFromOpacity(); _blendMode.addOptions({ @@ -691,7 +692,7 @@ void RenderableLabels::renderLabels(const RenderData& data, const glm::dvec3& orthoRight, const glm::dvec3& orthoUp, float fadeInVariable) { - glm::vec4 textColor = _labelColor; + glm::vec4 textColor = glm::vec4(glm::vec3(_labelColor), 1.f); textColor.a *= fadeInVariable; textColor.a *= _opacity; diff --git a/modules/base/rendering/renderablelabels.h b/modules/base/rendering/renderablelabels.h index 7d0466b9d0..af3b90ece5 100644 --- a/modules/base/rendering/renderablelabels.h +++ b/modules/base/rendering/renderablelabels.h @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include @@ -104,7 +104,7 @@ private: float linearSmoothStepFunc(float x, float startX, float endX, float sUnit, float eUnit) const; - properties::Vec4Property _labelColor; + properties::Vec3Property _labelColor; properties::FloatProperty _labelSize; properties::FloatProperty _fontSize; properties::FloatProperty _labelMinSize; diff --git a/modules/base/rendering/renderablesphere.cpp b/modules/base/rendering/renderablesphere.cpp index bd46acce0c..d38c48c417 100644 --- a/modules/base/rendering/renderablesphere.cpp +++ b/modules/base/rendering/renderablesphere.cpp @@ -360,7 +360,7 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) { ); _shader->setUniform(_uniformCache.modelViewRotation, modelViewRotation); - float adjustedTransparency = _opacity; + float adjustedOpacity = _opacity; if (!_disableFadeInDistance) { if (_fadeInThreshold > -1.0) { @@ -377,10 +377,10 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) { 0.f, 1.f ); - adjustedTransparency *= fadeFactor; + adjustedOpacity *= fadeFactor; } else if (logDistCamera <= startLogFadeDistance) { - adjustedTransparency = 0.f; + adjustedOpacity = 0.f; } } @@ -398,19 +398,19 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) { 0.f, 1.f ); - adjustedTransparency *= (1.f - fadeFactor); + adjustedOpacity *= (1.f - fadeFactor); } else if (logDistCamera >= stopLogFadeDistance) { - adjustedTransparency = 0.f; + adjustedOpacity = 0.f; } } } // Performance wise - if (adjustedTransparency < 0.01f) { + if (adjustedOpacity < 0.01f) { return; } - _shader->setUniform(_uniformCache.opacity, adjustedTransparency); + _shader->setUniform(_uniformCache.opacity, adjustedOpacity); _shader->setUniform(_uniformCache._mirrorTexture, _mirrorTexture.value()); ghoul::opengl::TextureUnit unit; diff --git a/modules/base/shaders/axes_fs.glsl b/modules/base/shaders/axes_fs.glsl index 0b1513ac46..8540409131 100644 --- a/modules/base/shaders/axes_fs.glsl +++ b/modules/base/shaders/axes_fs.glsl @@ -29,18 +29,19 @@ in float vs_screenSpaceDepth; in vec4 vs_positionViewSpace; in vec3 vs_positionModelSpace; -uniform vec4 xColor; -uniform vec4 yColor; -uniform vec4 zColor; +uniform vec3 xColor; +uniform vec3 yColor; +uniform vec3 zColor; Fragment getFragment() { Fragment frag; vec3 colorComponents = step(0.01f, vs_positionModelSpace); - frag.color = colorComponents.x * xColor + + frag.color.rgb = colorComponents.x * xColor + colorComponents.y * yColor + colorComponents.z * zColor; + frag.color.a = 1.0; frag.depth = vs_screenSpaceDepth; frag.gPosition = vs_positionViewSpace; diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp index caa8c1d84f..8fc50b03e5 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp @@ -131,6 +131,13 @@ namespace { "The text color for the astronomical object." }; + constexpr openspace::properties::Property::PropertyInfo TextOpacityInfo = { + "TextOpacity", + "Text Opacity", + "Determines the transparency of the text label, where 1 is completely opaque " + "and 0 fully transparent." + }; + constexpr openspace::properties::Property::PropertyInfo TextSizeInfo = { "TextSize", "Text Size", @@ -308,10 +315,16 @@ documentation::Documentation RenderableBillboardsCloud::Documentation() { }, { TextColorInfo.identifier, - new DoubleVector4Verifier, + new DoubleVector3Verifier, Optional::Yes, TextColorInfo.description }, + { + TextOpacityInfo.identifier, + new DoubleVerifier, + Optional::Yes, + TextOpacityInfo.description + }, { TextSizeInfo.identifier, new DoubleVerifier, @@ -411,12 +424,8 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di , _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 600.f) , _pointColor(ColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f)) , _spriteTexturePath(SpriteTextureInfo) - , _textColor( - TextColorInfo, - glm::vec4(1.f, 1.f, 1.f, 1.f), - glm::vec4(0.f), - glm::vec4(1.f) - ) + , _textColor(TextColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f)) + , _textOpacity(TextOpacityInfo, 1.f, 0.f, 1.f) , _textSize(TextSizeInfo, 8.f, 0.5f, 24.f) , _textMinSize(LabelMinSizeInfo, 8.f, 0.5f, 24.f) , _textMaxSize(LabelMaxSizeInfo, 20.f, 0.5f, 100.f) @@ -610,13 +619,17 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di _hasLabel = true; if (dictionary.hasKey(TextColorInfo.identifier)) { - _textColor = dictionary.value(TextColorInfo.identifier); + _textColor = dictionary.value(TextColorInfo.identifier); _hasLabel = true; } _textColor.setViewOption(properties::Property::ViewOptions::Color); addProperty(_textColor); _textColor.onChange([&]() { _textColorIsDirty = true; }); + if (dictionary.hasKey(TextOpacityInfo.identifier)) { + _textOpacity = dictionary.value(TextOpacityInfo.identifier); + } + addProperty(_textOpacity); if (dictionary.hasKey(TextSizeInfo.identifier)) { _textSize = dictionary.value(TextSizeInfo.identifier); @@ -911,9 +924,10 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data, break; } - glm::vec4 textColor = _textColor; - textColor.a *= fadeInVariable; - textColor.a *= _opacity; + glm::vec4 textColor = glm::vec4( + glm::vec3(_textColor), + _textOpacity * fadeInVariable + ); ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo; labelInfo.orthoRight = orthoRight; diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.h b/modules/digitaluniverse/rendering/renderablebillboardscloud.h index 7953806824..1c95698927 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.h +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.h @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -115,7 +114,8 @@ private: properties::FloatProperty _scaleFactor; properties::Vec3Property _pointColor; properties::StringProperty _spriteTexturePath; - properties::Vec4Property _textColor; + properties::Vec3Property _textColor; + properties::FloatProperty _textOpacity; properties::FloatProperty _textSize; properties::FloatProperty _textMinSize; properties::FloatProperty _textMaxSize; diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.cpp b/modules/digitaluniverse/rendering/renderabledumeshes.cpp index a9ce646b08..e5256a340d 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.cpp +++ b/modules/digitaluniverse/rendering/renderabledumeshes.cpp @@ -54,7 +54,6 @@ namespace { }; constexpr const char* KeyFile = "File"; - constexpr const char* keyColor = "Color"; constexpr const char* keyUnit = "Unit"; constexpr const char* MeterUnit = "m"; constexpr const char* KilometerUnit = "Km"; @@ -70,19 +69,19 @@ namespace { constexpr const int8_t CurrentCacheVersion = 1; constexpr const double PARSEC = 0.308567756E17; - constexpr openspace::properties::Property::PropertyInfo TransparencyInfo = { - "Transparency", - "Transparency", - "This value is a multiplicative factor that is applied to the transparency of " - "all point." - }; - constexpr openspace::properties::Property::PropertyInfo TextColorInfo = { "TextColor", "Text Color", "The text color for the astronomical object." }; + constexpr openspace::properties::Property::PropertyInfo TextOpacityInfo = { + "TextOpacity", + "Text Opacity", + "Determines the transparency of the text label, where 1 is completely opaque " + "and 0 fully transparent." + }; + constexpr openspace::properties::Property::PropertyInfo TextSizeInfo = { "TextSize", "Text Size", @@ -128,12 +127,6 @@ namespace { "Determines whether labels should be drawn or hidden." }; - constexpr openspace::properties::Property::PropertyInfo TransformationMatrixInfo = { - "TransformationMatrix", - "Transformation Matrix", - "Transformation matrix to be applied to each astronomical object." - }; - constexpr openspace::properties::Property::PropertyInfo MeshColorInfo = { "MeshColor", "Meshes colors", @@ -167,24 +160,6 @@ documentation::Documentation RenderableDUMeshes::Documentation() { "The path to the SPECK file that contains information about the " "astronomical object being rendered." }, - { - keyColor, - new Vector3Verifier, - Optional::Yes, - "Astronomical Object Color (r,g,b)." - }, - { - TransparencyInfo.identifier, - new DoubleVerifier, - Optional::Yes, - TransparencyInfo.description - }, - /*{ - ScaleFactorInfo.identifier, - new DoubleVerifier, - Optional::Yes, - ScaleFactorInfo.description - },*/ { DrawLabelInfo.identifier, new BoolVerifier, @@ -193,10 +168,16 @@ documentation::Documentation RenderableDUMeshes::Documentation() { }, { TextColorInfo.identifier, - new DoubleVector4Verifier, + new DoubleVector3Verifier, Optional::Yes, TextColorInfo.description }, + { + TextOpacityInfo.identifier, + new DoubleVerifier, + Optional::Yes, + TextOpacityInfo.description + }, { TextSizeInfo.identifier, new DoubleVerifier, @@ -227,12 +208,6 @@ documentation::Documentation RenderableDUMeshes::Documentation() { Optional::Yes, LineWidthInfo.description }, - { - TransformationMatrixInfo.identifier, - new Matrix4x4Verifier, - Optional::Yes, - TransformationMatrixInfo.description - }, { MeshColorInfo.identifier, new Vector3ListVerifier, @@ -243,12 +218,10 @@ documentation::Documentation RenderableDUMeshes::Documentation() { }; } - RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) : Renderable(dictionary) - , _alphaValue(TransparencyInfo, 1.f, 0.f, 1.f) - //, _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 64.f) - , _textColor(TextColorInfo, glm::vec4(1.f), glm::vec4(0.f), glm::vec4(1.f)) + , _textColor(TextColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f)) + , _textOpacity(TextOpacityInfo, 1.f, 0.f, 1.f) , _textSize(TextSizeInfo, 8.f, 0.5f, 24.f) , _drawElements(DrawElementsInfo, true) , _drawLabels(DrawLabelInfo, false) @@ -263,6 +236,9 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) "RenderableDUMeshes" ); + addProperty(_opacity); + registerUpdateRenderBinFromOpacity(); + if (dictionary.hasKey(KeyFile)) { _speckFile = absPath(dictionary.value(KeyFile)); _hasSpeckFile = true; @@ -309,25 +285,6 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) } } - /*if (dictionary.hasKey(keyColor)) { - _pointColor = dictionary.value(keyColor); - } - addProperty(_pointColor);*/ - - if (dictionary.hasKey(TransparencyInfo.identifier)) { - _alphaValue = static_cast( - dictionary.value(TransparencyInfo.identifier) - ); - } - addProperty(_alphaValue); - - /*if (dictionary.hasKey(ScaleFactorInfo.identifier)) { - _scaleFactor = static_cast( - dictionary.value(ScaleFactorInfo.identifier) - ); - } - addProperty(_scaleFactor);*/ - if (dictionary.hasKeyAndValue(LineWidthInfo.identifier)) { _lineWidth = static_cast( dictionary.value(LineWidthInfo.identifier) @@ -345,13 +302,17 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) _hasLabel = true; if (dictionary.hasKey(TextColorInfo.identifier)) { - _textColor = dictionary.value(TextColorInfo.identifier); + _textColor = dictionary.value(TextColorInfo.identifier); _hasLabel = true; } _textColor.setViewOption(properties::Property::ViewOptions::Color); addProperty(_textColor); _textColor.onChange([&]() { _textColorIsDirty = true; }); + if (dictionary.hasKey(TextOpacityInfo.identifier)) { + _textOpacity = dictionary.value(TextOpacityInfo.identifier); + } + addProperty(_textOpacity); if (dictionary.hasKey(TextSizeInfo.identifier)) { _textSize = dictionary.value(TextSizeInfo.identifier); @@ -369,12 +330,6 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) addProperty(_textMaxSize); } - if (dictionary.hasKey(TransformationMatrixInfo.identifier)) { - _transformationMatrix = dictionary.value( - TransformationMatrixInfo.identifier - ); - } - if (dictionary.hasKey(MeshColorInfo.identifier)) { ghoul::Dictionary colorDict = dictionary.value( MeshColorInfo.identifier @@ -385,8 +340,6 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) ); } } - - setRenderBin(Renderable::RenderBin::Opaque); } bool RenderableDUMeshes::isReady() const { @@ -482,8 +435,7 @@ void RenderableDUMeshes::renderMeshes(const RenderData&, _program->setUniform(_uniformCache.modelViewTransform, modelViewMatrix); _program->setUniform(_uniformCache.projectionTransform, projectionMatrix); - _program->setUniform(_uniformCache.alphaValue, _alphaValue); - //_program->setUniform(_uniformCache.scaleFactor, _scaleFactor); + _program->setUniform(_uniformCache.alphaValue, _opacity); for (const std::pair& pair : _renderingMeshesMap) { _program->setUniform(_uniformCache.color, _meshColorMap[pair.second.colorIndex]); @@ -562,16 +514,17 @@ void RenderableDUMeshes::renderLabels(const RenderData& data, labelInfo.scale = pow(10.f, _textSize); labelInfo.enableDepth = true; labelInfo.enableFalseDepth = false; + + glm::vec4 textColor = glm::vec4(glm::vec3(_textColor), _textOpacity); for (const std::pair& pair : _labelData) { - //glm::vec3 scaledPos(_transformationMatrix * glm::dvec4(pair.first, 1.0)); glm::vec3 scaledPos(pair.first); scaledPos *= scale; ghoul::fontrendering::FontRenderer::defaultProjectionRenderer().render( *_font, scaledPos, pair.second, - _textColor, + textColor, labelInfo ); } @@ -899,10 +852,7 @@ bool RenderableDUMeshes::readLabelFile() { dummy.clear(); } - glm::vec3 transformedPos = glm::vec3( - _transformationMatrix * glm::dvec4(position, 1.0) - ); - _labelData.emplace_back(std::make_pair(transformedPos, label)); + _labelData.emplace_back(std::make_pair(position, label)); } while (!file.eof()); diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.h b/modules/digitaluniverse/rendering/renderabledumeshes.h index bb0b6dce20..3a1fa603eb 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.h +++ b/modules/digitaluniverse/rendering/renderabledumeshes.h @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -118,14 +117,11 @@ private: bool _textColorIsDirty = true; bool _hasLabel = false; - properties::FloatProperty _alphaValue; - //properties::FloatProperty _scaleFactor; - //properties::Vec3Property _pointColor; - properties::Vec4Property _textColor; + properties::Vec3Property _textColor; + properties::FloatProperty _textOpacity; properties::FloatProperty _textSize; properties::BoolProperty _drawElements; properties::BoolProperty _drawLabels; - //properties::OptionProperty _blendMode; properties::FloatProperty _textMinSize; properties::FloatProperty _textMaxSize; properties::FloatProperty _lineWidth; @@ -147,8 +143,6 @@ private: std::vector> _labelData; int _nValuesPerAstronomicalObject = 0; - glm::dmat4 _transformationMatrix = glm::dmat4(1.0); - std::unordered_map _meshColorMap; std::unordered_map _renderingMeshesMap; }; diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.cpp b/modules/digitaluniverse/rendering/renderableplanescloud.cpp index befa6a125e..3fc991b7ee 100644 --- a/modules/digitaluniverse/rendering/renderableplanescloud.cpp +++ b/modules/digitaluniverse/rendering/renderableplanescloud.cpp @@ -68,13 +68,6 @@ namespace { BlendModeAdditive }; - constexpr openspace::properties::Property::PropertyInfo TransparencyInfo = { - "Transparency", - "Transparency", - "This value is a multiplicative factor that is applied to the transparency of " - "all points." - }; - constexpr openspace::properties::Property::PropertyInfo ScaleFactorInfo = { "ScaleFactor", "Scale Factor", @@ -88,6 +81,13 @@ namespace { "The text color for the astronomical object." }; + constexpr openspace::properties::Property::PropertyInfo TextOpacityInfo = { + "TextOpacity", + "Text Opacity", + "Determines the transparency of the text label, where 1 is completely opaque " + "and 0 fully transparent." + }; + constexpr openspace::properties::Property::PropertyInfo TextSizeInfo = { "TextSize", "Text Size", @@ -200,12 +200,6 @@ documentation::Documentation RenderablePlanesCloud::Documentation() { "The path to the SPECK file that contains information about the " "astronomical object being rendered." }, - { - TransparencyInfo.identifier, - new DoubleVerifier, - Optional::No, - TransparencyInfo.description - }, { ScaleFactorInfo.identifier, new DoubleVerifier, @@ -214,10 +208,16 @@ documentation::Documentation RenderablePlanesCloud::Documentation() { }, { TextColorInfo.identifier, - new DoubleVector4Verifier, + new DoubleVector3Verifier, Optional::Yes, TextColorInfo.description }, + { + TextOpacityInfo.identifier, + new DoubleVerifier, + Optional::Yes, + TextOpacityInfo.description + }, { TextSizeInfo.identifier, new DoubleVerifier, @@ -297,14 +297,9 @@ documentation::Documentation RenderablePlanesCloud::Documentation() { RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary) : Renderable(dictionary) - , _alphaValue(TransparencyInfo, 1.f, 0.f, 1.f) , _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 10000.f) - , _textColor( - TextColorInfo, - glm::vec4(1.0f, 1.0, 1.0f, 1.f), - glm::vec4(0.f), - glm::vec4(1.f) - ) + , _textColor(TextColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f)) + , _textOpacity(TextOpacityInfo, 1.f, 0.f, 1.f) , _textSize(TextSizeInfo, 8.0, 0.5, 24.0) , _drawElements(DrawElementsInfo, true) , _blendMode(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown) @@ -324,6 +319,8 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary "RenderablePlanesCloud" ); + addProperty(_opacity); + if (dictionary.hasKey(KeyFile)) { _speckFile = absPath(dictionary.value(KeyFile)); _hasSpeckFile = true; @@ -371,13 +368,6 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary _unit = Meter; } - if (dictionary.hasKey(TransparencyInfo.identifier)) { - _alphaValue = static_cast( - dictionary.value(TransparencyInfo.identifier) - ); - } - addProperty(_alphaValue); - if (dictionary.hasKey(ScaleFactorInfo.identifier)) { _scaleFactor = static_cast( dictionary.value(ScaleFactorInfo.identifier) @@ -393,13 +383,17 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary _hasLabel = true; if (dictionary.hasKey(TextColorInfo.identifier)) { - _textColor = dictionary.value(TextColorInfo.identifier); + _textColor = dictionary.value(TextColorInfo.identifier); _hasLabel = true; } _textColor.setViewOption(properties::Property::ViewOptions::Color); addProperty(_textColor); _textColor.onChange([&]() { _textColorIsDirty = true; }); + if (dictionary.hasKey(TextOpacityInfo.identifier)) { + _textOpacity = dictionary.value(TextOpacityInfo.identifier); + } + addProperty(_textOpacity); if (dictionary.hasKey(TextSizeInfo.identifier)) { _textSize = dictionary.value(TextSizeInfo.identifier); @@ -580,7 +574,7 @@ void RenderablePlanesCloud::renderPlanes(const RenderData&, _uniformCache.modelViewProjectionTransform, modelViewProjectionMatrix ); - _program->setUniform(_uniformCache.alphaValue, _alphaValue); + _program->setUniform(_uniformCache.alphaValue, _opacity); _program->setUniform(_uniformCache.fadeInValue, fadeInVariable); GLint viewport[4]; @@ -651,8 +645,10 @@ void RenderablePlanesCloud::renderLabels(const RenderData& data, break; } - glm::vec4 textColor = _textColor; - textColor.a *= fadeInVariable * _opacity; + glm::vec4 textColor = glm::vec4( + glm::vec3(_textColor), + _textOpacity * fadeInVariable + ); ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo; labelInfo.orthoRight = orthoRight; diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.h b/modules/digitaluniverse/rendering/renderableplanescloud.h index bf7cced594..96d2813edb 100644 --- a/modules/digitaluniverse/rendering/renderableplanescloud.h +++ b/modules/digitaluniverse/rendering/renderableplanescloud.h @@ -33,7 +33,6 @@ #include #include #include -#include #include #include @@ -116,9 +115,9 @@ private: int _planeStartingIndexPos = 0; int _textureVariableIndex = 0; - properties::FloatProperty _alphaValue; properties::FloatProperty _scaleFactor; - properties::Vec4Property _textColor; + properties::Vec3Property _textColor; + properties::FloatProperty _textOpacity; properties::FloatProperty _textSize; properties::BoolProperty _drawElements; properties::OptionProperty _blendMode; diff --git a/modules/digitaluniverse/rendering/renderablepoints.cpp b/modules/digitaluniverse/rendering/renderablepoints.cpp index 22054c2734..d48ddd9313 100644 --- a/modules/digitaluniverse/rendering/renderablepoints.cpp +++ b/modules/digitaluniverse/rendering/renderablepoints.cpp @@ -72,13 +72,6 @@ namespace { "The path to the texture that should be used as the point sprite." }; - constexpr openspace::properties::Property::PropertyInfo TransparencyInfo = { - "Transparency", - "Transparency", - "This value is a multiplicative factor that is applied to the transparency of " - "all points." - }; - constexpr openspace::properties::Property::PropertyInfo ScaleFactorInfo = { "ScaleFactor", "Scale Factor", @@ -131,12 +124,6 @@ documentation::Documentation RenderablePoints::Documentation() { Optional::Yes, SpriteTextureInfo.description }, - { - TransparencyInfo.identifier, - new DoubleVerifier, - Optional::No, - TransparencyInfo.description - }, { ScaleFactorInfo.identifier, new DoubleVerifier, @@ -157,7 +144,6 @@ documentation::Documentation RenderablePoints::Documentation() { RenderablePoints::RenderablePoints(const ghoul::Dictionary& dictionary) : Renderable(dictionary) - , _alphaValue(TransparencyInfo, 1.f, 0.f, 1.f) , _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 64.f) , _pointColor( ColorInfo, @@ -173,6 +159,9 @@ RenderablePoints::RenderablePoints(const ghoul::Dictionary& dictionary) "RenderablePoints" ); + addProperty(_opacity); + registerUpdateRenderBinFromOpacity(); + _speckFile = absPath(dictionary.value(KeyFile)); if (dictionary.hasKey(keyUnit)) { @@ -233,13 +222,6 @@ RenderablePoints::RenderablePoints(const ghoul::Dictionary& dictionary) _hasColorMapFile = true; } - if (dictionary.hasKey(TransparencyInfo.identifier)) { - _alphaValue = static_cast( - dictionary.value(TransparencyInfo.identifier) - ); - } - addProperty(_alphaValue); - if (dictionary.hasKey(ScaleFactorInfo.identifier)) { _scaleFactor = static_cast( dictionary.value(ScaleFactorInfo.identifier) @@ -322,7 +304,7 @@ void RenderablePoints::render(const RenderData& data, RendererTasks&) { _program->setUniform(_uniformCache.color, _pointColor); _program->setUniform(_uniformCache.sides, 4); - _program->setUniform(_uniformCache.alphaValue, _alphaValue); + _program->setUniform(_uniformCache.alphaValue, _opacity); _program->setUniform(_uniformCache.scaleFactor, _scaleFactor); if (_hasSpriteTexture) { diff --git a/modules/digitaluniverse/rendering/renderablepoints.h b/modules/digitaluniverse/rendering/renderablepoints.h index 58731d3c56..1b27786097 100644 --- a/modules/digitaluniverse/rendering/renderablepoints.h +++ b/modules/digitaluniverse/rendering/renderablepoints.h @@ -87,7 +87,6 @@ private: bool _spriteTextureIsDirty = true; bool _hasColorMapFile = false; - properties::FloatProperty _alphaValue; properties::FloatProperty _scaleFactor; properties::Vec3Property _pointColor; properties::StringProperty _spriteTexturePath; diff --git a/modules/globebrowsing/shaders/rings_fs.glsl b/modules/globebrowsing/shaders/rings_fs.glsl index b18d5d71a8..04cf03d2cc 100644 --- a/modules/globebrowsing/shaders/rings_fs.glsl +++ b/modules/globebrowsing/shaders/rings_fs.glsl @@ -35,7 +35,7 @@ in vec4 shadowCoords; uniform sampler2DShadow shadowMapTexture; uniform sampler1D ringTexture; uniform vec2 textureOffset; -uniform float transparency; +uniform float colorFilterValue; uniform vec3 sunPosition; uniform float _nightFactor; @@ -67,12 +67,11 @@ Fragment getFragment() { } vec4 diffuse = texture(ringTexture, texCoord); - float colorValue = length(diffuse.rgb); - // times 3 as length of vec3(1.0, 1.0, 1.0) will return 3 and we want - // to normalize the transparency value to [0,1] - if (colorValue < 3.0 * transparency) { - diffuse.a = pow(colorValue / (3.0 * transparency), 1); - //diffuse.a = (colorValue / 3.0) * transparency; + // divided by 3 as length of vec3(1.0, 1.0, 1.0) will return 3 and we want + // to normalize the alpha value to [0,1] + float colorValue = length(diffuse.rgb) / 3.0; + if (colorValue < colorFilterValue) { + diffuse.a = colorValue * colorFilterValue; if (diffuse.a < 0.65) discard; } diff --git a/modules/globebrowsing/src/globelabelscomponent.cpp b/modules/globebrowsing/src/globelabelscomponent.cpp index 2e678a03c6..28c9b60409 100644 --- a/modules/globebrowsing/src/globelabelscomponent.cpp +++ b/modules/globebrowsing/src/globelabelscomponent.cpp @@ -51,7 +51,7 @@ namespace { constexpr const double LabelFadeRangeConst = 1500.0; constexpr const double RangeAngularCoefConst = 0.8; - constexpr const float MinTransparencyValueConst = 0.009f; + constexpr const float MinOpacityValueConst = 0.009f; enum LabelRenderingAlignmentType { Horizontally = 0, @@ -109,6 +109,12 @@ namespace { "Labels Color" }; + constexpr openspace::properties::Property::PropertyInfo LabelsOpacityInfo = { + "LabelsOpacity", + "Labels Opacity", + "Labels Opacity" + }; + constexpr openspace::properties::Property::PropertyInfo LabelsFadeInStartingDistanceInfo = { @@ -210,10 +216,16 @@ documentation::Documentation GlobeLabelsComponent::Documentation() { }, { LabelsColorInfo.identifier, - new Vector4Verifier(), + new DoubleVector3Verifier, Optional::Yes, LabelsColorInfo.description }, + { + LabelsOpacityInfo.identifier, + new DoubleVerifier, + Optional::Yes, + LabelsOpacityInfo.description + }, { LabelsFadeInStartingDistanceInfo.identifier, new DoubleVerifier, @@ -270,10 +282,11 @@ GlobeLabelsComponent::GlobeLabelsComponent() , _labelsMinHeight(LabelsMinHeightInfo, 100.0, 0.0, 10000.0) , _labelsColor( LabelsColorInfo, - glm::vec4(1.f, 1.f, 0.f, 1.f), - glm::vec4(0.f), - glm::vec4(1.f) + glm::vec3(1.f, 1.f, 0.f), + glm::vec3(0.f), + glm::vec3(1.f) ) + , _labelsOpacity(LabelsOpacityInfo, 1.f, 0.f, 1.f) , _labelsFadeInDist(LabelsFadeInStartingDistanceInfo, 1e6, 1e3, 1e8) , _labelsFadeOutDist(LabelsFadeOutStartingDistanceInfo, 1e4, 1, 1e7) , _labelsFadeInEnabled(LabelsFadeInEnabledInfo, false) @@ -291,6 +304,7 @@ GlobeLabelsComponent::GlobeLabelsComponent() addProperty(_labelsMinHeight); _labelsColor.setViewOption(properties::Property::ViewOptions::Color); addProperty(_labelsColor); + addProperty(_labelsOpacity); addProperty(_labelsFadeInDist); addProperty(_labelsFadeOutDist); addProperty(_labelsMinSize); @@ -355,7 +369,11 @@ void GlobeLabelsComponent::initialize(const ghoul::Dictionary& dictionary, } if (dictionary.hasKey(LabelsColorInfo.identifier)) { - _labelsColor = dictionary.value(LabelsColorInfo.identifier); + _labelsColor = dictionary.value(LabelsColorInfo.identifier); + } + + if (dictionary.hasKey(LabelsOpacityInfo.identifier)) { + _labelsOpacity = dictionary.value(LabelsOpacityInfo.identifier); } if (dictionary.hasKey(LabelsFadeInEnabledInfo.identifier)) { @@ -642,7 +660,7 @@ void GlobeLabelsComponent::draw(const RenderData& data) { double funcValue = a * distanceCameraGlobeWorld + b; varyingOpacity *= static_cast(std::min(funcValue, 1.0)); - if (varyingOpacity < MinTransparencyValueConst) { + if (varyingOpacity < MinOpacityValueConst) { return; } } @@ -657,7 +675,7 @@ void GlobeLabelsComponent::draw(const RenderData& data) { double funcValue = a * distanceCameraGlobeWorld + b; varyingOpacity *= static_cast(std::min(funcValue, 1.0)); - if (varyingOpacity < MinTransparencyValueConst) { + if (varyingOpacity < MinOpacityValueConst) { return; } } @@ -670,8 +688,10 @@ void GlobeLabelsComponent::renderLabels(const RenderData& data, float distToCamera, float fadeInVariable ) { - glm::vec4 textColor = _labelsColor; - textColor.a *= fadeInVariable; + glm::vec4 textColor = glm::vec4( + glm::vec3(_labelsColor), + _labelsOpacity * fadeInVariable + ); glm::dvec4 cameraUpVecWorld = glm::dvec4(data.camera.lookUpVectorWorldSpace(), 0.0); diff --git a/modules/globebrowsing/src/globelabelscomponent.h b/modules/globebrowsing/src/globelabelscomponent.h index 98371f39e6..1bded12791 100644 --- a/modules/globebrowsing/src/globelabelscomponent.h +++ b/modules/globebrowsing/src/globelabelscomponent.h @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include @@ -89,7 +89,8 @@ private: properties::IntProperty _labelsMinSize; properties::FloatProperty _labelsSize; properties::FloatProperty _labelsMinHeight; - properties::Vec4Property _labelsColor; + properties::Vec3Property _labelsColor; + properties::FloatProperty _labelsOpacity; properties::FloatProperty _labelsFadeInDist; properties::FloatProperty _labelsFadeOutDist; properties::BoolProperty _labelsFadeInEnabled; diff --git a/modules/globebrowsing/src/ringscomponent.cpp b/modules/globebrowsing/src/ringscomponent.cpp index 4a45be2517..7bf3a70d73 100644 --- a/modules/globebrowsing/src/ringscomponent.cpp +++ b/modules/globebrowsing/src/ringscomponent.cpp @@ -52,7 +52,7 @@ namespace { constexpr const char* _loggerCat = "RingsComponent"; constexpr const std::array UniformNames = { - "modelViewProjectionMatrix", "textureOffset", "transparency", "_nightFactor", + "modelViewProjectionMatrix", "textureOffset", "colorFilterValue", "_nightFactor", "sunPosition", "ringTexture", "shadowMatrix", "shadowMapTexture", "zFightingPercentage" }; @@ -91,11 +91,11 @@ namespace { "of the night side occurs." }; - constexpr openspace::properties::Property::PropertyInfo TransparencyInfo = { - "Transparency", - "Transparency", - "This value determines the transparency of part of the rings depending on the " - "color values. For this value v, the transparency is equal to length(color) / v." + constexpr openspace::properties::Property::PropertyInfo ColorFilterInfo = { + "ColorFilter", + "Color Filter", + "This value affects the filtering out of part of the rings depending on the " + "color values of the texture. The higher value, the more rings are filtered out." }; constexpr openspace::properties::Property::PropertyInfo ZFightingPercentageInfo = { @@ -146,10 +146,10 @@ documentation::Documentation RingsComponent::Documentation() { NightFactorInfo.description }, { - TransparencyInfo.identifier, + ColorFilterInfo.identifier, new DoubleVerifier, Optional::Yes, - TransparencyInfo.description + ColorFilterInfo.description }, { ZFightingPercentageInfo.identifier, @@ -173,7 +173,7 @@ RingsComponent::RingsComponent(const ghoul::Dictionary& dictionary) , _size(SizeInfo, 1.f, 0.f, 1e25f) , _offset(OffsetInfo, glm::vec2(0.f, 1.f), glm::vec2(0.f), glm::vec2(1.f)) , _nightFactor(NightFactorInfo, 0.33f, 0.f, 1.f) - , _transparency(TransparencyInfo, 0.15f, 0.f, 1.f) + , _colorFilter(ColorFilterInfo, 0.15f, 0.f, 1.f) , _enabled({ "Enabled", "Enabled", "Enable/Disable Rings" }, true) , _zFightingPercentage(ZFightingPercentageInfo, 0.995f, 0.000001f, 1.f) , _nShadowSamples(NumberShadowSamplesInfo, 2, 1, 7) @@ -228,9 +228,9 @@ void RingsComponent::initialize() { } addProperty(_nightFactor); - if (_ringsDictionary.hasKeyAndValue(TransparencyInfo.identifier)) { - _transparency = static_cast( - _ringsDictionary.value(TransparencyInfo.identifier) + if (_ringsDictionary.hasKeyAndValue(ColorFilterInfo.identifier)) { + _colorFilter = static_cast( + _ringsDictionary.value(ColorFilterInfo.identifier) ); } @@ -248,7 +248,7 @@ void RingsComponent::initialize() { _nShadowSamples.onChange([this]() { compileShadowShader(); }); addProperty(_nShadowSamples); - addProperty(_transparency); + addProperty(_colorFilter); } bool RingsComponent::isReady() const { @@ -327,7 +327,7 @@ void RingsComponent::draw(const RenderData& data, modelViewProjectionTransform ); _shader->setUniform(_uniformCache.textureOffset, _offset); - _shader->setUniform(_uniformCache.transparency, _transparency); + _shader->setUniform(_uniformCache.colorFilterValue, _colorFilter); _shader->setUniform(_uniformCache.nightFactor, _nightFactor); _shader->setUniform(_uniformCache.sunPosition, _sunPosition); _shader->setUniform(_uniformCache.zFightingPercentage, _zFightingPercentage); diff --git a/modules/globebrowsing/src/ringscomponent.h b/modules/globebrowsing/src/ringscomponent.h index 62980e1bf6..d6c7351a90 100644 --- a/modules/globebrowsing/src/ringscomponent.h +++ b/modules/globebrowsing/src/ringscomponent.h @@ -81,14 +81,14 @@ private: properties::FloatProperty _size; properties::Vec2Property _offset; properties::FloatProperty _nightFactor; - properties::FloatProperty _transparency; + properties::FloatProperty _colorFilter; properties::BoolProperty _enabled; properties::FloatProperty _zFightingPercentage; properties::IntProperty _nShadowSamples; std::unique_ptr _shader; std::unique_ptr _geometryOnlyShader; - UniformCache(modelViewProjectionMatrix, textureOffset, transparency, nightFactor, + UniformCache(modelViewProjectionMatrix, textureOffset, colorFilterValue, nightFactor, sunPosition, ringTexture, shadowMatrix, shadowMapTexture, zFightingPercentage ) _uniformCache; UniformCache(modelViewProjectionMatrix, textureOffset, ringTexture diff --git a/modules/space/rendering/renderablerings.cpp b/modules/space/rendering/renderablerings.cpp index 1a30124232..1291ccbe4d 100644 --- a/modules/space/rendering/renderablerings.cpp +++ b/modules/space/rendering/renderablerings.cpp @@ -39,7 +39,7 @@ namespace { constexpr const std::array UniformNames = { - "modelViewProjectionTransform", "textureOffset", "transparency", "_nightFactor", + "modelViewProjectionTransform", "textureOffset", "colorFilterValue", "_nightFactor", "sunPosition", "texture1" }; @@ -73,11 +73,11 @@ namespace { "of the night side occurs." }; - constexpr openspace::properties::Property::PropertyInfo TransparencyInfo = { - "Transparency", - "Transparency", - "This value determines the transparency of part of the rings depending on the " - "color values. For this value v, the transparency is equal to length(color) / v." + constexpr openspace::properties::Property::PropertyInfo ColorFilterInfo = { + "ColorFilter", + "Color Filter", + "This value affects the filtering out of part of the rings depending on the " + "color values of the texture. The higher value, the more rings are filtered out." }; } // namespace @@ -119,10 +119,10 @@ documentation::Documentation RenderableRings::Documentation() { NightFactorInfo.description }, { - TransparencyInfo.identifier, + ColorFilterInfo.identifier, new DoubleVerifier, Optional::Yes, - TransparencyInfo.description + ColorFilterInfo.description } } }; @@ -134,7 +134,7 @@ RenderableRings::RenderableRings(const ghoul::Dictionary& dictionary) , _size(SizeInfo, 1.f, 0.f, 1e25f) , _offset(OffsetInfo, glm::vec2(0.f, 1.f), glm::vec2(0.f), glm::vec2(1.f)) , _nightFactor(NightFactorInfo, 0.33f, 0.f, 1.f) - , _transparency(TransparencyInfo, 0.15f, 0.f, 1.f) + , _colorFilter(ColorFilterInfo, 0.15f, 0.f, 1.f) { using ghoul::filesystem::File; @@ -169,12 +169,12 @@ RenderableRings::RenderableRings(const ghoul::Dictionary& dictionary) } addProperty(_nightFactor); - if (dictionary.hasKeyAndValue(TransparencyInfo.identifier)) { - _transparency = static_cast( - dictionary.value(TransparencyInfo.identifier) + if (dictionary.hasKeyAndValue(ColorFilterInfo.identifier)) { + _colorFilter = static_cast( + dictionary.value(ColorFilterInfo.identifier) ); } - addProperty(_transparency); + addProperty(_colorFilter); } bool RenderableRings::isReady() const { @@ -226,7 +226,7 @@ void RenderableRings::render(const RenderData& data, RendererTasks&) { data.camera.projectionMatrix() * glm::mat4(modelViewTransform) ); _shader->setUniform(_uniformCache.textureOffset, _offset); - _shader->setUniform(_uniformCache.transparency, _transparency); + _shader->setUniform(_uniformCache.colorFilterValue, _colorFilter); _shader->setUniform(_uniformCache.nightFactor, _nightFactor); _shader->setUniform(_uniformCache.sunPosition, _sunPosition); diff --git a/modules/space/rendering/renderablerings.h b/modules/space/rendering/renderablerings.h index d850670051..35152b1629 100644 --- a/modules/space/rendering/renderablerings.h +++ b/modules/space/rendering/renderablerings.h @@ -66,10 +66,10 @@ private: properties::FloatProperty _size; properties::Vec2Property _offset; properties::FloatProperty _nightFactor; - properties::FloatProperty _transparency; + properties::FloatProperty _colorFilter; std::unique_ptr _shader; - UniformCache(modelViewProjection, textureOffset, transparency, nightFactor, + UniformCache(modelViewProjection, textureOffset, colorFilterValue, nightFactor, sunPosition, texture) _uniformCache; std::unique_ptr _texture; std::unique_ptr _textureFile; diff --git a/modules/space/rendering/renderablestars.cpp b/modules/space/rendering/renderablestars.cpp index 2778673233..585c43a94e 100644 --- a/modules/space/rendering/renderablestars.cpp +++ b/modules/space/rendering/renderablestars.cpp @@ -165,13 +165,6 @@ namespace { "The path to the texture that should be used as the base shape for the stars." };*/ - constexpr openspace::properties::Property::PropertyInfo TransparencyInfo = { - "Transparency", - "Transparency", - "This value is a multiplicative factor that is applied to the transparency of " - "all stars." - }; - // PSF constexpr openspace::properties::Property::PropertyInfo MagnitudeExponentInfo = { "MagnitudeExponent", @@ -434,7 +427,6 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary) , _fixedColor(FixedColorInfo, glm::vec4(1.f), glm::vec4(0.f), glm::vec4(1.f)) , _filterOutOfRange(FilterOutOfRangeInfo, false) , _pointSpreadFunctionTexturePath(PsfTextureInfo) - , _alphaValue(TransparencyInfo, 1.f, 0.f, 1.f) , _psfMethodOption( PSFMethodOptionInfo, properties::OptionProperty::DisplayType::Dropdown @@ -478,6 +470,9 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary) "RenderableStars" ); + addProperty(_opacity); + registerUpdateRenderBinFromOpacity(); + _speckFile = absPath(dictionary.value(KeyFile)); _speckFile.onChange([&]() { _speckFileIsDirty = true; }); addProperty(_speckFile); @@ -605,13 +600,6 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary) }); _userProvidedTextureOwner.addProperty(_pointSpreadFunctionTexturePath); - if (dictionary.hasKey(TransparencyInfo.identifier)) { - _alphaValue = static_cast( - dictionary.value(TransparencyInfo.identifier) - ); - } - _parametersOwner.addProperty(_alphaValue); - _psfMethodOption.addOption(PsfMethodSpencer, "Spencer's Function"); _psfMethodOption.addOption(PsfMethodMoffat, "Moffat's Function"); _psfMethodOption = PsfMethodSpencer; @@ -1020,10 +1008,10 @@ void RenderableStars::render(const RenderData& data, RendererTasks&) { const double funcValue = a * distCamera + b; fadeInVariable *= static_cast(funcValue > 1.f ? 1.f : funcValue); - _program->setUniform(_uniformCache.alphaValue, _alphaValue * fadeInVariable); + _program->setUniform(_uniformCache.alphaValue, _opacity * fadeInVariable); } else { - _program->setUniform(_uniformCache.alphaValue, _alphaValue); + _program->setUniform(_uniformCache.alphaValue, _opacity); } ghoul::opengl::TextureUnit psfUnit; diff --git a/modules/space/rendering/renderablestars.h b/modules/space/rendering/renderablestars.h index 7e36d0aafb..9ab74c787d 100644 --- a/modules/space/rendering/renderablestars.h +++ b/modules/space/rendering/renderablestars.h @@ -104,7 +104,6 @@ private: std::unique_ptr _pointSpreadFunctionTexture; std::unique_ptr _pointSpreadFunctionFile; - properties::FloatProperty _alphaValue; properties::OptionProperty _psfMethodOption; properties::OptionProperty _psfMultiplyOption; properties::FloatProperty _lumCent; diff --git a/modules/space/shaders/rings_fs.glsl b/modules/space/shaders/rings_fs.glsl index b9d4e484c8..ffa20731da 100644 --- a/modules/space/shaders/rings_fs.glsl +++ b/modules/space/shaders/rings_fs.glsl @@ -32,7 +32,7 @@ in vec4 vs_position; uniform sampler1D texture1; uniform vec2 textureOffset; -uniform float transparency; +uniform float colorFilterValue; uniform bool hasSunPosition; uniform vec3 sunPosition; @@ -60,11 +60,13 @@ Fragment getFragment() { } vec4 diffuse = texture(texture1, texCoord); - float colorValue = length(diffuse.rgb); - // times 3 as length of vec3(1.0, 1.0, 1.0) will return 3 and we want - // to normalize the transparency value to [0,1] - if (colorValue < 3.0 * transparency) { - diffuse.a = pow(colorValue / (3.0 * transparency), 1); + // divided by 3 as length of vec3(1.0, 1.0, 1.0) will return 3 and we want + // to normalize the alpha value to [0,1] + float colorValue = length(diffuse.rgb) / 3.0; + if (colorValue < colorFilterValue) { + diffuse.a = colorValue * colorFilterValue; + if (diffuse.a < 0.65) + discard; } // The normal for the one plane depends on whether we are dealing diff --git a/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp b/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp index d3dd6614b3..2ba4d88f6c 100644 --- a/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp +++ b/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp @@ -49,8 +49,9 @@ namespace { }; } // namespace -// @TODO: This clas is not properly working anymore and needs to be substantially -// rewritten +// @TODO: This class is not properly working anymore and needs to be substantially +// rewritten. When doing so, make sure that any color property uses three +// values, not four. The opacity should be handled separately namespace openspace { diff --git a/modules/spacecraftinstruments/rendering/renderablefov.cpp b/modules/spacecraftinstruments/rendering/renderablefov.cpp index 12e2d4de1d..9da17a57b1 100644 --- a/modules/spacecraftinstruments/rendering/renderablefov.cpp +++ b/modules/spacecraftinstruments/rendering/renderablefov.cpp @@ -256,13 +256,48 @@ RenderableFov::RenderableFov(const ghoul::Dictionary& dictionary) , _drawSolid(DrawSolidInfo, false) , _standOffDistance(StandoffDistanceInfo, 0.9999, 0.99, 1.0, 0.000001) , _colors({ - { DefaultStartColorInfo, glm::vec4(0.4f) }, - { DefaultEndColorInfo, glm::vec4(0.85f, 0.85f, 0.85f, 1.f) }, - { ActiveColorInfo, glm::vec4(0.f, 1.f, 0.f, 1.f) }, - { TargetInFovInfo, glm::vec4(0.f, 0.5f, 0.7f, 1.f) }, - { IntersectionStartInfo, glm::vec4(1.f, 0.89f, 0.f, 1.f) }, - { IntersectionEndInfo, glm::vec4(1.f, 0.29f, 0.f, 1.f) }, - { SquareColorInfo, glm::vec4(0.85f, 0.85f, 0.85f, 1.f) } + { + DefaultStartColorInfo, + glm::vec3(0.4f), + glm::vec3(0.f), + glm::vec3(1.f) + }, + { + DefaultEndColorInfo, + glm::vec3(0.85f), + glm::vec3(0.f), + glm::vec3(1.f) + }, + { + ActiveColorInfo, + glm::vec3(0.f, 1.f, 0.f), + glm::vec3(0.f), + glm::vec3(1.f) + }, + { + TargetInFovInfo, + glm::vec3(0.f, 0.5f, 0.7f), + glm::vec3(0.f), + glm::vec3(1.f) + }, + { + IntersectionStartInfo, + glm::vec3(1.f, 0.89f, 0.f), + glm::vec3(0.f), + glm::vec3(1.f) + }, + { + IntersectionEndInfo, + glm::vec3(1.f, 0.29f, 0.f), + glm::vec3(0.f), + glm::vec3(1.f) + }, + { + SquareColorInfo, + glm::vec3(0.85f), + glm::vec3(0.f), + glm::vec3(1.f) + } }) { documentation::testSpecificationAndThrow( diff --git a/modules/spacecraftinstruments/rendering/renderablefov.h b/modules/spacecraftinstruments/rendering/renderablefov.h index dca23e19d3..082e6cb1fd 100644 --- a/modules/spacecraftinstruments/rendering/renderablefov.h +++ b/modules/spacecraftinstruments/rendering/renderablefov.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include @@ -69,15 +69,15 @@ private: void updateGPU(); void insertPoint(std::vector& arr, glm::vec4 p, glm::vec4 c); - glm::vec4 squareColor(float t) const { + glm::vec3 squareColor(float t) const { return _colors.active.value() * t + _colors.square.value() * (1 - t); } - glm::vec4 endColor(float t) const { + glm::vec3 endColor(float t) const { return _colors.active.value() * t + _colors.intersectionEnd.value() * (1 - t); } - glm::vec4 fovColor(float t) const { + glm::vec3 fovColor(float t) const { return _colors.active.value() * t + _colors.targetInFieldOfView.value() * (1 - t); } @@ -150,13 +150,13 @@ private: RenderInformation _fieldOfViewBounds; struct { - properties::Vec4Property defaultStart; // Start color for uninteresting times - properties::Vec4Property defaultEnd; // End color for uninteresting times - properties::Vec4Property active; // Color use when a field-of-view is projecting - properties::Vec4Property targetInFieldOfView; // Color to use for target in fov - properties::Vec4Property intersectionStart; // Color at the start of intersection - properties::Vec4Property intersectionEnd; // Color at the end of intersection - properties::Vec4Property square; // Color for the orthogonal square + properties::Vec3Property defaultStart; // Start color for uninteresting times + properties::Vec3Property defaultEnd; // End color for uninteresting times + properties::Vec3Property active; // Color use when a field-of-view is projecting + properties::Vec3Property targetInFieldOfView; // Color to use for target in fov + properties::Vec3Property intersectionStart; // Color at the start of intersection + properties::Vec3Property intersectionEnd; // Color at the end of intersection + properties::Vec3Property square; // Color for the orthogonal square } _colors; }; diff --git a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp index 3bef08edd9..df97458c92 100644 --- a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp +++ b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp @@ -38,8 +38,8 @@ namespace { constexpr const char* ProgramName = "ShadowCylinderProgram"; constexpr const char* MainFrame = "GALACTIC"; - constexpr const std::array UniformNames = { - "modelViewProjectionTransform", "shadowColor" + constexpr const std::array UniformNames = { + "modelViewProjectionTransform", "shadowColor", "opacity" }; constexpr openspace::properties::Property::PropertyInfo NumberPointsInfo = { @@ -135,7 +135,7 @@ documentation::Documentation RenderableShadowCylinder::Documentation() { }, { ShadowColorInfo.identifier, - new DoubleVector4Verifier, + new DoubleVector3Verifier, Optional::Yes, ShadowColorInfo.description }, @@ -189,11 +189,7 @@ RenderableShadowCylinder::RenderableShadowCylinder(const ghoul::Dictionary& dict : Renderable(dictionary) , _numberOfPoints(NumberPointsInfo, 190, 1, 300) , _shadowLength(ShadowLengthInfo, 0.1f, 0.f, 0.5f) - , _shadowColor( - ShadowColorInfo, - glm::vec4(1.f, 1.f, 1.f, 0.25f), - glm::vec4(0.f), glm::vec4(1.f) - ) + , _shadowColor(ShadowColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f)) , _terminatorType( TerminatorTypeInfo, properties::OptionProperty::DisplayType::Dropdown @@ -210,6 +206,9 @@ RenderableShadowCylinder::RenderableShadowCylinder(const ghoul::Dictionary& dict "RenderableShadowCylinder" ); + addProperty(_opacity); + registerUpdateRenderBinFromOpacity(); + if (dictionary.hasKey(NumberPointsInfo.identifier)) { _numberOfPoints = static_cast( dictionary.value(NumberPointsInfo.identifier) @@ -227,7 +226,7 @@ RenderableShadowCylinder::RenderableShadowCylinder(const ghoul::Dictionary& dict if (dictionary.hasKey(ShadowColorInfo.identifier)) { - _shadowColor = dictionary.value(ShadowLengthInfo.identifier); + _shadowColor = dictionary.value(ShadowLengthInfo.identifier); } _shadowColor.setViewOption(properties::Property::ViewOptions::Color); addProperty(_shadowColor); @@ -306,6 +305,8 @@ bool RenderableShadowCylinder::isReady() const { void RenderableShadowCylinder::render(const RenderData& data, RendererTasks&) { glDepthMask(false); + glDisable(GL_CULL_FACE); + _shader->activate(); // Model transform and view transform needs to be in double precision @@ -321,6 +322,7 @@ void RenderableShadowCylinder::render(const RenderData& data, RendererTasks&) { ); _shader->setUniform(_uniformCache.shadowColor, _shadowColor); + _shader->setUniform(_uniformCache.opacity, _opacity); glBindVertexArray(_vao); glDrawArrays(GL_TRIANGLE_STRIP, 0, static_cast(_vertices.size())); @@ -328,6 +330,7 @@ void RenderableShadowCylinder::render(const RenderData& data, RendererTasks&) { _shader->deactivate(); + glDisable(GL_CULL_FACE); glDepthMask(true); } diff --git a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.h b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.h index 85be7ab556..236f519470 100644 --- a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.h +++ b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.h @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include @@ -70,7 +70,7 @@ private: properties::IntProperty _numberOfPoints; properties::FloatProperty _shadowLength; - properties::Vec4Property _shadowColor; + properties::Vec3Property _shadowColor; properties::OptionProperty _terminatorType; properties::StringProperty _lightSource; properties::StringProperty _observer; @@ -79,7 +79,7 @@ private: properties::OptionProperty _aberration; ghoul::opengl::ProgramObject* _shader = nullptr; - UniformCache(modelViewProjectionTransform, shadowColor) _uniformCache; + UniformCache(modelViewProjectionTransform, shadowColor, opacity) _uniformCache; glm::dmat3 _stateMatrix = glm::dmat3(1.0); diff --git a/modules/spacecraftinstruments/shaders/fov_vs.glsl b/modules/spacecraftinstruments/shaders/fov_vs.glsl index 489f38ec48..2bf1ff5fde 100644 --- a/modules/spacecraftinstruments/shaders/fov_vs.glsl +++ b/modules/spacecraftinstruments/shaders/fov_vs.glsl @@ -34,13 +34,13 @@ out vec4 vs_positionScreenSpace; uniform mat4 modelViewProjectionTransform; -uniform vec4 defaultColorStart; -uniform vec4 defaultColorEnd; -uniform vec4 activeColor; -uniform vec4 targetInFieldOfViewColor; -uniform vec4 intersectionStartColor; -uniform vec4 intersectionEndColor; -uniform vec4 squareColor; +uniform vec3 defaultColorStart; +uniform vec3 defaultColorEnd; +uniform vec3 activeColor; +uniform vec3 targetInFieldOfViewColor; +uniform vec3 intersectionStartColor; +uniform vec3 intersectionEndColor; +uniform vec3 squareColor; uniform float interpolation; // This needs to be synced with the RenderableFov header @@ -60,29 +60,31 @@ void main() { vs_positionScreenSpace = z_normalization(positionClipSpace); gl_Position = vs_positionScreenSpace; + vec3 color; switch (colorInformation) { case VertexColorTypeDefaultStart: - vs_color = defaultColorStart; + color = defaultColorStart; break; case VertexColorTypeDefaultEnd: - vs_color = defaultColorEnd; + color = defaultColorEnd; break; case VertexColorTypeInFieldOfView: - vs_color = activeColor * interpolation + targetInFieldOfViewColor * (1 - interpolation); + color = activeColor * interpolation + targetInFieldOfViewColor * (1 - interpolation); break; case VertexColorTypeActive: - vs_color = activeColor; + color = activeColor; break; case VertexColorTypeIntersectionStart: - vs_color = intersectionStartColor; + color = intersectionStartColor; break; case VertexColorTypeIntersectionEnd: - vs_color = activeColor * interpolation + intersectionEndColor * (1 - interpolation); + color = activeColor * interpolation + intersectionEndColor * (1 - interpolation); break; case VertexColorTypeSquare: - vs_color = activeColor * interpolation + squareColor * (1 - interpolation); + color = activeColor * interpolation + squareColor * (1 - interpolation); break; default: - vs_color = vec4(1.0, 0.0, 1.0, 1.0); + color = vec3(1.0, 0.0, 1.0); } + vs_color = vec4(color, 1.0); } diff --git a/modules/spacecraftinstruments/shaders/terminatorshadow_fs.glsl b/modules/spacecraftinstruments/shaders/terminatorshadow_fs.glsl index 1fafbc02a2..bf7c29b1fb 100644 --- a/modules/spacecraftinstruments/shaders/terminatorshadow_fs.glsl +++ b/modules/spacecraftinstruments/shaders/terminatorshadow_fs.glsl @@ -26,15 +26,13 @@ #include "fragment.glsl" in vec4 vs_positionScreenSpace; -in vec4 vs_point_velocity; -in vec4 vs_color; - -uniform vec3 color; +in vec3 vs_color; +uniform float opacity; Fragment getFragment() { Fragment frag; - frag.color = vs_color; + frag.color = vec4(vs_color, opacity); frag.depth = vs_positionScreenSpace.w; return frag; diff --git a/modules/spacecraftinstruments/shaders/terminatorshadow_vs.glsl b/modules/spacecraftinstruments/shaders/terminatorshadow_vs.glsl index c837cac53b..55fd791490 100644 --- a/modules/spacecraftinstruments/shaders/terminatorshadow_vs.glsl +++ b/modules/spacecraftinstruments/shaders/terminatorshadow_vs.glsl @@ -28,22 +28,19 @@ layout(location = 0) in vec4 in_point_position; -out vec4 vs_color; +out vec3 vs_color; out vec4 vs_positionScreenSpace; uniform mat4 modelViewProjectionTransform; -uniform vec4 objectVelocity; - -uniform uint nVertices; -uniform vec4 shadowColor; +uniform vec3 shadowColor; void main() { if (mod(gl_VertexID,2) == 0.0) { vs_color = shadowColor; } else { - vs_color = vec4(0.0); + vs_color = vec3(0.0); } // Transform the damn psc to homogenous coordinate diff --git a/modules/touch/include/touchmarker.h b/modules/touch/include/touchmarker.h index 43d2d7be94..26ed9e18bf 100644 --- a/modules/touch/include/touchmarker.h +++ b/modules/touch/include/touchmarker.h @@ -58,12 +58,12 @@ private: properties::BoolProperty _visible; properties::FloatProperty _radiusSize; - properties::FloatProperty _transparency; + properties::FloatProperty _opacity; properties::FloatProperty _thickness; properties::Vec3Property _color; std::unique_ptr _shader; - UniformCache(radius, transparency, thickness, color) _uniformCache; + UniformCache(radius, opacity, thickness, color) _uniformCache; std::vector _vertexData; GLuint _quad = 0; diff --git a/modules/touch/shaders/marker_fs.glsl b/modules/touch/shaders/marker_fs.glsl index 9d04a92a38..2425e5323a 100644 --- a/modules/touch/shaders/marker_fs.glsl +++ b/modules/touch/shaders/marker_fs.glsl @@ -28,7 +28,7 @@ in vec2 out_position; uniform float radius; -uniform float transparency; +uniform float opacity; uniform float thickness; uniform vec3 color; @@ -47,7 +47,7 @@ Fragment getFragment() { // calculate lighting vec3 light_dir = vec3(0.0, 0.0, 1.0); float diffuse = max(0.0, dot(light_dir, n)); - float alpha = min(pow(sqrt(mag), thickness), transparency); + float alpha = min(pow(sqrt(mag), thickness), opacity); Fragment frag; frag.color = vec4(color * diffuse, alpha); diff --git a/modules/touch/src/touchmarker.cpp b/modules/touch/src/touchmarker.cpp index 386007074c..8abd11e7e8 100644 --- a/modules/touch/src/touchmarker.cpp +++ b/modules/touch/src/touchmarker.cpp @@ -32,7 +32,7 @@ namespace { constexpr const std::array UniformNames = { - "radius", "transparency", "thickness", "color" + "radius", "opacity", "thickness", "color" }; constexpr openspace::properties::Property::PropertyInfo VisibilityInfo = { @@ -47,9 +47,9 @@ namespace { "" // @TODO Missing documentation }; - constexpr openspace::properties::Property::PropertyInfo TransparencyInfo = { - "Transparency", - "Marker transparency", + constexpr openspace::properties::Property::PropertyInfo OpacityInfo = { + "Opacity", + "Marker opacity", "" // @TODO Missing documentation }; @@ -71,13 +71,13 @@ TouchMarker::TouchMarker() : properties::PropertyOwner({ "TouchMarker" }) , _visible(VisibilityInfo, true) , _radiusSize(RadiusInfo, 30.f, 0.f, 100.f) - , _transparency(TransparencyInfo, 0.8f, 0.f, 1.f) + , _opacity(OpacityInfo, 0.8f, 0.f, 1.f) , _thickness(ThicknessInfo, 2.f, 0.f, 4.f ) , _color(ColorInfo, glm::vec3(0.96f, 0.2f, 0.2f), glm::vec3(0.f), glm::vec3(1.f)) { addProperty(_visible); addProperty(_radiusSize); - addProperty(_transparency); + addProperty(_opacity); addProperty(_thickness); _color.setViewOption(properties::Property::ViewOptions::Color); addProperty(_color); @@ -117,7 +117,7 @@ void TouchMarker::render(const std::vector& list) { _shader->activate(); _shader->setUniform(_uniformCache.radius, _radiusSize); - _shader->setUniform(_uniformCache.transparency, _transparency); + _shader->setUniform(_uniformCache.opacity, _opacity); _shader->setUniform(_uniformCache.thickness, _thickness); _shader->setUniform(_uniformCache.color, _color.value()); diff --git a/modules/toyvolume/rendering/renderabletoyvolume.cpp b/modules/toyvolume/rendering/renderabletoyvolume.cpp index 46dc7ffca8..7a3d3b9479 100644 --- a/modules/toyvolume/rendering/renderabletoyvolume.cpp +++ b/modules/toyvolume/rendering/renderabletoyvolume.cpp @@ -92,7 +92,7 @@ RenderableToyVolume::RenderableToyVolume(const ghoul::Dictionary& dictionary) glm::vec3(0.f), glm::vec3(glm::two_pi()) ) - , _color(ColorInfo, glm::vec4(1.f, 0.f, 0.f, 0.1f), glm::vec4(0.f), glm::vec4(1.f)) + , _color(ColorInfo, glm::vec3(1.f, 0.f, 0.f), glm::vec3(0.f), glm::vec3(1.f)) , _downScaleVolumeRendering(DownscaleVolumeRenderingInfo, 1.f, 0.1f, 1.f) { if (dictionary.hasKeyAndValue(ScalingExponentInfo.identifier)) { @@ -113,8 +113,8 @@ RenderableToyVolume::RenderableToyVolume(const ghoul::Dictionary& dictionary) _rotation = dictionary.value(RotationInfo.identifier); } - if (dictionary.hasKeyAndValue(ColorInfo.identifier)) { - _color = dictionary.value(ColorInfo.identifier); + if (dictionary.hasKeyAndValue(ColorInfo.identifier)) { + _color = dictionary.value(ColorInfo.identifier); } if (dictionary.hasKeyAndValue(StepSizeInfo.identifier)) { @@ -141,7 +141,8 @@ RenderableToyVolume::RenderableToyVolume(const ghoul::Dictionary& dictionary) RenderableToyVolume::~RenderableToyVolume() {} void RenderableToyVolume::initializeGL() { - _raycaster = std::make_unique(_color); + glm::vec4 color(glm::vec3(_color), _opacity); + _raycaster = std::make_unique(color); _raycaster->initialize(); global::raycasterManager.attachRaycaster(*_raycaster.get()); @@ -163,6 +164,7 @@ void RenderableToyVolume::initializeGL() { addProperty(_translation); addProperty(_rotation); addProperty(_color); + addProperty(_opacity); addProperty(_downScaleVolumeRendering); } @@ -196,7 +198,9 @@ void RenderableToyVolume::update(const UpdateData& data) { std::pow(10.f, static_cast(_scalingExponent)) ); - _raycaster->setColor(_color); + glm::vec4 color(glm::vec3(_color), _opacity); + + _raycaster->setColor(color); _raycaster->setStepSize(_stepSize); _raycaster->setModelTransform(transform); _raycaster->setTime(data.time.j2000Seconds()); diff --git a/modules/toyvolume/rendering/renderabletoyvolume.h b/modules/toyvolume/rendering/renderabletoyvolume.h index 4f4692534b..d42988639d 100644 --- a/modules/toyvolume/rendering/renderabletoyvolume.h +++ b/modules/toyvolume/rendering/renderabletoyvolume.h @@ -30,7 +30,6 @@ #include #include #include -#include namespace openspace { @@ -54,7 +53,7 @@ private: properties::FloatProperty _stepSize; properties::Vec3Property _translation; properties::Vec3Property _rotation; - properties::Vec4Property _color; + properties::Vec3Property _color; properties::FloatProperty _downScaleVolumeRendering; std::unique_ptr _raycaster; diff --git a/src/rendering/renderable.cpp b/src/rendering/renderable.cpp index 8e11770be0..5a6f50de0f 100644 --- a/src/rendering/renderable.cpp +++ b/src/rendering/renderable.cpp @@ -44,8 +44,9 @@ namespace { constexpr openspace::properties::Property::PropertyInfo OpacityInfo = { "Opacity", - "Transparency", - "This value determines the transparency of this object." + "Opacity", + "This value determines the opacity of this renderable. A value of 0 means " + "completely transparent." }; constexpr openspace::properties::Property::PropertyInfo RenderableTypeInfo = {