Search Issue Tracker
By Design
Votes
0
Found in
5.0.1f1
2017.4
2020.2
Issue ID
687128
Regression
No
PVR textures are flipped upside-down when imported in the Editor or loaded via Texture2D.LoadRawTextureData
How to reproduce:
1. Open user-submitted project (Repro.zip)
2. Open the SampleScene
3. Enter Play Mode
4. Note the 2 images(loaded via script and imported in the Editor)
5. Open the PVR textures outside of the Unity Editor(local.pvr or StreamingAssets/lava.pvr)
6. Compare the images
Expected result: the image in Unity matches the image preview outside of Unity
Actual result: the image in Unity is flipped upside-down
Reproducible with: 2017.4.38f1, 2018.4.19f1, 2019.3.6f1, 2020.1.0b2, 2020.2.0a3
Notes:
Expected to be projected correctly with Metal for iOS and OpenGL & Vulkan for Android
Comments (4)
-
ToruTheRedFox
Jan 31, 2022 17:38
Why is this behaviour present on DXT textures and why can't it be disabled without decompressing and manually flipping it? (which completely defeats the purpose of using DXT in the first place)
-
tswalk
Nov 28, 2016 17:34
5.4.x and totally not fixed, also occurs with PVR images.
-
Gaello
May 13, 2015 16:27
5.0.2 and still not fixed..
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
Resolution Note:
The PVR compressed format does not allow Unity to flip the compressed image upon importing (in contrast to for example compressed DDS files, which Unity flips upon importing). Given that the default orientation of PVR textures does not match the required orientation of Unity, Unity renders these textures upside down. Hence Unity asks for flipped PVR textures (a warning is given: 'Unity expects vertically flipped PVR file.'). PVR encoders such as PVRTexTool allow PVR images to be encoded with a vertical flip, signaled in the PVR image header, hence the image source file does not have to be flipped. If it is not possible to encode the PVR images y-flipped, then the only solution is to manually flip the uvs in the shader. When using PVRTexTool, pass the arguments '-flip y,flag' to flip the image vertically and signal in the metadata that it was flipped.