I think the best way is to use a SwitchMaterial. This way you use only
one core and can set multiple materials into the switchmaterial.
have a look at the examples/tutorials.

Josef

On Thu, Mar 6, 2008 at 2:47 AM, Sajjadul Islam <[EMAIL PROTECTED]> wrote:
> Hello Carsten,
>
>
> Thanks for the hint.
>
> As you have suggested to make the shallow copy i tried that and came up with
> the following error:
>
> mainShader.cpp: In function 'osg::NodePtr createSceneGraph()':
>  mainShader.cpp:346: error: conversion from 'osg::FieldContainerPtr' to
> non-scalar type
> 'osg::FCPtr<osg::FCPtr<osg::FCPtr<osg::FCPtr<osg::AttachmentContainerPtr,
> osg::NodeCore>, osg::Drawable>, osg::MaterialDrawable>, osg::Geometry>'
> requested
>  make: *** [mainShader.o] Error 1
>
> In  the OpenSG i found another code posted by Dirk, i tried that and it
> worked , but i wonder if the one you suggested is the same as Dirk's
>
>     NodePtr utah_teapot2 = OSG::cloneTree(utah_teapot1);
>
>
> The function that is posted by dirks seems to share the node core and
> creating a new Node.
>
>
> I am not sure what procedure would be efficient to render the same
> geometry(utah teapot in my case ), with different shader(which is a material
> property)
>  and i would like to render the same geometry with different material
> property that will be selected with the key-press event.
>
>
> Can you suggest anything based on performance and memory efficiency?
>
>
> Cheers,
>
> Sajjad
>
>
>
>
>
> -------------------------------------------------------------------------
>  This SF.net email is sponsored by: Microsoft
>  Defy all challenges. Microsoft(R) Visual Studio 2008.
>  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
>  Opensg-users mailing list
>  [email protected]
>  https://lists.sourceforge.net/lists/listinfo/opensg-users
>
>



-- 
Josef Grunig

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to