Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Prelit Vertex lighting issue

Discussion in 'Editor & General Support' started by gabaghoul, Nov 24, 2008.

  1. gabaghoul

    gabaghoul

    Joined:
    Oct 18, 2008
    Posts:
    8
    I've completely prelit and lightmapped my scene in Maya and with no lights whatsoever in Maya the scene looks exactly as I want it to look in Unity.

    I'm having a couple of issues.

    The only parts of my scene that work right now are those objects that use the Lightmapped material. The prelit objects(those containing only baked vertex colors)are black. Is there a material that obeys the prebaked Emissive colors produced from the light baking process in Maya?

    Also, the only way I can get the lightmapped objects in Unity to look as they do in Maya is to turn off the lights in Unity completely. That would be fine. Of course, I need real-time lighting for the characters in the scene. Is there some type of light linking or object exclusion in Unity? Basically, I need to explicitly set the objects that should get lighting from the Directional and Ambient in the scene.

    Any help would be much appreciated.
     
  2. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    For baked vertex colors use this shader from the wiki.

    To turn dynamic lights off for lightmapped objects put the objects in a custom layer and turn that layer off for those lights by culling them.

    Ethan
     
  3. gabaghoul

    gabaghoul

    Joined:
    Oct 18, 2008
    Posts:
    8
    Thank you. I actually found that shader last night after I posted this message. Works like a charm.

    The layer works awesome too. Just set it up.

    One more question on this thread. How do I exclude the global ambient light for the new "No Lighting" layer I created? I want my player to get affected by the ambient but not the prelit terrain objects. Seems that lights I explicitly create in the scene(ie. Directional) work great but Global lights still affect all layers.

    If it is not possible to exclude the global ambient, is there anyway to get the effect of an ambient with a local light? Can an ambient light be created(like in Maya) so I can exclude it from the the prelit layer?
     
  4. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    In the vertex color shader turn the line "Lighting On" to "Lighting Off"... that should get rid of the Ambient Light.

    HTH,
    Ethan
     
  5. gabaghoul

    gabaghoul

    Joined:
    Oct 18, 2008
    Posts:
    8
    Worked perfect. Thanks.