Garry's Mod Texture Formats - Testers Needed

During the course of a project that I’m working on, I’ve needed real-time texture modification, and render targets are too slow to write pixel data to. So, I’ve created a module that will allow the creation and modification of procedural textures (it does other things, but that’s not important). I’ve noticed that when you create a procedural texture, you often don’t get the texture format you asked for. I need to know how consistent this behavior is across multiple video cards and operating systems, so I’ve created a little test script. I would appreciate it if the users of Facepunch would try this out, and report their findings.

https://dl.dropboxusercontent.com/u/20789739/texture_format_test.rar

There’s a clientside autorun script in there, with a binary module for Windows and Linux. I don’t have a Mac, so I can’t compile it for Mac. The test creates textures of various formats and attempts to write data that would be sensible for the requested formats. Pressing your +use key will toggle it between doing that, and writing data that would be sensible for the image formats I think it actually creates.

(ignore IMAGE_FORMAT_UVLX8888, I’ve removed it from the test due to crashing opengl)

If you get results that are different from what I’ve posted, I would like to see it.

Here’s what information I’ve gathered so far:

IMAGE_FORMAT_RGBA8888 - is actually BGRA8888
IMAGE_FORMAT_BGRA8888 - works as expected. 1 byte for each color channel, in the order BGRA
IMAGE_FORMAT_ARGB8888 - is actually BGRA8888
IMAGE_FORMAT_ABGR8888 - is actually BGRA8888
IMAGE_FORMAT_RGB888 - is actually BGR888
IMAGE_FORMAT_BGR888 - in directx, has an 4th padding byte, but is 3 bytes per pixel in opengl
IMAGE_FORMAT_I8 - 1 byte grayscale format
IMAGE_FORMAT_IA88 - 3 bytes for grayscale, 1 for alpha
IMAGE_FORMAT_A8 - 3 unused color bytes, 1 for alpha
IMAGE_FORMAT_BGRX8888 - no difference from BGR888
IMAGE_FORMAT_BGR565 - is actually BGR888
IMAGE_FORMAT_BGRX5551 - is actually BGR888
IMAGE_FORMAT_BGRA4444 - is actually BGRA8888
IMAGE_FORMAT_BGRA5551 - is actually BGRA8888
IMAGE_FORMAT_RGBA16161616 - works as expected. 2 bytes for each color channel, in the order RGBA
IMAGE_FORMAT_RGB888_BLUESCREEN - appears to be invalid
IMAGE_FORMAT_BGR888_BLUESCREEN - appears to be invalid
IMAGE_FORMAT_P8 - appears to be invalid
IMAGE_FORMAT_UV88 - appears to be invalid
IMAGE_FORMAT_UVWQ8888 - no idea what this is supposed to be, but has very different results on directx and opengl
IMAGE_FORMAT_UVLX8888 - also no idea here, but I get different results between graphics cards on directx, crashes opengl.

-snip didn’t read properly-

Yup, got the same result in ATI HD 6950 and win 10, don’t know why this keeps saying that i’m on win 7, i’ve reinstalled chrome

After +use

GPU: ATI Radeon HD 5700 series
OS: Windows10

nVidia GeForce GTX 850M, Windows 8.1, Latest non Windows 10 ready drivers.

[editline]25th August 2015[/editline]

DirectX 9.5


ShaderAPIDX8::CreateD3DTexture: Invalid color format!
ShaderAPIDX8::CreateD3DTexture: Invalid color format!
ShaderAPIDX8::CreateD3DTexture: Invalid color format!
ShaderAPIDX8::CreateD3DTexture: Invalid color format!
ShaderAPIDX8::CreateD3DTexture: Invalid color format!
ShaderAPIDX8::CreateD3DTexture: Invalid color format!
ShaderAPIDX8::CreateD3DTexture: Invalid color format!
ShaderAPIDX8::CreateD3DTexture: Invalid color format!
ShaderAPIDX8::CreateD3DTexture: Invalid color format!
ShaderAPIDX8::CreateD3DTexture: Invalid color format!
ShaderAPIDX8::CreateD3DTexture: Invalid color format!
ShaderAPIDX8::CreateD3DTexture: Invalid color format!
ShaderAPIDX8::CreateD3DTexture: Invalid color format!
ShaderAPIDX8::CreateD3DTexture: Invalid color format!
ShaderAPIDX8::CreateD3DTexture: Invalid color format!
ShaderAPIDX8::CreateD3DTexture: Invalid color format!
ShaderAPIDX8::CreateD3DTexture: Invalid color format!
ShaderAPIDX8::CreateD3DTexture: Invalid color format!
CPixelWriter::SetPixelMemory:  Unsupported image format 22



[t]http://i.imgur.com/fdv0H32.jpg

Windows 7 Geforce GT610

[t]http://thed3vine.net/s/5ebf00.png

Windows 10, GeForce GTX 690

+use

OS: Win10
GPU: AMD Radeon R9 270 (don’t remember if 270X or not)

Well, so far I haven’t seen anything unexpected. IMAGE_FORMAT_UVWQ8888 behaves differently on different cards, but I don’t think anyone would seriously consider using it for image data. These formats seem to be the useful ones:

IMAGE_FORMAT_BGRA8888
IMAGE_FORMAT_BGR888
IMAGE_FORMAT_I8
IMAGE_FORMAT_IA88
IMAGE_FORMAT_RGBA16161616

Would anyone object if these were the only image formats you could use?

I would still like to see some results from Linux (and Mac, if you can be bothered to compile the module).

Arch Linux - 4.1.4-1-ARCH Kernel
GTX760 with proprietary linux driver 352.30

Also got the same errors as RBB with developer 1.

Before correction:

http://f.donkie.co/rWexQ

After +use correction:

http://f.donkie.co/gJ5ly

Windows 10 Pro
GeForce 970, driver 355.60

windows 7, gigabyte r9 270x