Search Unity

Transparency on Android

Discussion in 'Android' started by wondersteve, Feb 16, 2017.

  1. wondersteve

    wondersteve

    Joined:
    Oct 3, 2016
    Posts:
    2
    I'd like to have Unity render to a surface with transparency on Android, for use as an overlay view within a native application. This was apparently possible in earlier versions of Unity, where it was possible to adjust the parameters of the created GLSurfaceView before surface creation. Currently it appears that Unity creates an opaque EGL surface in one of the shared libraries (libmain, libmono, or libunity)

    There are potential solutions which would require assistance from Unity (listed below). Anyone been able to work around this restriction on Android?

    I've submitted a "new idea" form for this, which allows users to vote for features. https://feedback.unity3d.com/sugges...o-be-used-as-an-overlay-on-native-application

    Here are the Unity assisted solutions I mentioned:

    1) Provide a build option to enable a transparent surface
    2) Provide custom libraries that would use a transparent surface
    3) Provide source code and build instructions for the libraries so that I may make the required changes
    4) Build an option in the java UnityPlayer class to allow for a transparent surface
     
  2. danw_unity

    danw_unity

    Unity Technologies

    Joined:
    Oct 16, 2014
    Posts:
    27
    Hi,

    You are correct, this is currently impossible with Unity (since 5.0), for the reason you describe. This feature (or variations of it) have been requested in the past, but it is not currently scheduled for implementation.

    Re. your point 3), source code access is available at additional cost, you would need to contact your local sales representative.

    Re. 4), this is not a viable solution because the final render target is opaque, so there is no information with which to render the transparency, even if the Java layer was set up to for it.

    Regards,

    Dan
    Unity Support
     
  3. pawelsamsel

    pawelsamsel

    Joined:
    Mar 8, 2016
    Posts:
    1
    Hi,

    has anything changed in this matter?

    Is it possible in Unity2020.3 to render unity as an overlay above a native android activity?