Search Unity

how can i set unity opengles version at runtime, not use playersetting.SetGraphicsAPIs

Discussion in 'Android' started by avrilfeng, Nov 15, 2018.

  1. avrilfeng

    avrilfeng

    Joined:
    Jun 27, 2014
    Posts:
    2
    how can i set unity opengles version at runtime with android, not use playersetting.SetGraphicsAPIs. cuz my game on some android old devices must use opengles2.0 to build apk. some shader is not work correctly. i do not want to build two apk for diffirent devices.
     
  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,014
    Unity picks the highest supported Graphics API automatically. If the device doesn't have support for anything but OpenGL ES 2 and OpenGL ES 2 is in the Graphics API list in Player settings, it will choose OpenGL ES 2.

    There is no way to choose the OpenGL version at runtime.

    If some shader doesn't work correctly, then check if this shader if supported on OpenGL ES 2 and provide a fallback if it isn't.
     
  3. avrilfeng

    avrilfeng

    Joined:
    Jun 27, 2014
    Posts:
    2
    I know what you mean. but sometimes some old devices which check support opengles3.0 and use it. but shader do not work correctly. That exist in some old android devices. i come from china. there also has some old devices has that problem. so i just try other way to solve it. thanks for your answer.
     
  4. LindsayParmenter

    LindsayParmenter

    Joined:
    Sep 10, 2014
    Posts:
    21
    Is this still impossible to force opengl (or other api's) other than via commandline? We'd like users to be able to boot in opengl as a workaround for some compatibility issues some users have been having with DirectX on older machines... but there is no way to specify a commandline in windows store builds..
     
  5. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,014
    @LindsayParmenter afaik not.
    Can you include shortcuts in a windows store build or create them while installing the app / on the first run?
     
  6. YURI_uwu

    YURI_uwu

    Joined:
    Mar 12, 2019
    Posts:
    12
    I have two builds for the Android platform where "BUILD A" uses OPENGL ES 2.0 and "BUILD B" uses OPENGL ES 3.0.
    Both builds also uses the URP Post Processing. I have noticed that the game runs much faster when it uses OPENGL ES 2.0 in a Samsung J7 Prime phone (Android 8.1). I also tried running Build A (OPENGL ES 2.0) in a Samsung Galaxy S7 (Android 6.0.1) and it works fine. HOWEVER, the Samsung Galaxy S7 doesn't have the Post Processing Effects when it uses BUILD A, but has the post processing effect when it uses Build B. I really don't know what to do at this point, I want my build to (1) perform faster, (2) have the post processing effects and at the same time (3) support Android 4.4 version and above. Am I missing something in the Player Settings to enable post processing for OPENGL ES 2.0 with the Samsung Galaxy S7? I just really don't get it that even if Samsung J7 prime uses Build A (OPENGL ES 2.0), it shows the post-processing while Samsung Galaxy S7 does not show Post Process when using Build A.
     
    Last edited: Jul 7, 2020
  7. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,014
    @MATEOICHIJO I suggest to open another thread in Android subforum.