Importing vertex colors and encoding

Hi there
I’m new to Unreal and I am working on import/export of file formats for an app i’m working on.

This question is about color “encoding” - as in linear vs sRGB.
There are some file formats (eg fbx) that even though they have data types that are large enough to store colors as linear, don’t actually document that choice, so there are some dcc (say, blender) that export colors as sRGB, while others export as linear.

How do Unreal 4 and 5 (prefer to) interpret vertex colors in the default file loaders?

  • glTF documents the color being linear.
  • The same is true (though that doc was hard to find) in USD and all its flavors.
  • No such info is found in FBX or OBJ.
    What does Unreal do with those and is that choice documented?

Hi,
here is some info that could help you for the FBX file format.

The vertex color of a mesh in FBX are store in a array of FBXColor. While the values used for the channels are double these are actually encoded in sRGB. (Yes this not documented unfortunately)

The FBX importer for the unreal editor convert these into linear value during the import.

1 Like