简体   繁体   中英

GL_INVALID_FRAMEBUFFER_OPERATION: Framebuffer is not complete or incompatible with command

i have made a 360 image viewer on unity and i am changing image texture dynamically using c# script, so its work fine on PC unity but when i run it on android device it say error below:

OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_FRAMEBUFFER_OPERATION: Framebuffer is not complete or incompatible with command

My code below

 IEnumerator registerFunc(WWW www)
{
    yield return www;
    if (www.error == null)
  //if(true)
    {
        Debug.Log("OK - CountTime");
        texturas = www.texture;
        www.Dispose();
        www = null;

       sphereMS.material.mainTexture = texturas;// here i am getting error
    }
    else
    {
        Debug.Log("ERROR");
    }
}

So any one can help me out in this how i can solve it.Thanks!

resolution is 9999x2429 and sphereMS is public variable to which i have assigned sphere using drag and drop

That's the problem. 9999 is really big. The limit on most Android devices is about 2048. Anything above this is a problem unless you are running this on very high end and expensive Android device.

One thing to try is replace

texturas = www.texture; 

with

texturas = new Texture2D(4, 4);
texturas.LoadImage(www.bytes);

The LoadImage function is used to load jpg/png image into a Texture. It might fail too due to the size of the image.


If LoadImage fails too then you should have different Texture resolution for each platform on your server. The Android platform should request for a lower resolution version of your Textures. Just keep reducing the Textures resolution until it stops crashing. 2048 resolution should be fine.

I suggest you read this post about texture size limit in Unity.

EDIT:

If you have changed the resolution to below 2048 and the problem is still there then this is a bug.

Install Unity 2017.2.0p1 or 2017.3.0b3 to get the fix. Few people experience this with the google-cardboard plugin.

Mostly it happens on Android devices using Mali GPU, even Asphalt 8 couldn't run on these devices (at least old ones).

I tried on Huawei Mate 10 and Samsung Galaxy A50s, as both are using Mali-G72 MP12 and MP3 respectively so getting the same error and the image gets black/blank (couldn't render).

While same works fine on other Android and iOS devices

use parametre

-disable-gpu  

or

app.disableHardwareAcceleration()

look here enter link description here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM