Hans Posted March 20, 2017 Share Posted March 20, 2017 How is it possible to make a mesh or sprite (in)visible for just one of two active cameras? Quote Link to comment Share on other sites More sharing options...
adam Posted March 20, 2017 Share Posted March 20, 2017 https://doc.babylonjs.com/tutorials/layermasks_and_multi-cam_textures Hans 1 Quote Link to comment Share on other sites More sharing options...
Hans Posted March 20, 2017 Author Share Posted March 20, 2017 Ah, thanks, this is what i need, but i dont get it to work. The demo in the tutorial also dont work for me. Is it a bug? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 20, 2017 Share Posted March 20, 2017 Layermask is working..there was a change in orthogonal cameras that broke the PG here is a fixed version: http://playground.babylonjs.com/#2GXKNW#18 Hans 1 Quote Link to comment Share on other sites More sharing options...
Hans Posted March 20, 2017 Author Share Posted March 20, 2017 If I get it right its not possible to show one komplex scene in two cameras completely and just one or few meshes in the scene are invisible for one of two cameras. The only way I see is to add more cameras which show/overlay the 'secret' meshes. Right? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 21, 2017 Share Posted March 21, 2017 It is possible. This is the goal of the layerMask: you can have objects visible only for one camera and some visible for both. For instance let's say that camera1.layerMask == 1 and camera2.LayerMask == 2 a mesh with a layerMask == 1 will only be on camera1 a mesh with a layerMask == 2 will only be on camera2 a mesh with a layerMask == 3 will be on both The layerMask is used to do a bitwise comparison Hans 1 Quote Link to comment Share on other sites More sharing options...
Hans Posted March 22, 2017 Author Share Posted March 22, 2017 So I need 4 cameras for a local coop game with two players who want to see the whole world and each his crosshair/gun sight. Example: player01: camera1 with layerMask == 3 // world camera2 with layerMask == 1 // crosshair for player01 player02: camera3 with layerMask == 3 // world camera4 with layerMask == 2 // crosshair for player02 I am right? How strongly a new camera affects the performance? Does this kill performance on mass for a 4 player coop game? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 22, 2017 Share Posted March 22, 2017 You are right! No worry for performance at all Hans 1 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.