Help with Builder instancing #935
Replies: 1 comment 1 reply
-
Setting vsg::Data::properties.dataVariance to DYNAMIC_DATA and then
calling data->dirty() is the way to tell the VSG that data is updated and
needs transferring to the associated GPU memory.
This transfer is done by the vsg::TransferData which is a container that
the vsg::Viewer will set up internally for during the compilation of scene
graph that happens when viewer->compile() is first called. This means you
should set up the Data::properties.dataVariance before the
viewer->compile() call for things to be set up correctly.
The vsgdynamcvertex and vsgdynamictexture and vsgdynamictexture_cs and
vsgclip are all examples that illustrate how to manage dynamic data.
The old references to vsg::CopyAndReleaseBuffer are best forgotten as they
are more complex to use and less efficient that the newer vsg::TransferData
class that tracks the dynamic data's modifiedCount() and transfer data when
data has been modified - singated by calling data->dirty().
It's a while since I worked on vsgbuilder so can't comment on the specifics
of what might be supported, but I think the instance container should be
shared by the built scene graph so it should be possible to set up the
positions data.
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
lufriem
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, please forgive my ignorance, I've been looking at the vsgBuilder example, with instancing enabled, like originally discussed in the vsg-users google group. There was an additional discussion on how to manipulate (move) these instances.
So what I tried to achieve was to simply change the color and position of sphere instances. Rather then creating 10000 I thought I'd start small, to help debugging, so I settled for three spheres
Now, in the second vsg-users thread, @robertosfield mentioned
So what I did was (naively, I guess)
So my question is, what exactly do I have to do now?
Right now none of my changes seem to result in any on-screen difference (even though the Data is changed between Visitor calls..), I'm sure I'm doing something stupid somewhere..
Any help/pointers would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions