Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

[Feature Request] Vertex Colored Lightmapping

Discussion in 'Unity 5 Pre-order Beta' started by Warrior1424, Dec 24, 2014.

  1. Warrior1424

    Warrior1424

    Joined:
    Sep 30, 2010
    Posts:
    984
    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.
     
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    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 :)
     
  3. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    The baking to vertex colors feature is a good idea and something we want to look into sometime during the 5.x cycle.
     
  4. Warrior1424

    Warrior1424

    Joined:
    Sep 30, 2010
    Posts:
    984
  5. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Cool, please make it work with terrain too :)