Problem OsgEarth Mask Feature

classic Classic list List threaded Threaded
1 message Options
Guyot Guyot
Reply | Threaded
Open this post in threaded view

Problem OsgEarth Mask Feature


I would like to report/have assistance on a bug I'm currently having with osgEarth. When working with the mask feature, the application crash inside the DrawElementsUInt::draw function inside the PrimitiveSet file in osg on glDrawElements.

I'm working with osgEarth 2.9.0 and osg

From what I gathered, it seems the glDrawElements function needs to have a VBO attached inside the state._vas. However, this VBO is always unbind and set to nullptr.

I noticed that the VBO was unbind inside the TileModelCompiler.cpp, from the osgEarthdrivers/engine_mp folder, every time something end up calling VertexArrayState::setVertexArray. I tried to correct this by myself but I always end up with more things that breaks.

At first I changed in src/osgEarthDrivers/engine_mp/TileModelCompiler.cpp, line 362

d.surface->setNormalArray( d.normals.get() );
d.surface->setNormalBinding( osg::Geometry::BIND_PER_VERTEX );


 d.surface->setNormalArray( d.normals.get(), osg::Array::Binding::BIND_PER_VERTEX);

Because I noticed that to create a BufferObject that will later on be used for VBO creation, the setNormalArray needs to have the BIND_PER_VERTEX flag when entering the setNormalArray method.

Then I had to do the same with d.surface->setVertexAttribArray, on line 376, with the normal array on line 1068, with the tileCoords and now I think I also have problems with the texCoords.

If you could have a look at this problem It would be really helpful. I tried to send you as much data as I had but if you need anything else don't hesitate to ask me.

Best regards.