Hello Sergey, thank you, it is good to know. I am a little bit frustrated. I read about OpenGL 4.2 and transform feedback and was so happy about this. That sounds so easy to use. By now it is hard to implement a simple first example. :-(
I found this thread: http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg46962.html You made this example, right? So far, I don't understand all the stuff. Is this all necessary for transform feedback? I only need the follow functions, don't I? 1. glTransformFeedbackVaryings 2. glBindBufferBase 3. glBeginTransformFeedback 4. glEndTransformFeedback For example, is a loadShaderFromFile function necessary? Is this only necessary, because the glTransformFeedbackVaryings have to be between the compiling and linking of the shader? I think my first problem is I don't have any experience with OpenGL code embedded into osg code. Are there any examples, tutorials or articles about this? I will keep on trying! Cheers, Martin -------- Original-Nachricht -------- > Datum: Thu, 01 Mar 2012 19:34:42 +0400 > Von: Sergey Polischuk <pol...@yandex.ru> > An: OpenSceneGraph Users <osg-users@lists.openscenegraph.org> > Betreff: Re: [osg-users] GL_TRANSFORM_FEEDBACK_BUFFER_NV in OSG > Generally you should use interfaces provided by osg to get to opengl > functions, as they can have different pointers in different graphics contexts. > > so it goes like > > typedef void (APIENTRY * TransformFeedbackVaryings)(GLuint, GLsizei, const > GLchar **, GLenum); > TransformFeedbackVaryings _glTransformFeedbackVaryingsPtr; > if (!osg::setGLExtensionFuncPtr(_glTransformFeedbackVaryingsPtr, > "glTransformFeedbackVaryings" )) > if (!osg::setGLExtensionFuncPtr(_glTransformFeedbackVaryingsPtr, > "glTransformFeedbackVaryingsEXT" )) > //not supported :( > // so now you can use this pointer in this gc > > > also if you need some opengl functions, first check osg::GL2Extensions, it > may be already wrapped and initialized there. > All of this should be called with active graphics context > > > Cheers > > > 29.02.2012, 18:22, "Martin Groer" <grosser.mar...@gmx.de>: > > Hello, > > > > I tried this in my camera draw callback: > > > > virtual void operator()(const osg::Camera& camera) const > > { > > // GL-Context-ID > > GLuint gcID = _gc->getState()->getContextID(); > > > > // GL-Program-Handle > > osg::Program::PerContextProgram* pcp = _program->getPCP(gcID); > > GLuint prID=pcp->getHandle(); > > > > const char* varyings[1] = { "vPosition" }; > > glTransformFeedbackVaryings(prID, 1, varyings, GL_SEPARATE_ATTRIBS); > > } > > > > But when I want to compile this, I get the error > "glTransformFeedbackVaryings isn't defined". I searched in my includes and it > is in the glext.h > and glew.h defined. What is wrong? > > > > Cheers, > > Martin > > > > -------- Original-Nachricht -------- > > > >> Datum: Tue, 28 Feb 2012 10:45:16 -0700 > >> Von: Paul Martz <pma...@skew-matrix.com> > >> An: OpenSceneGraph Users <osg-users@lists.openscenegraph.org> > >> Betreff: Re: [osg-users] GL_TRANSFORM_FEEDBACK_BUFFER_NV in OSG > >> On 2/28/2012 9:10 AM, "Martin Großer" wrote: > >>> Hello Paul, > >>> > >>> In OpenGL I have to define the varying variables for the transform > >> feedback between the compiling and linking of the shader program. > >>> glTransformFeedbackVaryings(programHandle, 1, varyings, > >> GL_SEPARATE_ATTRIBS); > >>> How can I do this in OSG? > >> The same way. You can issue an OpenGL call any time you have a > current > >> context > >> (Camera pre draw callback, Drawable draw callback, etc). > >> > >> A quick glance at the Program header file reveals that you can get > the > >> program > >> ID with a call to: > >> osg::Program::getPCP(contextID)->getHandle(); > >>> Additinally I use osg 2.8.4 from the Fedora repository. > >>> > >>> Cheers, > >>> Martin > >>> > >>> -------- Original-Nachricht -------- > >>>> Datum: Mon, 27 Feb 2012 09:51:15 -0700 > >>>> Von: Paul Martz<pma...@skew-matrix.com> > >>>> An: OpenSceneGraph Users<osg-users@lists.openscenegraph.org> > >>>> Betreff: Re: [osg-users] GL_TRANSFORM_FEEDBACK_BUFFER_NV in OSG > >>>> Yes, it's possible, but there are no examples that I know of. You > might > >>>> try > >>>> binding a buffer object in a Camera pre-draw callback, for an > example > >> of > >>>> one > >>>> strategy. > >>>> -Paul > >>>> > >>>> On 2/27/2012 8:21 AM, "Martin Großer" wrote: > >>>>> Hello, > >>>>> > >>>>> Is it possible to use GL_TRANSFORM_FEEDBACK_BUFFER_NV extension in > >> osg? > >>>> I would like write back my vertex position data into a new Vertex > >> Buffer > >>>> Object. Is there any example about this? > >>>>> Cheers > >>>>> > >>>>> Martin > >>>> _______________________________________________ > >>>> osg-users mailing list > >>>> osg-users@lists.openscenegraph.org > >> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > >> _______________________________________________ > >> osg-users mailing list > >> osg-users@lists.openscenegraph.org > >> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > -- > > NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone! > > Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a > > _______________________________________________ > > osg-users mailing list > > osg-users@lists.openscenegraph.org > > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org