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 

Swap parallel scenes?


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


Joined: 06 Dec 2013
Posts: 70

PostPosted: Tue Feb 20, 2018 1:53 pm    Post subject:
Swap parallel scenes?
Reply with quote

Dear OSG forum,

I have a dense mesh for which I have computed a per vertex curvature. Now I need to capture a snapshot of this mesh colorized according to the curvature (something like the bunny image attached to the message). This is only a snapshot to be stored into an array and I do not intend to display the curvature-highlighted mesh (well this could be a temporary display, but definitely not a permanent one).

I was thinking of having a primary scene for my usual display and a secondary scene for the curvature-highlighted render, and then swap displays according to my needs. Is there a way to achieve such a behavior?

Thanks a lot,

Antoine.
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12148

PostPosted: Tue Feb 20, 2018 4:24 pm    Post subject:
Swap parallel scenes?
Reply with quote

HI Antoine,

You explanation of confuses me as it may well be trivial what you want
to do, but I really can't tell.

Are we talking about a single scene graph that you simple want to
render with different effects/shaders? If so then just have change
uniforms or shaders to get the result you want. From OSG-3.4 onwards
there is #pragma(tic) shader composition support built in which allows
you to toggle different code paths in the shaders by changing global
#define's via inherited osg::StateSet. This topic has been discussed
many times here on the osg-users mailing list/forum so have a look
through the archives. Also look at the osgshadercomposition example.

Or we talking about two separate subgraphs that you want to switch
between? If so then simple decorate the two subgraphs with an
osg::Swtich.

Robert.

On 20 February 2018 at 13:53, Antoine Rennuit
<> wrote:
Quote:
Dear OSG forum,

I have a dense mesh for which I have computed a per vertex curvature. Now I need to capture a snapshot of this mesh colorized according to the curvature (something like the bunny image attached to the message). This is only a snapshot to be stored into an array and I do not intend to display the curvature-highlighted mesh (well this could be a temporary display, but definitely not a permanent one).

I was thinking of having a primary scene for my usual display and a secondary scene for the curvature-highlighted render, and then swap displays according to my needs. Is there a way to achieve such a behavior?

Thanks a lot,

Antoine.

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








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


Joined: 06 Dec 2013
Posts: 70

PostPosted: Tue Feb 20, 2018 4:38 pm    Post subject:
Reply with quote

Robert,

Thanks a lot for your answer. From your answer it seems that I need a switch, thanks for making this clear.

Antoine.
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 Efficient way to swap colors arennuit General 3 Tue Sep 05, 2017 4:31 pm View latest post
No new posts Blurred scenes for camera in motion suraj General 0 Thu Feb 09, 2017 9:13 am View latest post
No new posts Camera Eye psotion in scenes with lar... suraj General 0 Sat Sep 24, 2016 5:03 am View latest post
No new posts switching between multiple sub-scenes... roozyGPLFX General 5 Sat Jul 16, 2016 12:59 pm View latest post
No new posts Multiples scenes Flogo General 4 Mon May 23, 2016 5:39 am 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