Garry's Mod Wiki

Revision Difference

Enums/IMAGE_FORMAT#566113

<enum> <realm>Client</realm> <description> Enumerations used by <page>Global.GetRenderTargetEx</page> to determine the byte format of each pixel in the <page text="Render Target">render_rendertargets</page>. </description> <items> <item key="IMAGE_FORMAT_DEFAULT" value="-1"> </item> <item key="IMAGE_FORMAT_RGBA8888" value="0"> Red, Green, Blue, Alpha, 8 bit per pixel. </item> <item key="IMAGE_FORMAT_ABGR8888" value="1"> Probably legacy format. Alpha, Red, Green, Blue, 8 bit per pixel. </item> <item key="IMAGE_FORMAT_RGB888" value="2"> Red, Green, Blue, 8 bit per pixel. </item> <item key="IMAGE_FORMAT_BGR888" value="3"> Legacy format. Blue, Green, Red order, 8 bit per pixel. </item> <item key="IMAGE_FORMAT_RGB565" value="4"> Red, Green, Blue, 5 bit per pixel for Red and Blue channels, 6 bits for Green. Effectively uses less video memory. </item> <item key="IMAGE_FORMAT_ARGB8888" value="11"> `IMAGE_FORMAT_RGBA8888` with different byte order. Legacy format. </item> <item key="IMAGE_FORMAT_BGRA8888" value="12"> `IMAGE_FORMAT_RGBA8888` with different byte order. Legacy format. </item> <item key="IMAGE_FORMAT_RGBA16161616" value="25"> RGBA, but 16 bits per pixel. Was meant to be used for "Integer mode" for HDR. Probably legacy format. </item> <item key="IMAGE_FORMAT_RGBA16161616F" value="24"> RGBA, but floating point 16 bits per pixel. Is used for "Float mode" HDR. </item> </items> </enum> # Additional Values In addition to the enum values listed above, there are several additional image formats that can be used to create Render Targets but **do not** have Lua variables defined for them. To use these additional enums, use the numerical value directly (E.g. use `5` instead of `IMAGE_FORMAT_I8`) The values below may not be an completely exhaustive list. For more information on these formats, see [VTF Enumerations.](https://developer.valvesoftware.com/wiki/Valve_Texture_Format#VTF_enumerations) ## General The following enum values are from the base Source Engine and do not have Lua variables defined for them simply because they are used less frequently than other formats. | Enum Name | Value | Description | | ---- | ----- | ----------- | | IMAGE_FORMAT_I8 | 5 | Grayscale format (black and white), 8 bits per pixel. Not working on Proton as of 2026/01/11. | | IMAGE_FORMAT_IA88 | 6 | Grayscale format (black and white) with alpha support, 8 bits per pixel/channel. Not working on Proton. | | IMAGE_FORMAT_A8 | 8 | Unknown legacy format. 8 bit alpha? Same as `I8` besides assigned meaning/name to the channel? | | IMAGE_FORMAT_BGRX8888 | 16 | Unknown legacy format. Same as `BGRA8888`, but without defining meaning to the 4th channel? | | IMAGE_FORMAT_BGR565 | 17 | `RGB565`, but reverse color order. Legacy format. | | IMAGE_FORMAT_BGRX5551 | 18 | Unknown legacy format. | | IMAGE_FORMAT_BGRA4444 | 19 | Unknown legacy format. | | IMAGE_FORMAT_BGRA5551 | 21 | Unknown legacy format. | | IMAGE_FORMAT_R32F | 27 | Single color channel, 32bit float per pixel. | | IMAGE_FORMAT_RGBA32323232F | 29 | 32bit floating point RGBA. | | IMAGE_FORMAT_DXT1 | 13 | Compressed texture format. See https://en.wikipedia.org/wiki/S3_Texture_Compression. | | IMAGE_FORMAT_DXT3 | 14 | Compressed texture format. Do not use. See https://en.wikipedia.org/wiki/S3_Texture_Compression. | | IMAGE_FORMAT_DXT5 | 15 | Compressed texture format. Better quality than DXT1, supports alpha. See https://en.wikipedia.org/wiki/S3_Texture_Compression. | ## Team Fortress 2 The following enum values are available on the `main` and `dev` <page text="branches">Global.BRANCH</page> and are originally from [Team Fortress 2's engine branch](https://developer.valvesoftware.com/wiki/Team_Fortress_2_engine_branch). | Enum Name | Value | Description | | ---- | ----- | ----------- | | IMAGE_FORMAT_NV_DST16 | 30 | Hardware 16 bit Depth texture formats for shadow depth mapping. Used in <page>Global.ProjectedTexture</page>. | | IMAGE_FORMAT_NV_DST24 | 31 | Hardware 24 bit Depth texture formats for shadow depth mapping. | | IMAGE_FORMAT_NV_DST16 | 30 | Hardware 16 bit Depth texture format for shadow depth mapping. Used in <page>Global.ProjectedTexture</page>. | | IMAGE_FORMAT_NV_DST24 | 31 | Hardware 24 bit Depth texture format for shadow depth mapping. | | IMAGE_FORMAT_NV_INTZ | 32 | Hardware depth format. Allow to read depth as color texture. See [D3D9 GPU Hacks](https://aras-p.info/texts/D3D9GPUHacks.html). | ## Counter-Strike: Global Offensive The following enum values are available on the `x86-64` <page text="branch">Global.BRANCH</page> and are originally from [Counter-Strike: Global Offensive's engine branch](https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_engine_branch) | Enum Name | Value | Description | | ---- | ----- | ----------- | | IMAGE_FORMAT_D16 | 39 | Hardware 16 bit Depth texture formats for shadow depth mapping. | | IMAGE_FORMAT_D16_SHADOW | 47 | Hardware 16 bit Depth texture formats for shadow depth mapping. Used in <page>Global.ProjectedTexture</page>. | | IMAGE_FORMAT_D24X8_SHADOW | 48 | Hardware Depth-stencil texture formats for shadow depth mapping. 24 bit depth + 8 bit stencil. | | IMAGE_FORMAT_D16 | 39 | Hardware 16 bit Depth texture format for shadow depth mapping. | | IMAGE_FORMAT_D16_SHADOW | 47 | Hardware 16 bit Depth texture format for shadow depth mapping. Used in <page>Global.ProjectedTexture</page>. | | IMAGE_FORMAT_D24X8_SHADOW | 48 | Hardware Depth-stencil texture format for shadow depth mapping. 24 bit depth + 8 bit stencil. | | IMAGE_FORMAT_INTZ | 67 | Hardware depth format. Allow to read depth as color texture. See [D3D9 GPU Hacks](https://aras-p.info/texts/D3D9GPUHacks.html). |