Jump to content

highlight layer with renderingGroupId


haestflod
 Share

Recommended Posts

Hi, I was implementing the highlight layer for some meshes and when I was mouseovering some meshes it bugged out and eventually I found out its because of mesh.renderingGroupId = 1.

Even if I do layer.removeMesh( mesh ) it remains bugged where it draws very strong innerGlow despite innerGlow = false;

Is there a way to bypass this issue? Maybe onBeforeComposeObservable  and onAfterComposeObservable  to set renderingGroupId = 0 for all meshes and then back to original value?

Here's a PG replicating the issue:
https://www.babylonjs-playground.com/#11QFK8

 

Link to comment
Share on other sites

https://www.babylonjs-playground.com/#11QFK8#2

the ground layer is acting weird when you add it back your right, it seems to highlight the entire thing when the sphere.renderingGroupId = 1; is used.
https://www.babylonjs-playground.com/#11QFK8#3

I spit it into two highlight layers, but I am also able to get it to act weird when you exclude the ground mesh or the sphere from one of the highlight layers
https://www.babylonjs-playground.com/#11QFK8#4

And here is one where it works kinda correct Im assuming to what you want:
https://www.babylonjs-playground.com/#11QFK8#5

Its looking like this behavior is somewhat caused when the objects are in different rendergroups
https://www.babylonjs-playground.com/#11QFK8#5


I honestly have not done any reading about the highlight layer, but just figured Id mess around with what you had for a second.  This might take someone more familiar with the render stack/highlight layer.

Link to comment
Share on other sites

Hello,

This is by design. As the highlights rely on stencil, the rendering groups by default will clear the required information used to apply highlights.

In order to make highlights  works cross groups, you can disable clearing the stencil between groups with  scene.setRenderingAutoClearDepthStencil(1, true, true, false);

https://www.babylonjs-playground.com/#11QFK8#7

Hope that helps

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