Currently job artifacts in CI/CD pipelines on LRZ GitLab never expire. Starting from Wed 26.1.2022 the default expiration time will be 30 days (GitLab default). Currently existing artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

Commit e835e6f7 authored by Jakob Weiss's avatar Jakob Weiss
Browse files

Revert "First steps replacing QGLWidget with QOpenGLWidget - currently crashes and burns horribly"

This reverts commit e7e55015.

# Conflicts:
#	core/glsl/tools/shading.frag
parent c662c17e
...@@ -171,21 +171,4 @@ float getPhongShadingIntensity(in vec3 position, in LightSource light, in vec3 c ...@@ -171,21 +171,4 @@ float getPhongShadingIntensity(in vec3 position, in LightSource light, in vec3 c
toReturn *= computeAttenuation(light._attenuation, d); toReturn *= computeAttenuation(light._attenuation, d);
#endif #endif
return (toReturn.x + toReturn.y + toReturn.z) / 3.0; return (toReturn.x + toReturn.y + toReturn.z) / 3.0;
} }
\ No newline at end of file
vec3 calculateContourShading(in vec3 position, in vec3 camera, in vec3 normal, in vec3 materialColor, in vec3 outlineColor, in float contourExponent) {
float outlineStrength = 1. - pow(clamp(-dot(normalize(normal), normalize(position - camera)), 0, 1), contourExponent);
return mix(materialColor, outlineColor, outlineStrength);
}
vec4 calculateContourShading2(in vec3 position, in vec3 camera, in vec3 normal, in vec4 materialColor, in vec4 outlineColor, in float contourExponent) {
float outlineStrength = 1. - pow(clamp(dot(normal, normalize(camera - position)), 0, 1), contourExponent);
return outlineStrength * outlineColor;
}
void blendUnder(inout vec4 colorAbove, in vec4 colorBelow)
{
colorAbove.rgb = colorAbove.rgb + colorBelow.rgb * colorBelow.a * (1.0 - colorAbove.a);
colorAbove.a = colorAbove.a + (1.0 -colorAbove.a) * colorBelow.a;
}
...@@ -99,7 +99,7 @@ namespace campvis { ...@@ -99,7 +99,7 @@ namespace campvis {
CAMPVIS_CORE_API void startOpenGlThreadAndMoveQtThreadAffinity(cgt::Runnable* runnable, cgt::GLCanvas* canvas) { CAMPVIS_CORE_API void startOpenGlThreadAndMoveQtThreadAffinity(cgt::Runnable* runnable, cgt::GLCanvas* canvas) {
// welcome to a complex signalling ping-pong to move the OpenGL context thread affinity // welcome to a complex signalling ping-pong to move the OpenGL context thread affinity
// we will use targetThread as signalling variable and initialize it with nullptr: // we will use targetThread as signalling variable and initialize it with nullptr:
volatile void* targetThread = nullptr; void* targetThread = nullptr;
// start the new thread with special init function // start the new thread with special init function
runnable->start([&]() { runnable->start([&]() {
...@@ -120,7 +120,7 @@ namespace campvis { ...@@ -120,7 +120,7 @@ namespace campvis {
std::this_thread::yield(); std::this_thread::yield();
// set the QGLContext's thread affinity // set the QGLContext's thread affinity
canvas->moveThreadAffinity(const_cast<void*>(targetThread)); canvas->moveThreadAffinity(targetThread);
// reset the signal variable so that the new thread can continue. // reset the signal variable so that the new thread can continue.
targetThread = nullptr; targetThread = nullptr;
......
...@@ -40,12 +40,6 @@ ...@@ -40,12 +40,6 @@
namespace campvis { namespace campvis {
const std::string AbstractPipeline::loggerCat_ = "CAMPVis.core.datastructures.AbstractPipeline"; const std::string AbstractPipeline::loggerCat_ = "CAMPVis.core.datastructures.AbstractPipeline";
void AbstractPipeline::debugMessageCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * message, const void * userParam)
{
std::cerr << "**** GL Debug Message Error: " << type << " " << id << " " << severity << " " << std::endl << message << std::endl;
}
AbstractPipeline::AbstractPipeline(DataContainer& dc) AbstractPipeline::AbstractPipeline(DataContainer& dc)
: HasPropertyCollection() : HasPropertyCollection()
, cgt::EventHandler() , cgt::EventHandler()
...@@ -80,11 +74,6 @@ namespace campvis { ...@@ -80,11 +74,6 @@ namespace campvis {
_painter->init(); _painter->init();
initAllProperties(); initAllProperties();
glDebugMessageCallback(&debugMessageCallback, this);
LGL_ERROR;
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, true);
LGL_ERROR;
// initialize all processors: // initialize all processors:
for (std::vector<AbstractProcessor*>::iterator it = _processors.begin(); it != _processors.end(); ++it) { for (std::vector<AbstractProcessor*>::iterator it = _processors.begin(); it != _processors.end(); ++it) {
try { try {
......
...@@ -230,10 +230,6 @@ namespace campvis { ...@@ -230,10 +230,6 @@ namespace campvis {
sigslot::signal0 s_deinit; sigslot::signal0 s_deinit;
protected: protected:
/// debug message callback registered to glDebugMessageCallback to catch OpenGL Errors
static void debugMessageCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam);
/** /**
* Forces the execution of the given processor regardless of its invalidation or enabled state. * Forces the execution of the given processor regardless of its invalidation or enabled state.
* \param processor Processor to execute. * \param processor Processor to execute.
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
**********************************************************************/ **********************************************************************/
#include "cgt/init.h" #include "cgt/init.h"
#include "cgt/cgt_gl.h"
#include "cgt/assert.h" #include "cgt/assert.h"
#include "cgt/glcanvas.h" #include "cgt/glcanvas.h"
...@@ -101,20 +102,11 @@ void initGL(GLCanvas* backgroundGlContext, InitFeature::Features featureset) { ...@@ -101,20 +102,11 @@ void initGL(GLCanvas* backgroundGlContext, InitFeature::Features featureset) {
TextureManager::init(); TextureManager::init();
if (featureset & InitFeature::GPU_PROPERTIES) { if (featureset & InitFeature::GPU_PROPERTIES )
GpuCapabilities::init(); GpuCapabilities::init();
#ifdef _MSC_VER #ifdef _MSC_VER
GpuCapabilitiesWindows::init(); GpuCapabilitiesWindows::init();
#endif #endif
}
// setup debug callback
if (featureset & InitFeature::GL_DEBUG_CALLBACK) {
glDebugMessageCallback(&debugMessageCallback, nullptr);
LGL_ERROR;
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, true);
LGL_ERROR;
}
// starting shadermanager // starting shadermanager
ShaderManager::init(); ShaderManager::init();
...@@ -140,11 +132,4 @@ void deinitGL() { ...@@ -140,11 +132,4 @@ void deinitGL() {
} }
void debugMessageCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * message, const void * userParam)
{
std::cerr << "**** GL Debug Message Error: " << type << " " << id << " " << severity << " " << std::endl << message << std::endl;
}
} // namespace } // namespace
...@@ -32,28 +32,25 @@ ...@@ -32,28 +32,25 @@
#include "cgt/types.h" #include "cgt/types.h"
#include "cgt/logmanager.h" #include "cgt/logmanager.h"
#include "cgt/cgt_gl.h"
namespace cgt { namespace cgt {
class GLCanvas; class GLCanvas;
class CGT_API InitFeature { class CGT_API InitFeature {
public: public:
enum Features { enum Features {
NONE = 0, NONE = 0,
LOG_MANAGER = 1 << 0, LOG_MANAGER = 1 << 0,
FILE_SYSTEM = 1 << 1, FILE_SYSTEM = 1 << 1,
GPU_PROPERTIES = 1 << 2, GPU_PROPERTIES = 1 << 2,
SCRIPT_MANAGER = 1 << 3, SCRIPT_MANAGER = 1 << 3,
SHADER_MANAGER = 1 << 4, SHADER_MANAGER = 1 << 4,
TEXTURE_MANAGER = 1 << 6, TEXTURE_MANAGER = 1 << 6,
TESSELATOR = 1 << 7, TESSELATOR = 1 << 7,
GL_DEBUG_CALLBACK = 1 << 8, LOG_TO_CONSOLE = 1 << 30,
LOG_TO_CONSOLE = 1 << 30, ALL = (
ALL = (
LOG_MANAGER | FILE_SYSTEM | GPU_PROPERTIES | LOG_MANAGER | FILE_SYSTEM | GPU_PROPERTIES |
SCRIPT_MANAGER | SHADER_MANAGER | SCRIPT_MANAGER | SHADER_MANAGER |
TEXTURE_MANAGER | TESSELATOR | GL_DEBUG_CALLBACK | TEXTURE_MANAGER | TESSELATOR |
LOG_TO_CONSOLE LOG_TO_CONSOLE
) )
}; };
...@@ -69,11 +66,7 @@ CGT_API void initGL(GLCanvas* backgroundGlContext, InitFeature::Features feature ...@@ -69,11 +66,7 @@ CGT_API void initGL(GLCanvas* backgroundGlContext, InitFeature::Features feature
CGT_API void deinit(); CGT_API void deinit();
/// deinit the singletons of cgt /// deinit the singletons of cgt
CGT_API void deinitGL(); CGT_API void deinitGL();
/// debug message callback registered to glDebugMessageCallback to catch OpenGL Errors
void debugMessageCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam);
}; };
#endif //CGT_INIT_H #endif //CGT_INIT_H
...@@ -29,18 +29,17 @@ ...@@ -29,18 +29,17 @@
#include "qtcanvas.h" #include "qtcanvas.h"
#include <QThread> #include <QThread>
#include <QOpenGLContext>
namespace cgt { namespace cgt {
// shared context widget // shared context widget
QOpenGLWidget* QtCanvas::shareWidget_ = 0; QGLWidget* QtCanvas::shareWidget_ = 0;
QtCanvas::QtCanvas(const std::string& title, QtCanvas::QtCanvas(const std::string& title,
const ivec2& size, const ivec2& size,
const Buffers buffers, const Buffers buffers,
QWidget* parent, bool shared, Qt::WindowFlags f, char* /*name*/) QWidget* parent, bool shared, Qt::WindowFlags f, char* /*name*/)
: QOpenGLWidget(parent, f) : QGLWidget(getQGLFormat(buffers), 0, (shared ? shareWidget_ : 0), f)
, GLCanvas(title, size, buffers) , GLCanvas(title, size, buffers)
{ {
resize(size.x, size.y); resize(size.x, size.y);
...@@ -53,7 +52,7 @@ QtCanvas::QtCanvas(const std::string& title, ...@@ -53,7 +52,7 @@ QtCanvas::QtCanvas(const std::string& title,
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
// we have our own AutoBufferSwap-mechanism (GLCanvas::setAutoFlush), so disable the one of qt // we have our own AutoBufferSwap-mechanism (GLCanvas::setAutoFlush), so disable the one of qt
//setAutoBufferSwap(false); // TODO jw: not sure what this does, figure out later setAutoBufferSwap(false);
rgbaSize_ = ivec4(format().redBufferSize(), rgbaSize_ = ivec4(format().redBufferSize(),
format().greenBufferSize(), format().greenBufferSize(),
...@@ -61,7 +60,7 @@ QtCanvas::QtCanvas(const std::string& title, ...@@ -61,7 +60,7 @@ QtCanvas::QtCanvas(const std::string& title,
format().alphaBufferSize()); format().alphaBufferSize());
stencilSize_ = format().stencilBufferSize(); stencilSize_ = format().stencilBufferSize();
depthSize_ = format().depthBufferSize(); depthSize_ = format().depthBufferSize();
doubleBuffered_ = format().swapBehavior() == QSurfaceFormat::DoubleBuffer; doubleBuffered_ = doubleBuffer();
stereoViewing_ = format().stereo(); stereoViewing_ = format().stereo();
connect(this, &QtCanvas::s_sizeChangedExternally, this, &QtCanvas::sizeChangedExternally); connect(this, &QtCanvas::s_sizeChangedExternally, this, &QtCanvas::sizeChangedExternally);
...@@ -69,13 +68,13 @@ QtCanvas::QtCanvas(const std::string& title, ...@@ -69,13 +68,13 @@ QtCanvas::QtCanvas(const std::string& title,
} }
QtCanvas::QtCanvas(QWidget* parent, bool shared, Qt::WindowFlags f, char* /*name*/) QtCanvas::QtCanvas(QWidget* parent, bool shared, Qt::WindowFlags f, char* /*name*/)
: QOpenGLWidget(parent, f) : QGLWidget(getQGLFormat(), 0, (shared ? shareWidget_ : 0), f)
{ {
if (shared && shareWidget_ == 0) if (shared && shareWidget_ == 0)
shareWidget_ = this; shareWidget_ = this;
// we have our own AutoBufferSwap-mechanism (GLCanvas::setAutoFlush), so disable the one of qt // we have our own AutoBufferSwap-mechanism (GLCanvas::setAutoFlush), so disable the one of qt
//setAutoBufferSwap(false); setAutoBufferSwap(false);
rgbaSize_ = ivec4(format().redBufferSize(), rgbaSize_ = ivec4(format().redBufferSize(),
format().greenBufferSize(), format().greenBufferSize(),
...@@ -83,7 +82,7 @@ QtCanvas::QtCanvas(QWidget* parent, bool shared, Qt::WindowFlags f, char* /*name ...@@ -83,7 +82,7 @@ QtCanvas::QtCanvas(QWidget* parent, bool shared, Qt::WindowFlags f, char* /*name
format().alphaBufferSize()); format().alphaBufferSize());
stencilSize_ = format().stencilBufferSize(); stencilSize_ = format().stencilBufferSize();
depthSize_ = format().depthBufferSize(); depthSize_ = format().depthBufferSize();
doubleBuffered_ = format().swapBehavior() == QSurfaceFormat::DoubleBuffer; doubleBuffered_ = doubleBuffer();
stereoViewing_ = format().stereo(); stereoViewing_ = format().stereo();
} }
...@@ -91,7 +90,7 @@ QtCanvas::~QtCanvas() {} ...@@ -91,7 +90,7 @@ QtCanvas::~QtCanvas() {}
void QtCanvas::moveThreadAffinity(void* threadPointer) { void QtCanvas::moveThreadAffinity(void* threadPointer) {
QThread* qThreadPointer = static_cast<QThread*>(threadPointer); QThread* qThreadPointer = static_cast<QThread*>(threadPointer);
context()->moveToThread(qThreadPointer); this->context()->moveToThread(qThreadPointer);
} }
void* QtCanvas::getCurrentThreadPointer() { void* QtCanvas::getCurrentThreadPointer() {
...@@ -110,17 +109,16 @@ void QtCanvas::paintGL() { ...@@ -110,17 +109,16 @@ void QtCanvas::paintGL() {
} }
void QtCanvas::repaint() { void QtCanvas::repaint() {
QOpenGLWidget::update(); updateGL();
} }
void QtCanvas::update() { void QtCanvas::update() {
QOpenGLWidget::update(); QWidget::update();
} }
void QtCanvas::swap() { void QtCanvas::swap() {
//context()->swapBuffers(); QGLWidget::swapBuffers();
//QOpenGLWidget::makeCurrent(); QGLWidget::makeCurrent();
update();
} }
void QtCanvas::toggleFullScreen() { void QtCanvas::toggleFullScreen() {
...@@ -257,37 +255,25 @@ cgt::Event::Modifier QtCanvas::getModifier(QInputEvent* e) { ...@@ -257,37 +255,25 @@ cgt::Event::Modifier QtCanvas::getModifier(QInputEvent* e) {
return cgt::Event::Modifier(result); return cgt::Event::Modifier(result);
} }
QSurfaceFormat QtCanvas::getQGLSurfaceFormat(const Buffers buffers) { QGLFormat QtCanvas::getQGLFormat(const Buffers buffers) {
QSurfaceFormat format = getQGLSurfaceFormat(); QGLFormat format = getQGLFormat();
if (buffers & GLCanvas::ALPHA_BUFFER) format.setAlphaBufferSize(8); format.setAlpha(buffers & GLCanvas::ALPHA_BUFFER);
if (buffers & GLCanvas::DEPTH_BUFFER) format.setDepthBufferSize(24); format.setDepth(buffers & GLCanvas::DEPTH_BUFFER);
if (buffers & GLCanvas::DOUBLE_BUFFER) format.setSwapBehavior(QSurfaceFormat::DoubleBuffer); format.setDoubleBuffer(buffers & GLCanvas::DOUBLE_BUFFER);
format.setStencil(buffers & GLCanvas::STENCIL_BUFFER);
if (buffers & GLCanvas::STENCIL_BUFFER) format.setStencilBufferSize(8); format.setAccum(buffers & GLCanvas::ACCUM_BUFFER);
if (buffers & GLCanvas::ACCUM_BUFFER) {// TODO QSurfaceFormat does not support htis anymore? format.setStereo(buffers & GLCanvas::STEREO_VIEWING);
throw std::logic_error("Accumulation buffer not implemented directly on the surface."); format.setSampleBuffers(buffers & GLCanvas::MULTISAMPLING);
}
if (buffers & GLCanvas::STEREO_VIEWING) {
format.setOption(QSurfaceFormat::StereoBuffers);
}
if (buffers & GLCanvas::MULTISAMPLING) {
format.setSamples(2);
}
return format; return format;
} }
QSurfaceFormat QtCanvas::getQGLSurfaceFormat() QGLFormat QtCanvas::getQGLFormat()
{ {
QSurfaceFormat format; QGLFormat format = QGLFormat(QGL::NoDeprecatedFunctions);
format.setVersion(4, 3); format = QGLFormat(QGL::NoDeprecatedFunctions);
format.setProfile(QSurfaceFormat::CoreProfile); format.setProfile(QGLFormat::CoreProfile);
format.setOption(QSurfaceFormat::DebugContext); //format.setVersion(3, 3);
format.setDepthBufferSize(24);
format.setStencilBufferSize(8);
//QSurfaceFormat::setDefaultFormat(format);
return format; return format;
} }
...@@ -621,11 +607,11 @@ QSize QtCanvas::sizeHint() const { ...@@ -621,11 +607,11 @@ QSize QtCanvas::sizeHint() const {
} }
void QtCanvas::acquireAsCurrentContext() { void QtCanvas::acquireAsCurrentContext() {
QOpenGLWidget::makeCurrent(); QGLWidget::makeCurrent();
} }
void QtCanvas::releaseAsCurrentContext() { void QtCanvas::releaseAsCurrentContext() {
QOpenGLWidget::doneCurrent(); QGLWidget::doneCurrent();
} }
void QtCanvas::sizeChangedExternally(int w, int h) { void QtCanvas::sizeChangedExternally(int w, int h) {
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "cgt/glcanvas.h" #include "cgt/glcanvas.h"
#include "cgt/types.h" #include "cgt/types.h"
#include <QOpenGLWidget> #include <QGLWidget>
#include <QGLFormat> #include <QGLFormat>
#include <QMouseEvent> #include <QMouseEvent>
#include <QKeyEvent> #include <QKeyEvent>
...@@ -44,7 +44,7 @@ namespace cgt { ...@@ -44,7 +44,7 @@ namespace cgt {
/** /**
* Qt implementation of GLCanvas. Inherits QGLWidget and combines the Qt methods and cgt methods. * Qt implementation of GLCanvas. Inherits QGLWidget and combines the Qt methods and cgt methods.
*/ */
class CGT_API QtCanvas : public QOpenGLWidget, public GLCanvas { class CGT_API QtCanvas : public QGLWidget, public GLCanvas {
Q_OBJECT; Q_OBJECT;
public: public:
...@@ -150,8 +150,8 @@ public: ...@@ -150,8 +150,8 @@ public:
static cgt::MouseEvent::MouseButtons getButtons(QMouseEvent* e); static cgt::MouseEvent::MouseButtons getButtons(QMouseEvent* e);
static cgt::Event::Modifier getModifier(QInputEvent* e); static cgt::Event::Modifier getModifier(QInputEvent* e);
static KeyEvent::KeyCode getKey(int key); static KeyEvent::KeyCode getKey(int key);
static QSurfaceFormat getQGLSurfaceFormat(const Buffers buffers); static QGLFormat getQGLFormat(const Buffers buffers);
static QSurfaceFormat getQGLSurfaceFormat(); static QGLFormat getQGLFormat();
signals: signals:
void s_sizeChangedExternally(int w, int h); void s_sizeChangedExternally(int w, int h);
...@@ -161,8 +161,7 @@ protected slots: ...@@ -161,8 +161,7 @@ protected slots:
void changeFullScreen(bool fullscreen); void changeFullScreen(bool fullscreen);
protected: protected:
static QOpenGLWidget* shareWidget_; ///< widget that this canvas shares the OpenGL context with static QGLWidget* shareWidget_; ///< widget that this canvas shares the OpenGL context with
///< TODO: This is very bad design. Context sharing should happen on another level and not using a static
signals: signals:
void fullScreenChanged(bool fullscreen); void fullScreenChanged(bool fullscreen);
......
...@@ -41,8 +41,8 @@ uniform float _lambda; ...@@ -41,8 +41,8 @@ uniform float _lambda;
uniform float _minDepth; uniform float _minDepth;
uniform float _maxDepth; uniform float _maxDepth;
uniform vec4 _coldColor; uniform vec3 _coldColor;
uniform vec4 _warmColor; uniform vec3 _warmColor;
int _halfKernelDimension; int _halfKernelDimension;
float[25] _gaussKernel; float[25] _gaussKernel;
...@@ -116,10 +116,10 @@ void main() { ...@@ -116,10 +116,10 @@ void main() {
#ifdef USE_COLORCODING #ifdef USE_COLORCODING
float deltaDPlus = (deltaD > 0 ? deltaD : 0.0); float deltaDPlus = (deltaD > 0 ? deltaD : 0.0);
float deltaDMinus = (deltaD < 0 ? -deltaD : 0.0); float deltaDMinus = (deltaD < 0 ? -deltaD : 0.0);
curColor.rgb += (_coldColor.rgb * _coldColor.a * deltaDMinus + _warmColor.rgb * _warmColor.a * deltaDPlus) * _lambda; curColor.rgb += (_coldColor * deltaDMinus + _warmColor * deltaDPlus) * _lambda;
#else #else
if (deltaD < 0.0) { if (deltaD < 0.0) {
curColor.rgb += deltaD * _lambda * _warmColor.rgb; curColor.rgb += deltaD * _lambda;
} }
#endif #endif
......
...@@ -46,8 +46,8 @@ namespace campvis { ...@@ -46,8 +46,8 @@ namespace campvis {
, p_sigma("Sigma", "Sigma of Gaussian Filter", 2.f, 0.f, 10.f, 0.1f) , p_sigma("Sigma", "Sigma of Gaussian Filter", 2.f, 0.f, 10.f, 0.1f)
, p_lambda("Lambda", "Strength of Depth Darkening Effect", 10.f, 0.f, 150.f, 0.1f) , p_lambda("Lambda", "Strength of Depth Darkening Effect", 10.f, 0.f, 150.f, 0.1f)
, p_useColorCoding("UseColorCoding", "Cold/Warm Color Coding", false) , p_useColorCoding("UseColorCoding", "Cold/Warm Color Coding", false)
, p_coldColor("ColdColor", "Cold Color (Far Objects)", cgt::vec4(0.f, 0.f, 1.f, 1.0f)) , p_coldColor("ColdColor", "Cold Color (Far Objects)", cgt::vec3(0.f, 0.f, 1.f), cgt::vec3(0.f), cgt::vec3(1.f))
, p_warmColor("WarmColor", "Warm Color (Near Objects)", cgt::vec4(1.f, 0.f, 0.f, 1.0f)) , p_warmColor("WarmColor", "Warm Color (Near Objects)", cgt::vec3(1.f, 0.f, 0.f), cgt::vec3(0.f), cgt::vec3(1.f))
, _shader(0) , _shader(0)
, _glReduction(0) , _glReduction(0)
{ {
...@@ -100,9 +100,9 @@ namespace campvis { ...@@ -100,9 +100,9 @@ namespace campvis {
_shader->setUniform("_lambda", p_lambda.getValue()); _shader->setUniform("_lambda", p_lambda.getValue());
_shader->setUniform("_minDepth", minDepth); _shader->setUniform("_minDepth", minDepth);
_shader->setUniform("_maxDepth", maxDepth); _shader->setUniform("_maxDepth", maxDepth);
_shader->setUniform("_warmColor", p_warmColor.getValue());
if (p_useColorCoding.getValue()) { if (p_useColorCoding.getValue()) {
_shader->setUniform("_coldColor", p_coldColor.getValue()); _shader->setUniform("_coldColor", p_coldColor.getValue());
_shader->setUniform("_warmColor", p_warmColor.getValue());
} }
createAndAttachColorTexture(); createAndAttachColorTexture();
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include "core/pipeline/visualizationprocessor.h" #include "core/pipeline/visualizationprocessor.h"
#include "core/properties/datanameproperty.h" #include "core/properties/datanameproperty.h"
#include "core/properties/floatingpointproperty.h" #include "core/properties/floatingpointproperty.h"
#include "core/properties/colorproperty.h"
#include "modules/modulesapi.h" #include "modules/modulesapi.h"
...@@ -62,7 +61,7 @@ namespace campvis { ...@@ -62,7 +61,7 @@ namespace campvis {
/// \see AbstractProcessor::deinit /// \see AbstractProcessor::deinit
virtual void deinit(); virtual void deinit();
/// To be used in ProcessorFactory static methods /// To be used in ProcessorFactory static methods
static const std::string getId() { return "DepthDarkening"; }; static const std::string getId() { return "DepthDarkening"; };
/// \see AbstractProcessor::getName() /// \see AbstractProcessor::getName()
...@@ -81,8 +80,8 @@ namespace campvis { ...@@ -81,8 +80,8 @@ namespace campvis {
FloatProperty p_lambda; ///< strength of depth effect FloatProperty p_lambda; ///< strength of depth effect
BoolProperty p_useColorCoding; ///< Flag whether to use depth color coding BoolProperty p_useColorCoding; ///< Flag whether to use depth color coding
ColorProperty p_coldColor; ///< Cold color (color for far objects) Vec3Property p_coldColor; ///< Cold color (color for far objects)
ColorProperty p_warmColor; ///< Warm color (color for near objects) Vec3Property p_warmColor; ///< Warm color (color for near objects)