haestflod Posted August 8, 2017 Share Posted August 8, 2017 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 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 8, 2017 Share Posted August 8, 2017 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 layershttps://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 rendergroupshttps://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. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted August 9, 2017 Share Posted August 9, 2017 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 haestflod 1 Quote Link to comment Share on other sites More sharing options...
haestflod Posted August 9, 2017 Author Share Posted August 9, 2017 @Sebavan Thanks, that solved it! This is probably a bug though? Where I removed the renderingGroupId = 1 mesh from the highlight layer.https://www.babylonjs-playground.com/#11QFK8#8 Quote Link to comment Share on other sites More sharing options...
Sebavan Posted August 9, 2017 Share Posted August 9, 2017 This is actually exactly the same issue where you ll need to keep the stencil across groups. 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.