Search code examples
c#unity-game-enginegraphicstexture2d

Unity3D WebCamTexture graphicsFormat value doesn't exist


I wanted to check which UnityEngine.Experimental.Rendering.GraphicsFormat my WebCamTexture is using.

WebCamTexture webCam = new WebCamTexture();
Debug.Log($"Graphics Format is {webCam.graphicsFormat}");

The output is Graphics Format is 88 but 88 does not seem to be in the GraphicsFormat enum, which goes up to 86 and then continues at 96.

So which format is the WebCamTexture using?

EDIT: I am using Unity 2019.4.21f1 for this project.


Solution

  • 88 is ARGB32, even though it's not part of the named enum values.

    Edit: the full list of undocumented options is as follows:

    • Alpha8 54
    • ARGB32 88
    • YUY2 141
    • ASTC_HDR_4x4 145
    • ASTC_HDR_5x5 146
    • ASTC_HDR_6x6 147
    • ASTC_HDR_8x8 148
    • ASTC_HDR_10x10 149
    • ASTC_HDR_12x12 150
    • PVRTC_2BPP_RGBA 108875872