Hi, yes, I know this behavior with glVertexPointer/glNormalPointer/glTexCoordPointer/glColorPointer and I have found it useful in the past. However, are you sure that it is still supported with glVertexAttribPointer?
Anyway, I just wanted to point out that there could be a potential issue there, but maybe it works on other versions/platforms. Cheers, Peter On Mon, Mar 11, 2013 at 4:02 PM, Sergey Polischuk <pol...@yandex.ru> wrote: > Hi > > in lower gl versions, if buffer object is bound to GL_ARRAY_BUFFER, > pointer is offset in buffer, else pointer is treated as pointer to block of > vertex data in memory to be used as vertices. > > 11.03.2013, 18:09, "peter klosowski" <klo...@gmail.com>: > > Hi, > > From reading OpenGL documentation ( > http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribPointer.xml), I > have concluded that glVertexAttribPointer was designed for VBOs only. > Please correct me if I am wrong. > > In that case, OSG passing a raw pointer when using State:: > setUseVertexAttributeAliasing with VBOs disabled on the Geometry should > be regarded as a bug? > > Cheers, > Peter > > On Tue, Mar 5, 2013 at 6:23 PM, peter klosowski <klo...@gmail.com> wrote: > > Hi, > > Perfect, osgUtil::GLObjectsVisitor is just what I was looking for! > > However, I still wonder about the first part of my question. Are VBOs > inevitable when using State::setUseVertexAttributeAliasing? It seems that > otherwise OSG is trying to call glVertexAttribPointer with a raw pointer > rather than a VBO offset, ultimately failing to render the object ('invalid > framebuffer operation' and the object does not show up). > > Cheers, > Peter > > On Tue, Mar 5, 2013 at 9:55 AM, Sergey Polischuk <pol...@yandex.ru> wrote: > > Hi > > you can use osgUtil::GLObjectsVisitor, it have option to enable vbos on > drawables. > > Cheers. > > 05.03.2013, 04:07, "peter klosowski" <klo...@gmail.com>: > > Hi, > > In order to use modern shaders (without built-in OpenGL > uniforms/attributes) it is necessary > call State::setUseModelViewAndProjectionUniforms and > State::setUseVertexAttributeAliasing. This provides a bridge to the old > fixed-function approach, using a well defined set of names for sending the > respective values to the shaders. Therefore, it is possible to seamlessly > use existing OSG classes (Transformations, Geometries etc.). > > However, my question is the following: Does > State::setUseVertexAttributeAliasing also require to enable VBOs via > Geometry::setUseVertexBufferObjects? In my attached example, failing to do > so produces a warning and the object is not drawn: > > Warning: detected OpenGL error 'invalid framebuffer operation' at After > Renderer::compile > > Is it really necessary to manually enable VBOs for each geometry that is > rendered using such a shader? In particular, what about 3d models that are > imported with osgDB? What would be an elegant way to enable VBOs for all > geometries? > > Cheers, > Peter > , > > _______________________________________________ > 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 > > , > > _______________________________________________ > 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 > >
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org