[osg-users] Is it possible to load texture without applying to a drawable

Robert Osfield robert.osfield at gmail.com
Thu May 9 12:01:01 PDT 2019

Hi Steven,

It probably isn't directly related to the lack of Drawable but my
guess is that the subgraph you have it on isn;t being traversed by the
cull or draw traversal so isn't being applied.  We don't know enough
about your whole scene graph setup to know exactly what might be going

As a general note, the OSG's compile traversal will explicitly call
Texture::compileGLObjects() for any Texture's you have in the scene
graph when the compile traversal is called on the first frame.  If the
texture isn't added till after the first frame then you cold explictly
call Texture::compielGLObjects() within a Camera or other draw



On Thu, 9 May 2019 at 16:34, Steve Powers <stevenapowers at gmail.com> wrote:
> I am attempting to load a Texture2D into memory in order to pass the texture ID to a 3rd party OpenGL object that will use the ID within it's own drawable class.
> The issue is that the TextureObject attached to the texture is not getting instantiated and I think this is because it is not assigned to a drawable object and thus not getting visited.
> Instead, I set the texture to a stateset on an osg::Group node
> stateset = group->getOrCreateStateSet();
> stateset->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON);
> Is there a way to have this texture object instantiate without physically using the texture on a drawable?
> Thank you!
> Cheers,
> Steven
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

More information about the osg-users mailing list