simpleraycaster.cpp 984 Bytes
Newer Older
schultezub's avatar
schultezub committed
1
2
3
4
5
6
7
8
9
#include "simpleraycaster.h"

#include "tgt/quadrenderer.h"
#include "core/datastructures/imagedatarendertarget.h"

namespace TUMVis {
    const std::string SimpleRaycaster::loggerCat_ = "TUMVis.modules.vis.SimpleRaycaster";

    SimpleRaycaster::SimpleRaycaster(GenericProperty<tgt::ivec2>& canvasSize)
10
        : RaycastingProcessor(canvasSize, "modules/vis/simpleraycaster.frag", true)
schultezub's avatar
schultezub committed
11
12
13
14
15
16
17
18
19
        , _targetImageID("targetImageID", "Output Image", "")
    {
        addProperty(&_targetImageID);
    }

    SimpleRaycaster::~SimpleRaycaster() {

    }

20
21
22
    void SimpleRaycaster::processImpl(DataContainer& data) {
        ImageDataRenderTarget* rt = new ImageDataRenderTarget(tgt::svec3(_renderTargetSize.getValue(), 1));
        rt->activate();
schultezub's avatar
schultezub committed
23

24
25
26
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
        tgt::QuadRenderer::renderQuad();
        LGL_ERROR;
schultezub's avatar
schultezub committed
27

28
29
        rt->deactivate();
        data.addData(_targetImageID.getValue(), rt);
schultezub's avatar
schultezub committed
30
31
    }
}