Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Baking scenes with Cycles and Blender

Discussion in 'Asset Importing & Exporting' started by joni-giuro, Nov 25, 2014.

  1. joni-giuro

    joni-giuro

    Joined:
    Nov 21, 2013
    Posts:
    435
    Hi all,
    I created a scene containing a room with some furniture. I would like to bake the whole lighting in blender using cycles and save it into a texture atlas and then bring the whole thing to unity.
    I guess I'm not the only one trying to bake lighting of the entire scene so I'm wondering, how do you guys go about this? I couldn't figure it out. Is there a plugin?
     
  2. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    You need to create UVs first. You can do a sort of UV Smartpack unwrap I think it is call in the unwrap menu('U' in edit mode).

    Now that cycles does baking, you basically just set up the lighting, set the bake options, and hit the BAKE button. The 2d image would then come up in the 2d viewer, and you export that.

    I guess I should mention you can also let Unity do it for you instead. It auto-creates the UVs too and the results aren't really bad when you tweak the settings.
     
    Last edited: Nov 25, 2014
  3. joni-giuro

    joni-giuro

    Joined:
    Nov 21, 2013
    Posts:
    435
    Thanks for the answer kburkhart84.
    Yeah I knew about the unity lightmapper but I've had some trouble setting it up as it doesn't have raw realtime preview (also, I couldn't achieve hard shadows, my scene is basically a bedroom at night, with the moon shining through the window and indirectly illuminating the whole scene). I knew how to export lightmaps from blender using cycle as well, but my problem is that I can't bake the whole scene into one big texture atlas and then use only one shared material in order to reduce draw calls.
    I found this, it seems a bit tedious but it looks like it's the only way. Thanks anyway:

     
  4. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    Yup, if you want to bake onto a single texture, I would think you would have to take the time to set up the UVs that way, and it is much easier if the whole scene is one big material/texture for the diffuse as well if that is the case.