Bake Color Bleeding / Texture Brightness into Cycles Lightmap?

Hey everyone!
I am currently exploring the possibilities of Blender Cycles, especially its new baking functionality.
The thing I am working at right now is baking lightmaps. And while it is working so far I still have some questions in order to improve my lightmaps.
The steps I am currently doing are the following:

  • Add a new UV Channel/Map (not sure how you call them) to a pre-textured / pre-UV-unwrapped Object and call it UVLightmap
  • Smart UV Project unwrap the object using the new UV Channel
  • Create a new image in the UV/Image Editor
  • Create a new cycles material
  • Add an Image Texture node to the new cycles material and link that previously created image
  • Copy the same node into every other already existing material
  • Bake a lightmap onto the new material using the Bake Type: Combined

My Questions:

  • Are my steps correct? I am not entirely sure if this is the correct way to bake Lightmaps in Blender Cycles. Possible mistakes are for example the step where I apply a new material over the old ones or using the wrong Bake Type…
  • This is the more important question. Is there a way to include (for example) the color bleeding or the brightness values based on the other textures into the lightmap baking process?

Thanks in advance. :wink:

I kinda solved this problem. I was using a material overwrite to give every object in the scene a plain colour before I started to bake.
The nice thing with this procedure is that you don’t have to mess around with your pre-existing materials and don’t have to worry that there are material information on your lightmap, because you only want the lighting information and no texture information on that.
The not so nice thing is that there is no radiosity because everything looks exactly the same… So even if you have a yellowish wooden floor, the wall would still be white/greyish.

I removed the material overwrite, which in retrospect probably was a bit a silly idea, and used a work around to achieve my goal. I split the Model into several objects. (floor, walls, roof) gave them a new UV Channel, duplicated every object and removed all materials from these clones. Then I added a new “baking” material and started to bake, activating the clone only to bake while deactivating the original.
In the end the lightmap on the clone received colour information from the other two originals and I got my lightmaps with radiosity. After that I only hat to apply the baked lightmap to every texture of the original object using the new UV channel.

It’s a ton of work, but I don’t know if there is a smarter way to do this. So if someone knows how to simplify this workflow I would be more than happy to hear his/her solution.

I used baking lightmaps to make archviz quite a lot ultimately.
The ovveride with plain color is not correct imho because a red floor should bounce red and not grey for example.

I use the combine too for simplicity, but probably the best would be to bake Direct and Indirect diffuse, and add them together as in compositing.

Here i made a post about a test.

Yeah I too came to the conclusion, that the override is not really a valid option.

Can you tell me what you mean by “combine”? Wouldn’t you have Material/texture information on your Lightmap when you bake Direct and Indirect diffuse? At the moment I am still not quite sure on what’s the correct way for baking lightmaps, because there are no real Tutorials online on how you do it in cycles. Ideally there would be a Bake Mode for baking Lightmaps in Cycles…

I meant “Combined” type. But with that you also include glossy reflections for example. What’s your final goal btw? What you need? Indirect light (GI) and use this map in a game, for example?

In the example i linked i used the lightmap with an emission shader, but just for indirect rays/ secondary bounces…a sort of Irradiance Map.

Oh I see… Yeah the combined bake type is the only one that works for me too, but hopefully there will be more bake types in the future. Especially one that lets you bake a lightmap. :smiley:

I am working on a apartment that is going to be a showcase for the online visualisation tool of the company that I am working for. The blend file gets exported for three.js as .json file. Basically I need the lightmaps so that we can fake the lighting in order to improve the overall performance and don’t have to rely on dynamic light/shadows. I also used a bit of ambient occlusion for the rooms that don’t have a window facing in the direction of the sun.

Diffuse rays in Cycles is Global Illumination basically. If you want you can bake the three Diffuse component (diff direct, diff indirect, diff color) and combine them in Photoshop, with Direct->Add->Indirect->Multiply->Color. This is the scheme, same as Passes in Blender Cycles - link

This way you will skip the glossy and let it to be managed by your realtime engine of choice. “Lightmap” can be done.

Here is an example, i baked diffuse direct and indirect

Note the image editors, one is indirect diffuse (red color bleed onto the floor), the other is diffuse direct (direct lit by lamps).
If you combine these two resulting maps with Photoshop (or Blender) with “Add” mix type, you will get the map containing the direct and indirect light into the same map.
(do note i haven’t baked diffuse color for simplicity)

**we could ask for the future, if it would be possible to get other options in the dropdown menu of Baking, to avoid manual mixing of images…(for example Bake->Diffuse only components = DIR+IND+COL, already mixed together…) The combined pass contains everything

I think I understand it now, thanks for the explanation. So a real lightmap consists of the three different diffuse components only, without the glossy components. In other words, the combined bake type is just a convenience solution with unnecessary information.
Yeah, it would be great if we could bake the diffuse components already combined. It would save a lot of time and work, because right now I don’t think that it is really a good option for me to bake three different maps and then combining them manually in photoshop, compared to bake a combined pass.

Well, depends on what are your needs. If your external realtime engine will handle direct light/shadows for example, you may want to bake just indirect diffuse to simulate Global Illumination in realtime (fixed light and not moving object of course)…blender lights placement and realtime engine must match…

If you instead export for lets say Sketchfab and use a “Shedeless” option (where sketchfab is lighting nothing by its own) you may want to export also the other passes…

Without knowing your final usage and software is difficult, and i’m not even a game biz guy so my kwnoledge here is limited.