J-S, 

At this point, anything will help. I believe I'm using a ref pointer but I
will double check. I tried following the paradigm outlined in the osgshaders
example which seems to be "newing" the same way I'm doing below (i.e. new
osg::Program).

The reason for the postdraw callback is that I'm rendering OGL symbology on
top of an OSG view. I don't want the shader to be on when I render the
symbology. Perhaps I need to turn shaders off in an update callback before
the post drawback is hit.?.?

FYI, the OSG and OGL are sharing the same render context but I'm pushing and
popping state appropriately...

On the complete program, it's a little difficult to include everything since
my email machine is different from my development machine. If it's needed, I
could try to include the whole program as an attachment...

What's your pleasure?

-Shayne

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Jean-Sébastien Guay
Sent: Friday, November 14, 2008 12:41 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] shaders in OSG...

Hi Shayne,

> // shader code done at setup time
> tgpProgram = new osg::Program();

...

> emptyProgram = new osg::Program();

First, I don't know if you meant not to put the type here, but I hope 
you're storing these in ref_ptr<osg::Program>. Otherwise, you create the 
program (refCount = 0), then you attach the program to some node 
(refCount = 1), then detach it (refCount=0, the program is deleted) and 
thus you're using a dangling pointer the next time you try to attach it 
to a node.

Second, you're running the code in a draw callback, and not an update 
callback. You need to run it in an update callback. The draw traversal 
(even the end of the draw traversal) is not a safe place to be modifying 
the scene graph.

Can you send us a complete program that shows the problem? It's much 
easier that way around.

Hope this helps,

J-S
-- 
______________________________________________________
Jean-Sebastien Guay    [EMAIL PROTECTED]
                                http://www.cm-labs.com/
                         http://whitestar02.webhop.org/
_______________________________________________
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