Dad72 Posted July 25, 2014 Share Posted July 25, 2014 Hello, I'm not sure to understand the use of the class BABYLON.Layer() and property BABYLON.Mesh.LayerMask Can we have some explanation, use cases, code example. I am interested in its two features, but I'm not sure to understand yet. I want to understand how it works concretely. Thank you Quote Link to comment Share on other sites More sharing options...
Temechon Posted July 25, 2014 Share Posted July 25, 2014 Layers are for sprites : http://doc.babylonjs.com/page.php?p=24694 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 25, 2014 Author Share Posted July 25, 2014 Ah, I have not seen her like this. sprites uses layer if I understand well. But the layers can also be used a anything else from making sprites not? Then LayerMask that interests me is to create masks (for example a circle on my minimap to the places a carrer) but I'm not sure how to with LayerMask PS: It would be although LayerMask is also implemented for the lights to illuminate only parts of the scene. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 25, 2014 Author Share Posted July 25, 2014 It would be although LayerMask is also implemented for the lights to illuminate only parts of the scene. Is it also a "CullingMask" (array()) for the camera that must make objects selectively with to the layerMask.It would only display for example for a viewport (mini-map) disable some mesh in the scene (water, particle...) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 25, 2014 Share Posted July 25, 2014 For lights you can use light.excludedMeshes Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 25, 2014 Author Share Posted July 25, 2014 I mean just to illuminate the portion of meshes of the mask. not exclude a mesh as a whole, but enlighten just one part and exclude another of the same object And what do you think of the ideas CullingMask (array) on the cameras? it could be very useful. (In the same manner as Lights.excludedMeshes) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 25, 2014 Share Posted July 25, 2014 this is the aim of camera.layerMask: A mesh is rendered only if (mesh.layerMask & this.activeCamera.layerMask) != 0 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 25, 2014 Author Share Posted July 25, 2014 Ah ok. Thanks DK Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 25, 2014 Author Share Posted July 25, 2014 I partly understand, but I have several camera, one that is the view of the controllable character in viewport 1 (cameraRotative) and one which is for the mini-map in viewport 2 (freecamera). need some object to be rendered for a camera but not necessarily for the other and there I do not know. I want to do is on the mini-map does not make some object on the viewport 2, but it still made for the camera on the viewport 1 Is it possible? Thanks again DK. ********** FR ***********J'ai en partie compris dans le cas de l'utilisation de une seule camera, mais j'ai plusieurs camera, une qui est la vue du personnage contrôlable en viewport 1 (cameraRotative) et une qui est pour la mini-map en viewport 2 (freecamera). il faut que certain objet soit rendu pour une camera mais pas forcement pour l'autre et là je bloque, je comprend pas trop. Ce que je voudrais faire c’est sur la mini-map ne pas rendre certain objet sur le viewport 2, mais qu'il reste rendu pour la camera sur le viewport 1 Est ce possible ? Merci encore DK. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 29, 2014 Share Posted July 29, 2014 yes this is possible:cam1.layerMask = 2;cam2.layerMask = 4; mesh.layerMask = 2 this way mesh will be rendered only on cam1 gwenael 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 30, 2014 Author Share Posted July 30, 2014 OK, I understand. Thank you. It works 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.