* Allow execution of RenderTargetCompositor also if only a single input image...

* Allow execution of RenderTargetCompositor also if only a single input image is available and the compositing mode is set accordingly.
* Introducing allproperties.h
parent 3a1c27eb
// ================================================================================================
//
// 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.
//
// ================================================================================================
#ifndef ALLPROPERTIES_H__
#define ALLPROPERTIES_H__
#include "core/properties/buttonproperty.h"
#include "core/properties/cameraproperty.h"
#include "core/properties/datanameproperty.h"
#include "core/properties/floatingpointproperty.h"
#include "core/properties/metaproperty.h"
#include "core/properties/numericproperty.h"
#include "core/properties/optionproperty.h"
#include "core/properties/stringproperty.h"
#include "core/properties/transferfunctionproperty.h"
#endif // ALLPROPERTIES_H__
\ No newline at end of file
......@@ -88,7 +88,7 @@ namespace campvis {
ScopedTypedData<RenderData> firstImage(data, p_firstImageId.getValue());
ScopedTypedData<RenderData> secondImage(data, p_secondImageId.getValue());
if (firstImage != 0 && secondImage != 0 ) {
if ((p_compositingMethod.getOptionValue() == CompositingModeSecond || firstImage != nullptr) && (p_compositingMethod.getOptionValue() == CompositingModeFirst || secondImage != nullptr)) {
FramebufferActivationGuard fag(this);
createAndAttachColorTexture();
createAndAttachDepthTexture();
......@@ -96,8 +96,11 @@ namespace campvis {
_shader->activate();
tgt::TextureUnit firstColorUnit, firstDepthUnit, secondColorUnit, secondDepthUnit;
firstImage->bind(_shader, firstColorUnit, firstDepthUnit, "_firstColor", "_firstDepth", "_firstTexParams");
secondImage->bind(_shader, secondColorUnit, secondDepthUnit, "_secondColor", "_secondDepth", "_secondTexParams");
if (p_compositingMethod.getOptionValue() != CompositingModeSecond)
firstImage->bind(_shader, firstColorUnit, firstDepthUnit, "_firstColor", "_firstDepth", "_firstTexParams");
if (p_compositingMethod.getOptionValue() != CompositingModeFirst)
secondImage->bind(_shader, secondColorUnit, secondDepthUnit, "_secondColor", "_secondDepth", "_secondTexParams");
_shader->setUniform("_compositingMethod", p_compositingMethod.getOptionValue());
_shader->setUniform("_alpha", p_alphaValue.getValue());
_shader->setUniform("_enableBackground", p_enableBackground.getValue());
......
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