Hello to All,

I'm having a very specific issue using OpenSceneGraph. While using a texture 
shader I developped, I need to attach a texture to my object. But my texture 
need to be changed at each frame. However, I noticed that my texture is not 
updated in the next viewer.update() if my computer is very fast. If I slow down 
my computer it is correctly synchronized.

In other word, I'm looking for a way to way for a texture object to be 
propagated in the gpu buffer before rendering the frame.

As I'm using OpenSceneGraph for simulation purpose even 1 frame offset is not 
acceptable for me.


Basically the code can be summed up this way:

Code:

osg::Image IMAGE;
IMAGE->setImage(..., imageData, osg::Image::AllocationMode::NO_DELETE);

osg::StateSet *mystate = new osg::StateSet();
osg::Texture2D *texture = new osg::Texture2D();
texture->setImage(IMAGE);

(...)

for(int i=0;i<!viewer->done();++i)
{
IMAGE->setImage(..., ImageData[i], osg::Image::AllocationMode::NO_DELETE);


viewer->frame(ctime);
}



In this example when rendering the scene OSG sometimes uses the ImageData of 
index i-1 instead of index i


If anyone can help me I would be very happy.
Regards.

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





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

Reply via email to