Search Unity

GL.IssuePluginEvent issue with Unity 5.3 on Android

Discussion in 'Android' started by sloopidoopi, Dec 23, 2015.

  1. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    Hi,

    i made a plugin that calls via the GL.IssuePluginEvent(callbackfunc,id) method into my native code. In Unity 5.2 everything worked like expected but with Unity 5.3.0 my screen is black if i use two instances of my scripts at the same time that call GL.IssuePluginEvent with different parameters. This seems to be a bug as this behaviour is also when the native method is only a dummy with no code inside to be sure that no native code causes this issue.
    Can somebody confirm this behaviour ?
     
  2. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    I managed to get my plugin working again. It was a combination of changing the GL.IssuePluginEvent call from a Coroutine that calls after a WaitForEndOfFrame like in the NativeRendering example to a normal Update() interval.
    And in my OpenGL code i had to setup the statemachine more stricly before i render.
    Code (CSharp):
    1. glDisable(GL_CULL_FACE);
    2. glDisable(GL_BLEND);
    3. glDepthFunc(GL_LEQUAL);
    4. glEnable(GL_DEPTH_TEST);
    5. glDepthMask(false);
    In Unity 5.2 it worked without this setup.
    Really crazy these changes in the backend of Unity with every new version.:mad:
     
  3. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    I opend a new bug as this is an issue not only in my project. I tested the NativeRendering project from Unity. If you try to call from multiple scripts the GL.IssuePluginEvent command you get a black screen . Only if you change the point of the calling from the coroutine into the normal Update() method it works.
     
    MrEsquire likes this.