English 中文(简体)
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





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签