Major fix for AMD GPUs.

Apparently, glBindAttribLocation() does not work as planned with AMD GPUs. Therefore, all Shaders yielded black images. Replaced all attribute locations with hard-coded ones in the vertex shader and removed corresponding convenience function from cgt::Shader.

refs #382
parent fef9f926
...@@ -129,8 +129,6 @@ namespace campvis { ...@@ -129,8 +129,6 @@ namespace campvis {
void CampVisPainter::init() { void CampVisPainter::init() {
try { try {
_copyShader = ShdrMgr.load("core/glsl/passthrough.vert", "core/glsl/copyimage.frag", ""); _copyShader = ShdrMgr.load("core/glsl/passthrough.vert", "core/glsl/copyimage.frag", "");
_copyShader->setAttributeLocation(0, "in_Position");
_copyShader->setAttributeLocation(1, "in_TexCoords");
} }
catch (cgt::Exception& e) { catch (cgt::Exception& e) {
LFATAL("Encountered cgt::Exception: " << e.what()); LFATAL("Encountered cgt::Exception: " << e.what());
......
...@@ -111,8 +111,6 @@ namespace campvis { ...@@ -111,8 +111,6 @@ namespace campvis {
initAllProperties(); initAllProperties();
_paintShader = ShdrMgr.load("core/glsl/passthrough.vert", "application/glsl/datacontainerinspector.frag", ""); _paintShader = ShdrMgr.load("core/glsl/passthrough.vert", "application/glsl/datacontainerinspector.frag", "");
_paintShader->setAttributeLocation(0, "in_Position");
_paintShader->setAttributeLocation(1, "in_TexCoords");
createQuad(); createQuad();
// set this as painter to get notified when window size changes // set this as painter to get notified when window size changes
......
...@@ -152,11 +152,7 @@ namespace campvis { ...@@ -152,11 +152,7 @@ namespace campvis {
template<class T> template<class T>
void campvis::GenericGeometryTransferFunction<T>::initShader() { void campvis::GenericGeometryTransferFunction<T>::initShader() {
_shader = ShdrMgr.load("core/glsl/passthrough.vert", "core/glsl/passthrough.frag", ""); _shader = ShdrMgr.load("core/glsl/passthrough.vert", "core/glsl/passthrough.frag", "");
if (_shader != 0) { if (_shader == nullptr) {
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(2, "in_Color");
}
else {
LERROR("Could not create Shader for Rendering the TF into the lookup texture!"); LERROR("Could not create Shader for Rendering the TF into the lookup texture!");
} }
} }
......
// ================================================================================================
//
// This file is part of the CAMPVis Software Framework.
//
// If not explicitly stated otherwise: Copyright (C) 2012-2014, all rights reserved,
// Christian Schulte zu Berge <christian.szb@in.tum.de>
// Chair for Computer Aided Medical Procedures
// Technische Universitaet Muenchen
// Boltzmannstr. 3, 85748 Garching b. Muenchen, Germany
//
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
//
// ================================================================================================
void main() {
// just pass everything through to fragment shader.
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_Position = ftransform();
gl_FrontColor = gl_Color;
}
\ No newline at end of file
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
// //
// ================================================================================================ // ================================================================================================
in vec3 in_Position; ///< incoming vertex position layout(location = 0) in vec3 in_Position; ///< incoming vertex position
in vec3 in_TexCoord; ///< incoming texture coordinate layout(location = 1) in vec3 in_TexCoord; ///< incoming texture coordinate
in vec4 in_Color; ///< incoming color layout(location = 2) in vec4 in_Color; ///< incoming color
out vec3 ex_TexCoord; ///< outgoing texture coordinate out vec3 ex_TexCoord; ///< outgoing texture coordinate
out vec4 ex_Color; ///< outgoing color out vec4 ex_Color; ///< outgoing color
......
...@@ -70,8 +70,6 @@ namespace campvis { ...@@ -70,8 +70,6 @@ namespace campvis {
void RaycastingProcessor::init() { void RaycastingProcessor::init() {
VisualizationProcessor::init(); VisualizationProcessor::init();
_shader = ShdrMgr.loadWithCustomGlslVersion("core/glsl/passthrough.vert", "", _fragmentShaderFilename, generateHeader(), _customGlslVersion); _shader = ShdrMgr.loadWithCustomGlslVersion("core/glsl/passthrough.vert", "", _fragmentShaderFilename, generateHeader(), _customGlslVersion);
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
_minReduction = new GlReduction(GlReduction::MIN); _minReduction = new GlReduction(GlReduction::MIN);
_maxReduction = new GlReduction(GlReduction::MAX); _maxReduction = new GlReduction(GlReduction::MAX);
......
...@@ -100,8 +100,6 @@ namespace campvis { ...@@ -100,8 +100,6 @@ namespace campvis {
void SliceRenderProcessor::init() { void SliceRenderProcessor::init() {
VisualizationProcessor::init(); VisualizationProcessor::init();
_shader = ShdrMgr.loadWithCustomGlslVersion("core/glsl/passthrough.vert", "", _fragmentShaderFilename, getGlslHeader(), _customGlslVersion); _shader = ShdrMgr.loadWithCustomGlslVersion("core/glsl/passthrough.vert", "", _fragmentShaderFilename, getGlslHeader(), _customGlslVersion);
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
} }
void SliceRenderProcessor::deinit() { void SliceRenderProcessor::deinit() {
......
...@@ -61,8 +61,6 @@ namespace campvis { ...@@ -61,8 +61,6 @@ namespace campvis {
_fbo = new cgt::FramebufferObject(); _fbo = new cgt::FramebufferObject();
_copyShader = ShdrMgr.load("core/glsl/passthrough.vert", "core/glsl/copyimage.frag", ""); _copyShader = ShdrMgr.load("core/glsl/passthrough.vert", "core/glsl/copyimage.frag", "");
_copyShader->setAttributeLocation(0, "in_Position");
_copyShader->setAttributeLocation(1, "in_TexCoord");
} }
void ViewportSplitter::deinit() { void ViewportSplitter::deinit() {
......
...@@ -58,13 +58,6 @@ namespace campvis { ...@@ -58,13 +58,6 @@ namespace campvis {
LERROR("Could not load Shader for OpenGL reduction. Reduction will not work!"); LERROR("Could not load Shader for OpenGL reduction. Reduction will not work!");
return; return;
} }
_shader1d->setAttributeLocation(0, "in_Position");
_shader1d->setAttributeLocation(1, "in_TexCoord");
_shader2d->setAttributeLocation(0, "in_Position");
_shader2d->setAttributeLocation(1, "in_TexCoord");
_shader3d->setAttributeLocation(0, "in_Position");
_shader3d->setAttributeLocation(1, "in_TexCoord");
} }
GlReduction::~GlReduction() { GlReduction::~GlReduction() {
......
...@@ -1288,10 +1288,12 @@ void Shader::setAttribute(GLint index, const Vector4<GLuint>& v) { ...@@ -1288,10 +1288,12 @@ void Shader::setAttribute(GLint index, const Vector4<GLuint>& v) {
glVertexAttrib4uiv(index, v.elem); glVertexAttrib4uiv(index, v.elem);
} }
// ATTENTION: This method was deliberately deactivated, since it was not working as expected
// with AMD GPUs.
// Attribute locations // Attribute locations
void Shader::setAttributeLocation(GLuint index, const std::string& name) { //void Shader::setAttributeLocation(GLuint index, const std::string& name) {
glBindAttribLocation(id_, index, name.c_str()); // glBindAttribLocation(id_, index, name.c_str());
} //}
GLint Shader::getAttributeLocation(const string& name) { GLint Shader::getAttributeLocation(const string& name) {
GLint l; GLint l;
......
...@@ -393,7 +393,9 @@ public: ...@@ -393,7 +393,9 @@ public:
static void setAttribute(GLint index, const Vector4<GLuint>& v); static void setAttribute(GLint index, const Vector4<GLuint>& v);
// Attribute locations // Attribute locations
void setAttributeLocation(GLuint index, const std::string& name); // ATTENTION: This method was deliberately deactivated, since it was not working as expected
// with AMD GPUs.
// void setAttributeLocation(GLuint index, const std::string& name);
GLint getAttributeLocation(const std::string& name); GLint getAttributeLocation(const std::string& name);
// Normalized attributes // Normalized attributes
......
...@@ -106,8 +106,6 @@ namespace campvis { ...@@ -106,8 +106,6 @@ namespace campvis {
void AdvancedUsFusion::init() { void AdvancedUsFusion::init() {
VisualizationProcessor::init(); VisualizationProcessor::init();
_shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/advancedusvis/glsl/advancedusfusion.frag", generateHeader()); _shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/advancedusvis/glsl/advancedusfusion.frag", generateHeader());
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
} }
void AdvancedUsFusion::deinit() { void AdvancedUsFusion::deinit() {
......
...@@ -75,8 +75,6 @@ namespace campvis { ...@@ -75,8 +75,6 @@ namespace campvis {
VisualizationProcessor::init(); VisualizationProcessor::init();
_shader = ShdrMgr.loadWithCustomGlslVersion("core/glsl/passthrough.vert", "", "modules/advancedusvis/glsl/pointpredicateevaluator.frag", generateHeader(), "400"); _shader = ShdrMgr.loadWithCustomGlslVersion("core/glsl/passthrough.vert", "", "modules/advancedusvis/glsl/pointpredicateevaluator.frag", generateHeader(), "400");
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
p_histogram.s_headerChanged.connect(this, &PointPredicateEvaluator::onHistogramHeaderChanged); p_histogram.s_headerChanged.connect(this, &PointPredicateEvaluator::onHistogramHeaderChanged);
} }
......
...@@ -67,8 +67,6 @@ namespace campvis { ...@@ -67,8 +67,6 @@ namespace campvis {
VisualizationProcessor::init(); VisualizationProcessor::init();
_shader = ShdrMgr.loadWithCustomGlslVersion("core/glsl/passthrough.vert", "", "modules/advancedusvis/glsl/scanlinedistributioncomputation.frag", generateHeader(), "400"); _shader = ShdrMgr.loadWithCustomGlslVersion("core/glsl/passthrough.vert", "", "modules/advancedusvis/glsl/scanlinedistributioncomputation.frag", generateHeader(), "400");
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
_viewportSizeProperty->s_changed.disconnect(this); _viewportSizeProperty->s_changed.disconnect(this);
setPropertyInvalidationLevel(*_viewportSizeProperty, VALID); setPropertyInvalidationLevel(*_viewportSizeProperty, VALID);
......
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
// //
// ================================================================================================ // ================================================================================================
in vec3 in_Position; ///< incoming vertex position layout(location = 0) in vec3 in_Position; ///< incoming vertex position
in vec3 in_TexCoord; ///< incoming texture coordinate layout(location = 1) in vec3 in_TexCoord; ///< incoming texture coordinate
in vec4 in_Color; ///< incoming color layout(location = 2) in vec4 in_Color; ///< incoming color
out vec3 vert_TexCoord; ///< outgoing texture coordinate out vec3 vert_TexCoord; ///< outgoing texture coordinate
out vec4 vert_Color; ///< outgoing color out vec4 vert_Color; ///< outgoing color
......
...@@ -67,9 +67,6 @@ namespace campvis { ...@@ -67,9 +67,6 @@ namespace campvis {
void GeometryStrainRenderer::init() { void GeometryStrainRenderer::init() {
VisualizationProcessor::init(); VisualizationProcessor::init();
_shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/vis/glsl/geometrystrainrenderer.frag", ""); _shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/vis/glsl/geometrystrainrenderer.frag", "");
if (_shader != 0) {
_shader->setAttributeLocation(0, "in_Position");
}
} }
void GeometryStrainRenderer::deinit() { void GeometryStrainRenderer::deinit() {
......
...@@ -75,10 +75,6 @@ namespace campvis { ...@@ -75,10 +75,6 @@ namespace campvis {
void StrainFiberRenderer::init() { void StrainFiberRenderer::init() {
VisualizationProcessor::init(); VisualizationProcessor::init();
_shader = ShdrMgr.load("modules/columbia/glsl/strainfiberrenderer.vert", "modules/columbia/glsl/strainfiberrenderer.geom", "modules/columbia/glsl/strainfiberrenderer.frag", generateGlslHeader()); _shader = ShdrMgr.load("modules/columbia/glsl/strainfiberrenderer.vert", "modules/columbia/glsl/strainfiberrenderer.geom", "modules/columbia/glsl/strainfiberrenderer.frag", generateGlslHeader());
if (_shader != 0) {
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
}
invalidate(AbstractProcessor::INVALID_SHADER); invalidate(AbstractProcessor::INVALID_SHADER);
} }
......
...@@ -77,8 +77,6 @@ namespace campvis { ...@@ -77,8 +77,6 @@ namespace campvis {
void DevilImageReader::init() { void DevilImageReader::init() {
AbstractImageReader::init(); AbstractImageReader::init();
_shader = ShdrMgr.load("core/glsl/passthrough.vert", "core/glsl/copyimage.frag", "#define NO_DEPTH\n"); _shader = ShdrMgr.load("core/glsl/passthrough.vert", "core/glsl/copyimage.frag", "#define NO_DEPTH\n");
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
} }
void DevilImageReader::deinit() { void DevilImageReader::deinit() {
......
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
// //
// ================================================================================================ // ================================================================================================
in vec3 in_Position; ///< incoming vertex position layout(location = 0) in vec3 in_Position; ///< incoming vertex position
in vec3 in_TexCoord; ///< incoming texture coordinate layout(location = 1) in vec3 in_TexCoord; ///< incoming texture coordinate
in vec4 in_Color; ///< incoming color layout(location = 2) in vec4 in_Color; ///< incoming color
out vec3 vert_TexCoord; ///< outgoing texture coordinate out vec3 vert_TexCoord; ///< outgoing texture coordinate
out vec4 vert_Position; ///< outgoing world coordinates out vec4 vert_Position; ///< outgoing world coordinates
......
...@@ -82,10 +82,6 @@ namespace dti { ...@@ -82,10 +82,6 @@ namespace dti {
void FiberRenderer::init() { void FiberRenderer::init() {
VisualizationProcessor::init(); VisualizationProcessor::init();
_shader = ShdrMgr.load("modules/dti/glsl/fiberrenderer.vert", "modules/dti/glsl/fiberrenderer.geom", "modules/dti/glsl/fiberrenderer.frag", generateGlslHeader()); _shader = ShdrMgr.load("modules/dti/glsl/fiberrenderer.vert", "modules/dti/glsl/fiberrenderer.geom", "modules/dti/glsl/fiberrenderer.frag", generateGlslHeader());
if (_shader != 0) {
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
}
invalidate(AbstractProcessor::INVALID_SHADER); invalidate(AbstractProcessor::INVALID_SHADER);
} }
......
...@@ -117,8 +117,6 @@ namespace campvis { ...@@ -117,8 +117,6 @@ namespace campvis {
LDEBUG("Generated a " << w << " x "<< h << " texture atlas"); LDEBUG("Generated a " << w << " x "<< h << " texture atlas");
_shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/fontrendering/glsl/fontatlas.frag", ""); _shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/fontrendering/glsl/fontatlas.frag", "");
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
LGL_ERROR; LGL_ERROR;
} }
......
...@@ -64,8 +64,6 @@ namespace campvis { ...@@ -64,8 +64,6 @@ namespace campvis {
void IxpvCompositor::init() { void IxpvCompositor::init() {
VisualizationProcessor::init(); VisualizationProcessor::init();
_shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/ixpv/glsl/ixpvcompositor.frag", ""); _shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/ixpv/glsl/ixpvcompositor.frag", "");
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
} }
void IxpvCompositor::deinit() { void IxpvCompositor::deinit() {
......
...@@ -122,8 +122,6 @@ namespace campvis { ...@@ -122,8 +122,6 @@ namespace campvis {
void ManualTissueSegmenter::init() { void ManualTissueSegmenter::init() {
VisualizationProcessor::init(); VisualizationProcessor::init();
_shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/manualsegmentation/glsl/manualtissuesegmenter.frag", ""); _shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/manualsegmentation/glsl/manualtissuesegmenter.frag", "");
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
_controlPoints.push_back(std::map< int, std::vector< ControlPoint > >()); _controlPoints.push_back(std::map< int, std::vector< ControlPoint > >());
_segmentation.addLayer(TissueSegmentation::Layer()); _segmentation.addLayer(TissueSegmentation::Layer());
......
...@@ -93,12 +93,7 @@ namespace neuro { ...@@ -93,12 +93,7 @@ namespace neuro {
void MultiVolumeMprRenderer::init() { void MultiVolumeMprRenderer::init() {
VisualizationProcessor::init(); VisualizationProcessor::init();
_shader = ShdrMgr.load("modules/vis/glsl/geometryrenderer.vert", "modules/vis/glsl/geometryrenderer.geom", "modules/neuro/glsl/multivolumemprrenderer.frag", generateHeader()); _shader = ShdrMgr.load("modules/vis/glsl/geometryrenderer.vert", "modules/vis/glsl/geometryrenderer.geom", "modules/neuro/glsl/multivolumemprrenderer.frag", generateHeader());
if (_shader != nullptr) {
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
}
} }
void MultiVolumeMprRenderer::deinit() { void MultiVolumeMprRenderer::deinit() {
......
...@@ -90,16 +90,7 @@ namespace neuro { ...@@ -90,16 +90,7 @@ namespace neuro {
VisualizationProcessor::init(); VisualizationProcessor::init();
_eepShader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/neuro/glsl/multivolumeraycaster_eep.frag", generateHeader()); _eepShader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/neuro/glsl/multivolumeraycaster_eep.frag", generateHeader());
if (_eepShader != nullptr) {
_eepShader->setAttributeLocation(0, "in_Position");
_eepShader->setAttributeLocation(1, "in_TexCoord");
}
_rcShader = ShdrMgr.loadWithCustomGlslVersion("core/glsl/passthrough.vert", "", "modules/neuro/glsl/multivolumeraycaster_rc.frag", generateHeader(), "400"); _rcShader = ShdrMgr.loadWithCustomGlslVersion("core/glsl/passthrough.vert", "", "modules/neuro/glsl/multivolumeraycaster_rc.frag", generateHeader(), "400");
if (_rcShader != nullptr) {
_rcShader->setAttributeLocation(0, "in_Position");
_rcShader->setAttributeLocation(1, "in_TexCoord");
}
_vhm1 = new VoxelHierarchyMapper(); _vhm1 = new VoxelHierarchyMapper();
_vhm2 = new VoxelHierarchyMapper(); _vhm2 = new VoxelHierarchyMapper();
......
...@@ -67,12 +67,7 @@ namespace campvis { ...@@ -67,12 +67,7 @@ namespace campvis {
VisualizationProcessor::init(); VisualizationProcessor::init();
_shader2D = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/glgaussianfilter.frag", "#define GAUSSIAN_2D\n"); _shader2D = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/glgaussianfilter.frag", "#define GAUSSIAN_2D\n");
_shader2D->setAttributeLocation(0, "in_Position");
_shader2D->setAttributeLocation(1, "in_TexCoord");
_shader3D = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/glgaussianfilter.frag", "#define GAUSSIAN_3D\n"); _shader3D = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/glgaussianfilter.frag", "#define GAUSSIAN_3D\n");
_shader3D->setAttributeLocation(0, "in_Position");
_shader3D->setAttributeLocation(1, "in_TexCoord");
// create kernel buffer // create kernel buffer
cgt::TextureUnit inputUnit; cgt::TextureUnit inputUnit;
......
...@@ -64,8 +64,6 @@ namespace campvis { ...@@ -64,8 +64,6 @@ namespace campvis {
VisualizationProcessor::init(); VisualizationProcessor::init();
_shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/glgradientvolumegenerator.frag", generateHeader()); _shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/glgradientvolumegenerator.frag", generateHeader());
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
} }
void GlGradientVolumeGenerator::deinit() { void GlGradientVolumeGenerator::deinit() {
......
...@@ -63,12 +63,7 @@ namespace campvis { ...@@ -63,12 +63,7 @@ namespace campvis {
VisualizationProcessor::init(); VisualizationProcessor::init();
_shader2D = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/glimagecrop.frag", "#define GLIMAGECROP_2D\n"); _shader2D = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/glimagecrop.frag", "#define GLIMAGECROP_2D\n");
_shader2D->setAttributeLocation(0, "in_Position");
_shader2D->setAttributeLocation(1, "in_TexCoord");
_shader3D = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/glimagecrop.frag", "#define GLIMAGECROP_3D\n"); _shader3D = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/glimagecrop.frag", "#define GLIMAGECROP_3D\n");
_shader3D->setAttributeLocation(0, "in_Position");
_shader3D->setAttributeLocation(1, "in_TexCoord");
} }
void GlImageCrop::deinit() { void GlImageCrop::deinit() {
......
...@@ -62,12 +62,7 @@ namespace campvis { ...@@ -62,12 +62,7 @@ namespace campvis {
VisualizationProcessor::init(); VisualizationProcessor::init();
_shader2D = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/glimageresampler.frag", "#define GLRESAMPLER_2D\n"); _shader2D = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/glimageresampler.frag", "#define GLRESAMPLER_2D\n");
_shader2D->setAttributeLocation(0, "in_Position");
_shader2D->setAttributeLocation(1, "in_TexCoord");
_shader3D = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/glimageresampler.frag", "#define GLRESAMPLER_3D\n"); _shader3D = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/glimageresampler.frag", "#define GLRESAMPLER_3D\n");
_shader3D->setAttributeLocation(0, "in_Position");
_shader3D->setAttributeLocation(1, "in_TexCoord");
} }
void GlImageResampler::deinit() { void GlImageResampler::deinit() {
......
...@@ -67,8 +67,6 @@ namespace campvis { ...@@ -67,8 +67,6 @@ namespace campvis {
VisualizationProcessor::init(); VisualizationProcessor::init();
_shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/glintensityquantizer.frag", ""); _shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/glintensityquantizer.frag", "");
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
} }
void GlIntensityQuantizer::deinit() { void GlIntensityQuantizer::deinit() {
......
...@@ -71,12 +71,7 @@ namespace campvis { ...@@ -71,12 +71,7 @@ namespace campvis {
VisualizationProcessor::init(); VisualizationProcessor::init();
_erosionFilter = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/GlMorphologyFilter.frag", generateGlslHeader("min")); _erosionFilter = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/GlMorphologyFilter.frag", generateGlslHeader("min"));
_erosionFilter->setAttributeLocation(0, "in_Position");
_erosionFilter->setAttributeLocation(1, "in_TexCoord");
_dilationFilter = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/GlMorphologyFilter.frag", generateGlslHeader("max")); _dilationFilter = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/GlMorphologyFilter.frag", generateGlslHeader("max"));
_dilationFilter->setAttributeLocation(0, "in_Position");
_dilationFilter->setAttributeLocation(1, "in_TexCoord");
} }
void GlMorphologyFilter::deinit() { void GlMorphologyFilter::deinit() {
......
...@@ -62,8 +62,6 @@ namespace campvis { ...@@ -62,8 +62,6 @@ namespace campvis {
VisualizationProcessor::init(); VisualizationProcessor::init();
_shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/glsignaltonoiseratiofilter.frag", ""); _shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/preprocessing/glsl/glsignaltonoiseratiofilter.frag", "");
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
} }
void GlSignalToNoiseRatioFilter::deinit() { void GlSignalToNoiseRatioFilter::deinit() {
......
...@@ -74,8 +74,6 @@ namespace campvis { ...@@ -74,8 +74,6 @@ namespace campvis {
VisualizationProcessor::init(); VisualizationProcessor::init();
_shader = ShdrMgr.loadWithCustomGlslVersion("core/glsl/passthrough.vert", "", "modules/preprocessing/glsl/glvesselnessfilter.frag", "", "400"); _shader = ShdrMgr.loadWithCustomGlslVersion("core/glsl/passthrough.vert", "", "modules/preprocessing/glsl/glvesselnessfilter.frag", "", "400");
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
} }
void GlVesselnessFilter::deinit() { void GlVesselnessFilter::deinit() {
......
...@@ -26,14 +26,13 @@ ...@@ -26,14 +26,13 @@
#include "cgt/event/keyevent.h" #include "cgt/event/keyevent.h"
#include "cgt/openglgarbagecollector.h" #include "cgt/openglgarbagecollector.h"
#include "cgt/opengljobprocessor.h"
#include "cgt/painter.h" #include "cgt/painter.h"
#include "core/classification/geometry1dtransferfunction.h" #include "core/classification/geometry1dtransferfunction.h"
#include "core/classification/tfgeometry1d.h" #include "core/classification/tfgeometry1d.h"
#include "core/datastructures/renderdata.h" #include "core/datastructures/renderdata.h"
#include "core/tools/glreduction.h" #include "core/tools/glreduction.h"
#include "core/tools/job.h"
#include "core/tools/opengljobprocessor.h"
namespace campvis { namespace campvis {
static const GenericOption<nlopt::algorithm> optimizers[3] = { static const GenericOption<nlopt::algorithm> optimizers[3] = {
...@@ -117,7 +116,8 @@ namespace campvis { ...@@ -117,7 +116,8 @@ namespace campvis {