Ok.
for me It doesn't work if you have two ebo on same vbo
with only one primitiveset all works fine
tested with core context and compatability context

Code:

#0  0x00007ffff2d0d091 in ?? () from /usr/lib/libnvidia-glcore.so.343.22
#1  0x00007ffff2d138f1 in ?? () from /usr/lib/libnvidia-glcore.so.343.22
#2  0x00007ffff28dec48 in ?? () from /usr/lib/libnvidia-glcore.so.343.22
#3  0x00007ffff76cc4b2 in osg::Geometry::drawImplementation(osg::RenderInfo&) 
const () from /home/i/work/osg_git032015/osg/lib/libosg.so.118
#4  0x00007ffff5b6ee07 in osgUtil::RenderLeaf::render(osg::RenderInfo&, 
osgUtil::RenderLeaf*) () from 
/home/i/work/osg_git032015/osg/lib/libosgUtil.so.118
#5  0x00007ffff5b69910 in 
osgUtil::RenderBin::drawImplementation(osg::RenderInfo&, osgUtil::RenderLeaf*&) 
() from /home/i/work/osg_git032015/osg/lib/libosgUtil.so.118
#6  0x00007ffff5b749e4 in 
osgUtil::RenderStage::drawImplementation(osg::RenderInfo&, 
osgUtil::RenderLeaf*&) () from 
/home/i/work/osg_git032015/osg/lib/libosgUtil.so.118
#7  0x00007ffff5b69ef3 in osgUtil::RenderBin::draw(osg::RenderInfo&, 
osgUtil::RenderLeaf*&) () from 
/home/i/work/osg_git032015/osg/lib/libosgUtil.so.118
#8  0x00007ffff5b72f33 in osgUtil::RenderStage::drawInner(osg::RenderInfo&, 
osgUtil::RenderLeaf*&, bool&) () from 
/home/i/work/osg_git032015/osg/lib/libosgUtil.so.118
#9  0x00007ffff5b7428a in osgUtil::RenderStage::draw(osg::RenderInfo&, 
osgUtil::RenderLeaf*&) () from 
/home/i/work/osg_git032015/osg/lib/libosgUtil.so.118
#10 0x00007ffff5b7e092 in osgUtil::SceneView::draw() () from 
/home/i/work/osg_git032015/osg/lib/libosgUtil.so.118
#11 0x00007ffff731022f in osgViewer::Renderer::cull_draw() () from 
/home/i/work/osg_git032015/osg/lib/libosgViewer.so.118
#12 0x00007ffff76e90a9 in osg::GraphicsContext::runOperations() () from 
/home/i/work/osg_git032015/osg/lib/libosg.so.118
#13 0x00007ffff73442cb in osgViewer::ViewerBase::renderingTraversals() () from 
/home/i/work/osg_git032015/osg/lib/libosgViewer.so.118
#14 0x00007ffff73416da in osgViewer::ViewerBase::run() () from 
/home/i/work/osg_git032015/osg/lib/libosgViewer.so.118
#15 0x0000000000418f40 in main ()



here is code how I create textured quad

Code:

  Geometry* geom = new Geometry;

    Vec3Array* coords = new Vec3Array(4);
    (*coords)[0] = corner+heightVec;
    (*coords)[1] = corner;
    (*coords)[2] = corner+widthVec;
    (*coords)[3] = corner+widthVec+heightVec;
    geom->setVertexArray(coords);

    Vec2Array* tcoords = new Vec2Array(4);
    (*tcoords)[0].set(l,t);
    (*tcoords)[1].set(l,b);
    (*tcoords)[2].set(r,b);
    (*tcoords)[3].set(r,t);
    geom->setTexCoordArray(0,tcoords);

    osg::Vec4Array* colours = new osg::Vec4Array(4);
    (*colours)[0].set(1.0f,1.0f,1.0,1.0f);
        (*colours)[1].set(1.0f,1.0f,1.0,1.0f);
        (*colours)[2].set(1.0f,1.0f,1.0,1.0f);
        (*colours)[3].set(1.0f,1.0f,1.0,1.0f);

    geom->setColorArray(colours,osg::Array::BIND_PER_VERTEX);

    osg::Vec3Array* normals = new osg::Vec3Array(4);
    (*normals)[0] = widthVec^heightVec;
    (*normals)[0].normalize();
    geom->setNormalArray(normals, osg::Array::BIND_PER_VERTEX);


    DrawElementsUByte* elems = new DrawElementsUByte(PrimitiveSet::TRIANGLES);
    elems->push_back(0);
    elems->push_back(1);
    elems->push_back(2);

    elems->push_back(2);
    elems->push_back(3);
    elems->push_back(0);
    geom->addPrimitiveSet(elems);

    DrawElementsUByte* elems2 = new DrawElementsUByte(PrimitiveSet::TRIANGLES);
    elems2->push_back(0);
    elems2->push_back(1);
    elems2->push_back(2);

    elems2->push_back(2);
    elems2->push_back(3);
    elems2->push_back(0);
        geom->addPrimitiveSet(elems2);





------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=63154#63154





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

Reply via email to