Search Unity

Lightmapping and mobile

Discussion in 'Global Illumination' started by martaaay, Mar 15, 2018.

  1. martaaay

    martaaay

    Joined:
    Apr 13, 2009
    Posts:
    136
    Many of my static objects are using Standard shader for best light mapping results. After the light map is generated, what happens when deploying on mobile? Do I still get the expensive standard shader performance on mobile? Or does it turn into a nice simple shader that combines the light map with the albedo texture?

    If the latter, does anybody have any recommendations on a workflow for mobile? Does anybody else generate the light map and change the shader to something like 'diffuse' at build time?

    Thank you!
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,790
    Why? The standard shader doesn't do anything for lightmapping.

    Yes. (or at least the simplified mobile version)
     
  3. martaaay

    martaaay

    Joined:
    Apr 13, 2009
    Posts:
    136
    The standard shader doesn't do anything for light mapping? Interesting. But if I choose something like mobile/diffuse, I won't get nice effects like emission that makes a nice glow when doing GI calculations. Is there another option, or am I just totally confused (the latter may be the case!).

    The workflow I'm considering is this: Material my static elements with standard, Lightmap, then at build time swap all standard materials to mobile/diffuse.
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,790
    If you want emission you can choose an emissive shader.
     
    UnityLighting likes this.
  5. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    Only color (+ texture's color) and emissive value is important in lightmapping from shaders

    So you can use Diffuse shader for all surfaces and Legacy Shaders->Self Illuminated->Diffuse shader for emissive materials (set GI Mode to Baked)