Re: [osg-users] GPU Data Access
Hi, On 11/07/11 17:47, Martin Großer wrote: Hello, I have written a little application, which renders a scene into a texture. I use the frame buffer object, but my problem is, I need the data on the cpu after the rendering. I know that is the bottleneck, but I hope someone can give me a clever tip how I can do this without big delay. Maybe, is it possible to get access to the texture via a cuda program. Then I can do my procedure on the gpu and then I only transport the result back to the cpu? My procedure is quite simple. I have a depth map and I want to get the sum over all pixel values. There are some ideas about my problem? you can do this with osgCompute and its osgCUDA. It can read the OSG texture and then you can do some CUDA kung-foo on it. E.g. we've used thrust to make a histogram in GPU. Let me know if you need more help. jp Cheers Martin -- 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. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GPU Data Access
Hi, Couldn't this be done in a fragment shader ? Create a one by one pixel texture, to calculate the result. Give the corresponding fragment shader access to your fbo render, and sum up the values. Of course you would need a scaling factor to not leave float max boundary. The osgPPU HDRI example is doing a similar thing to calculate tone mapping. Cheers, ParticlePeter -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=41316#41316 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GPU Data Access
Hello, thank to all for these nice solutions. I will try these. Cheers Martin Original-Nachricht Datum: Tue, 12 Jul 2011 12:06:45 +0200 Von: Peter Wrobel particlepe...@gmx.de An: osg-users@lists.openscenegraph.org Betreff: Re: [osg-users] GPU Data Access Hi, Couldn't this be done in a fragment shader ? Create a one by one pixel texture, to calculate the result. Give the corresponding fragment shader access to your fbo render, and sum up the values. Of course you would need a scaling factor to not leave float max boundary. The osgPPU HDRI example is doing a similar thing to calculate tone mapping. Cheers, ParticlePeter -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=41316#41316 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- NEU: FreePhone - kostenlos mobil telefonieren! Jetzt informieren: http://www.gmx.net/de/go/freephone ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] GPU Data Access
Hello, I have written a little application, which renders a scene into a texture. I use the frame buffer object, but my problem is, I need the data on the cpu after the rendering. I know that is the bottleneck, but I hope someone can give me a clever tip how I can do this without big delay. Maybe, is it possible to get access to the texture via a cuda program. Then I can do my procedure on the gpu and then I only transport the result back to the cpu? My procedure is quite simple. I have a depth map and I want to get the sum over all pixel values. There are some ideas about my problem? Cheers Martin -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GPU Data Access
On 07/11/2011 11:47 AM, Martin Großer wrote: Hello, I have written a little application, which renders a scene into a texture. I use the frame buffer object, but my problem is, I need the data on the cpu after the rendering. I know that is the bottleneck, but I hope someone can give me a clever tip how I can do this without big delay. Maybe, is it possible to get access to the texture via a cuda program. Then I can do my procedure on the gpu and then I only transport the result back to the cpu? My procedure is quite simple. I have a depth map and I want to get the sum over all pixel values. OpenCL 1.1 has methods to exchange GL Textures and CL Image objects (i.e.: you can use an OpenGL texture as an OpenCL image object inside a CL program). To do this, you'd use the clCreateFromGLTexture2D() function in your OpenCL program. I've not done this myself, so I can't give you any code or specifics, but I do know that it's possible. I imagine that the latest CUDA version has similar functionality. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org