Jump to content

Changing "quality" of meshes in a scene?


aWeirdo
 Share

Recommended Posts

Hi guys,

i want to add a quality control to my project so a user can change the quality of the scene to reduce lag / improve performance on low-end machines,

I stumpled over the "Auto-LOD" https://doc.babylonjs.com/tutorials/In-Browser_Mesh_Simplification_(Auto-LOD) 

but it doesn't quite do the trick, indices only reduced slightly & no change to vertices.

 

Take a simple sphere made with 20 segments/subdivs, 

var sphere = BABYLON.Mesh.CreateSphere("sphere", 20, 2, scene);

This sphere contains 5808 indices & 1035 vertices,

 

But if i create the sphere with 10 segments instead,

var sphere = BABYLON.Mesh.CreateSphere("sphere", 10, 2, scene);

This sphere only contains 1728 indices & 325 vertices.

 


Is there any way available to reduce the actual "quality" of a mesh (live) without using the LOD or Auto-LOD systems? (i need to use it on custom 3d models aswell).

For the sphere as an example. I want to go from 20 -> 10 segments if quality is reduced by 50%, is this possible to do "on-the-go" or would it be better to force a reload and then load the meshes/models with the requested quality?

 

Any ideas/input would be greately appreciated :)

Cheers

Link to comment
Share on other sites

Hi @aWeirdo!   Umm... http://www.babylonjs-playground.com/#1ED15P#23

I didn't accomplish a damned thing, but I sure am having good fun.  First, I discovered that the edgesRenderer doesn't update after simpLOD ops.  :)

And... um... the decimation activity is definitely working... as we mouse-wheel the camera out.  But... this particular scene seems like too much of a challenge for the simpLOD Al Gore rhythm.  (huh?)

In short... stuff seen in this hacked demo from the Auto-LOD docs you reffed... is acting slightly < optimal.  :)  The other type of LOD (making various-rezzed replacement meshes)... yup, that exists, too.  heh.  Which is better?   I have no idea. 

Aren't I just the best helper EVER!  Chocked full of valuable facts and info hot air.  Interesting topic, though.  Experts?

Link to comment
Share on other sites

Hey @Wingnut cheers, i had simular results with "auto-lod".

It can quickly mess up a mesh if you push it too far, and the "benefit" regarding preformance increase from using it isnt that big a deal tbh.

Of the two systems, for now, i suppose the standard lod system is probably the best, with the downsides being increased memory useage and increase in development time..

E.g.

Having just 3 different quality settings,

Low, Medium & High

You need to "re-do" each single mesh 3 times as well as load all versions into memory in order to change between them without preforming a reload of the scene..

Which ofc becomes a bit of a pain with custom 3d models.. :D

Link to comment
Share on other sites

Hi @aWeirdo 

The auto LOD fits many different types of meshes, but it sometimes fails, as it is being calculated on the client. Using a better simplification method offline and uploading 3 types of the same mesh is probably better quality-wise, but has its downsides (as you understood yourself already).

Would be great to see the mesh you are trying to simplify, and to understand what is not really working. maybe the simplification can be improved!

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...