Hey Folks,
I have a scene with 9 cameras, each camera has its own view port ( 2D grid).
I want to render different texts (e.g : The id of the view port) on each different view port.
How can I do this ?
Hey Folks,
I have a scene with 9 cameras, each camera has its own view port ( 2D grid).
I want to render different texts (e.g : The id of the view port) on each different view port.
How can I do this ?
Hi @AhmedFathyHagar and welcome to the forum
For the text by itself, you can use dynamic texture like in this example:
Dynamic Textures | Babylon.js Documentation
The idea then is to create as many quads with text as the viewport count you have.
Then associate each quad with each camera.viewport.
I guess that can be done with layers? Asking @Evgeni_Popov to be sure I’m not wrong
Thanks a lot, @Cedric !
I managed to make it work based on your advice yep.
The solution in case anyone faces the same issue :
Make sure the pairwise & between those masks is always zero.
Create a dynamic texture per camera, and set its layer.layerMask property to the corresponding camera’s layer mask. e.g :
var advancedTexture_1 = new BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI(“UI”);
advancedTexture_1.layer.layerMask = camera_1.layerMask
var advancedTexture_2 = new BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI(“UI”);
advancedTexture_2.layer.layerMask = camera_2.layerMask
This did it for me. Thanks !