MarcoC Posted December 21, 2017 Share Posted December 21, 2017 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. Quote Link to comment Share on other sites More sharing options...
BitOfGold Posted December 21, 2017 Share Posted December 21, 2017 Have you tried SPS?https://doc.babylonjs.com/how_to/solid_particle_system It's really fast if you have one non-transparent material and many meshes. It's a bit tricky with multimaterials or transparent... But there are solutions. MarcoC 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 21, 2017 Share Posted December 21, 2017 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 MarcoC 1 Quote Link to comment Share on other sites More sharing options...
MarcoC Posted December 21, 2017 Author Share Posted December 21, 2017 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. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.