mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-15 10:09:48 -05:00
Improved fade-io/out controls in GUI. Changed default behavior for unknown textures in renderable planes cloud.
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user