Sign in to follow this  
haestflod

highlight layer with renderingGroupId

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

 

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.