[osg-users] Swap parallel scenes?
Robert Osfield
robert.osfield at gmail.com
Tue Feb 20 08:20:36 PST 2018
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
<antoinerennuit at hotmail.com> wrote:
> 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
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
More information about the osg-users
mailing list