Jump to content

WorldSpaceCanvas problem with FreeCamera


HenryPeng
 Share

Recommended Posts

3 hours ago, HenryPeng said:

Hera is an example,   http://www.babylonjs-playground.com/#1BKDEO#43 

I created two worldspacecanvas named canv1 and canv2, In the beginning, canv2 is over can1, but canv2  will be under canv1 when canv2.position is reset.

It happens on using FreeCamera, AcrRotateCamera is no problem.

Is it a bug ? @Nockawa

 

A WorldSpaceCanvas (WSC) is in reality a Mesh (a Plane), positioned in the Scene, that displays the canvas' content. Whether canv1 is other the top of canv2 or the opposite depend on the Z value of the node. Per default if you change nothing both canv1/2 have the same Z, so we have a case of Z-fighting issue.

I've tried to change the canv2.position.z but looks like it doesn't change the order both Canvas are drawn. I think it's more related to the Orthographic camera mode.

Try to do the exact same thing by creating two Planes instead of a WSC and if the behavior is the same then you have to escalate this of the 3D people of bjs.

Link to comment
Share on other sites

2 hours ago, HenryPeng said:

I've tried it, I created just two Planes, and they worked well when I used Orthographic camera mode .

I think it is a bug for WSC. Here is my example : http://www.babylonjs-playground.com/#1BKDEO#44

@Nockawa  @Deltakosh

Ok, I can see your issue now, I understand it. But I don't know why suddenly it switch places and go underneath the canv1, I'm investigating right now. thanks for reporting!

Link to comment
Share on other sites

I need the help of @Deltakosh on this one, DK, I've made a simpler BG; http://www.babylonjs-playground.com/#1BKDEO#89

I don't understand why but the scrolling canvas is suddenly switching to the bottom, I've logged the z position value of each canvas but they don't change.

What I don't understand is that regarding to the 3D Scene, a WSC is just a Mesh built from a plane and I never do anything else...So a bit of help would be appreciated. Both Canvas have a different position.z, their value is not changing and still at some point it's changing Z position....

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