[osg-users] Removing Shader from Program

Per Fahlberg perfa at remograph.com
Mon Oct 29 12:28:23 PDT 2007


Hi Mike,

Thanks for your reply.
I'm not sure I understand what the corner cases are, but I had a go at 
implementing the shader detachment and for my tests it works.
If you don't mind could you have a look at my changes in case I have 
overlooked something before I submit them?
The changes is mainly in osg::Program where I have added two lists to 
PerContextProgram with shaders to attach and detach.

Regards,
Per

Mike Weiblen wrote:
> Hi,
>
> As I recall, shader detachment is not fully implemented in OSG.  GL has
> its own reference-counting and garbage-collection of attachments between
> glShaders and glPrograms, and putting a robust OSG wrapper around that
> revealed several tedious corner cases that seemed a bit too
> resource-intensive for the benefit.
>
> cheers
> -- mew
>
>
> On Thu, October 25, 2007 15:31, Per Fahlberg wrote:
>   
>> Hi,
>>
>> I'm having problems removing osg::Shader from osg::Program. If a
>> osg::Shader is removed from a osg::Program the program is relinked but
>> the I don't think the OpenGL shader object is detached from the OpenGL
>> program object and if you attach a new osg::Shader the corresponding
>> OpenGL shader object is never attached to the OpenGL program.
>>
>> I've attached a modifed GL2Scene.cpp from the osgshaders example which
>> shows the problem, if 'x' is hit the fragment shader is removed from the
>> program but the scene does not change.
>>
>> Regards,
>> Per
>>     
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>   

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Program
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20071029/0682929c/attachment-0002.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Shader
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20071029/0682929c/attachment-0004.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Program.cpp
Type: text/x-c++src
Size: 76997 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20071029/0682929c/attachment-0006.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Shader.cpp
Type: text/x-c++src
Size: 10374 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20071029/0682929c/attachment-0007.cpp>


More information about the osg-users mailing list