abou.konate Posted October 10, 2012 Posted October 10, 2012 I'm currently creating some dynamic mesh custom file format and I would like to instanciate them. So I looked in Unigine documentation and saw that ObjectMeshDynamic doesn't handle instanciation while ObjectMesh does. However reading the source I don't get where instanciation are disabled for ObjectMeshDynamic. So what does the clone method do exactly ?
ulf.schroeter Posted October 10, 2012 Posted October 10, 2012 Deep-copy of all geometry, effectively this creates a fully independent object copy.
abou.konate Posted October 11, 2012 Author Posted October 11, 2012 Sorry but I don't get where the deep copy is done.
ulf.schroeter Posted October 11, 2012 Posted October 11, 2012 ObjectMeshDynamic::clone() on the original ObejctMeshDynamic instance A returns a new ObjectMeshDynamic instance B having deep-copied geometry data from instance A. So if you change instance B data afterwards instnac A data will NOT be effected.
frustum Posted October 11, 2012 Posted October 11, 2012 ObjectMeshDynamic::clone() on the original ObejctMeshDynamic instance A returns a new ObjectMeshDynamic instance B having deep-copied geometry data from instance A. So if you change instance B data afterwards instnac A data will NOT be effected. It's incorrect. ObjectMeshDynamic::clone() method returns new Object but this object refers to the same mesh geometry. All cloned ObjectMeshDynamic objects shares same mesh. Because of that hardware instancing for rendering is available across all cloned ObjectMeshDynamic objects.
abou.konate Posted October 11, 2012 Author Posted October 11, 2012 Okay perfect this is what I was thinking. The only thing that not seems to be instancied are surface created after the clone() method. Is that right ? So care should be used some surface are added/ removed or the geometry change.
ulf.schroeter Posted October 11, 2012 Posted October 11, 2012 All cloned ObjectMeshDynamic objects shares same mesh. Because of that hardware instancing for rendering is available across all cloned ObjectMeshDynamic objects. Good news, so then Unigine documentation for ObjectMeshDynamic Geometry instancing is not supported, so if you want to render the same mesh several times, several copies of it will be stored on the GPU. seems to be outdated and should be updated and also clone() behaviour description should be more specifc. BTW if clone() does not produce a data deep-copy, how to do it, if required ? Usage of get/add.... methods for all surfaces, vertices, indices, etc seems a little bit unconveniant.
manguste Posted October 22, 2012 Posted October 22, 2012 (edited) Ulf, right now, if required, it is actually done manually. Ah, and I've added a note on clone() into docs. Edited October 22, 2012 by manguste
s.moussa Posted July 3, 2015 Posted July 3, 2015 Hi every one, instanciation in unigine is not clear for me. 1-What should I do to export/import from Maya to Unigine a group of object,created, instantiated (Duplicate Special with Instance), and positionned IN maya ? 2- is World clutter, or cluster allows that ? Thx!
silent Posted July 3, 2015 Posted July 3, 2015 Hi, 2- is World clutter, or cluster allows that ? It is better to use ObjectMeshClutter / ObjectMeshCluster to render the identical objects (please, check this comment). 1-What should I do to export/import from Maya to Unigine a group of object,created, instantiated (Duplicate Special with Instance), and positionned IN maya ? We can suggest you to export from Maya only objects placeholders and use a City Import plugin to populate the meshes automatically (and bake them in to the single Clusters). Placeholder is a simple polygon that indicates in which direction should be rotated the object.Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Recommended Posts