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 

FBO-RTT doubt


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
romulogcerqueira
User


Joined: 11 Jun 2015
Posts: 65
Location: Brazil

PostPosted: Mon Apr 30, 2018 10:22 pm    Post subject:
FBO-RTT doubt
Reply with quote

Hi Folks!

I have developed a GPU-based underwater imaging sonar simulator for real-time applications (for further details please refer to my last paper) using OSG + GLSL. The missing part is the reverberation effect, that can be represented by a ray-triangle intersection algorithm. This work uses precomputed information (normal and depth) during rasterization pipeline using shaders in order to calculate the simulated sonar data, however this way is restricted to primary reflections. To address the secondary reflections, I need to build a hybrid pipeline (rasterization and ray-triangle intersection), where the data computed in first shader (rasterization) will be used in second one (ray-triangle intersection) to produce the final precomputed information (normal and depth from both reflections). Once the data computed on fragment shader is not pixel level yet (they are ¨fragments¨), it is necessary to use the FBO-RTT to allow two shader passes:

FIRST PASS
-> output: primary reflections (as RTT texture)
SECOND PASS
-> output: RTT texture + secondary reflections (as fragment out vec4 data)

My main C++ classes are: NormaDepthMap, responsible by OSG node and shaders; and ImageViewCaptureTool, where the camera with GraphicsContext is configured (e.g. resolution and field-of-view) and the scene/shader image is grabbed from NormalDepthMap. I investigated a lot the related OSG examples (osgdeferred, osgmultiplerendertargets, osgprerender and stereomatch) and I`m aware how the FBO-RTT works, where each RTT texture needs one PRE_RENDER camera. My question is: how can I set the FBO-RTT setup for my scenario, once I have the main camera defined at ImageViewCaptureTool and the shaders at NormalDepthMap?

I already have the source codes to implement the RTT (from osgCookbook):
https://github.com/openscenegraph/OpenSceneGraph/blob/master/examples/osgdeferred/osgdeferred.cpp#L161

Source codes:
- NormalDepthMap.hpp: https://github.com/Brazilian-Institute-of-Robotics/simulation-normal_depth_map/blob/master/src/NormalDepthMap.hpp
- NormalDepthMap.cpp: https://github.com/Brazilian-Institute-of-Robotics/simulation-normal_depth_map/blob/master/src/NormalDepthMap.cpp
- ImageViewerCaptureTool.hpp: https://github.com/Brazilian-Institute-of-Robotics/simulation-normal_depth_map/blob/master/src/ImageViewerCaptureTool.hpp
- ImageViewerCaptureTool.cpp: https://github.com/Brazilian-Institute-of-Robotics/simulation-normal_depth_map/blob/master/src/ImageViewerCaptureTool.cpp

Thanks in advance,

Rômulo Cerqueira[/url]
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12132

PostPosted: Tue May 01, 2018 7:34 am    Post subject:
FBO-RTT doubt
Reply with quote

Hi Rômulo,

You don't say what problem you are having or what specific doubts you
have, so we don't have any clues to if there is problem we are looking
for or whether you just want a 3rd party view of whether the code is
sensible.

Once you provide so guidance on the problem you are having I'l have a
look at the code.

As general comment, the OSG can nest Render to Texture techniques (so
RTT passes can have other RTT passes that are enclosed in their
subgraphs and these will be rendered first) as well as allow you to
control rendering order explicitly using Camera::setRenderOrder(..).
This means you can chain any number of RTT passes together, it could
handle hundreds if you really wanted it to.

Robert.


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


Joined: 11 Jun 2015
Posts: 65
Location: Brazil

PostPosted: Sat May 12, 2018 4:36 pm    Post subject:
Reply with quote

Hi Robert,

thanks for your reply. Nowadays this topic is outdated. I will create a new topic in OSG forum and explain better the scenario. Thanks for the tip.
...

Thank you!

Cheers,
Rômulo
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General 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 Doubt regarding integrating shapefile... vinothrajendran4 VirtualPlanetBuilder [vpb] 5 Thu Feb 16, 2017 2:10 pm View latest post
No new posts osgpick example doubt Redbeard General 3 Wed Jun 02, 2010 6:37 pm View latest post
No new posts OSG lighting doubt nikhilsimha General 5 Fri May 21, 2010 1:50 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