Sign in to follow this  
BlackMojito

Selection effect and Octree

Recommended Posts

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 :D

Share this post


Link to post
Share on other sites
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? 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.