Merge pull request #1240 from OpenSpace/issue/1196

Issue/1196 - Unify usage of color, transparency/opacity
This commit is contained in:
Emma Broman
2020-07-13 12:23:33 +02:00
committed by GitHub
84 changed files with 435 additions and 487 deletions
+2 -2
View File
@@ -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"
@@ -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",
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
+30 -54
View File
@@ -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,
@@ -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",
@@ -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,
@@ -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,
@@ -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 = {
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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"
@@ -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" },
@@ -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" },
@@ -100,6 +100,7 @@ local CharonShadow = {
Parent = CharonProjection .Identifier,
Renderable = {
Type = "RenderableShadowCylinder",
Opacity = 0.25,
TerminatorType = "PENUMBRAL",
LightSource = "SUN",
Observer = "NEW HORIZONS",
@@ -226,6 +226,7 @@ local PlutoShadow = {
Parent = PlutoProjection.Identifier,
Renderable = {
Type = "RenderableShadowCylinder",
Opacity = 0.25,
TerminatorType = "PENUMBRAL",
LightSource = "SUN",
Observer = "NEW HORIZONS",
@@ -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" },
@@ -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 = {
@@ -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" },
@@ -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" },
@@ -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" },
@@ -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" },
@@ -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" },
@@ -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" },
@@ -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" },
@@ -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" },
@@ -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" },
@@ -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" },
@@ -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" },
@@ -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" },
@@ -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" },
@@ -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" },
+5 -5
View File
@@ -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,
+2 -1
View File
@@ -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 = {
@@ -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<glm::vec4>(XColorInfo.identifier);
_xColor = dictionary.value<glm::vec3>(XColorInfo.identifier);
}
_xColor.setViewOption(properties::Property::ViewOptions::Color);
addProperty(_xColor);
if (dictionary.hasKey(XColorInfo.identifier)) {
_yColor = dictionary.value<glm::vec4>(YColorInfo.identifier);
_yColor = dictionary.value<glm::vec3>(YColorInfo.identifier);
}
_yColor.setViewOption(properties::Property::ViewOptions::Color);
addProperty(_yColor);
if (dictionary.hasKey(ZColorInfo.identifier)) {
_zColor = dictionary.value<glm::vec4>(ZColorInfo.identifier);
_zColor = dictionary.value<glm::vec3>(ZColorInfo.identifier);
}
_zColor.setViewOption(properties::Property::ViewOptions::Color);
addProperty(_zColor);
@@ -31,7 +31,7 @@
#include <openspace/properties/matrix/dmat4property.h>
#include <openspace/properties/scalar/floatproperty.h>
#include <openspace/properties/scalar/intproperty.h>
#include <openspace/properties/vector/vec4property.h>
#include <openspace/properties/vector/vec3property.h>
#include <ghoul/opengl/ghoul_gl.h>
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;
+6 -5
View File
@@ -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;
+2 -2
View File
@@ -32,7 +32,7 @@
#include <openspace/properties/scalar/boolproperty.h>
#include <openspace/properties/scalar/floatproperty.h>
#include <openspace/properties/vector/vec2property.h>
#include <openspace/properties/vector/vec4property.h>
#include <openspace/properties/vector/vec3property.h>
#include <ghoul/opengl/ghoul_gl.h>
#include <ghoul/opengl/uniformcache.h>
@@ -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;
+7 -7
View File
@@ -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;
+5 -4
View File
@@ -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;
@@ -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<glm::vec4>(TextColorInfo.identifier);
_textColor = dictionary.value<glm::vec3>(TextColorInfo.identifier);
_hasLabel = true;
}
_textColor.setViewOption(properties::Property::ViewOptions::Color);
addProperty(_textColor);
_textColor.onChange([&]() { _textColorIsDirty = true; });
if (dictionary.hasKey(TextOpacityInfo.identifier)) {
_textOpacity = dictionary.value<float>(TextOpacityInfo.identifier);
}
addProperty(_textOpacity);
if (dictionary.hasKey(TextSizeInfo.identifier)) {
_textSize = dictionary.value<float>(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;
@@ -33,7 +33,6 @@
#include <openspace/properties/scalar/floatproperty.h>
#include <openspace/properties/vector/vec2property.h>
#include <openspace/properties/vector/vec3property.h>
#include <openspace/properties/vector/vec4property.h>
#include <ghoul/opengl/ghoul_gl.h>
#include <ghoul/opengl/uniformcache.h>
#include <functional>
@@ -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;
@@ -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<float>,
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<double>,
Optional::Yes,
TransformationMatrixInfo.description
},
{
MeshColorInfo.identifier,
new Vector3ListVerifier<float>,
@@ -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<std::string>(KeyFile));
_hasSpeckFile = true;
@@ -309,25 +285,6 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
}
}
/*if (dictionary.hasKey(keyColor)) {
_pointColor = dictionary.value<glm::vec3>(keyColor);
}
addProperty(_pointColor);*/
if (dictionary.hasKey(TransparencyInfo.identifier)) {
_alphaValue = static_cast<float>(
dictionary.value<double>(TransparencyInfo.identifier)
);
}
addProperty(_alphaValue);
/*if (dictionary.hasKey(ScaleFactorInfo.identifier)) {
_scaleFactor = static_cast<float>(
dictionary.value<double>(ScaleFactorInfo.identifier)
);
}
addProperty(_scaleFactor);*/
if (dictionary.hasKeyAndValue<double>(LineWidthInfo.identifier)) {
_lineWidth = static_cast<float>(
dictionary.value<double>(LineWidthInfo.identifier)
@@ -345,13 +302,17 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
_hasLabel = true;
if (dictionary.hasKey(TextColorInfo.identifier)) {
_textColor = dictionary.value<glm::vec4>(TextColorInfo.identifier);
_textColor = dictionary.value<glm::vec3>(TextColorInfo.identifier);
_hasLabel = true;
}
_textColor.setViewOption(properties::Property::ViewOptions::Color);
addProperty(_textColor);
_textColor.onChange([&]() { _textColorIsDirty = true; });
if (dictionary.hasKey(TextOpacityInfo.identifier)) {
_textOpacity = dictionary.value<float>(TextOpacityInfo.identifier);
}
addProperty(_textOpacity);
if (dictionary.hasKey(TextSizeInfo.identifier)) {
_textSize = dictionary.value<float>(TextSizeInfo.identifier);
@@ -369,12 +330,6 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
addProperty(_textMaxSize);
}
if (dictionary.hasKey(TransformationMatrixInfo.identifier)) {
_transformationMatrix = dictionary.value<glm::dmat4>(
TransformationMatrixInfo.identifier
);
}
if (dictionary.hasKey(MeshColorInfo.identifier)) {
ghoul::Dictionary colorDict = dictionary.value<ghoul::Dictionary>(
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<const int, RenderingMesh>& 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<glm::vec3, std::string>& 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());
@@ -32,7 +32,6 @@
#include <openspace/properties/scalar/boolproperty.h>
#include <openspace/properties/scalar/floatproperty.h>
#include <openspace/properties/vector/vec3property.h>
#include <openspace/properties/vector/vec4property.h>
#include <ghoul/opengl/ghoul_gl.h>
#include <ghoul/opengl/uniformcache.h>
#include <unordered_map>
@@ -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<std::pair<glm::vec3, std::string>> _labelData;
int _nValuesPerAstronomicalObject = 0;
glm::dmat4 _transformationMatrix = glm::dmat4(1.0);
std::unordered_map<int, glm::vec3> _meshColorMap;
std::unordered_map<int, RenderingMesh> _renderingMeshesMap;
};
@@ -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<std::string>(KeyFile));
_hasSpeckFile = true;
@@ -371,13 +368,6 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary
_unit = Meter;
}
if (dictionary.hasKey(TransparencyInfo.identifier)) {
_alphaValue = static_cast<float>(
dictionary.value<double>(TransparencyInfo.identifier)
);
}
addProperty(_alphaValue);
if (dictionary.hasKey(ScaleFactorInfo.identifier)) {
_scaleFactor = static_cast<float>(
dictionary.value<double>(ScaleFactorInfo.identifier)
@@ -393,13 +383,17 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary
_hasLabel = true;
if (dictionary.hasKey(TextColorInfo.identifier)) {
_textColor = dictionary.value<glm::vec4>(TextColorInfo.identifier);
_textColor = dictionary.value<glm::vec3>(TextColorInfo.identifier);
_hasLabel = true;
}
_textColor.setViewOption(properties::Property::ViewOptions::Color);
addProperty(_textColor);
_textColor.onChange([&]() { _textColorIsDirty = true; });
if (dictionary.hasKey(TextOpacityInfo.identifier)) {
_textOpacity = dictionary.value<float>(TextOpacityInfo.identifier);
}
addProperty(_textOpacity);
if (dictionary.hasKey(TextSizeInfo.identifier)) {
_textSize = dictionary.value<float>(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;
@@ -33,7 +33,6 @@
#include <openspace/properties/scalar/floatproperty.h>
#include <openspace/properties/vector/vec2property.h>
#include <openspace/properties/vector/vec3property.h>
#include <openspace/properties/vector/vec4property.h>
#include <ghoul/opengl/ghoul_gl.h>
#include <ghoul/opengl/uniformcache.h>
@@ -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;
@@ -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<std::string>(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<float>(
dictionary.value<double>(TransparencyInfo.identifier)
);
}
addProperty(_alphaValue);
if (dictionary.hasKey(ScaleFactorInfo.identifier)) {
_scaleFactor = static_cast<float>(
dictionary.value<double>(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) {
@@ -87,7 +87,6 @@ private:
bool _spriteTextureIsDirty = true;
bool _hasColorMapFile = false;
properties::FloatProperty _alphaValue;
properties::FloatProperty _scaleFactor;
properties::Vec3Property _pointColor;
properties::StringProperty _spriteTexturePath;
+6 -7
View File
@@ -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;
}
@@ -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<float>(),
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<glm::vec4>(LabelsColorInfo.identifier);
_labelsColor = dictionary.value<glm::vec3>(LabelsColorInfo.identifier);
}
if (dictionary.hasKey(LabelsOpacityInfo.identifier)) {
_labelsOpacity = dictionary.value<float>(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<float>(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<float>(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);
@@ -31,7 +31,7 @@
#include <openspace/properties/scalar/boolproperty.h>
#include <openspace/properties/scalar/floatproperty.h>
#include <openspace/properties/scalar/intproperty.h>
#include <openspace/properties/vector/vec4property.h>
#include <openspace/properties/vector/vec3property.h>
#include <ghoul/font/fontrenderer.h>
#include <ghoul/glm.h>
@@ -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;
+14 -14
View File
@@ -52,7 +52,7 @@ namespace {
constexpr const char* _loggerCat = "RingsComponent";
constexpr const std::array<const char*, 9> 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<double>(TransparencyInfo.identifier)) {
_transparency = static_cast<float>(
_ringsDictionary.value<double>(TransparencyInfo.identifier)
if (_ringsDictionary.hasKeyAndValue<double>(ColorFilterInfo.identifier)) {
_colorFilter = static_cast<float>(
_ringsDictionary.value<double>(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);
+2 -2
View File
@@ -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<ghoul::opengl::ProgramObject> _shader;
std::unique_ptr<ghoul::opengl::ProgramObject> _geometryOnlyShader;
UniformCache(modelViewProjectionMatrix, textureOffset, transparency, nightFactor,
UniformCache(modelViewProjectionMatrix, textureOffset, colorFilterValue, nightFactor,
sunPosition, ringTexture, shadowMatrix, shadowMapTexture, zFightingPercentage
) _uniformCache;
UniformCache(modelViewProjectionMatrix, textureOffset, ringTexture
+14 -14
View File
@@ -39,7 +39,7 @@
namespace {
constexpr const std::array<const char*, 6> 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<double>(TransparencyInfo.identifier)) {
_transparency = static_cast<float>(
dictionary.value<double>(TransparencyInfo.identifier)
if (dictionary.hasKeyAndValue<double>(ColorFilterInfo.identifier)) {
_colorFilter = static_cast<float>(
dictionary.value<double>(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);
+2 -2
View File
@@ -66,10 +66,10 @@ private:
properties::FloatProperty _size;
properties::Vec2Property _offset;
properties::FloatProperty _nightFactor;
properties::FloatProperty _transparency;
properties::FloatProperty _colorFilter;
std::unique_ptr<ghoul::opengl::ProgramObject> _shader;
UniformCache(modelViewProjection, textureOffset, transparency, nightFactor,
UniformCache(modelViewProjection, textureOffset, colorFilterValue, nightFactor,
sunPosition, texture) _uniformCache;
std::unique_ptr<ghoul::opengl::Texture> _texture;
std::unique_ptr<ghoul::filesystem::File> _textureFile;
+5 -17
View File
@@ -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<std::string>(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<float>(
dictionary.value<double>(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<float>(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;
@@ -104,7 +104,6 @@ private:
std::unique_ptr<ghoul::opengl::Texture> _pointSpreadFunctionTexture;
std::unique_ptr<ghoul::filesystem::File> _pointSpreadFunctionFile;
properties::FloatProperty _alphaValue;
properties::OptionProperty _psfMethodOption;
properties::OptionProperty _psfMultiplyOption;
properties::FloatProperty _lumCent;
+8 -6
View File
@@ -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
@@ -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 {
@@ -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(
@@ -30,7 +30,7 @@
#include <openspace/properties/scalar/boolproperty.h>
#include <openspace/properties/scalar/doubleproperty.h>
#include <openspace/properties/scalar/floatproperty.h>
#include <openspace/properties/vector/vec4property.h>
#include <openspace/properties/vector/vec3property.h>
#include <openspace/util/spicemanager.h>
#include <ghoul/glm.h>
#include <ghoul/opengl/ghoul_gl.h>
@@ -69,15 +69,15 @@ private:
void updateGPU();
void insertPoint(std::vector<float>& 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;
};
@@ -38,8 +38,8 @@ namespace {
constexpr const char* ProgramName = "ShadowCylinderProgram";
constexpr const char* MainFrame = "GALACTIC";
constexpr const std::array<const char*, 2> UniformNames = {
"modelViewProjectionTransform", "shadowColor"
constexpr const std::array<const char*, 3> 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<int>(
dictionary.value<double>(NumberPointsInfo.identifier)
@@ -227,7 +226,7 @@ RenderableShadowCylinder::RenderableShadowCylinder(const ghoul::Dictionary& dict
if (dictionary.hasKey(ShadowColorInfo.identifier)) {
_shadowColor = dictionary.value<glm::vec4>(ShadowLengthInfo.identifier);
_shadowColor = dictionary.value<glm::vec3>(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<GLsizei>(_vertices.size()));
@@ -328,6 +330,7 @@ void RenderableShadowCylinder::render(const RenderData& data, RendererTasks&) {
_shader->deactivate();
glDisable(GL_CULL_FACE);
glDepthMask(true);
}
@@ -31,7 +31,7 @@
#include <openspace/properties/stringproperty.h>
#include <openspace/properties/scalar/intproperty.h>
#include <openspace/properties/scalar/floatproperty.h>
#include <openspace/properties/vector/vec4property.h>
#include <openspace/properties/vector/vec3property.h>
#include <ghoul/opengl/ghoul_gl.h>
#include <ghoul/opengl/uniformcache.h>
@@ -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);
@@ -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);
}
@@ -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;
@@ -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
+2 -2
View File
@@ -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<ghoul::opengl::ProgramObject> _shader;
UniformCache(radius, transparency, thickness, color) _uniformCache;
UniformCache(radius, opacity, thickness, color) _uniformCache;
std::vector<GLfloat> _vertexData;
GLuint _quad = 0;
+2 -2
View File
@@ -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);
+7 -7
View File
@@ -32,7 +32,7 @@
namespace {
constexpr const std::array<const char*, 4> 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<openspace::TouchInputHolder>& 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());
@@ -92,7 +92,7 @@ RenderableToyVolume::RenderableToyVolume(const ghoul::Dictionary& dictionary)
glm::vec3(0.f),
glm::vec3(glm::two_pi<float>())
)
, _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<double>(ScalingExponentInfo.identifier)) {
@@ -113,8 +113,8 @@ RenderableToyVolume::RenderableToyVolume(const ghoul::Dictionary& dictionary)
_rotation = dictionary.value<glm::vec3>(RotationInfo.identifier);
}
if (dictionary.hasKeyAndValue<glm::vec4>(ColorInfo.identifier)) {
_color = dictionary.value<glm::vec4>(ColorInfo.identifier);
if (dictionary.hasKeyAndValue<glm::vec3>(ColorInfo.identifier)) {
_color = dictionary.value<glm::vec3>(ColorInfo.identifier);
}
if (dictionary.hasKeyAndValue<double>(StepSizeInfo.identifier)) {
@@ -141,7 +141,8 @@ RenderableToyVolume::RenderableToyVolume(const ghoul::Dictionary& dictionary)
RenderableToyVolume::~RenderableToyVolume() {}
void RenderableToyVolume::initializeGL() {
_raycaster = std::make_unique<ToyVolumeRaycaster>(_color);
glm::vec4 color(glm::vec3(_color), _opacity);
_raycaster = std::make_unique<ToyVolumeRaycaster>(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<float>(_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());
@@ -30,7 +30,6 @@
#include <openspace/properties/scalar/floatproperty.h>
#include <openspace/properties/scalar/intproperty.h>
#include <openspace/properties/vector/vec3property.h>
#include <openspace/properties/vector/vec4property.h>
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<ToyVolumeRaycaster> _raycaster;
+3 -2
View File
@@ -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 = {