Zephos Posted October 19, 2018 Share Posted October 19, 2018 Hi all, I am having an issue where the axis are not showing up for a PositionGizmo when using a GizmoManager. Strangely, I can't reproduce the problem in a PG. I literally put the exact same code into my app and it stops working. Here is a PG of a simple gizmo setup that I want to do. I have added comments to mark the code I put in my app. https://www.babylonjs-playground.com/#31M2AP#34 The differences that I do have in my code is that I am using a skybox and two cameras with layer masks, so I have to add a layer mask to the sphere. The best results I have been able to achieve in my app (with other code, not what's in the pg) is to get the gizmo attached and be able to move them but the axis still never showed up. I have tried removing the layer mask to no effect. The next thing I will try is making the axis gizmos manually, and I will edit this when I have done that, but I wanted to get this up in case someone knows something that I don't. I have a suspicion the axis meshes are not playing nice for some reason with my scene. Any help is appreciated. Thanks. Quote Link to comment Share on other sites More sharing options...
JohnK Posted October 19, 2018 Share Posted October 19, 2018 @Zephos looks like you forgot the PG. Quote Link to comment Share on other sites More sharing options...
Zephos Posted October 19, 2018 Author Share Posted October 19, 2018 17 minutes ago, JohnK said: @Zephos looks like you forgot the PG. Did indeed. Added. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted October 19, 2018 Share Posted October 19, 2018 It works at home. Quote Link to comment Share on other sites More sharing options...
Zephos Posted October 20, 2018 Author Share Posted October 20, 2018 I figured out the issue. Apparently the gizmo meshes have a layerMask = 1. Is there a way to set that to a different value? Quote Link to comment Share on other sites More sharing options...
Guest Posted October 22, 2018 Share Posted October 22, 2018 Pinging @trevordev Quote Link to comment Share on other sites More sharing options...
trevordev Posted October 22, 2018 Share Posted October 22, 2018 @Zephos I can add a function to set the layer mask on a gizmo but I'm not sure that is the issue, when I look at the gizmo's mesh the layer mask is set to max number which should be visible with any layer mask (See this PG: https://www.babylonjs-playground.com/#31M2AP#38 , the gizmo is still visible). how did you see that the layer mask was 1? If you can get it to repro in the playground I can try to debug further, maybe there is an issue with the gizmos interacting with the skybox or multiple cameras. Quote Link to comment Share on other sites More sharing options...
Zephos Posted October 24, 2018 Author Share Posted October 24, 2018 On 10/22/2018 at 12:28 PM, trevordev said: @Zephos I can add a function to set the layer mask on a gizmo but I'm not sure that is the issue, when I look at the gizmo's mesh the layer mask is set to max number which should be visible with any layer mask (See this PG: https://www.babylonjs-playground.com/#31M2AP#38 , the gizmo is still visible). how did you see that the layer mask was 1? If you can get it to repro in the playground I can try to debug further, maybe there is an issue with the gizmos interacting with the skybox or multiple cameras. I will try to repro the issue tonight. But I don't think you want the gizmos to show for any layer mask if you have multiple cameras, because that would lead to multiple angles of view an some weird rendering. At the very least we need to be able to set the layer mask on the gizmo meshes I think, so adding that would still be good probably. Quote Link to comment Share on other sites More sharing options...
Zephos Posted October 24, 2018 Author Share Posted October 24, 2018 On 10/22/2018 at 12:28 PM, trevordev said: @Zephos I can add a function to set the layer mask on a gizmo but I'm not sure that is the issue, when I look at the gizmo's mesh the layer mask is set to max number which should be visible with any layer mask (See this PG: https://www.babylonjs-playground.com/#31M2AP#38 , the gizmo is still visible). how did you see that the layer mask was 1? If you can get it to repro in the playground I can try to debug further, maybe there is an issue with the gizmos interacting with the skybox or multiple cameras. I actually managed to repro it pretty quickly while at work. So here is the new PG: https://www.babylonjs-playground.com/#31M2AP#39 The issue seems to only happen with the layer masks in this format: 0x20000000, which according to this should be okay: https://doc.babylonjs.com/how_to/layermasks_and_multi-cam_textures Maybe I am not understanding something, or maybe something is broken. I have no clue. Quote Link to comment Share on other sites More sharing options...
trevordev Posted October 24, 2018 Share Posted October 24, 2018 Interesting, I guess meshes layer mask is not set to max value, its set to 0x0FFFFFFF. I did not know this. So now if that's true you can just set the camera to 0x0000000F instead and everything should work. eg. https://www.babylonjs-playground.com/#31M2AP#40 , or am I missing something? And if you want to make the gizmo not visible in a camera just set one of the starting bits eg. 0xF0000000 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.