Search Issue Tracker

Fixed in Unity 5.2.0

Votes

16

Found in

5.0.0f4

Issue ID

681089

Regression

No

[Texture2D] Texture2D.ReadPixels() fails if RenderTexture has anti-aliasing set

Graphics - General

-

-

Priority: 2Necessary for shipping a final release

-

Severity: 0Severity not yet defined

There is a camera which renders to a RenderTexture. If this RenderTexture has anti-aliasing set Texture2D.ReadPixels results into an empty texture.

How to reproduce:
1. Open Main.scene in the attached project
2. Press buttons

One of the buttons uses an anti-aliased RenderTexture, another one uses a nonanti-aliased RenderTexture.
The first one fails to be captured into another Texture2D.

Comments (6)

  1. 70fa0f436516c66768ba165d6af77766?d=mm

    KevKevOnFire

    Sep 12, 2016 15:35

    I am still seeing this issue in 5.4.0 when passing a the resulting texture2D into a shader

  2. Ab22d5dd95f19b400e36810be9ef90d9?d=mm

    mpgholden

    Aug 27, 2015 19:23

    This happens in 4.6 as well, and is a pretty big issue for Gear VR developers. Gear VR games crash on 4.6 when running in GLES 3.0 unless all eye texture anti aliasing is disabled. Only current option is to run in GLES 2.0 mode, which forces us to texture compression that makes me cry :(

  3. 2e3d9ba8ff2a88c0162235ea4658b378?d=mm

    eVRydayVR

    Jul 23, 2015 14:34

    I implemented a workaround for this bug, which you can read about in detail on my blog (https://evrydayvr.wordpress.com/2015/07/23/unity-bug-workaround-readpixels-and-rendertexture-antialiasing-1/), although it's still quite annoying as it requires an extra temporary render target.

  4. E11a5e4dbae74b7cd633d41153a586cb?d=mm

    ngothanhtai

    Apr 09, 2015 07:01

    To me, this problem just happened with OS X, works fine on Windows.

  5. 71cb5bdc73bba20d73fc4c24f0fdbdfe?d=mm

    PNordlund

    Apr 02, 2015 06:11

    Amazingly, I get this too.

  6. Db70af7395df0dd8cf3aed22b81c96d3?d=mm

    leokrzewina

    Apr 01, 2015 18:59

    This happened in Unity 4 as well.

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.