[Feature Request] Vertex Colored Lightmapping

While playing Left 4 Dead 2 today, I noticed something.
Some of the objects used vertex colors for their lightmap, instead of a second texture for the lightmap.
This is used sparingly, and mostly on smaller props that don’t need super detailed shadows, but still need some static shading to a degree

(See Boxes):

But what it is most useful for is rounded surfaces. Rounded surfaces are almost impossible to lightmap properly with a second texture, unless you hand unwrap all the lightmap UVs yourself.
Vertex colors might not be as accurate or detailed, but I personally feel huge seams near curves are much more distracting than slight lighting inaccuracies on the flatter areas.

Rounded Surfaces:

I don’t know how the memory of some vertex colors compares to the memory of a larger lightmap, but I can imagine that having loads of small props each being unwrapped onto a lightmap could be quite memory intensive.

Also, I know that there are some addons that do this, but it would be nice to see it integrated into the current lightmapping system on a per-object basis.

Also, I’m not an expert on vertex colors, but when using some addons I noticed that a copy of the mesh had to be created so that the vertex colors could be applied.
Is this a limitation that existed because the addon was not fully integrated into Unity, or is this an issue that even the Unity devs would run into if they would implement it into the engine? Because having a copy of every mesh with the vertex colors applied would be a horrible idea.

I’m interested in hearing everyone’s input.

I also requested this feature and Unity had a bit of a discussion and decided it would be feasible sometime in the future after 5 shipped, but they haven’t guaranteed it nor made any kind of promise. It’s merely a good suggestion with a lot of fringe benefits.

Some objects simply don’t uv well and in these cases (plus small objects), it would really shine even on high end hardware.

It wouldn’t require a copy of the mesh, there’s another vertex channel Unity can use or such during editor/build so it’s very viable. Here’s hoping after Unity 5 they’ll get time :slight_smile:

The baking to vertex colors feature is a good idea and something we want to look into sometime during the 5.x cycle.

5 Likes

Cool!

Cool, please make it work with terrain too :slight_smile: