Search Issue Tracker

Fixed in 2018.3.X

Votes

0

Found in

2018.1.0b1

2018.1.0f2

Issue ID

1037570

Regression

Yes

Error appears when calling Texture2D.SetPixels32() with a texture that has format set to BGRA32

Graphics - General

-

Reproduction steps:
1. Open the attached project "2018BugReport.zip";
2. Open the TestScene;
3. Enter a play mode.

Expected results: The scene is played without any errors.
Actual results: There an error shown in the console:
SetPixels32 can only be called on a RGBA32 or BGRA32 texture but is being called on TextureFormat(14)
UnityEngine.Texture2D:SetPixels32(Color32[])
GenerateTexture:Start() (at Assets/GenerateTexture.cs:12)

Reproduced on: 2018.1.0b1, 2018.1.1f1, 2018.2.0b4, 2018.3.0a1.
Not reproduced on: 2018.1.0a1, 2017.4.3.f1 or lower.

Comments (4)

  1. MortePCAndVR

    Jul 28, 2018 06:28

    Same issue in Unity 2018.2.1f1

  2. MortePCAndVR

    Jul 28, 2018 05:31

    Confirmed also same issue in Unity 2018.2.0f2
    On Textureformat.BGRA32

    "SetPixels32 can only be called on a RGBA32 or BGRA32 texture but is being called on TextureFormat(14)
    UnityEngine.Texture2D:SetPixels32(Int32, Int32, Int32, Int32, Color32[])"

    So, Issue tracker above says "fixed in future release"

    - Since 2018.2.1f1 is the latest version and this issue does not appear in the patch list:
    https://unity3d.com/unity/whatsnew/unity-2018.2.1
    I'm guessing that is a yet-to-be-announced future release which isn't even in beta yet?

  3. MortePCAndVR

    Jul 27, 2018 15:44

    Same issue here using a BGRA32 Texture2D, in Unity 2018.1.6f1.
    SetPixels32 works fine with an ARGB32 Texture2D, but requires expensive conversion code on each 32bit int to reverse colour byte order (endian-ness).

    LoadRawTextureData(intPtr,size) works fine with Textureformat.BGRA32 from the native framebuffer pixel data encoding without requiring endian preprocessing, but I need SetPixels32 for smaller rectangles inside the texture2D.

  4. ajayzthakur7

    May 28, 2018 15:52

    Facing same issue for 2018.1.0b1 , is any way to fix this please.

Add comment

Log in to post comment

All about bugs

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