Hi,
my project setup on Android includes WebView which is injected behind the UnityPlayer.
The unityPlayer is subclassed to set a translucent pixel format for the player SurfaceView.
public class CustomUnityPlayer extends UnityPlayer
{
...
public void addView(View child) {
if (child instanceof SurfaceView) {
final SurfaceView surfaceView = (SurfaceView) child;
surfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
surfaceView.setZOrderOnTop(true);
}
super.addView(child);
}
}
The plugin later also injects the WebView into the layout.
This works all fine except that any transparent UI canvas element that is rendered on top of an opaque ui element somehow leaves the frame buffer to being transparent in that area with the result that it is blended against the WebView behind.
You can see in the screenshot that the progress bar is showing some elements from the webview behind. The progress bar however is not supposed to be transparent. It’s an opaque image with some transparent shine effect rendered on top. But this transparent image sets the alpha value for the final frame buffer.
Any ideas how this can be prevented?