Jump to content

[SOLVED] ObjectMeshDynamic : Instanciation


photo

Recommended Posts

Posted

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 ?

Posted

Deep-copy of all geometry, effectively this creates a fully independent object copy.

Posted

Sorry but I don't get where the deep copy is done.

Posted

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.

Posted

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.

Posted

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.

Posted

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.

  • 2 weeks later...
Posted (edited)

Ulf, right now, if required, it is actually done manually.

 

Ah, and I've added a note on clone() into docs.

Edited by manguste
  • 2 years later...
Posted

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!

Posted

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:

×
×
  • Create New...