Hi Jens,
On 04/02/11 18:05, Jens Orthmann wrote:
Hi serkan, hi J.P.,
Here is a link to a simple example solving your problem:
http://www.cg.informatik.uni-siegen.de/data/Downloads/svt/osgComputeDemoApp.zip
We render a rotating cow into a texture then run a cuda-kernel and display the
result in the same scene.
You need to set the usage flags of your render targets to GL_TARGET, e.g. :
Target0->setUsage( osgCompute::GL_TARGET_COMPUTE_SOURCE ).
With this flag you tell the texture that it is used as a FBO.
Unfortunately, OpenSceneGraph does not call any function of osg::Texture when
it renders into a texture.
In other words something like texture->applyAsFBO() is missing.
So there is no way to get notified when this happens.
The only way to deal with this is to copy the texture memory each time a mapping
function is called (GPU->GPU which is still fast).
However, for this the user needs to setup the usage flag.
I added the flag and my test app is now working, thanks.
regards
jp
Additionally, with older drivers/CUDA versions (we are not sure about this) you
have to call MRTTexture->unmap() after your kernel has finished.
If you do not call unmap(), the MRTTexture is still mapped in the CUDA context
and OpenGL cannot render into it successfully.
Hopefully this helps,
Jens
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=36373#36373
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean. MailScanner thanks Transtec Computers for their support.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org