Full precision float Vertex Colors

Hi,

I noticed that the Vertex Colors used in blender gets crushed into 8bit/channel. I would find it useful if this was changed to allow full precision float values. As a Technical Artist in the games industry I could use this for other things like altering deformation in vertex shaders or a cheep way of storing one shape key.

If I were to make a patch for this, would it be accepted?

8 Likes

It’s a bit odd to change vertex colors so you can use it for purposes that vertex groups and shape keys are intended for. Why not use vertex groups and shape keys?

If we change it should really be with the intent of improving vertex colors, not to use them for a different purpose. Memory usage will increase but it’s probably not too bad in practice.

1 Like

The game engines imports meshes from standard file formats like OBJ and FBX. Vertex Colors can be included in most of these formats as float values. FBX also can also carry shape keys but they are for instance imported as a skeleton mesh in unreal. These are a bit heavy to deal with so sometimes it might be necessary to use trickeries like using vertex color in an unintended way to get performant effects on game consoles.

There are ways around this. Instead of using the vertex colors I could for instance create a data UV map and store the precision data in OpenEXR images. But every texture sample is expensive.

There are also a problem using Blender in a tool chain if the vertex color information gets crushed. A link can not be allowed to destroy information.

I can’t really say that it’s to make Vertex Colors them self better… but I think the interoperability is important.

2 Likes

afaik vertex groups are not accesable for shader in most engines (even in eevee/cycles)
And using shape key enforces using skinned mesh which is more expensive than static mesh.

From my experience using vertex colors as set of 3/4 often unrelated vertex groups in shader is more common than using it as color information.

Eg. As factor of mixing textures (1, 2)

1 Like

Ok, then I think we would accept a patch that makes vertex colors floats.

If you do this change, it may also be a good time to then store the colors in linear color space rather than sRGB. Since this is a bit of a mess now. But that’s probably best as a second step.

6 Likes

Has there been any work on this patch?

It would be really nice to have higher precision with vertex colors. This is especially very sad situation when vertex colors passed to AOVs for representing classification masks for objects, which does not work properly since the correspondence between the precise color information and what comes out of the AOV is lost to a big degree.

The new sculpt vertex colors are float precision, they’re experimental now but aimed to be in the 2.91 release.

6 Likes

It would be beneficial to be able to select between 8 bit and 32 bit precision.

Or just 16 half float.

I really want to pass attributes from another software into Blender for shading purposes and also need float support.

2 Likes

Lots of my Alembics come from Houdini and I render in Cycles.
As long as there isn’t support for custom attributes coming from the Alembic, I work around it by (ab)using vertex colors for a lot of things which works astoundingly well, except for the 8bit limit the others already mentioned.
While custom attributes of all kinds (floats, vectors, colors, 8-, 16-half float, 32-full float) are available both for import via Alembic and for use in Cycles, having at least 16bit float colors in vertex colors would be awesome.

5 Likes

I too have used Vertex Colors for storing vectors (in my case, for displacement). I want to give my +1 to this topic and also mention: please fix the hard-coded colorspace in the vertex color node. It’s really confusing to know you have the right values stored in the vertex color channel, but see the wrong values in your displacement shaders because you don’t know that they’re being gamma-adjusted!

4 Likes

This is really painful,

I`m planning to render tens of float textures using the vertex corner values,
finding out suddenly that the blender shader solution ( at the moment) cant support it
is really really bad !.