Raggar Posted March 18, 2017 Share Posted March 18, 2017 Silly title, I know. I'm not sure how to achieve this, and I'm sure a PG is not necessary, if this functionality actually exists. Imagine the simple and common version of a FPS-setup. You have a camera, and a mesh or more in front of this camera, usually a couple of hands and a gun of some sorts. Now, when I hit a wall face-first, part of the hands/gun model will clip through the wall, and we sure don't want that to happen. Is there some way to always render the hands/gun models in front of everything else, igoring depth? I looked at z-index, renderingGroups and masks without luck. Quote Link to comment Share on other sites More sharing options...
Temechon Posted March 18, 2017 Share Posted March 18, 2017 Hi, Renderinggroupid is your friend : http://www.babylonjs-playground.com/#1N9CSW#0 haestflod 1 Quote Link to comment Share on other sites More sharing options...
Raggar Posted March 18, 2017 Author Share Posted March 18, 2017 It's weird, because it works with some of my meshes, but not this particular one: http://www.babylonjs-playground.com/#1N9CSW#1 I tried other meshes, and by assigning the new groupId to those, it works just fine. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 20, 2017 Share Posted March 20, 2017 It seems to work for me (I can see the hands in front of everything) Quote Link to comment Share on other sites More sharing options...
Raggar Posted March 20, 2017 Author Share Posted March 20, 2017 1 hour ago, Deltakosh said: It seems to work for me (I can see the hands in front of everything) Are you sure? Try getting closer to the plane and sphere objects. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 20, 2017 Share Posted March 20, 2017 This is because your newMeshes[0] is the parent of newMeshes[1] newMeshes[0] has no geometry and thus is not rendered. The rendered mesh is the #1 here is the fix: http://www.babylonjs-playground.com/#1N9CSW#3 Quote Link to comment Share on other sites More sharing options...
Raggar Posted March 20, 2017 Author Share Posted March 20, 2017 Oh. I've had similar issues when scaling individual meshes. Should have thought of that I guess Thanks. Thread marked as solved. 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.