Re: [osg-users] How to use different shader for different cameras ?
Thanks for your answers ! But the special rendering-mode shader is not the same for all the objects, so how can I : - tell to object A : your special shader for special rendering mode is this one - tell to object B : your special shader for special rendering mode is this one - tell to object C : your special shader for special rendering mode is this one etc... ? Regards, Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=42415#42415 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to use different shader for different cameras ?
On 9/5/2011 1:49 AM, Aurelien Albert wrote: Thanks for your answers ! But the special rendering-mode shader is not the same for all the objects, so how can I : - tell to object A : your special shader for special rendering mode is this one - tell to object B : your special shader for special rendering mode is this one - tell to object C : your special shader for special rendering mode is this one Make two copies of the scene graph. Use DEEP_COPY_CHILDREN or which ever copyop is appropriate to copy only the elements you need. -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] How to use different shader for different cameras ?
Hi, I'm building an application based on OSG and I'm trying to have 2 viewports in my GUI, showing the same scene, but from different cameras, each camera having a rendering mode parameter. Everything works, but I don't know if there is an efficient way to manage the rendering mode parameter which should acts like that : - normal mode = standard rendering of the scene - special mode = special rendering of the scene (all objects should use an alternative shader) My problem is to render, simulteanously, the 2 cameras whith the different modes : is there any way to use different textures/colors/shaders on an object, depending on which camera is rendering it ? Regards, Aurelien ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to use different shader for different cameras ?
On 9/4/2011 2:12 PM, ALBERT Aurélien wrote: Hi, I'm building an application based on OSG and I'm trying to have 2 viewports in my GUI, showing the same scene, but from different cameras, each camera having a rendering mode parameter. Everything works, but I don't know if there is an efficient way to manage the rendering mode parameter which should acts like that : - normal mode = standard rendering of the scene - special mode = special rendering of the scene (all objects should use an alternative shader) My problem is to render, simulteanously, the 2 cameras whith the different modes : is there any way to use different textures/colors/shaders on an object, depending on which camera is rendering it ? Store the state for the first rendering on the first Camera, and store the state for the second rendering on the second Camera. -- -Paul Martz Skew Matrix Software http://www.skew-matrix.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org