Feature/volume tools (#614)

* Create volume generation task

* Change domain bounds into a non-optional parameter

* Work on volume generation and rendering

* Example generation of time varying volume

* Example generation of time varying volume

* Compile fix in RenderableKameleonVolume

* Fix copy and paste error

* Enable spherical raycasting again

* Uniform naming

* Add some documentation and remove dead code
This commit is contained in:
Emil Axelsson
2018-06-08 09:47:24 -04:00
committed by micahnyc
parent 0d870f7c9d
commit 5de728442d
29 changed files with 858 additions and 166 deletions
@@ -0,0 +1,3 @@
cartesian/
cartesiansequence/
spherical/
@@ -0,0 +1,38 @@
-- This asset requires OpenSpace to be built with the OPENSPACE_MODULE_VOLUME enabled
-- Before using this example,
-- the volume data itself needs to be generated,
-- using the task 'data/tasks/volume/generate_cartesian.task'
local assetHelper = asset.require('util/asset_helper')
local transforms = asset.require("scene/solarsystem/sun/transforms")
local sunRadius = 695508000
local volume = {
Identifier = "GeneratedVolume",
Parent = transforms.SolarSystemBarycenter.Identifier,
Renderable = {
Type = "RenderableTimeVaryingVolume",
SourceDirectory = asset.localResource("cartesian"),
TransferFunction = asset.localResource("../transferfunction.txt"),
StepSize = 0.01,
MinValue = 0,
MaxValue = 1,
GridType = "Cartesian",
SecondsBefore = 50*365*24*60*60, -- 50 years before
SecondsAfter = 50*365*24*60*60 -- 50 years after
},
GUI = {
Path = "/Examples"
},
Transform = {
Scale = {
Type = "StaticScale",
Scale = 1000 * sunRadius
}
}
}
local objects = { volume }
assetHelper.registerSceneGraphNodes(asset, objects)
@@ -0,0 +1,38 @@
-- This asset requires OpenSpace to be built with the OPENSPACE_MODULE_VOLUME enabled
-- Before using this example,
-- the volume data itself needs to be generated,
-- using the task 'data/tasks/volume/generate_cartesian_sequence.task'
local assetHelper = asset.require('util/asset_helper')
local transforms = asset.require("scene/solarsystem/sun/transforms")
local sunRadius = 695508000
local volume = {
Identifier = "GeneratedVolume",
Parent = transforms.SolarSystemBarycenter.Identifier,
Renderable = {
Type = "RenderableTimeVaryingVolume",
SourceDirectory = asset.localResource("cartesiansequence"),
TransferFunction = asset.localResource("../transferfunction.txt"),
StepSize = 0.01,
MinValue = 0,
MaxValue = 1,
GridType = "Cartesian",
SecondsBefore = 50*365*24*60*60, -- 50 years before
SecondsAfter = 50*365*24*60*60 -- 50 years after
},
GUI = {
Path = "/Examples"
},
Transform = {
Scale = {
Type = "StaticScale",
Scale = 1000 * sunRadius
}
}
}
local objects = { volume }
assetHelper.registerSceneGraphNodes(asset, objects)
@@ -0,0 +1,38 @@
-- This asset requires OpenSpace to be built with the OPENSPACE_MODULE_VOLUME enabled
-- Before using this example,
-- the volume data itself needs to be generated,
-- using the task 'data/tasks/volume/generate_spherical.task'
local assetHelper = asset.require('util/asset_helper')
local transforms = asset.require("scene/solarsystem/sun/transforms")
local astronomicalUnit = 149597870700
local volume = {
Identifier = "GeneratedVolume",
Parent = transforms.SolarSystemBarycenter.Identifier,
Renderable = {
Type = "RenderableTimeVaryingVolume",
SourceDirectory = asset.localResource("spherical"),
TransferFunction = asset.localResource("../transferfunction.txt"),
StepSize = 0.01,
MinValue = 0,
MaxValue = 1,
GridType = "Spherical",
SecondsBefore = 50*365*24*60*60, -- 50 years before
SecondsAfter = 50*365*24*60*60 -- 50 years after
},
GUI = {
Path = "/Examples"
},
Transform = {
Scale = {
Type = "StaticScale",
Scale = astronomicalUnit
}
}
}
local objects = { volume }
assetHelper.registerSceneGraphNodes(asset, objects)
@@ -0,0 +1,5 @@
width 1024
lower 0.0
upper 1.0
mappingkey 0.0 250 250 250 0
mappingkey 1.0 200 200 200 255