History

Fix glow line vanishing, improve transparency interaction

Brad Davis committed 10 years ago

Commit c644c871 parent 8ca36303 files · +14 −31Browse files

Showing the changes to libraries/render-utils/src/GeometryCache.cpp (1 of 3 files). Show all

Unified · Split

libraries/render-utils/src/GeometryCache.cpp+7−6
@@ -11,11 +11,12 @@ · 10 unmodified lines
1111
1212 #include "GeometryCache.h"
1313
14+
1415 #include <cmath>
1516
16−#include <QNetworkReply>
17−#include <QThreadPool>
17+#include <QtCore/QThreadPool>
1818 #include <QtCore/QFileInfo>
19+#include <QtNetwork/QNetworkReply>
1920
2021 #include <FSTReader.h>
2122 #include <NumericalConstants.h>
@@ -1462,11 +1463,11 @@ void GeometryCache::renderGlowLine(gpu::Batch& batch, const glm::vec3& p1, const · 1440 unmodified lines
14621463 auto GS = gpu::Shader::createGeometry(std::string(glowLine_geom));
14631464 auto PS = gpu::Shader::createPixel(std::string(glowLine_frag));
14641465 auto program = gpu::Shader::createProgram(VS, GS, PS);
1465− state->setCullMode(gpu::State::CULL_BACK);
1466+ state->setCullMode(gpu::State::CULL_NONE);
14661467 state->setDepthTest(true, true, gpu::LESS_EQUAL);
1467− state->setDepthBias(1.0f);
1468− state->setDepthBiasSlopeScale(1.0f);
1469− state->setBlendFunction(true, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA);
1468+ state->setBlendFunction(true,
1469+ gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA,
1470+ gpu::State::FACTOR_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::ONE);
14701471 gpu::Shader::BindingSet slotBindings;
14711472 slotBindings.insert(gpu::Shader::Binding(std::string("normalFittingMap"), render::ShapePipeline::Slot::MAP::NORMAL_FITTING));
14721473 gpu::Shader::makeProgram(*program, slotBindings);