mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-13 17:09:05 -05:00
Fixed bug in Tully galaxies rendering.
This commit is contained in:
@@ -782,7 +782,6 @@ namespace openspace {
|
||||
|
||||
std::stringstream str(line);
|
||||
|
||||
// JCC: This should be moved to the RenderablePlanesCloud:
|
||||
glm::vec3 u(0.0f), v(0.0f);
|
||||
int textureIndex = 0;
|
||||
|
||||
@@ -818,7 +817,6 @@ namespace openspace {
|
||||
textureIndex = static_cast<int>(values[i]);
|
||||
}
|
||||
}
|
||||
|
||||
_fullData.insert(_fullData.end(), values.begin(), values.end());
|
||||
} while (!file.eof());
|
||||
|
||||
@@ -961,6 +959,7 @@ dummy.clear();
|
||||
if (_dataIsDirty && _hasSpeckFile) {
|
||||
LDEBUG("Creating planes");
|
||||
|
||||
int planeNumber = 0;
|
||||
for (int p = 0; p < _fullData.size(); p += _nValuesPerAstronomicalObject) {
|
||||
glm::vec4 transformedPos = glm::vec4(_transformationMatrix *
|
||||
glm::dvec4(_fullData[p + 0], _fullData[p + 1], _fullData[p + 2], 1.0));
|
||||
@@ -988,7 +987,7 @@ dummy.clear();
|
||||
|
||||
RenderingPlane plane;
|
||||
plane.planeIndex = _fullData[p + _textureVariableIndex];
|
||||
|
||||
|
||||
// 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;
|
||||
@@ -1070,7 +1069,7 @@ dummy.clear();
|
||||
reinterpret_cast<GLvoid*>(sizeof(GLfloat) * 4)
|
||||
);
|
||||
|
||||
_renderingPlanesMap.insert({plane.planeIndex, plane});
|
||||
_renderingPlanesMap.insert({planeNumber++, plane});
|
||||
}
|
||||
|
||||
glBindVertexArray(0);
|
||||
|
||||
@@ -29,16 +29,20 @@ in vec2 vs_st;
|
||||
|
||||
uniform sampler2D galaxyTexture;
|
||||
//uniform bool additiveBlending;
|
||||
uniform float alphaValue;
|
||||
|
||||
|
||||
Fragment getFragment() {
|
||||
Fragment frag;
|
||||
if (gl_FrontFacing) {
|
||||
frag.color = texture(galaxyTexture, vs_st);
|
||||
}
|
||||
else {
|
||||
frag.color = texture(galaxyTexture, vec2(1 - vs_st.s, vs_st.t));
|
||||
}
|
||||
// if (gl_FrontFacing) {
|
||||
// frag.color = texture(galaxyTexture, vs_st);
|
||||
// }
|
||||
// else {
|
||||
// frag.color = texture(galaxyTexture, vec2(1 - vs_st.s, vs_st.t));
|
||||
// }
|
||||
|
||||
frag.color = texture(galaxyTexture, vs_st);
|
||||
frag.color *= alphaValue;
|
||||
|
||||
if (frag.color.a == 0.0) {
|
||||
discard;
|
||||
|
||||
Reference in New Issue
Block a user