* Fixed too early FBO activation in SliceExtractor and SliceRenderer3D

* Fixed pointer inconsistencies in ScopedTypedData and ScopedRepresentation
parent 39eb232a
......@@ -64,6 +64,9 @@ namespace campvis {
if (data != 0) {
representation = data->getRepresentation<T>();
}
if (data == 0 || representation == 0) {
dh = DataHandle(0);
}
}
};
......@@ -81,6 +84,9 @@ namespace campvis {
if (data != 0) {
representation = data->getRepresentation<T>();
}
if (data == 0 || representation == 0) {
dh = DataHandle(0);
}
}
};
......
......@@ -74,6 +74,9 @@ namespace campvis {
if (data != 0) {
representation = data->getRepresentation< GenericImageRepresentationLocal<BASETYPE, NUMCHANNELS> >();
}
if (data == 0 || representation == 0) {
dh = DataHandle(0);
}
}
};
......@@ -91,6 +94,9 @@ namespace campvis {
if (data != 0) {
representation = data->getRepresentation<ThisType>();
}
if (data == 0 || representation == 0) {
dh = DataHandle(0);
}
}
};
......
......@@ -55,6 +55,8 @@ namespace campvis {
{
if (dh.getData() != 0) {
data = dynamic_cast<const T*>(dh.getData());
if (data == 0)
dh = DataHandle(0);
}
};
......
......@@ -153,20 +153,20 @@ namespace campvis {
tgt::mat4 modelMatrix = (ratioRatio > 1) ? tgt::mat4::createScale(tgt::vec3(1.f, 1.f / ratioRatio, 1.f)) : tgt::mat4::createScale(tgt::vec3(ratioRatio, 1.f, 1.f));
// prepare OpenGL
FramebufferActivationGuard fag(this);
createAndAttachColorTexture();
createAndAttachDepthTexture();
_shader->activate();
decorateRenderProlog(data, _shader);
tgt::TextureUnit inputUnit, tfUnit;
img->bind(_shader, inputUnit);
p_transferFunction.getTF()->bind(_shader, tfUnit);
// render slice
_shader->setUniform("_texCoordsMatrix", texCoordsMatrix);
_shader->setUniform("_modelMatrix", modelMatrix);
_shader->setUniform("_useTexturing", true);
// render slice
FramebufferActivationGuard fag(this);
createAndAttachColorTexture();
createAndAttachDepthTexture();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
QuadRdr.renderQuad();
......
......@@ -101,10 +101,6 @@ namespace campvis {
const FaceGeometry& slice = clipped.getFaces().back(); // the last face is the closing face
delete cube;
FramebufferActivationGuard fag(this);
createAndAttachColorTexture();
createAndAttachDepthTexture();
glEnable(GL_DEPTH_TEST);
_shader->activate();
......@@ -120,6 +116,9 @@ namespace campvis {
img->bind(_shader, inputUnit);
p_transferFunction.getTF()->bind(_shader, tfUnit);
FramebufferActivationGuard fag(this);
createAndAttachColorTexture();
createAndAttachDepthTexture();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
slice.render(GL_POLYGON);
......
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