Improved fade-io/out controls in GUI. Changed default behavior for unknown textures in renderable planes cloud.

This commit is contained in:
Jonathas Costa
2017-12-04 11:15:39 -05:00
parent 695df47b00
commit 24d3c5e8d2
4 changed files with 14 additions and 14 deletions

View File

@@ -8,21 +8,13 @@ return {
Enabled = true,
Color = { 1.0, 1.0, 1.0 },
Transparency = 0.90,
ScaleFactor = 2.3,
ScaleFactor = 2.8,
File = "speck/galaxy.speck",
TexturePath = "textures",
Luminosity = "size",
ScaleLuminosity = 1.0,
--[[
TransformationMatrix = {
-0.7357425748, 0.67726129641, 0.0, 0.0,
-0.074553778365, -0.080991471307, 0.9939225904, 0.0,
0.67314530211, 0.73127116582, 0.11008126223, 0.0,
0.0, 0.0, 0.0, 1.0
},
]]
ScaleLuminosity = 1.0,
-- Fade in value in the same unit as "Unit"
FadeInThreshould = 0.1,
FadeInThreshould = 119441,
PlaneMinSize = 5.0,
Unit = "pc",
},

View File

@@ -355,7 +355,7 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
, _drawElements(DrawElementsInfo, true)
, _drawLabels(DrawLabelInfo, false)
, _colorOption(ColorOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
, _fadeInDistance(FadeInThreshouldInfo, 0.0, 0.1, 100.0)
, _fadeInDistance(FadeInThreshouldInfo, 0.0, 0.0, 100.0)
, _disableFadeInDistance(DisableFadeInInfo, true)
, _billboardMaxSize(BillboardMaxSizeInfo, 400.0, 0.0, 1000.0)
, _billboardMinSize(BillboardMinSizeInfo, 0.0, 0.0, 100.0)
@@ -1413,6 +1413,7 @@ void RenderableBillboardsCloud::createDataSlice() {
}
}
float biggestCoord = -1.0f;
for (size_t i = 0; i < _fullData.size(); i += _nValuesPerAstronomicalObject) {
glm::dvec4 transformedPos = _transformationMatrix * glm::dvec4(_fullData[i + 0], _fullData[i + 1], _fullData[i + 2], 1.0);
glm::vec4 position(glm::vec3(transformedPos), static_cast<float>(_unit));
@@ -1420,6 +1421,7 @@ void RenderableBillboardsCloud::createDataSlice() {
if (_hasColorMapFile) {
for (auto j = 0; j < 4; ++j) {
_slicedData.push_back(position[j]);
biggestCoord = biggestCoord < position[j] ? position[j] : biggestCoord;
}
// Finds from which bin to get the color.
// Note: the first color in the colormap file
@@ -1445,6 +1447,8 @@ void RenderableBillboardsCloud::createDataSlice() {
}
}
}
_fadeInDistance.setMaxValue(10.0f * biggestCoord);
}
void RenderableBillboardsCloud::createPolygonTexture() {

View File

@@ -583,6 +583,10 @@ void RenderablePlanesCloud::renderPlanes(const RenderData&,
_program->setUniform("galaxyTexture", unit);
int currentTextureIndex = -1;
for (auto renderingPlane : _renderingPlanesArray) {
// For planes with undefined textures references
if (renderingPlane.planeIndex == -1) {
continue;
}
glm::dvec4 vertex0(renderingPlane.vertexData[0], renderingPlane.vertexData[1],
renderingPlane.vertexData[2], renderingPlane.vertexData[3]);
@@ -1216,7 +1220,7 @@ void RenderablePlanesCloud::createPlanes() {
// JCC: Ask Abbott about these points refeering to a non-existing texture.
if (plane.planeIndex == 30) {
//std::cout << "--- Creating planes - index: " << plane.planeIndex << std::endl;
plane.planeIndex = 0;
plane.planeIndex = -1;
}
glGenVertexArrays(1, &plane.vao);