Closed danybony closed 2 months ago
That's not how SurfaceView work. A SurfaceView can't be "sandwiched" between Views as it cuts a hole through the window. The content of the SurfaceView is either above your activity, or below. This can be controlled with the zorder on the SurfaceView. Filament's UI utilities automatically set the zorder to be "on top" for transparent rendering because it's what makes the most sense. If you want your Filament rendering sandwiched between Views, use TextureView instead.
Describe the bug When setting the scene like in the Android transparent rendering sample (without skybox, not opaque) the render is always drawn on top of all other Android views, even if they should be on top according to the hierarchy.
To Reproduce In https://github.com/google/filament/blob/main/android/samples/sample-transparent-view/src/main/java/com/google/android/filament/transparentrendering/MainActivity.kt#L111-L116 invert the two
addView()
invocations so that thesurfaceView
is added to theFrameLayout
before theTextView
.Expected behavior The text should be displayed in front of the rendered triangle
Screenshots The text is instead always drawn below, like in the original sample
Smartphone (please complete the following information):