Jump to content

Gizmo axis not showing with GizmoManager.


Zephos
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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