layerMask in android #6957
-
I'm going crazy trying to control renderable visibility using layerMask on Android's Filament 1.40. The actual runtime behavior is always unexpected and I totally don't understand how this API works. I have two questions: When calling RenderableManager.Builder to create renderables, who does the layerMask method actually affect - the whole rendering environment or just the created renderable objects?
Based on my understanding, renderable1 should be hidden and only renderable2 displayed. But it seems there was no change. And if I call |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
Are you calling
Here's an example from our own sample code:
|
Beta Was this translation helpful? Give feedback.
RenderableManager::Builder::layerMask
only affects the renderable being currently created.Are you calling
setLayerMask()
with an entity instead of an instance maybe? The proper way to call those APIs (like otherRenderableManager
APIs) is:renderableManager.setLayerMask(renderableManager.getInstance(myRenderableEntity), 0xff, 0x00)
view.setVisibleLayers(0xff, 0xff)
makes all the layers visible, which you don't need to do in your example since you are removingrenderable
from layer 0 (the default visible layer).Here's an example from our own sample code: