Jump to content

HighlightLayer problems


Kesshi
 Share

Recommended Posts

I found two issues regarding the HightlightLayer:

1: The implementation of the HightlightLayer is using Mesh.id to manage the meshes internally. This is a problem because the id may not be unique (as default its the same as Mesh.name). In my projects i usally don't care about the id or the name and that makes it difficult for me to use the HightlightLayer.
Here is a Playground to show the problem: http://www.babylonjs-playground.com/#2IIVG2#0
Box2 should not be red but it is because both boxes have the same name. Maybe the implementation should be changed to use Mesh.uniqueId instead of Mesh.id.

2: The HightlightLayer can't be used in combination with renderingGroups.
Here a playground: http://www.babylonjs-playground.com/#2IIVG2#1
The highlight of box1 is not rendered correctly because box2 uses renderingGroupId 1 (line 15).

Link to comment
Share on other sites

12 minutes ago, Sebavan said:

For 1. PR in progress to fix it: https://github.com/BabylonJS/Babylon.js/pull/1588 and should be in tomorrow.

Thx. :D

13 minutes ago, Sebavan said:

And for 2: http://www.babylonjs-playground.com/#2IIVG2#2 you need to prevent the group to clear the stencil

Hope that helps.

Hmm this is not what i had in mind. Now box2 is no longer rendered on top of box1.
I would like box2 to always stay on top (thats why i use the renderinggroups). I would also expect that box2 covers the highlight layer of box1.
I have several objects in my project which need to stay on top of everything else.

Link to comment
Share on other sites

Ahhh i was thinking already that you will say that :)  I was hoping that there is another solution. Synchronizing/managing multiple cameras makes things more complicated compared to the simplicity of renderinggroups. That would mean big changes in my framework. I will need to reconsider if the HighlightLayer is usable in my case.

Link to comment
Share on other sites

So :-)

The following is all dependent of this pull request (https://github.com/BabylonJS/Babylon.js/pull/1589) so I guess the PGs will begin to work in one day.

Here is a way of doing what you are trying to achieve (clearing everything but stencil between groups):

http://www.babylonjs-playground.com/#2IIVG2#3

As you can see, when the mesh overlaps, the highlights are completely blocked. This is the same as discussed on the highlight layer thread and you will need one layer per object that intersects:

http://www.babylonjs-playground.com/#2IIVG2#4

Hope that fits, at least, it helped us tracking down an issue on the engine.

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