Hi,

could you file a JIRA with a test case please? These changes are supposed to be batched within a spin of the event loop before sent to to the backend. And on the backend, the geometry buffer update should happen within the same frame as the count is adjusted. So, looks like we've missed something from what you describe.

Cheers,

Sean

On 22/04/2017 00:04, Oleg Evseev wrote:
Hi,

I frequently update geometry with help of updateData function of vertex
QBuffer, increasing vertices count with help of setCount function of
geometry position QAttribute like this:

    uint vertexCount = positionAttribute->count();

vertexBuffer->updateData(vertexCount*3*sizeof(VERTEX_TYPE),appendVertexArray);
    positionAttribute->setCount(vertexCount+2);

(initial data of vertexBuffer of course has enough space for updates)

Sometimes (especially with high frequency updates) I observe temporary
very short time visual artifacts - triangles (faces) based on newly
added vertices jump somewhere aside, but then "come back" to the place
they should be.

As for me it all looks like setCount get to qt3d rendering backend and
"goes down" to opengl calls before updateData, so data that is in
current (not yet updated) vertex buffer on the place of new vertices
(some scrap) is used in rendering and leads to artifacts. And only after
that buffer data is finally updates.
(sorry if I'm not correct in qt3d backend work aspects)

Also finally when I don't need updates anymore, I want to reduce size of
vertexBuffer data like this:

QByteArray vertexArray = vertexBuffer->data();
vertexArray.detach();
vertexArray.resize((vertexCount+2)*3*sizeof(VERTEX_TYPE));
...
vertexBuffer->setData(vertexArray);
positionAttribute->setCount(vertexCount+2);

This one leads sometimes (not always) to artifacts that remains, that is
faces based on new vertexes are goes somewhere out of the screen
(probably to 0 coordinate) and do not change anymore.

Also in contrast with updateData I can't understand and trace chain how
changing count of vertex attribute goes down finally to opengl calls.

Thank in advance for help.

--
With regards, Oleg.



_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


--
Dr Sean Harmer | sean.har...@kdab.com | Managing Director UK
KDAB (UK) Ltd, a KDAB Group company
Tel. +44 (0)1625 809908; Sweden (HQ) +46-563-540090
Mobile: +44 (0)7545 140604
KDAB - Qt Experts
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to