Jump to content

Gui elements not aligned on mesh ?


phaselock
 Share

Recommended Posts

erm, I'm not sure what to classify this problem as or what its title should be. So, I tried to combine the PG (from the GUI announcement) I made a few mths back (https://www.babylonjs-playground.com/#FBKE1P#1) with the default rendering post processing tutorial and erm...I honestly don't quite understand the problem I'm seeing on my screen. The recreated PG is https://www.babylonjs-playground.com/#5XB8YT#5

All I did was port some codes from FBKE1P to the post processing part. I was hoping to get the same mouse-over text on the skull while being able to play with the sliders. It seems like the entire skull is offset virtually ? or the GUI elements are in the wrong place ? or or... loss of words, sorry :(

Any help, guys?

Link to comment
Share on other sites

Hi phaselock.

    https://www.babylonjs-playground.com/#5XB8YT#6

Here's what I did.  Adjusted line 4 camera position.  Disabled bgCamera lines 30-33.  Removed layerMask from ADT in line 36.  Changed line 252, removing bgCamera from that line.

Things started acting more sane.  :)  So... I think the problem might be in one of those areas.

Not quite sure why/how, yet.  I'll need more coffee and testing, for that. 

Thoughts?  Anyone?   Gorgeous PG/GUI, PhaseLock.  Nice job!

Link to comment
Share on other sites

Hi wingnut, thanks for the help. It seems like the bgCamera is responsible for the gui elements and separates the post processing. If its commented out, when you try to, say, toggle bloom, the bloom will affect the gui itself. I guess it can't be removed. I tried setting the bgcamera's position and orientation vectors similar to camera but it still seems off during mouse-over and the frame rate stutters pretty badly. You can try it here: https://www.babylonjs-playground.com/#5XB8YT#7

Mouse-over the top of the skull and try to mouse-over the jaw, it should be quite obvious that the cameras are somehow offset ? Not sure... :(

Btw, the post processing GUI is not done by me, its from the post-processing tutorial, I just wanted to stress test the codes, hope it helps.

Link to comment
Share on other sites

haha, figured it out. Thanks to clues left in the other posts of this forum. For keeps: https://www.babylonjs-playground.com/#5XB8YT#8

I tested zoom and rotations, the mouse-over still works. Lesson learnt I guess...Although, design-wise, it would be really so much easier to have an option toggle for post-process not affecting GUI. This way, there is no need for a 2nd camera and extra codes for syncing views. Cheers ! :)

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