Hi Robert,

this is exactly what I did, I called dirty on the vertexArray which is passed 
each frame
to the geometry using 
geom->setVertexArray(vcoords); 
vcoords->dirty();

The problem was that, it screws up all other attached geometry arrays like 
(colors, normals, texcoords) which do not change.... 

This behavior does not occur when the geometry is not specified as VBO or in 
2.8. 
I can try to call dirty on all arrays whether they change or not, but it does 
not seem logical.

I attach a small example which show the problem (along with the makefile). The 
example
changes vertexArrays of a VBO geometry (a cube) at runtime using 2 different 
vertexArrays.
You should see a pulsating colored, textured cube if it runs fine.
Commenting/Uncommenting the dirty calls make, or disabling the VBO makes it 
clear.

Dimi




----- Original Message ----
From: Robert Osfield <[email protected]>
To: OpenSceneGraph Users <[email protected]>
Sent: Thu, May 19, 2011 3:52:06 PM
Subject: Re: [osg-users] VBO incosistencies between 2.8 and 2.912

Hi Dimi,

The buffer object support in the OSG has been revamped and in theory
should be robust and flexible... but like all code there is a chance
for regressions so wide spread testing it neccessary.  Whether in this
instance there is an actual bug, or just a different behaviour I can't
say as I haven't tested your code.

As a quick test I would suggest calling dirty on each array your modiy.

Robert.

On Thu, May 19, 2011 at 1:37 PM, dimi christop <[email protected]> wrote:
> Hi,
>
> I recently upgraded my code base to 2.912 (Linux, GTX 280) , unfortunately my
> GPU morphing code stopped working.
> I use VBO, GLSL and vertex attributes to copy the changing morph shapes and do
> the interpolation on the GPU.
>
> After searching for the problem I found that when I declared a geometry as VBO
>     // Disable Display lists and setup Vertex Buffer Objects
>    geom->setUseDisplayList (false);
>      geom->setUseVertexBufferObjects(true);
>      osg::VertexBufferObject* df = geom->getOrCreateVertexBufferObject();
>      df->setUsage (GL_STREAM_DRAW);
>
>
> the subsequent commands during the update which changed the vertexArray had no
> effect and produced random triangles on the screen.
> geom->setVertexArray(vcoords);
>
> Because of the many morph shapes, I have many vertex arrays preallocated and
> pass them to the geometry based on a time. I do not copy assign to the vertex
> array of the geometry for speed reasons.
> As I said in the 2.8 version everything worked fine.
> When change the code to issued a dirty on the vertex arrays
> vcoords->dirty()
> the shape morphed correctly but the color, normal, texcoord arrays (which do 
>not
> morph) did not show up correctly.
>
> Has anyone any idea what changed between the 2.8-2.912 versions. I was under 
>the
> impression that issuing a setVertexArray command
> calls dirty() at least on the geometry array.
> Is it therefore mandatory to issue a dirty() call for all arrays (color, 
>normal,
> texcoords) assigned to the geometry?
>
> Please note then when I disable the VBO usage, a single dirty() call on the
> vertexarray works and the other arrays show up normal.
>
> Thank you in advance
> Dimi
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Attachment: osggpumorph.cpp
Description: Binary data

Attachment: GNUmakefile
Description: Binary data

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to