Result of Texture2D.ReadPixels() is a texture completely blue

Hi everyone, I working currently on a game for Tizen platform and I have a little issue concerning Texture2D.ReadPixels()

I explain you quickly the problem, in my game, I need screenshot a camera and display the render on a UI, to do that I use Texture2D.ReadPixels() and display the texture2D on an UI image raw.

On all platforms, everything working great, even on the Tizen emulator, but when I try with a “real” Tizen device, the result of ReadPixels is a texture completely blue.

I attach you a picture of that, the result is the blue square in the center:

On all the other platforms, I have this result:

I saved the texture on the phone to be sure the problem isn’t the display on the image raw … and the result is the same an image completely blue.

Last information, I start, I built my app with unity 5.5.0, now I build with 5.6.2 and the result is not exactly the same, the UI is displayed on the screenshot:

I looked the features currently not supported by Unity Tizen and I didn’t see ReadPixels so … I don’t know what is the problem.

Has this ever happened to anyone ? And did you find how solve it ? Thank you

I couldn’t reproduce this problem on Z1 and z2, and Z3.
Could you share the codes you are using? (and settings of Main Camera too)

Ok thank you for your reply, I have extracted the codes I am using:

public IEnumerator GrabPicture()
{
    yield return new WaitForEndOfFrame();

    // Calculate screenshot size
    int width = Screen.width;
    int height = Mathf.FloorToInt(Screen.width / ratio);
    if (width > Screen.height)
    {
        width = Mathf.FloorToInt(Screen.height * ratio);
        height = Screen.height;
    }

    // Calculate margin
    int marginWidth = Mathf.FloorToInt((Screen.width - width) / 2f);
    int marginHeight = Mathf.FloorToInt((Screen.height - height) / 2f);

    // Capture
    Texture2D screenshotTexture = new Texture2D(width, height, TextureFormat.RGB24, false);
    screenshotTexture.ReadPixels(new Rect(marginWidth, marginHeight, width, height), 0, 0, false);
    screenshotTexture.Apply();

    // Save picture on file
    byte[] bytes = screenshotTexture.EncodeToJPG();
    string screenshotPathFull = screenshotPath + ((screenshotPath == "") ? "" : "/") + screenshotName + ".jpg";
    File.WriteAllBytes(screenshotPathFull, bytes);

    // Callback
    if (callbackGrabPath != null)
        callbackGrabPath(screenshotPathFull);
    if (callbackGrabTexture != null)
        callbackGrabTexture(screenshotTexture);
    if (callbackGrabPathTexture != null)
        callbackGrabPathTexture(screenshotPathFull, screenshotTexture);
}

I just call StartCoroutine(GrabPicture()); in an OnClick event attach to an UI button.

And for the settings of the camera:
3123560--236510--TizenReadPixelsBug-04.jpg

I created an “empty” project with only the necessary codes … and the problem append. But everything is completely black not blue :frowning:

You can download the project here: https://drive.google.com/file/d/0BwCnbLR5WTgFMGFEQ1JwRlJ4Q2M/view?usp=sharing

Ok, I finally find the problem, and it’s not coming only of the methods screenshotTexture.ReadPixels.
The problem was at the same time, I activate a RenderTexture on the camera.