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 

Problem with postfilter/rtt setup


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


Joined: 11 Dec 2012
Posts: 4

PostPosted: Wed Dec 12, 2012 10:49 am    Post subject:
Problem with postfilter/rtt setup
Reply with quote

Hi,

I have a slight problem with my tries to get some post processing working with osgCompute (most recent trunk version from today).

I have several textures attached to my cameras in a RTT manner, e.g. like this:
Code:

  textures.colorTex = new osgCuda::Texture2D;
  textures.colorTex->setName("color texture");
  textures.colorTex->setTextureWidth(__m_width);
  textures.colorTex->setTextureHeight(__m_height);
  textures.colorTex->setInternalFormat(GL_RGBA32F_ARB);
  textures.colorTex->setSourceFormat(GL_RGBA);
  textures.colorTex->setSourceType(GL_FLOAT);
  textures.colorTex->addIdentifier("SRC_COLORTEX");
  imageCamera->attach(osg::Camera::COLOR_BUFFER0, textures.colorTex);


All textures have the same format (GL_RGBA32F_ARB). What i want to do is the following: Put all textures in a osgCompute::Computation and use this to pass everything to our CUDA-based post-processing framework. Everything is rendered to a single screen-filling quad with an according target texture in the end.

Now to first check if everything works as it should, I just tried to play around a little with the memory mapping, but they didn't quite work as I expected them to do. To make this more clear: If I map something with MAP_XXX_TARGET, it seems to work alright (I can write to it and the result is also displayed later on). The problem arises when mapping as source, e.g. like this:
Code:

float* d_srcBuffer_color = (float*) _m_srcBuffer_color->map(osgCompute::MAP_HOST_SOURCE);


When I try to copy the values over to the target buffer (mapped with MAP_HOST_TARGET), it turns out that the whole d_srcBuffer_color seems to be filled with zeroes. I also tried to loop over the source buffer and tell me if there's any non-zero value, but no, there isn't.

So maybe you guys have some idea what's going wrong here. Could it also be a version conflict? Here are the versions I am currently using:

- OpenSceneGraph 3.0.1
- CUDA 5.0.35
- latest osgCompute trunk version (rev 509)

The examples work flawlessly, btw.

Thanks in advance Smile

...


Thank you!

Cheers,
Thorsten
Back to top
View user's profile Send private message
Thoro
Newbie


Joined: 11 Dec 2012
Posts: 4

PostPosted: Wed Dec 26, 2012 5:59 pm    Post subject:
Problem with postfilter/rtt setup
Reply with quote

Hi,

I have a slight problem with my tries to get some post processing working with osgCompute (most recent trunk version from today).

I have several textures attached to my cameras in a RTT manner, e.g. like this:

Code:

textures.colorTex = new osgCuda::Texture2D;
textures.colorTex->setName("color texture");
textures.colorTex->setTextureWidth(__m_width);
textures.colorTex->setTextureHeight(__m_height);
textures.colorTex->setInternalFormat(GL_RGBA32F_ARB);
textures.colorTex->setSourceFormat(GL_RGBA);
textures.colorTex->setSourceType(GL_FLOAT);
textures.colorTex->addIdentifier("SRC_COLORTEX");
imageCamera->attach(osg::Camera::COLOR_BUFFER0, textures.colorTex);




All textures have the same format (GL_RGBA32F_ARB). What i want to do is the following: Put all textures in a osgCompute::Computation and use this to pass everything to our CUDA-based post-processing framework. Everything is rendered to a single screen-filling quad with an according target texture in the end.

Now to first check if everything works as it should, I just tried to play around a little with the memory mapping, but they didn't quite work as I expected them to do. To make this more clear: If I map something with MAP_XXX_TARGET, it seems to work alright (I can write to it and the result is also displayed later on). The problem arises when mapping as source, e.g. like this:

Code:

float* d_srcBuffer_color = (float*) _m_srcBuffer_color->map(osgCompute::MAP_HOST_SOURCE);




When I try to copy the values over to the target buffer (mapped with MAP_HOST_TARGET), it turns out that the whole d_srcBuffer_color seems to be filled with zeroes. I also tried to loop over the source buffer and tell me if there's any non-zero value, but no, there isn't.

So maybe you guys have some idea what's going wrong here. Could it also be a version conflict? Here are the versions I am currently using:

- OpenSceneGraph 3.0.1
- CUDA 5.0.35
- latest osgCompute trunk version (rev 509)

The examples work flawlessly, btw.

Thanks in advance :)

...


Thank you!

Cheers,
Thorsten

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=51537#51537







------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Thoro
Newbie


Joined: 11 Dec 2012
Posts: 4

PostPosted: Wed Dec 26, 2012 9:25 pm    Post subject:
Reply with quote

Hi,

this has actually already been fixed soon after I had posted it. I simply didn't know I had to attach those additional observers so it's known when the texture is updated. After adding this, it works flawlessly. OsgCompute is really just what I've been looking for Smile

...


Thank you!

Cheers,
Thorsten
Back to top
View user's profile Send private message
Thoro
Newbie


Joined: 11 Dec 2012
Posts: 4

PostPosted: Thu Jan 24, 2013 1:26 pm    Post subject:
Problem with postfilter/rtt setup
Reply with quote

Hi,

this has actually already been fixed soon after I had posted it. I simply didn't know I had to attach those additional observers so it's known when the texture is updated. After adding this, it works flawlessly. OsgCompute is really just what I've been looking for :)

...


Thank you!

Cheers,
Thorsten

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=51713#51713







------------------
Post generated by Mail2Forum
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 A problem with regard to std:istream ... first_gle General 1 Fri May 26, 2017 6:11 am View latest post
No new posts Regarding Lod problem in osg Rambabu General 0 Fri Apr 28, 2017 5:12 am View latest post
No new posts osgFX::Outline Redraw Problem sshaw General 3 Tue Apr 25, 2017 6:51 pm View latest post
No new posts Scale problem while transforming obje... YuraIU02 General 1 Sat Apr 15, 2017 4:26 pm View latest post
No new posts OSG 3.4 and Qt 5 cmake problem. Found... Elias Tarasov General 1 Mon Apr 10, 2017 12:26 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