What can be the problem with this? When you click the button, it starts to animate the visibility property on all meshes. In my case the FPS drops from ~100 to ~45 FPS. Yes, there are 1700 meshes, but is it such a big deal? Any ideas?
Each time the visibility property of a mesh is updated, the material of this mesh is flagged as dirty, meaning the effect must be re-created.
I think we should be able to improve this by flagging as dirty only when the visibility is switched from 1 to something < 1 and vice-versa (same thing for the alpha property of the materials). What do you think @sebavan?
Guys, and can this cause the strange behavior Iām experiencing in the following scenario? I animate overlayAlpha (black) from 0 to 1 on my meshes. While all black I change the material of the meshes. Than I animate the overlayAlpha to 0 to reveal the meshes with the new material set. So far OK. Now I animate the overlayAlpha from 0 to 1 and I set the materials on my meshes back to the original materials and I animate the overlyAlpha again from 1 to 0 to reveal the new (the original ones) materials. Setting a new material on the meshes doubles the number of vertices in the scene. Any ideas?
Thanks!
R.
Dealing with materials only canāt change the geometry of meshes, so itās not possible the total number of the vertices in the scene can change. I think you will need to setup a repro of this behaviour.
It would be very cool to have this in both cases. I am just a few steps to finish my project, I use alpha and overlayAlpha anims a lot and this part is scaring me, because I didnāt find a way how to overcome the performance problems yet. I would like to have nice smooth animations without my notebook trying to take off from my desk and that was me who pushed hard to switch from Unity to Babylonjs, so guys is there a chance, that the optimalizations gets implemented soon and I can keep my balls safe from my bosses leg? Thank you!
I think itās creating a copy of the mesh not visible in the inspector and believe or not just by removing the line where I assign the material the weird behavior goes away. Iāll try to isolate the case and setup a PG.
Open the Inspector/Statistics and after 10 seconds the first animation takes place. There are originally about 1.3mil indices. When the anim starts it pops up to 2.5 and over 5mil. After 5 seconds another animation takes places and it freezes the render loop.
Anyway, setting needDepthPrePass = true on a material will make the object rendered in the depth buffer as a first pass, so all objects with materials having needDepthPrePass = true will be rendered 2 times.
Ooops⦠Yes, that was causing the lock had a filter set in debugger console so I didnāt catch this one, my bad. However the information about needDepthPrePass demystified the vertice doubling. Thank you very much for your effort!
R.