Re: [osg-users] VBO and vertex attribute data

2012-10-04 Thread Janna Terde
Ok I think it is working now with eometry->getVertexAttribArray(s_attributeIndex)->dirty(); Thank you :) -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50413#50413 ___ osg-users mailing list osg-us

Re: [osg-users] VBO and vertex attribute data

2012-10-04 Thread Janna Terde
Btw I am using osg 2.8.3-4, not sure if it could make any difference -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50412#50412 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lis

Re: [osg-users] VBO and vertex attribute data

2012-10-04 Thread Janna Terde
Hi Sebastian, I set the vertex attribute array this way: Code: geometry->setVertexAttribArray(s_attributeIndex, m_vertexAttributes.get()); geometry->setVertexAttribBinding(s_attributeIndex, osg::Geometry::BIND_PER_VERTEX); geometry->setVertexAttribNormalize(s_attributeIndex, GL_FALSE); and

Re: [osg-users] VBO and vertex attribute data

2012-10-04 Thread Sebastian Messerschmidt
Hi Janna, can you provide the bits of your code where you setup the attributes in the c++ code and the GLSL part where you access it? I've been using this feature for tangent-space attributes like forever and it simply works. The only thing to keep in mind is the slot numbers and names you are

Re: [osg-users] VBO and vertex attribute data

2012-10-03 Thread Janna Terde
Hi, I've tried to use gl_MultiTexCoord1 and do geometry->setTexCoordArray(1, secondTexCoords); instead of custom vertex attributes to pass my data and it seems to be working. Does anyone know if there is some kind of problem with using custom vertex attributes ( using methods like setVerte

Re: [osg-users] VBO and vertex attribute data

2012-10-03 Thread Janna Terde
This is being done and as I mention it works fine unless I try to use vertex buffer object. so lets say code like this works: Code: geometry->setVertexAttribArray(s_attributeIndex, m_vertexAttributes.get()); geometry->setVertexAttribBinding(s_attributeIndex, osg::Geometry::BIND_PER_VERTEX);

Re: [osg-users] VBO and vertex attribute data

2012-10-03 Thread Sebastian Messerschmidt
Hello Janna, If you use a shader program you'll have to bind the attributes to the program: const std::string name="v_tangent" program->addBindAttribLocation(name, index); Then in the vertex shader you can access the attribute via: attribute vec3 v_tangent; hth Sebastian Hi, I am working o

[osg-users] VBO and vertex attribute data

2012-10-02 Thread Janna Terde
Hi, I am working on optimizing existing code for height field. I've enabled VBO for height field geometry which seems to make draw time faster however it seems can not retrieve vertex attribute data in the vertex shader anymore. Is there a special way of using VBO with geometry which has additi