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() {
out_Color = vec4((abs(texel.rgb) - vec3(_transferFunctionParams._intensityDomain.x)) / (_transferFunctionParams._intensityDomain.y - _transferFunctionParams._intensityDomain.x), 1.0);
}
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 {
out_Color = vec4(0.1, 0.6, 1.0, 0.75);
......@@ -89,10 +89,10 @@ void main() {
out_Color = lookupTF(_transferFunction, _transferFunctionParams, texel.r);
}
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) {
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 {
out_Color = vec4(0.1, 0.6, 1.0, 0.75);
......
......@@ -188,12 +188,17 @@ namespace campvis {
void AbstractPipeline::onEvent(tgt::Event* e) {
// copy and paste from tgt::EventHandler::onEvent() but without deleting e
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
if(listeners_[i]->getEventTypes() & e->getEventType() ){
else if (listeners_[i]->getEventTypes() & e->getEventType() ){
listeners_[i]->onEvent(e);
if (e->isAccepted())
break;
}
if (e->isAccepted())
break;
}
}
......
Markdown is supported
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