Jump to content

Z-Fighting on Mobile and Merging / Instancing performance


MarcoC
 Share

Recommended Posts

Hello guys!
First of all I would like to thank you for all your valuable comments on this forum.
I’ve found basically all answers to my questions digging up this forum.
I’m trying to make a simulation/rpg like game with Babylon and I'm experimenting with procedural generation and content streaming.

I need help on two (probably related) questions:
https://playground.babylonjs.com/#SCV25U#6

1 Z-Fighting / Flickering on Mobile.
I’ve noticed that some meshes are flickering on mobile (especially the ones who are generated on click).
I thought could be some Z-Fighting problem and I moved the ground generation before the trees generation, doing this has solved the issue only on the meshes who are generated on load, not on the meshes generated on con click. 
I’ve also tried various ways of click picking / invisible mesh combination but nothing changed apparently. I need to try with no overlapping visible meshes, but I still need an overlapping invisible plane to detect the click.

2 Merging / Instancing doubts.
Merging a big group of boxes has really amazing FPS performance (even on mobile with a large world), but freezes the browser. So I’ve splitted and delayed the merging execution, still freezing but it looks better.
I’ve tried with ribbons, amazing performance and results if you need something like Transport Tycoon, but isn’t what I was looking for. 
Instancing a big group of boxes has no freezing at all but really low FPS rate, I need to try to use a box without 2 useless faces, but I suppose the FPS rate will be much the same.

Clues on solving this or ideas about different approaches will be really appreciated.

Thanks, Marco.

Link to comment
Share on other sites

Hello,

1. for zfighting, you can either reduce camera.maxZ or play with material.zOffset 

2. Unfortunately for us, javascript runs on only one single thread. So complex operation can clearly freeze the browser. I need to better understand what you are trying to do as I think the best option will be a combination of createInstance / object removal

Link to comment
Share on other sites

Sps is used on the Voxel Demo (https://nesh108.github.io/babylon-voxel-demo/) , right?
I need to investigate more on this subject, thank you @BitOfGold

Thank you @Deltakosh, reducing camera.maxZ makes almost all flickering issues go away (and also reducing the number of boxes generated in every step).
I think that probably with the right way to remove the unseen meshes all should work perfectly.
 

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