Commit 59646d0f authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Two fixes:

* Fixed possible endless loop in event evaluation of AbstractPipeline.
* Fixed 4-channel image rendering in datacontainerinspector.frag.
parent 7f0ac514
...@@ -75,7 +75,7 @@ void main() { ...@@ -75,7 +75,7 @@ void main() {
out_Color = vec4((abs(texel.rgb) - vec3(_transferFunctionParams._intensityDomain.x)) / (_transferFunctionParams._intensityDomain.y - _transferFunctionParams._intensityDomain.x), 1.0); out_Color = vec4((abs(texel.rgb) - vec3(_transferFunctionParams._intensityDomain.x)) / (_transferFunctionParams._intensityDomain.y - _transferFunctionParams._intensityDomain.x), 1.0);
} }
else if (_3dTextureParams._numChannels == 4) { else if (_3dTextureParams._numChannels == 4) {
out_Color = (abs(texel) - vec4(_transferFunctionParams._intensityDomain.x)) / (_transferFunctionParams._intensityDomain.y - _transferFunctionParams._intensityDomain.x); out_Color = vec4((abs(texel.rgb) - vec3(_transferFunctionParams._intensityDomain.x)) / (_transferFunctionParams._intensityDomain.y - _transferFunctionParams._intensityDomain.x), texel.a);
} }
else { else {
out_Color = vec4(0.1, 0.6, 1.0, 0.75); out_Color = vec4(0.1, 0.6, 1.0, 0.75);
...@@ -89,10 +89,10 @@ void main() { ...@@ -89,10 +89,10 @@ void main() {
out_Color = lookupTF(_transferFunction, _transferFunctionParams, texel.r); out_Color = lookupTF(_transferFunction, _transferFunctionParams, texel.r);
} }
else if (_2dTextureParams._numChannels == 3) { else if (_2dTextureParams._numChannels == 3) {
out_Color = vec4(abs(texel.rgb), 1.0); out_Color = vec4((abs(texel.rgb) - vec3(_transferFunctionParams._intensityDomain.x)) / (_transferFunctionParams._intensityDomain.y - _transferFunctionParams._intensityDomain.x), 1.0);
} }
else if (_2dTextureParams._numChannels == 4) { else if (_2dTextureParams._numChannels == 4) {
out_Color = (abs(texel) - vec4(_transferFunctionParams._intensityDomain.x)) / (_transferFunctionParams._intensityDomain.y - _transferFunctionParams._intensityDomain.x); out_Color = vec4((abs(texel.rgb) - vec3(_transferFunctionParams._intensityDomain.x)) / (_transferFunctionParams._intensityDomain.y - _transferFunctionParams._intensityDomain.x), texel.a);
} }
else { else {
out_Color = vec4(0.1, 0.6, 1.0, 0.75); out_Color = vec4(0.1, 0.6, 1.0, 0.75);
......
...@@ -188,14 +188,19 @@ namespace campvis { ...@@ -188,14 +188,19 @@ namespace campvis {
void AbstractPipeline::onEvent(tgt::Event* e) { void AbstractPipeline::onEvent(tgt::Event* e) {
// copy and paste from tgt::EventHandler::onEvent() but without deleting e // copy and paste from tgt::EventHandler::onEvent() but without deleting e
for (size_t i = 0 ; i < listeners_.size() ; ++i) { for (size_t i = 0 ; i < listeners_.size() ; ++i) {
// don't forward this event to ourselves - otherwise we'll end up with an endless loop.
if (listeners_[i] == this) {
tgt::EventListener::onEvent(e);
}
// check if current listener listens to the eventType of e // check if current listener listens to the eventType of e
if(listeners_[i]->getEventTypes() & e->getEventType() ){ else if (listeners_[i]->getEventTypes() & e->getEventType() ){
listeners_[i]->onEvent(e); listeners_[i]->onEvent(e);
}
if (e->isAccepted()) if (e->isAccepted())
break; break;
} }
} }
}
void AbstractPipeline::setCanvas(tgt::GLCanvas* canvas) { void AbstractPipeline::setCanvas(tgt::GLCanvas* canvas) {
_canvas = canvas; _canvas = canvas;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment