16.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 662ce762 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Merge branch 'development' into 'master'

Development



See merge request !2
parents 9abcb3e4 cbd8ddaa
......@@ -59,7 +59,7 @@ namespace campvis {
_imageReader.p_targetImageID.addSharedProperty(&_ve.p_inputVolume);
Geometry1DTransferFunction* dvrTF = new Geometry1DTransferFunction(128, cgt::vec2(0.f, .05f));
Geometry1DTransferFunction* dvrTF = new Geometry1DTransferFunction(512, cgt::vec2(0.f, .05f));
dvrTF->addGeometry(TFGeometry1D::createQuad(cgt::vec2(.12f, .15f), cgt::col4(85, 0, 0, 128), cgt::col4(255, 0, 0, 128)));
dvrTF->addGeometry(TFGeometry1D::createQuad(cgt::vec2(.19f, .28f), cgt::col4(89, 89, 89, 155), cgt::col4(89, 89, 89, 155)));
dvrTF->addGeometry(TFGeometry1D::createQuad(cgt::vec2(.41f, .51f), cgt::col4(170, 170, 128, 64), cgt::col4(192, 192, 128, 64)));
......
......@@ -85,7 +85,8 @@ namespace campvis {
if (p_enableShading.getValue() == false || light != nullptr) {
// undo MIPMAP hack from RaycastingProcessor, as mipmapping results in artifacts during ray clipping...
const_cast<cgt::Texture*>(image->getTexture())->setFilter(cgt::Texture::LINEAR);
if (image->getTexture()->getFilter() != cgt::Texture::LINEAR)
const_cast<cgt::Texture*>(image->getTexture())->setFilter(cgt::Texture::LINEAR);
_shader->activate();
......
......@@ -29,6 +29,8 @@
#include "cgt/shadermanager.h"
#include "cgt/textureunit.h"
#include "core/classification/geometry1dtransferfunction.h"
#include "core/classification/tfgeometry1d.h"
#include "core/datastructures/imagedata.h"
#include "core/datastructures/renderdata.h"
#include "core/datastructures/imagerepresentationgl.h"
......@@ -47,6 +49,7 @@ namespace campvis {
, p_text("Text", "Text", "Ultrasound Title")
, p_fontFileName("FontFileName", "Path to the Font File to Use", "", StringProperty::OPEN_FILENAME)
, p_fontSize("FontSize", "Font Size", 20, 4, 100)
, p_tf("TransferFunction", "Transfer Function", new Geometry1DTransferFunction(512, cgt::vec2(-1.f, 1.f)))
, _shader(0)
, _grid(nullptr)
{
......@@ -59,6 +62,8 @@ namespace campvis {
addProperty(p_fontFileName);
addProperty(p_fontSize);
addProperty(p_tf);
p_fontFileName.setValue(ShdrMgr.completePath("/modules/fontrendering/fonts/FreeSans.ttf"));
}
......@@ -67,12 +72,13 @@ namespace campvis {
void UsFanRenderer::init() {
VisualizationProcessor::init();
_shader = ShdrMgr.load("modules/cudaconfidencemaps/glsl/usfanrenderer.vert", "modules/cudaconfidencemaps/glsl/usfanrenderer.frag", "");
_shader = ShdrMgr.load("modules/vis/glsl/usfanrenderer.vert", "modules/vis/glsl/usfanrenderer.frag", "");
// Creates the grid, with the origin at the center of the top edge, with the +y axis representing depth
_grid = GeometryDataFactory::createGrid(cgt::vec3(-0.5f, 1.0f, 0.0f), cgt::vec3(0.5f, 0.0f, 0.0f),
cgt::vec3(0.0f, 1.0f, 0.0f), cgt::vec3(1.0f, 0.0f, 0.0f),
32, 32);
static_cast<Geometry1DTransferFunction*>(p_tf.getTF())->addGeometry(TFGeometry1D::createHeatedBodyColorMap());
// Initialize font rendering
updateFontAtlas();
}
......@@ -121,11 +127,13 @@ namespace campvis {
viewportMatrix *= cgt::mat4::createTranslation(-bbCenter);
_shader->activate();
cgt::TextureUnit textureUnit;
cgt::TextureUnit textureUnit, tfUnit;
textureUnit.activate();
if (texture != nullptr)
texture->bind(_shader, textureUnit, "_texture", "_textureParams");
p_tf.getTF()->bind(_shader, tfUnit);
_shader->setUniform("_projectionMatrix", viewportMatrix);
_shader->setUniform("halfAngle", halfAngle);
_shader->setUniform("innerRadius", innerRadius);
......
......@@ -80,6 +80,8 @@ namespace campvis {
StringProperty p_fontFileName; ///< Path to the font file to use
IntProperty p_fontSize; ///< Font size to use
TransferFunctionProperty p_tf;
protected:
/// \see AbstractProcessor::updateResult
virtual void updateResult(DataContainer& dataContainer);
......
......@@ -48,6 +48,7 @@
#include "modules/vis/processors/sliceextractor.h"
#include "modules/vis/processors/slicerenderer2d.h"
#include "modules/vis/processors/slicerenderer3d.h"
#include "modules/vis/processors/usfanrenderer.h"
#include "modules/vis/processors/virtualmirrorcombine.h"
#include "modules/vis/processors/virtualmirrorgeometrygenerator.h"
#include "modules/vis/processors/volumeexplorer.h"
......@@ -79,6 +80,7 @@ namespace campvis {
template class SmartProcessorRegistrar<SliceExtractor>;
template class SmartProcessorRegistrar<SliceRenderer2D>;
template class SmartProcessorRegistrar<SliceRenderer3D>;
template class SmartProcessorRegistrar<UsFanRenderer>;
template class SmartProcessorRegistrar<VirtualMirrorCombine>;
template class SmartProcessorRegistrar<VirtualMirrorGeometryGenerator>;
template class SmartProcessorRegistrar<VolumeExplorer>;
......
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