[osg-users] Correct way to modify Image used in a Texture2D (and have the Texture2D re-upload)

OpenSceneGraph Users osg-users at lists.openscenegraph.org
Wed Apr 15 04:07:45 PDT 2020


Calling dirty() on the image should be sufficient as the Texture2D will
check the modifiedCount on each time the texture is applied.  It's how
we've implemented things like video textures and has been working for a
long time.  It "should" work.

Put a check point or debug notice into the Texture/Texture2D::apply() code
to see if it's being applied correctly.

On Wed, 15 Apr 2020 at 12:00, OpenSceneGraph Users <
osg-users at lists.openscenegraph.org> wrote:

> I'm trying to figure out the correct way to notify Texture2D that I've
> modified the raw bytes of its underlying Image (previous set via setImage)
>
> I'm modifying the image data using image->data(), and then calling
> image->dirty() once modifications are complete. I can see this changes the
> 'modificationCount' of base-class BufferData, and if I write the image out
> to disk, it contains the changes. So, the image is being modified correctly.
>
> However, the Texture2D doesn't seem to to schedule a glTexSubImage2D (or
> similar ) on the next draw. What I'd be expecting is that Texture2D sees
> that the image modification count has changed, and uploads the new data.
>
> I tried to find other similar places in the code - eg the VncPlugin just
> calls 'dirty' on its Image as far as I can see.
>
> What else can I check to debug this?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "OpenSceneGraph Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osg-users+unsubscribe at googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/osg-users/7d933227-d014-4afd-a445-c7854d5cda26%40googlegroups.com
> <https://groups.google.com/d/msgid/osg-users/7d933227-d014-4afd-a445-c7854d5cda26%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20200415/3d54235b/attachment.html>


More information about the osg-users mailing list