-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Thrall,
Bryan
Sent: Friday, November 14, 2008 10:10 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] shaders in OSG...


>Do these crashes go away if you run OSG single-threaded? It sounds like
>you might be changing the scenegraph at a point where it isn't safe to
>do so. In general, it is safe to change the scenegraph from an update
>callback, but otherwise you could have problems. Also, if you are making
>changes to a StateSet, you should mark it as DYNAMIC. See also below.

I have not tried running OSG single threaded. I have tried the changes both
before I call osgviewer.run() and in an update callback after the render
loop is going. Both have caused crashes.

I have not tried marking the StateSet as DYNAMIC unless that is the default
setting. I will look into this.


>See osg::Switch; you could create two child nodes, one with an empty
>Program, the other with the shaders. Have them both make the actual
>scenegraph their child; then you can use the Switch to determine whether
>the fixed pipeline is used or not.

Thanks for this suggestion. I will look into this further...

-Shayne

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Mike
> Weiblen
> Sent: Thursday, November 13, 2008 11:33 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] shaders in OSG...
> 
> The only way to turn off a glProgram in GL is glUseProgram(0), there
> is no glEnable/glDisable.
> 
> In OSG you do that by creating an "empty" osg::Program, one with no
> osg::Shaders attached.  Just attach that empty osg::Program where you
> want to revert to fixed-function.  Further details in
> http://mew.cx/osg_glsl_july2005.pdf
> 
> cheers
> -- mew
> 
> 
> 
> On Wed, Nov 12, 2008 at 2:55 PM, Tueller,  Shayne R Civ USAF AFMC 519
> SMXS/MXDEC <[EMAIL PROTECTED]> wrote:
>> Hello,
>> 
>> 
>> 
>> Is there a "light weight" way to turn off shaders in OSG without
unloading
>> the vertex and fragment shaders from the shader program?
>> 
>> 
>> 
>> My application needs to switch back and forth from the shader
pipeline to
>> the fixed pipeline and vice versa during runtime. This can be done at
the
>> OpenGL level by calling the function glUseProgramObject() to make the
quick
>> switch. Is there an equivalent in OpenSceneGraph?
>> 
>> 
>> 
>> Thanks in advance,
>> 
>> -Shayne
>> 
>> _______________________________________________
>> osg-users mailing list
>> [email protected]
>>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g



-- 
Bryan Thrall
FlightSafety International
[EMAIL PROTECTED]
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to