Hi Alex,

hmm, ok, it seems to be a solution, however I am not sure if this is a general 
one. I mean, what if for example the input texture is not 2D and the output 
texture is also not 2D. Then fbo will still overwrite current binding.

I would propose to try following solution:

glPushAttrib(GL_TEXTURE_BIT);
mFBO->apply(*info.getState());
glPopAttrib();

Alex, could you please try if this works for you? Based on the specifications 
of glPushAttrib this should store current texture bindings

cheers,
art



airion wrote:
> Hi,
> 
> the last days I was fighting the problem, that osgPPU rendering was not 
> working in the first frame. Normally, this is rarely noticeable, but I use it 
> for generating a texture, that does not change anymore - so I use osgPPU with 
> a single shot rendering and if the rendering is faulty, the error remains 
> visible for all the time.
> 
> I tracked the problem down to reside in UnitInOut::noticeBeginRendering(). 
> There "mFBO->apply(*info.getState());" causes the units output texture to be 
> generated in the first frame. This causes a glBindTexture() which brakes the 
> binding of the already bound input texture, so that rendering can not work in 
> this frame.
> 
> Please find attached fix, that restores the texture binding after applying 
> the FBO.
> 
> Regards,
> --Alex


------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=43933#43933





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to