[osg-users] Selecting techniques for an osgEffect in Camera Callbacks

Florent Berthaut florent at hitmuri.net
Mon Sep 28 10:41:56 PDT 2015


Hi all,

I recently switched from Ogre to OpenSceneGraph so that I can take advantage of the OpenGL 3+ possiblities, but i'm facing some issues getting some of what was working in Ogre work in OSG.

What I need to do is to render the same scene on different windows, each with a different material "scheme" / technique. 

Right now, I have a CompositeViewer, and one view and camera per window. 
I have an Effect that I placed at the root of my scene, in which I added two techniques.
For now i am just trying to select technique 0 for the first view, and technique 1 for all the other views.
 
I have tried switching the selected technique in the camera initial render callback (I use the singlethread threading model), so that the effect should be set to the correct technique before rendering the scene from that view. It seems that the technique is being switched correctly (if I cout the selected technique after calling setSelected ... ) . 

However, the visual result I am getting is not correct at all, i for example get the visual result of technique 1 for the second view instead of the first, and technique 0 for the second.

Is there something I need to do in addition to selectTechnique to ensure that the effect uses the correct technique for each view ? Or should I do that somewhere else than in a camera callback ?

Thanks in advance for your help 

Regards ,

Florent

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








More information about the osg-users mailing list