Sign in to follow this  

Rendering Groups

Recommended Posts


I'm working with Babylon.js to make a Facebook Instant Game and I was wondering if this issue happened to someone before me. My main object is a ball that I want to kick. My problem is that it always displays in front of all my other meshes. For example, if the ball lands behind a tree, the ball will appear above the tree in the screen. I used to work with rendering groups and have my ball be in the fourth group (renderingGroup = 3). I now know that this group appears above everything else. Consequently, I tried removing all the rendering group from every mesh but the issue still appears, the ball displays before everything else.

Is there some configuration I should make in Babylon.js so that every mesh displays according to their 3D position?

Best regards!

Share this post

Link to post
Share on other sites

It's the default behaviour to display according to the 3D position (there are exceptions like glow/highlight layer/full screen UI/etc).  The 3D position for render order is determined by the distance to the camera.  If you have a huge bounding box on your ball then I think that will be used to determine "depth" in the scene.  You can show the bounding box with ball.showBoundingBox = true  If that doesn't help --  make sure to ask this question in the main BabylonJS forum as this does not appear FB specific and this forum is not monitored by their team.

Share this post

Link to post
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.

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.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.