Describe the bug
Hi everyone. I have a doubt about this issue https://github.com/google/filament/issues/3460 . Is there a way to create the "sandwich" effect on Android, using a SurfaceView? Maybe drawing a background image into the scene, I don't know. I've tried to use a TextureView instead of the SurfaceView to achieve that but no luck so far, in particular replacing the SurfaceView with the TextureView I'm not able to see the 3d model anymore when launching the application, I cannot see any error but the model rendering is not started.
To Reproduce
I put the reference link of the issue I'm trying to solve on my app https://github.com/google/filament/issues/3460 .
Expected behavior
I'd like to have a background image behind the 3d model, but avoiding to put the model at the very top of the screen, because in this case it will overlap the other UI elements in the screen (this is what I'm trying to avoid). Thanks in advance.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
https://github.com/google/filament/issues/3460
Same problem! Any news?
SAME ISSUE FROM DAYS!!! I am happy that I am not alone!! xD
Please samples or support!
SurfaceView cannot be used in the way you describe. A SurfaceView is a separate window and can be either below (default) or above your Activity's window. It cannot be between regular UI elements. That's what TextureView is for and we provide a sample showing how to use a TextureView.
Thank you @romainguy, I followed the example provided and I loaded a glb model in my textureView but the rendering seems not to work, on the other hand using the SurfaceView the model works like a charm but I'm not able to create the "sandwich" effect as said by @luca-90. Any thoughts?
Again, SurfaceView cannot do this. You have to use a TextureView or render the background in the SurfaceView.
Yes this is clear, but the TextureView seems not to work properly with modelViewer, indeed the screen is empty. @romainguy
again, we already used the Textureview with your example but it doesn't work with all the glb/gltfs files we tried so far. Surfaceview cannot create the "sandwich" effect so we cannot use it in this case @romainguy . We will try one more again with a simple glb file, but in case it doesn't work please could you provide us a simple example working with a glb file ? We can share also our code in case needed.
Does the unmodified TextureView sample work for you? Source code would be helpful too yes.
I tried to implement the sample project but the build.gradle configuration seems not to work and I'm not able to compile the material file needed. @romainguy