Hi,
We have an issue that is specific to URP and Linear. In Gamma or Default pipeline the problem cannot be reproduced. Picture is worth a thousand words, so…
good:
bad:
Switching to the default pipeline OR to gamma color space makes the color correct again. I’ve tried about all possible things I’ve found online, including but not limited to:
- disabling HDR,
- trying out postprocess volumes to get the correct result (it’s hack, and I couldn’t make it work),
- try various ETC2 fallbacks and texture compression settings,
- Android blit type,
- lighting settings,
- pretty much all other settings in the Rendering menu.
I’ve also confirmed that the texture has correct colors before going to the Unity side, using renderdoc, so it’s definitely some Unity settting or bug…
Any hint welcome. Currently using Unity 2022.3.20f1.
If you want to test, try running the minimal scene from https://videolabs.io/solutions/vlc-unity-trial.unitypackage on a Android or iOS and URP/Linear project.
1 Like
@Videolabs In Assets/VLCUnity/Demos/Scripts/VLCYouTubePlayback.cs, lines 115-120, a Texture2D is being created with linear set to true on line 119. Does setting this to false change how the video looks on your device?
You might want to look for other places textures are being created. Make sure they’re using the correct texture format and colour space in their constructor.
Edit: Android recommends using SurfaceView instead of TextureView. I assume you’d need a native Android plugin to use SurfaceView on a polygon in Unity through.
No, this doesn’t affect the output when set to false. And it should be true anyway, the display issue is specifically with Linear.
This is the only place on the Unity side that a texture is created. And the issue is only happening on the Unity side as demonstrated by the RenderDoc screenshot.
These are Android UI concepts, we’re using an opengl es texture. And all works fine with the default pipeline and gamma color space. Same behavior on iOS (e.g. linear urp color are off).