number of states changed and added new assets

This commit is contained in:
Christian Adamsson
2020-08-13 19:36:16 +02:00
parent e51032ce0f
commit 8328152271
7 changed files with 39 additions and 25 deletions
@@ -2,7 +2,7 @@ local TexturesPath = asset.syncedResource({
Type = "HttpSynchronization",
Name = "cutplanes_textures",
Identifier = "cutplanes_textures",
Version = 1
Version = 2
})
asset.export("TexturesPath", TexturesPath)
@@ -16,7 +16,7 @@ local textures_coronasphere = asset.require('./cutplanes_textures_sphere_corona'
local transforms = asset.require("./transforms")
local default_opacity = 0.99
--textureversion 1 has purple for low flux, 2 has transparent.
local textureversion = 1
local textureversion = 2
local TexturesPathEarth = asset.syncedResource({
Type = "HttpSynchronization",
@@ -70,7 +70,7 @@ local Cutplane_sphere_venus = {
Type = "RenderableTimeVaryingSphere",
Size = 107710467 * 10^3,
Enabled = true,
Texture = TexturesPathMercury,
Texture = TexturesPathVenus,
--BlendMode = "Additive",
Opacity = default_opacity,
Segments = 132
@@ -102,7 +102,7 @@ local Cutplane_sphere_corona = {
Parent = transforms.SunIAU.Identifier,
Renderable = {
Type = "RenderableTimeVaryingSphere",
Size = 7479893 * 10^3,
Size = 7479894 * 10^3,
Enabled = true,
Texture = TexturesPathCorona,
--BlendMode = "Additive",
@@ -115,5 +115,5 @@ local Cutplane_sphere_corona = {
},
};
assetHelper.registerSceneGraphNodesAndExport(asset, { Cutplane_sphere_earth, Cutplane_sphere_venus, Cutplane_sphere_mercury, Cutplane_sphere_corona})
--something wrong with Cutplane_sphere_corona.
assetHelper.registerSceneGraphNodesAndExport(asset, { Cutplane_sphere_earth, Cutplane_sphere_venus, Cutplane_sphere_mercury})
@@ -12,6 +12,13 @@ local assetHelper = asset.require("util/asset_helper")
local textures = asset.require('./cutplanes_textures').TexturesPath
local transforms = asset.require("./transforms")
local TexturesPathMeridial = asset.syncedResource({
Type = "HttpSynchronization",
Name = "cutplane_meridial_textures",
Identifier = "cutplane_meridial_textures",
Version = 1
})
local Cutplane = {
Identifier = "Cutplane",
Parent = transforms.SunIAU.Identifier,
@@ -35,22 +42,22 @@ local Cutplane = {
},
};
--local Cutplane2 = {
-- Identifier = "Cutplane2",
-- Parent = transforms.SunIAU.Identifier,
-- Renderable = {
-- Type = "RenderablePlaneImageLocal",
-- Size = 1.3*10^11,
-- Enabled = false,
-- Texture = textures .. "/cutplane1.png",
-- BlendMode = "Additive",
-- Opacity = 0.65,
-- },
-- GUI = {
-- Name = "Cutplane2",
-- Path = "/Solar System/Heliosphere"
-- },
--};
local Cutplane2 = {
Identifier = "Cutplane2",
Parent = transforms.SunIAU.Identifier,
Renderable = {
Type = "RenderableTimeVaryingPlaneImageLocal",
Size = 1.5*10^11,
Enabled = true,
Texture = TexturesPathMeridial,
BlendMode = "Normal",
Opacity = 1,
},
GUI = {
Name = "Cutplane2",
Path = "/Solar System/Heliosphere"
},
};
assetHelper.registerSceneGraphNodesAndExport(asset, { Cutplane, Cutplane2 })
assetHelper.registerSceneGraphNodesAndExport(asset, { Cutplane })
@@ -155,6 +155,7 @@ namespace openspace {
void RenderableTimeVaryingPlaneImageLocal::initializeGL() {
RenderablePlane::initializeGL();
LDEBUG("sourcefiles size:" + std::to_string(_sourceFiles.size()));
if (!extractMandatoryInfoFromDictionary()) {
@@ -196,6 +197,7 @@ namespace openspace {
));
return false;
}
_nStates = _sourceFiles.size();
LDEBUG("returning true");
return true;
}
@@ -215,6 +217,7 @@ namespace openspace {
if (!this->_enabled) {
return;
}
const double currentTime = data.time.j2000Seconds();
const bool isInInterval = (currentTime >= _startTimes[0]) &&
(currentTime < _sequenceEndTime);
@@ -325,6 +328,8 @@ namespace openspace {
//);
texture->uploadTexture();
texture->setFilter(ghoul::opengl::Texture::FilterMode::LinearMipMap);
texture->setWrapping(ghoul::opengl::Texture::WrappingMode::ClampToEdge);
//texture->setWrapping(ghoul::opengl::Texture::WrappingMode::ClampToEdge);
texture->purgeFromRAM();
return texture;
@@ -338,6 +343,7 @@ namespace openspace {
[&](const ghoul::filesystem::File&) { _textureIsDirty = true; }
);
_isLoadingTexture = false;
//glTexParameterf(_texture, GL_TEXTURE_MIN_FILTER, 0);
}
}
@@ -66,7 +66,7 @@ namespace openspace {
std::vector<double> _startTimes;
int _activeTriggerTimeIndex = 0;
// Number of states in the sequence
size_t _nStates = 274;
size_t _nStates = 90;
properties::StringProperty _texturePath;
//properties::StringProperty _timestapsPath;
ghoul::opengl::Texture* _texture = nullptr;
@@ -495,6 +495,7 @@ bool RenderableTimeVaryingSphere::extractMandatoryInfoFromDictionary()
));
return false;
}
_nStates = _sourceFiles.size();
LDEBUG("returning true");
return true;
}
@@ -74,7 +74,7 @@ private:
std::vector<double> _startTimes;
int _activeTriggerTimeIndex = 0;
// Number of states in the sequence
size_t _nStates = 272;
size_t _nStates = 95;
bool _isLoadingTexture = false;
properties::StringProperty _texturePath;