Commit 0dd9b3da authored by schultezub's avatar schultezub
Browse files

Fixed RenderTargets of ray casters messing with the already bound textures

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@228 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent d9f37c2b
......@@ -75,7 +75,6 @@ namespace TUMVis {
_transferFunction.getTF()->bind(_shader, tfUnit);
if (! _bindEntryExitDepthTextures) {
// FIXME: something is somehow wrong here - see DRRRaycaster...
entryPoints->bind(_shader, &entryUnit, 0, "_entryPoints");
exitPoints->bind(_shader, &exitUnit, 0, "_exitPoints");
processImpl(data);
......
......@@ -80,6 +80,9 @@ namespace TUMVis {
* Put additional (processor specific) setup code here, create and activate your render target(s), render
* your quad and store your results in \a data.
*
* \note When creating new render targets, pleas make sure to activate a new TextureUnit first or
* one of the previous bound textures (volume, TF, entry-/exit points) will be destroyed!
*
* \sa RaycastingProcessor::process()
* \param data DataContainer to work on.
*/
......
......@@ -7,7 +7,7 @@ namespace TUMVis {
const std::string DRRRaycaster::loggerCat_ = "TUMVis.modules.vis.DRRRaycaster";
DRRRaycaster::DRRRaycaster(GenericProperty<tgt::ivec2>& canvasSize)
: RaycastingProcessor(canvasSize, "modules/vis/drrraycaster.frag", true) // FIXME: the last parameter should be false, but it results in a wrong rendering
: RaycastingProcessor(canvasSize, "modules/vis/drrraycaster.frag", false)
, _targetImageID("targetImageID", "Output Image", "")
, _shift("shift", "Normalization Shift", 0.f, -10.f, 10.f)
, _scale("scale", "Normalization Scale", 1.f, 0.f, 1000.f)
......@@ -27,6 +27,8 @@ namespace TUMVis {
_shader->setUniform("_shift", _shift.getValue());
_shader->setUniform("_scale", _scale.getValue());
tgt::TextureUnit rtUnit;
rtUnit.activate();
ImageDataRenderTarget* rt = new ImageDataRenderTarget(tgt::svec3(_renderTargetSize.getValue(), 1));
rt->activate();
......
......@@ -18,6 +18,8 @@ namespace TUMVis {
}
void SimpleRaycaster::processImpl(DataContainer& data) {
tgt::TextureUnit rtUnit;
rtUnit.activate();
ImageDataRenderTarget* rt = new ImageDataRenderTarget(tgt::svec3(_renderTargetSize.getValue(), 1));
rt->activate();
......
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