robertosfield wrote:
> Hi Qingjie,
>
>
> The osgTexture::TextureObject* osg::Texture::getTextureObject(uint contextID) method can be used to get the OSG's wrapper for the OpenGL texture object. The TextureObject::id() method returns the OpenGL texture object id.
>
>
> Robert.
>
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=65067#65067
Qingjie
robertosfield wrote:
> Hi Qingjie,
>
>
> The osgTexture::TextureObject* osg::Texture::getTextureObject(uint contextID) method can be used to get the OSG's wrapper for the OpenGL texture object. The TextureObject::id() method returns the OpenGL texture object id.
>
>
> Robert.
>
>
> On 8 September 2015 at 15:20, Qingjie Zhang < ()> wrote:
>
> > Hi,
> > I generated a texture2d with osg, to use the texture in CUDA, I have to get the corresponding "opengl texture" handle(GLuint), and then access to the texture by the handle in CUDA.
> > Now I don't know how to get the handle.
> > Many thanks for your reply!!!
> > ...
> >
> > Thank you!
> >
> > Cheers,
> > Qingjie
> >
> > ------------------
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=65061#65061 (http://forum.openscenegraph.org/viewtopic.php?p=65061#65061)
> >
> >
> >
> >
> >
> > _______________________________________________
> > osg-users mailing list
> > ()
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> >
>
>
> ------------------
> Post generated by Mail2Forum
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=65073#65073
Do you mean the DrawCallback in the Camera class, which contains
virtual void operator () (osg::RenderInfo& renderInfo) ? And here I can use the RenderInfo right?
As I know, the following code can get a contextID:
camera->getGraphicsContext()->getState()->getContextID();
Is this contextID same as the upper one?
And,
Thank you!
Qingjie.
robertosfield wrote:
> Hi Qingjie,
>
>
> The RenderInfo is managed by the my the rendering back end, it's passed to all draw callbacks and Drawables.
>
>
> Robert
>
>
> On 9 September 2015 at 04:29, Qingjie Zhang < ()> wrote:
>
> > Hi Robert,
> > I'm knowing that the RenderInfo->getContextID() can give me the contextID to use in the getTextureObject(uint contextID), but where can I get the RenderInfo? I searched the source code of Texture but did not find that..
> > Many thanks.
> >
> > Qingjie
> >
> >
> > robertosfield wrote:
> >
> > > Hi Qingjie,
> > >
> > >
> > > The osgTexture::TextureObject* osg::Texture::getTextureObject(uint contextID) method can be used to get the OSG's wrapper for the OpenGL texture object. The TextureObject::id() method returns the OpenGL texture object id.
> > >
> > >
> > > Robert.
> > >
> > >
> > > On 8 September 2015 at 15:20, Qingjie Zhang < ()> wrote:
> > >
> > >
> > > > Hi,
> > > > I generated a texture2d with osg, to use the texture in CUDA, I have to get the corresponding "opengl texture" handle(GLuint), and then access to the texture by the handle in CUDA.
> > > > Now I don't know how to get the handle.
> > > > Many thanks for your reply!!!
> > > > ...
> > > >
> > > > Thank you!
> > > >
> > > > Cheers,
> > > > Qingjie
> > > >
> > > > ------------------
> > > > Read this topic online here:
> > > > http://forum.openscenegraph.org/viewtopic.php?p=65061#65061 (http://forum.openscenegraph.org/viewtopic.php?p=65061#65061) (http://forum.openscenegraph.org/viewtopic.php?p=65061#65061 (http://forum.openscenegraph.org/viewtopic.php?p=65061#65061))
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > _______________________________________________
> > > > osg-users mailing list
> > > > ()
> > > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org))
> > > >
> > > >
> > >
> > >
> > > ------------------
> > > Post generated by Mail2Forum
> > >
> >
> >
> > ------------------
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=65073#65073 (http://forum.openscenegraph.org/viewtopic.php?p=65073#65073)
> >
> >
> >
> >
> >
> > _______________________________________________
> > osg-users mailing list
> > ()
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> >
> >
> >
>
>
> ------------------
> Post generated by Mail2Forum
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=65075#65075
Do you mean the DrawCallback in the Camera class, which contains
virtual void operator () (osg::RenderInfo& renderInfo) ? And here I can use the RenderInfo right?
As I know, the following code can get a contextID:
camera->getGraphicsContext()->getState()->getContextID();
Is this contextID same as the upper one?
But the function operator() int the callback does not run, I tried setPostDrawCallback() and setFinalDrawCallback(), they were the same.
I was thinking that the DrawCallback would run every frame...
Can you tell me when the callback runs?
And, to get the handle, is it right to attach DrawCallback to camera? If not, can you tell me the detailed method to get the handle?
Thank you,
Qingjie.
robertosfield wrote:
> Hi Qingjie,
> ------------------
> Post generated by Mail2Forum
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=65083#65083
I fount it! I'm so sorry for my carelessness.
Thank you soooo much!!
Qingjie.
robertosfield wrote:
> Hi Qingjie,
>
>
> > ------------------
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=65083#65083 (http://forum.openscenegraph.org/viewtopic.php?p=65083#65083)
> >
> >
> >
> >
> >
> > _______________________________________________
> > osg-users mailing list
> > ()
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> >
> >
> >
>
>
> ------------------
> Post generated by Mail2Forum
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=65118#65118