Hi all.
For a current project, we need a lot of image processing and similar
stuff that has to be done on the depthbuffer image of a particular
model. The current solution works for displaying it, but if I try to
save the image it's always black...
What works:
If someone presses a key, I create and add an fbo viewport to the
window (it's not needed every frame, so performance penalty of adding
and removing the viewport is not an issue). internal and external
format of the attached TextureChunk are set to GL_DEPTH_COMPONENT_ARB,
the image attached to that is GL_RGB.
* if I use this texture as an input to a simple shader that is applied
to the polygon of a PolygonForeground (just added another viewport for
testing), everything is displayed correctly - R, G and B got the same
values and it looks perfectly fine. However, if I try to return or
save that image (which is what I need for doing my processing), all I
get is a black image. What I thought should work (but doesn't) was
more or less this:
- setup the viewports, cameras etc.
- create the Image and the TextureChunk
...
and then:
beginEditCP(_window);
_window->addPort(_fboViewport);
endEditCP(_window);
RenderAction *act = RenderAction::create()
_window->render(act);
//remove viewport again.
/delete action
return image;
What's wrong about this approach? As the image is black, I assume that
the depth buffer is already cleared again. Is there a way to avoid
this? I tried to use a passive background on the fboviewport, but that
doesn't work either. Any ideas?
Yours,
Dominik
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users