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 

osgOcean: setting main camera to RTT


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> osgOcean [osgOcean]
View previous topic :: View next topic  
Author Message
Janne
User


Joined: 14 Oct 2009
Posts: 32

PostPosted: Tue Sep 18, 2012 9:38 pm    Post subject:
osgOcean: setting main camera to RTT
Reply with quote

Hi,

I am trying to implement a monochrome camera in my application, which is using osg::Ocean. However I've encountered a problem related to osg::Ocean.

What I am trying to do:
take the main camera and set it to use Frame Buffer Object and render into texture. Then I am adding a slave camera which will render a screen quad with the texture coming from the main camera and use my shader to create monochrome effect.

Everything works except setting main camera to use FBO and render into texture does nothing at all. If i remove osg:Ocean from the scene everything works.

I've tried this in osg::Ocean example too.

Code:

viewer.setSceneData( root );

osgViewer::ViewerBase::Views views;
viewer.getViews(views);

osgViewer::View* view = views[0];
osg::Camera* mainCamera = view->getCamera();
mainCamera>setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
viewer.realize();


Again if I have osg::Ocean inside of the scene setting FBO for main camera does not seems to do anything and everything works fine without osg::Ocean.

I assume it has to do something with the way osg::Ocean does it's passes. However I wonder if there is some way I can achieve my goal?

Thank you!

Cheers,
Janna
Back to top
View user's profile Send private message
Janne
User


Joined: 14 Oct 2009
Posts: 32

PostPosted: Wed Sep 19, 2012 3:57 pm    Post subject:
Reply with quote

Hi,

Seems to be working if I disable some effects such as glare and some underwater effects (I did not look exactly which ones are causing the problem).

Cheers,
Janna
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11275

PostPosted: Thu Sep 20, 2012 8:50 am    Post subject:
osgOcean: setting main camera to RTT
Reply with quote

Hi Janna,

On 19 September 2012 16:57, Janna Terde <> wrote:
Quote:
Seems to be working if I disable some effects such as glare and some underwater effects (I did not look exactly which ones are causing the problem).

I haven't used osgOcean for a little while but I recall an issue with
the osgOcean effects using render to texture and this conflicting with
effects that contain them due to the way that osgOcean was setting up
things, I vaguely recall that it might check for camera names so and
have some handling of this, so have a look at the sources of osgOcean
to see if you can understand how it's put together.

Robert.


------------------
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 -> osgOcean [osgOcean] 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 Resizing an FBO camera with OSG 3.2.0 James Turner General 0 Fri Dec 08, 2017 9:07 pm View latest post
No new posts How to simulate camera distortion ? blackball General 3 Fri Dec 08, 2017 11:16 am View latest post
No new posts When gets the view matrix of a camera... wernerM General 2 Sat Nov 18, 2017 4:08 pm View latest post
No new posts Camera collision with terrain ht11 General [3rdparty] 0 Fri Oct 13, 2017 7:34 am View latest post
No new posts How to set field of view of second sl... kefaline General [forum] 2 Wed Oct 04, 2017 1:29 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