Jump to content

Grouping objects


TomaszFurca
 Share

Recommended Posts

Some time ago I started optimize my scene. After some fixes, now I have problem with grouping objects in BabylonJS. For export I use tower of Babel. I experimented with linking, parenting and joining.

Linking
When objects is linked in Babylon i can see only one object.

Parenting
This method do not change anything about draw calls - it is same without parenting.

Joining
This method show all objects correct with smaller draw calls. But i must divide to smaller groupis to avoid inncorect collisions (check link https://ibb.co/gVcROQ to show how bounding boxes are builded). In this screen it is not perfect, so i must divide to more groups my trees. 

Can anyone help me to export/import my scene to Babylon with optimal perfomance? I think about one object for all tress for example.

Link to comment
Share on other sites

Joining makes selected obejcts into one.

After read some articles about optimize scene I found terminology linking objects. I don't know, which method is correct, but i try all possibilities  to optimize my scene. 

Do you have any idea do resolve my perfomance problem? 

Link to comment
Share on other sites

Perhaps you could share the articles where you found the terms joining and linking as in BabylonJS the term merging is used to form one mesh from many. However merging meshes means one material. For example merging the trunk and leaves on your tree would mean the they would both have to be the same colour. Also you could not have a character colliding with one tree.

Have you looked at the solid particle system? You could make a forest from the trunks and branches (as separate solid particles) with their own colours and the forest would be one mesh. By making the forest mesh immutable then there is only one draw call. However if you wish a character to collide with a tree then it is possible but memory and CPU time is increased.

Link to comment
Share on other sites

Why do you not use Blender & the exporter to optimize?  I did not have time to watch your video, but have put many things in exporter to transfer things already optimized.  Running through checklists for optimization, rather than developing for optimization, just seems like turd polishing to me.

For all your background meshes, check 'Freeze World Matrix'.  Saves computing a world matrix for a mesh every frame when it never moves / rotates / or scales differently.

You can also check 'check ready only once' for unique materials.  Be ready to uncheck if this causes side effects.  Tower of Babel generates fairly friendly code to get around this though.  Every time you instance a mesh, the materials are marked as unready.

For using BABYLON.InstancedMesh, you can establish this in Blender.  Blender also has tools like Joining and Limited Dissolve.  For these you may want to do them at the end of dev & increment your .blend file to save both ways.  Always delimit by UV when using Limited Dissolve on a mesh with textures.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...