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 

Computation on a rendered texture quad


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


Joined: 30 May 2011
Posts: 3

PostPosted: Wed Feb 22, 2012 10:06 am    Post subject:
Computation on a rendered texture quad
Reply with quote

Hi,

What does the "applyAsRenderTarget" function do, and when should I call it ?

I have a TextureQuad with a osgCuda::TextureRect on it. The textureRect is updated every frame with a frame from a video.
I want to render the quad on the screen and use the same osgCuda::TextureRect in my Computation that is attached to the same scenegraph.
The computation only reads from the texture.

The problem is that when I call the map function, I get the "[osgCuda::TextureMemory::alloc()]: unable to register image object (cudaGraphicsGLRegisterImage())" error.

If I don't display the TextureQuad, then the errors goes away. But I need to display the TextureQuad. Do I need to call "applyAsRenderTarget" somewhere ??

Thank you!

Cheers,
Jaco
Back to top
View user's profile Send private message
jens.svt
User


Joined: 16 Mar 2009
Posts: 30

PostPosted: Mon Feb 27, 2012 1:52 pm    Post subject:
Reply with quote

Hi jcronje,

The method applyAsRenderTarget() or mapAsRenderTarget() is automatically called when
a GLMemoryTargetCallback is attached to a camera.
Please see the osgRTTDemo-example.
It is required in order to synchronize the memory spaces correctly.
You need to be shure that a GL-Context is ready in order to call applyAsRenderTarget().

Does it already work by now?

Best regards,
Jens
Back to top
View user's profile Send private message
jcronje
Newbie


Joined: 30 May 2011
Posts: 3

PostPosted: Tue Feb 28, 2012 9:34 am    Post subject:
Reply with quote

Hi,

I got it working, thanks.
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 obj plugin does not support diffuse a... Ralf Habacker General 1 Tue Sep 19, 2017 6:21 am View latest post
No new posts How to texture map Box/Sphere/Cone/Ca... pleopard General 2 Mon Aug 07, 2017 7:14 pm View latest post
No new posts Render to texture with GL3. Raizel General 3 Tue May 23, 2017 10:33 am View latest post
No new posts Fix FBX rotation matrix computation Farshid Lashkari Submission 1 Tue Apr 11, 2017 11:21 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


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