Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Lightmapping trees with baked only directional light

Discussion in 'iOS and tvOS' started by kmoosmann, Apr 27, 2014.

  1. kmoosmann

    kmoosmann

    Joined:
    Mar 1, 2014
    Posts:
    22
    Hello there,

    I'm totally new in the forums and I'm hoping that I'm in the correct forum to post this problem :)

    I would like to completely bake a directional light into my scene, disabling it on runtime due to performance reasons. Problem however is that my trees don't get lightmapped. I am not using the Treemaker assets, rather than assets we created ourselves. They are currently using the built in "Tree soft occlusion leaves" shader.

    Now my initial problem was that the trees simply vanished as soon as the baking was completed, which I "hack-solved" by setting the lightmap size on the trees to zero. Now the trees cast shadows onto the terrain, but they are still of course not lightmapped themselves and as soon as I disable they directional light, they simply "go black" because of the missing lightmap.

    These are very simple trees, but they do of course have transparent textures for the leaves. Is there any way to bake a lightmap onto a transparent texture like that? Any way to get rid of the realtime directional light?

    Using Unity Pro btw.

    Cheers!
     
  2. Savahax

    Savahax

    Joined:
    Nov 24, 2016
    Posts:
    3
    Bump. Well formulated problem there. I have the exact same issue and it took me two days to figure out it was because I set the Direction Light to Baked before placing the trees. They're only properly lit when DL is set to Mixed.

    Also looking for a solution to not have black trees when the DL is set to Baked only. Cheers
     
  3. NathanBrower

    NathanBrower

    Joined:
    May 20, 2017
    Posts:
    1
    Bump. I am also looking for a solution to this problem.