Skip to content

Commit ebe3244

Browse files
author
Brig Bagley
committed
fixed edges issue with uniform color #855
1 parent 9d49ad0 commit ebe3244

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

src/Modules/Visualization/ShowField.cc

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,18 +1457,17 @@ void ShowFieldModule::renderEdges(
14571457
}
14581458
else if (colorScheme == GeometryObject::COLOR_UNIFORM)
14591459
{
1460-
ColorRGB dft = state.defaultColor;
1461-
uniforms.push_back(GeometryObject::SpireSubPass::Uniform("uAmbientColor",
1462-
glm::vec4(0.1f, 0.1f, 0.1f, 1.0f)));
1463-
uniforms.push_back(GeometryObject::SpireSubPass::Uniform("uDiffuseColor",
1464-
glm::vec4(dft.r(), dft.g(), dft.b(), 1.0f)));
1465-
uniforms.push_back(GeometryObject::SpireSubPass::Uniform("uSpecularColor",
1466-
glm::vec4(0.1f, 0.1f, 0.1f, 0.1f)));
1467-
uniforms.push_back(GeometryObject::SpireSubPass::Uniform("uSpecularPower", 32.0f));
1468-
if (state.get(RenderState::USE_CYLINDER))
1460+
if (state.get(RenderState::USE_CYLINDER)) {
1461+
ColorRGB dft = state.defaultColor;
1462+
uniforms.push_back(GeometryObject::SpireSubPass::Uniform("uAmbientColor",
1463+
glm::vec4(0.1f, 0.1f, 0.1f, 1.0f)));
1464+
uniforms.push_back(GeometryObject::SpireSubPass::Uniform("uDiffuseColor",
1465+
glm::vec4(dft.r(), dft.g(), dft.b(), 1.0f)));
1466+
uniforms.push_back(GeometryObject::SpireSubPass::Uniform("uSpecularColor",
1467+
glm::vec4(0.1f, 0.1f, 0.1f, 0.1f)));
1468+
uniforms.push_back(GeometryObject::SpireSubPass::Uniform("uSpecularPower", 32.0f));
14691469
attribs.push_back(GeometryObject::SpireVBO::AttributeData("aFieldData", 1 * sizeof(float)));
1470-
else
1471-
attribs.push_back(GeometryObject::SpireVBO::AttributeData("aColor", 1 * sizeof(uint32_t), true));
1470+
}
14721471
}
14731472
GeometryObject::SpireIBO::PRIMITIVE primIn = GeometryObject::SpireIBO::LINES;
14741473
// Use cylinders...
@@ -1685,7 +1684,12 @@ void ShowFieldModule::renderEdges(
16851684
}
16861685
if (colorScheme == GeometryObject::COLOR_MAP)
16871686
vboBuffer->write(static_cast<float>(colors.at(i).r()));
1688-
else {
1687+
else if (colorScheme == GeometryObject::COLOR_UNIFORM &&
1688+
!state.get(RenderState::USE_CYLINDER) ){
1689+
ColorRGB dft = state.defaultColor;
1690+
uniforms.push_back(GeometryObject::SpireSubPass::Uniform("uColor",
1691+
glm::vec4(dft.r(), dft.g(), dft.b(), 1.0f)));
1692+
} else {
16891693
// Writes uint8_t out to the VBO. A total of 4 bytes.
16901694
vboBuffer->write(COLOR_FTOB(colors.at(i).r()));
16911695
vboBuffer->write(COLOR_FTOB(colors.at(i).g()));

0 commit comments

Comments
 (0)