BlackMojito Posted December 4, 2017 Share Posted December 4, 2017 Hi Folks, I wrote a small selection effect like in the playground http://www.babylonjs-playground.com/#2EHGYF#7. Actually I add cloned meshes on top of the originals. This seems to work perfectly but every time I select, unselect a mesh, I need to update the Octree. I am working on a similar effect on highlighting when the hover the mouse on the meshes. I am not sure if the performance can be OK with large models. Is there any way to handle this? I mean maybe I can have another scene or...the Octree can be applied only on the main scene? Many thanks Quote Link to comment Share on other sites More sharing options...
Sebavan Posted December 4, 2017 Share Posted December 4, 2017 I am sorry I did not understand the question, could you detail the use case a bit more ? Quote Link to comment Share on other sites More sharing options...
BlackMojito Posted December 5, 2017 Author Share Posted December 5, 2017 8 hours ago, Sebavan said: I am sorry I did not understand the question, could you detail the use case a bit more ? Sure. This is mainly for selection. Instead of directly modifying the material of the base mesh, I would like to clone the mesh and apply a fancy effect on the cloned mesh. However every time after cloning the mesh, I must update the Octree. Otherwise, the cloned mesh will not be rendered. The same for deselect because the cloned mesh should be disposed. My question is whether the performance of updating the Octree can be OK for large models? If no, how can use the Octree only for my "basic' meshes? Quote Link to comment Share on other sites More sharing options...
Sebavan Posted December 5, 2017 Share Posted December 5, 2017 Why not updating the material of the main mesh ? royibernthal 1 Quote Link to comment Share on other sites More sharing options...
BlackMojito Posted December 6, 2017 Author Share Posted December 6, 2017 On 12/5/2017 at 1:26 PM, Sebavan said: Why not updating the material of the main mesh ? because I need to create a two layer selection effect. The first layer is the basic layer which take into account the depth buffer. the second layer is a semi-transparent layer on top of the first layer. It is always rendered on top of the current color buffer. The is for displaying hidden part of the selection scene which a very low alpha value. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted December 6, 2017 Share Posted December 6, 2017 so you could clone once only and enable disable only also You could allow picking only on the none cloned mesh to keep perf unchanged during picking. 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.