[osg-users] Equivalent of glTexSubImage2D ?

Julien Valentin julienvalentin51 at gmail.com
Tue Feb 28 08:37:25 PST 2017


Hi steel
As we already said; it's difficult to understand what you want without code.
If I understand correctly you want to update a part of a texture with the content of an image...(to implement sprites?)
In this case There are:
directcall to 
Code:
Texture::applyTexImage2D_subload(State& state, GLenum target, const Image* image, GLsizei inwidth, GLsizei inheight, GLint inInternalFormat, GLint numMipmapLevels) const


or use a Textue2D::SubloadCallback 

But my humble opinion is it would be more efficient to work entirely with custom textures composition rtt with shaders...(it would intempestive RAM->VRAM  transfer bus killer)

cheers


Steal wrote:
> Hi,
> 
> I've been exploring my options, and have not found a decent solution.
> 
> In the osg prerender example, there's an image that's attached to a camera. It is attached to a texture with texture->setImage(0, image);, and the camera has a post-draw callback that inverts the colors on the image.
> 
> The image holds the pixels of the scene.
> 
> When we render the texture, the texture may see that it has a dirty image attachment.
> 
> The problem is that I don't want to dirty the whole image, which is 2048x2048.
> 
> Cheers,
> Johny
[/list]

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








More information about the osg-users mailing list