OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

How to postprocess the data in depth buffer using osgCompute?


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> osgCompute [osgCompute]
View previous topic :: View next topic  
Author Message
eastwood
Newbie


Joined: 25 Aug 2014
Posts: 2

PostPosted: Mon Aug 25, 2014 4:56 pm    Post subject:
How to postprocess the data in depth buffer using osgCompute?
Reply with quote

Hi,

This library is a great work for combing CUDA with OSG. I think osgCompute is just what I'm looking for. I'm trying to use osgCompute in a manner very similar to the example of osgComputeDemoApp which can be found in the forum.
However, my project needs to bind DEPTH_BUFFER instead of COLOR_BUFFER to the render texture, and then use the rendered depth information in the CUDA kernel. Here comes a problem. As the formats related to the depth buffer (GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT32, etc.) are not supported by CUDA, such error occurs:
[osgCuda::TextureMemory::alloc()]: unable to register image object (cudaGraphicsGLRegisterImage()). Not all GL formats are supported.
This problem troubles me a lot. So, how can I deliver the rendered depth information of the scene to the CUDA kernel by using osgCompute?


Thank you!

Cheers,
Jack
Back to top
View user's profile Send private message Send e-mail
sholmes
User


Joined: 05 Sep 2011
Posts: 62

PostPosted: Mon Aug 25, 2014 6:36 pm    Post subject:
Reply with quote

Hi,

Which version of osgCompute are you using? I think if you use the osgRTTDemo code from the latest osgCompute in svn as an example you should be able to render to a depth texture and pass that to a cuda kernel. it works for me.

CD
...


Thank you!

Cheers,
Conan
Back to top
View user's profile Send private message
eastwood
Newbie


Joined: 25 Aug 2014
Posts: 2

PostPosted: Wed Aug 27, 2014 7:12 am    Post subject:
Reply with quote

Hi sholmes,

Thanking you for your answers. Previously, I used osgCompute-1.1 and osgComputeDemoApp for my project. Now, taking your advice, I've check out the latest osgCompute from svn and I'm using the osgRTTDemo code as an example. However, I still can't map the depth texture to CUDA successfully. Such error still occurs:
osgCompute::Memory::Object: "": allocation of memory failed
My codes related to the depth texture are shown as follows:
Code:

......
rttTexture->setInternalFormat( GL_DEPTH_COMPONENT );
rttTexture->setSourceFormat( GL_DEPTH_COMPONENT );
rttTexture->setSourceType( GL_FLOAT );
......
targetTexture->setInternalFormat( GL_DEPTH_COMPONENT );
targetTexture->setSourceFormat( GL_DEPTH_COMPONENT );
targetTexture->setSourceType( GL_FLOAT );
......
rttCamera->attach(osg::Camera::DEPTH_BUFFER, rttTexture, 0, 0, false, 0, 0 );
......

I'm successful in rending a depth texture but fails to pass that to a CUDA kernel. Could you send me your depth texture codes that you have run successfully with osgCompute?

Thanks again!

Cheers,
Jack
Back to top
View user's profile Send private message Send e-mail
sholmes
User


Joined: 05 Sep 2011
Posts: 62

PostPosted: Wed Aug 27, 2014 4:23 pm    Post subject:
Reply with quote

I'll go back and look at my code, but it will be a few days before I can get to it.

eastwood wrote:
Hi sholmes,

Thanking you for your answers. Previously, I used osgCompute-1.1 and osgComputeDemoApp for my project. Now, taking your advice, I've check out the latest osgCompute from svn and I'm using the osgRTTDemo code as an example. However, I still can't map the depth texture to CUDA successfully. Such error still occurs:
osgCompute::Memory::Object: "": allocation of memory failed
My codes related to the depth texture are shown as follows:
Code:

......
rttTexture->setInternalFormat( GL_DEPTH_COMPONENT );
rttTexture->setSourceFormat( GL_DEPTH_COMPONENT );
rttTexture->setSourceType( GL_FLOAT );
......
targetTexture->setInternalFormat( GL_DEPTH_COMPONENT );
targetTexture->setSourceFormat( GL_DEPTH_COMPONENT );
targetTexture->setSourceType( GL_FLOAT );
......
rttCamera->attach(osg::Camera::DEPTH_BUFFER, rttTexture, 0, 0, false, 0, 0 );
......

I'm successful in rending a depth texture but fails to pass that to a CUDA kernel. Could you send me your depth texture codes that you have run successfully with osgCompute?

Thanks again!

Cheers,
Jack
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> osgCompute [osgCompute] All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Custom data within nodes or drawables arennuit General 2 Thu Aug 24, 2017 9:52 am View latest post
No new posts A problem of depth on osgText::Text i... gyw General 4 Mon Jul 10, 2017 7:29 am View latest post
No new posts Update to Depth Patitioner ravidavi General 2 Tue May 23, 2017 9:03 pm View latest post
No new posts How to replace the texture data in th... xdfanfan General 1 Wed Apr 05, 2017 12:44 pm View latest post
No new posts Multisampled FBO camera with shared d... HonzaS General 0 Fri Mar 17, 2017 3:19 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP