Search Unity

Light Mapping and Shaders

Discussion in 'General Graphics' started by boadleFTG, Jul 29, 2020.

  1. boadleFTG

    boadleFTG

    Joined:
    Nov 23, 2017
    Posts:
    18
    Couple of light mapping and shader questions, folks.

    (1) My baked lightmaps aren’t displaying when I go into play mode. Why might that be?

    (2) If a light map bakes from UV coordinates, does that mean all instances of a prefab will have the same lighting? What about tiling geometry that shares UVs (eg a road system)?

    (3) Why does the Screen Space Reflections post-process cause my (Amplify) CustomOutlineToon shader material to render half transparent, and what could I do about it?

    Thanks!
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    1) Do they show before you go into play mode?

    2) Light maps require unique UVs within a 0.0 to 1.0 UV range. They won't work on any single object with overlapping or repeating UVs. However multiple copies of the same mesh are fine as the UVs aren't used directly, but rather are scaled & offset to position them inside an atlas that multiple objects share.

    3) My guess is you're using deferred rendering. You can't use custom light models on opaque objects with deferred rendering, though Unity will pretend to. The result is any post processing that makes use of the gbuffer data that deferred rendering generates will be effectively corrupted by the opaque-but-not-deferred objects. Forward rendering can kind of avoid this problem, but some post processing techniques don't work at all... like screen space reflections.