Are 8-bit Dynamic Textures supported?

Hi, I’m trying to create a dynamic texture with the pixel format PF_R8_UINT in C++, and then use that in as a texture object parameter through a dynamic material. Below is a tiny code snippet where I create the texture:

    int Width = 2592;
    int Height = 1936;        
    m_Texture = UTexture2D::CreateTransient(Width, Height, PF_R8_UINT);
    m_Texture->UpdateResource();

And this is a snapshot of a material blueprint I’m starting out with:

Executing the program, however, often results in an error message that says my types aren’t configured correctly:

failed assertion `MTLPixelFormat of texture [Texture2D_0 (MTLPixelFormatR8Uint)] bound at index 0 is incompatible with texture parameter [MTLDataTypeFloat ps0[0]]. MTLPixelFormatR8Uint is compatible with texture data types type(s) (
    uint,
    ushort
).'

Changing PF_R8_UINT to something like PF_R32_FLOAT works, though I’d rather not take that route.

Anyone else have success creating an dynamic texture of 8bit uints or chars?

Any insight is greatly appreciated! Thanks!

I stumbled upon this question when searching for a similar issue.

And after a lot of trial and error I found out that by setting the dynamic texture format to PF_G8 and changing the sampler type inside the material from Colour to Distance Field Font like this:

137915-kuvakaappaus+-+2017-05-14+19-29-28.png

I got it working.

This is the code I used to create my textures DensityMaterial = UTexture2D::CreateTransient(1024, 1024, PF_G8);

and I filled it with the UpdateTextureRegions example function from the wiki: A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums