Re: [osg-users] Equivalent of glTexSubImage2D ?

2017-03-03 Thread Johny Canes
Hi, For the lurker coming here for Awesomium, use the following code. The key is to use the unpack alignment settings. Very non optimized and copied from https://github.com/assertfail/bezel-webkit/blob/master/Source/wkSurface.cpp Code: void nr::awe::Drawer::operator() (const osg::Camera& cam)

Re: [osg-users] Equivalent of glTexSubImage2D ?

2017-03-02 Thread Johny Canes
Hi, Ow wow, yes. Thank you! Cheers, Johny -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=70392#70392 ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] Equivalent of glTexSubImage2D ?

2017-03-02 Thread Jannik Heller
Hi Johny, By default, OSG will run graphics operations in a separate thread so trying to do OpenGL calls from the main thread will not have an effect. Update callbacks are always invoked from the main thread. Try using a DrawCallback on a Drawable or Camera instead which will be invoked from

Re: [osg-users] Equivalent of glTexSubImage2D ?

2017-03-02 Thread Johny Canes
Hi, Oh it's throwing an INVALID_OPERATION Thank you! Cheers, Johny -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=70386#70386 ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] Equivalent of glTexSubImage2D ?

2017-03-02 Thread Johny Canes
Hi, I'll post a pretty print I know you guys like colors. https://codepaste.net/cwre47 The callback is attached with `texture->setUpdateCallback( new Painter() );` Cheers, Johny -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=70385#70385

Re: [osg-users] Equivalent of glTexSubImage2D ?

2017-03-02 Thread Robert Osfield
Hi Johny, On 2 March 2017 at 10:57, Johny Canes wrote: > On the upside, I've been studying the workings of OSG and looking at the > source code really helps. However, my glTexSubImage2D continues to have zero > effect on its code. I'm doing this via a operator StateAttribute

Re: [osg-users] Equivalent of glTexSubImage2D ?

2017-03-02 Thread Johny Canes
Hi, On the upside, I've been studying the workings of OSG and looking at the source code really helps. However, my glTexSubImage2D continues to have zero effect on its code. I'm doing this via a operator StateAttribute callback on the texture, binding it, then trying to write pixels. I've also

Re: [osg-users] Equivalent of glTexSubImage2D ?

2017-03-01 Thread Johny Canes
Hi, Thanks. Where would I put the callback? As a pre-callback for the quad that is rendered by the ortographic camera? Something like that sounds alright to me for a view(er) slave with its own graph. Currently though, texture->getTextureObject( cid )->bind(); and subsequently the

Re: [osg-users] Equivalent of glTexSubImage2D ?

2017-03-01 Thread Sebastian Messerschmidt
Hi Johny, Hi, Thanks for the amazing answers. I'm not trying for sprites, I'm for a repaint over an existing surface. The code below works on another project of mine, but I haven't got it working in my OSG app yet... What it does, it gives you an BGRA buffer for you to paint your existing

Re: [osg-users] Equivalent of glTexSubImage2D ?

2017-03-01 Thread Johny Canes
Hi, Thanks for the amazing answers. I'm not trying for sprites, I'm for a repaint over an existing surface. The code below works on another project of mine, but I haven't got it working in my OSG app yet... What it does, it gives you an BGRA buffer for you to paint your existing surface with.

Re: [osg-users] Equivalent of glTexSubImage2D ?

2017-02-28 Thread Robert Osfield
On 28 February 2017 at 12:04, Johny Canes wrote: > Hi, > > Mh Robert, it seems glTexSubImage2D is the most straightforward. I don't want > to build an abstraction around one simple operation. > > There's a couple of things now. Can I or may I manually bind using > Code: >

Re: [osg-users] Equivalent of glTexSubImage2D ?

2017-02-28 Thread Julien Valentin
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,

Re: [osg-users] Equivalent of glTexSubImage2D ?

2017-02-28 Thread Johny Canes
Hi, Mh Robert, it seems glTexSubImage2D is the most straightforward. I don't want to build an abstraction around one simple operation. There's a couple of things now. Can I or may I manually bind using Code: texture->getTextureObject( cid )->bind(); or alternatively, directly with Code:

Re: [osg-users] Equivalent of glTexSubImage2D ?

2017-02-28 Thread Johny Canes
Hi, https://github.com/xarray/osgRecipes/blob/master/integrations/osgawesomium/osgawesomium.cpp Someone seems to have made a tutorial. Cheers, Johny -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=70360#70360

Re: [osg-users] Equivalent of glTexSubImage2D ?

2017-02-28 Thread Johny Canes
Hello, Ah that's useful, ty. I was already thinking of hacking the OSG a little but no need. Johny -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=70359#70359 ___ osg-users mailing list

Re: [osg-users] Equivalent of glTexSubImage2D ?

2017-02-28 Thread Robert Osfield
HI Johny, The OSG isn't a mechanism that automatically subloads a portion of an osg::Image. However, there osg::Texture2D has a osg::Textuew2D::SubcloadCallback that you can subclass from and impement the load and subload methods. This gives you full control over creation of the texture object,

Re: [osg-users] Equivalent of glTexSubImage2D ?

2017-02-27 Thread Johny Canes
Hi, Without being mr mysterious, I am 'implementing' Awesomium. Thank you! Cheers, Johny -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=70357#70357 ___ osg-users mailing list

[osg-users] Equivalent of glTexSubImage2D ?

2017-02-27 Thread Johny Canes
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.