As far as I can tell, glGetTexImage retrieve the whole texture data. If you want to read a subset of that, you'll have to read the framebuffer object with glReadBuffer/glReadPixels as suggested by Gordon.
-Fred ----- "Martin Aasen" <[email protected]> a écrit : > Hi, > > Thanks for the replies, guys! I think we are on to something, but I > have to make myself a bit more clear. > > What I want is a function like > > float getSample(Texture2D* tex, Vec2 pos), > > which will return the float value stored in tex at pos (tex is a float > 32 texture with one component) on demand. I would also need a function > that will read a subset of the texture, not only a single texel. I > guess I want the functionality provided by osg::Image::readPixels, but > I want to read from a specified texture, not the window frame buffer. > > I don't want to transfere the full texture image from GPU to CPU on > each frame, which is what I believe osgprerender does. Sorry for not > making this clear from the start. Any ideas on how to do this? > > > Cheers, > Martin > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=28748#28748 > > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

