Kesshi Posted December 14, 2016 Share Posted December 14, 2016 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). Quote Link to comment Share on other sites More sharing options...
Sebavan Posted December 14, 2016 Share Posted December 14, 2016 For 1. PR in progress to fix it: https://github.com/BabylonJS/Babylon.js/pull/1588 and should be in tomorrow. And for 2: http://www.babylonjs-playground.com/#2IIVG2#2 you need to prevent the group to clear the stencil Hope that helps. Dad72 1 Quote Link to comment Share on other sites More sharing options...
Kesshi Posted December 14, 2016 Author Share Posted December 14, 2016 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. 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. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted December 14, 2016 Share Posted December 14, 2016 You will need to use two cameras for this cause the highlights are working as a post process. Quote Link to comment Share on other sites More sharing options...
Kesshi Posted December 14, 2016 Author Share Posted December 14, 2016 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. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted December 14, 2016 Share Posted December 14, 2016 I ll try smthg tonight I may have an idea you ll have it tomorrow if that works :-) Quote Link to comment Share on other sites More sharing options...
Kesshi Posted December 14, 2016 Author Share Posted December 14, 2016 2 minutes ago, Sebavan said: I ll try smthg tonight I may have an idea you ll have it tomorrow if that works :-) good luck Quote Link to comment Share on other sites More sharing options...
Sebavan Posted December 15, 2016 Share Posted December 15, 2016 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. Kesshi 1 Quote Link to comment Share on other sites More sharing options...
Kesshi Posted December 15, 2016 Author Share Posted December 15, 2016 Thank you that sounds promising. I will try it after the PG update. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 15, 2016 Share Posted December 15, 2016 PG updated and problem fixed 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.