Search Unity

External Lightmaps...

Discussion in 'Global Illumination' started by Vagabond_, Dec 5, 2016.

  1. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Hi, i was able to import and load (use) some custom lightmaps into Unity (using 5.5f3). All seems to work good except that lightmaps are gone as soon as i press play or close and reopen the scene... Like it is not serialized... I guess there is something about the "LightingData" asset which i probably used to store some data instead of serializing the lightmap data...!

    Is this is true and how i suppose to make the maps not be gone as no API for LightingData is available... ???
     
  2. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    You can add light map texture slot to any shader. if you need this, i can help you.
     
  3. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Thanks but there is a specif reason i am asking for this - take a look at this tool:
    https://www.assetstore.unity3d.com/en/#!/content/55406

    This is a tool that i am working on... using the GPU to bake AO to vertex colors and separate textures but now in v0.93b i am trying to implement scene baking with all the objects packed to atlases to be used as Lightmaps... In general there is a good chance for this to happen as soon as i manage to make Unity use my textures ( if possible at all )...

    Hey @Kuba i know you are doing work on Enlighten, can you look at this thread and suggest something...

    P.S. just to assume both problems i am having:
    1. Textures gone when press play...
    2. Mesh faces which are facing positive scene directions are darkened...

    Thanks !

    POLM_Atlas.png
     
    Last edited: Dec 5, 2016
    UnityLighting likes this.
  4. leitecunha

    leitecunha

    Joined:
    Jun 26, 2013
    Posts:
    7
    Hi there. After struggling to integrate my externally rendered lightmaps into Unity, and having no success with what I found, I created my own shader. It's called Standard Plus and you can simply plug in your custom lightmap textures baked for the models' second UV channel.

    In addition to that, It supports up to 5 lightmaps per material, so you can tweak their color and HDR levels at runtime, essentially doing a realtime light mixing, like day/night lighting... different interior lighting setups, etc.

    I hope you all like it!! Thanks! This is it: https://www.assetstore.unity3d.com/en/#!/content/93745

    It is basically the standard shader, plus the external lightmaps feature (and the ability to create realistic glass and translucent materials as well). No fancy weird shader UI with crazy inspector buttons and what not.
    That's it,
     
  5. orkungo

    orkungo

    Joined:
    May 3, 2014
    Posts:
    62
    Hi,

    I would like to add a lightmap slot to standard shader and save it as a new shader to use with my FBX file that has multiple meshes inside. As output I am trying to get day/night views at the runtime. Can you help with that?
     
    Last edited: Nov 13, 2017
  6. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    You can add lightmap texture into any new shader
    New shader can be created using Coding or Amplify Shader Editor
     
  7. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    You must multiply Lightmap texture into Albedo RGB and send it to Emission output of the shader
    Also you can use UV1 or UV 2 as lightmap UV
    My test in Baked Lightmap using VRay in MAYA in 10 min (screenshots from Unity)
    v1.jpg
    v2.jpg
    v3.jpg
     
    lolclol, zecafranca and boxhallowed like this.