Cycles Baking

Baking is a popular ‘technique’ to flat down your shading work into easy to use images (textures) that can be applied to your 3d models without any concerns with lighting calculation. This can help game development, online visualization, 3d printing, archiviz animations, and many other fields.

Koro, from Caminandes project, fully baked

Koro, from Caminandes project, fully baked

Supported Maps

The Cycles renderer is based on physics based lighting calculations. That means the passes we can bake in Cycles are different than what you may be used to in the Blender Internal renderer. For Cycles we currently support the following passes:

Data Passes

  • Normal
  • UV
  • Diffuse/Glossy/Transmission/Subsurface/Emit Color

Light Passes

  • AO
  • Combined
  • Shadow
  • Diffuse/Glossy/Transmission/Subsurface/Emit Direct/Indirect

Koro Ambient Occlusion Bake Map

Koro Combined Bake Map

The above maps illustrates Ambient Occlusion and Combined baking. Ambient Occlusion can be used to lit the game scene, while combined emulates what you get out of a full render of your object, which can be used in shadless engines.

The character baked here is Koro from the Caminandes project. Koro and all the other production files from Caminandes Gran Dillama are part of the USB customized card you can buy to learn the nitty-gritty of their production, and to help supporting the project and the Blender Foundation.

Open Shading Language

Open Shading Language (OSL) is a shading language created and maintained by Sony Image Works and used by them in many blockbusters already (Amazing Spider Man, MIB III, Smurfs 2, …). It’s a great contribution from Sony to the industry, given that it was released in a permissive license, free to be implemented, and expanded by any interested party.

Blender was the first 3d package outside of Sony to officially support OSL, and since November 2012 we can use OSL in a “Script Node” to create custom shaders. Blender uses OSL via Cycles. The “Script Node” was implemented by Brecht van Lommel, Lukas Tönne, Thomas Dinges and me (Dalai Felinto).

Thus, with baking support in Cycles we get for “free” a way to store the shaders designed with it. In the following example you see the Node Cell Noise sample script from OpenShading.com. So even if your final application is not aware of OSL, you can still benefit from it to make your textures and materials look more robust.

Open Shading Language Baking

For early Testers

There are no official builds of this feature yet. However if you are familiar with git and building Blender, you can get it from this github repository. Clone the bake-cycles branch from the blender-git repository. Once you build you need to UV Unwrap the object you want to bake, select it and run the following script:

import bpy
bpy.ops.object.bake(type=’COMBINED’, is_save_external=True, filepath=”/tmp/baked.png”, width=512, height=512)

If you can’t build your own Blender you can download a build from GraphicAll.org. You can also follow my Blender Foundation Weekly Report to learn about the progress of this feature and to be informed on when the work will be ready and merged upstream in the official Blender repository.

Development Plans

Cycles Baking is part of a larger baking refactor project for Blender. The initial idea is to support features which would help game development such as Baking MapsCage, Blockers and Anti-Alias. Since Cycles baking were to be tackled eventually, we decided to start the work by implementing its bare bones. That would guarantee that later changes on the baking core code would benefit both Blender Internal and Cycles renderers. Cycles baking was also used validate the proposed refactor of the internal baking API, which can eventually be supported by other external render engines as well.

That means Cycles Baking may or may not hit Blender on its own any soon. There are bugs to be fixed, loose ends to be tied. That said, if there is expressive interest in Cycles Baking, the priority can shift to make sure Cycles baking is polished and ‘master’-ready before we tackle the remaining targets. This is yet to be discussed and defined. So, speak up!

Best regards,
Dalai Felinto

62 comments 35,240 Views
  1. Well done Dalai! Great addition!

  2. OMG thats awesome!!
    i SOOOOOOOOO hope that this finds its way into the offical branch

  3. Yes we are all interested!!!! Make it the #1 priority please!

  4. Oh yes! Thank you very much! We needed that desperately!

  5. definitely top priority subject. and keep up the good work!

  6. We were waiting the baking feature a lot time ago. This is a very important feature for the videogame industry. And it´s crucial also because you can use indirect lighting.
    Please keep working on this! Great work!

  7. YES!!! I’ve been anticipating this feature since cycles first started. I will try building it tonight. Is it limited to the CPU, or will it work on the GPU as well?

    • So far only CPU is working, but GPU will eventually be supported too. So if compiling fails for you try to disable CUDA.

  8. Does this code in any way make a holdout material in Cycles for VFX possible?

  9. Been waiting for Cycles baking for so long! Mainly for Archiviz projects and Real-time 3d visualizations of these projects. I’m working more and more with cycles but if I want to present to the client a full 3D interactive tour, I have to re-light and re-materialize the entire scene for BI to bake. I find this something that is really hard to live without! I can’t wait any longer…

  10. Fantastic.
    i would love to use cycles baked maps for use in nuke 3-d in a VFX pipeline.
    Lin exr out please.

  11. This is great, can’t wait!

    Baking from cycles, and baking improvements in general would be a tremendous addition to our pipeline as a gamedev studio. It would almost remove the necessity to move between different softwares, increasing our production speed significantly.

    Plaease consider baking an exteremely important topic, because, well basically we game developers bake stuff as our final step in the pipeline instead of rendering 🙂

  12. Love this! Please make a high priority?

  13. high priority
    make possible npr with cycles !

  14. I’ve baked a whole lot of object space normal maps using a multi-res modifier using Blender Render Baking as well as AO and diffuse. I think it’s pretty excellent and continues to become better as new map types are added. It would be a shame if this was lost. That being said, I’ve been waiting anxiously for Cycles to also have baking. Can’t we have both? A second baking path would be very welcome but a replacement of the current one would be a serious loss.

    • @Marc who ever said we would replace the blender internal? We are refactoring both. There is nothing to be afraid of.

  15. I am so so glad to hear this is going to be implemented!

  16. This feature is a quantum leap in terms of game production! Can’t wait to ‘turn the lights on’ 😉 Big thanks to all blender devs!

  17. In addition to all the others, please keep working on this!! That would be extreme useful for our game project. 🙂

  18. This is fantastic news, would love to see this in Blender. Thank you, you made my day!

  19. I’ve hoped for cycles baking from the time cycles was introduced. I’m ecstatic to see that it is becoming a reality!

  20. thx! now, when cycle is full of grate features, i hope baking will be priority now. and in near feature blender rendering system will be at last complete, containing baking feature. i can’t wait for flawles normal map baking with cage in blender 🙂

  21. would be great a cycles based bake system !!! fundamental for my works.

  22. One of the best news of this year! I’ve been waited bake to cycles a long time. Now it’s seems that my dream come true 🙂

  23. Im so happy to see this and cant wait! I was waiting so long for this to happen

  24. is there any further news on this? Actually I tried the test version but very often I got some strange rainbow colors which apparently don’t have anything in common with lights I have on the scene… If needed I can provide .blend and samples of this. Usually I did the tests with very simple object like the standard cube and using environment world texture to be able to see the reflections on the cycles material. See the website for what I mean: environment is correctly displaying the reflexions, but many other rendering appear weird …

    • @Salahzar and others, you can follow further progress on this in this Blender Artist thread.

      As for the rainbow colors you either tried to bake with Render Internal, or tried a pass which is not supported. (e.g., at the moment there is no DIFFUSE pass in Cycles, you should instead use DIFFUSE_COLOR, DIFFUSE_DIRECT or DIFFUSE_INDIRECT)

  25. This is a very, very important feature, and great news. I hope you will give it *high* priority.

  26. Have been waiting for this! Good job so far! 😀

  27. I have been waiting for this for a looong time, please give it the priority it deserves 😉

  28. As a game designer, I vote this really needs to happen. We have not good way to bake lighting into a scene as it is, so this would be a great tool!

  29. Great news and great work so far. Cycles baking will boost the quality of games created with blender.

  30. +1

  31. In my eyes, this is the #1-feature to come in the future.
    And hopefully with GPU-rendering, as the actual built doesn’t support that. Thanks for that wonderful news, I was hoping for that feature for months.

  32. Thank you! Thank you so much for working on this! It is very important for Cycles work in general, not just for games. I see a lot of game developers in here applauding this feature, and games are certainly important, but I am not involved with any game work and nevertheless this has been my #1 most wanted feature! I use Blender for animation videos and the potential for being able to speed up render times by using baked cycles textures when rendering scenes with moving cameras in an otherwise static environment is huge! I’ve actually been making baked textures using Blender Internal and then rendering out animations with those textures on shadeless geometry in Cycles so I can take advantage of Cycles’ vastly superior motion blur. If I could use real Cycles baked textures that would be a dream come true. It would make animation rendering with Cycles environments on low or mid range hardware possible finally! Thank you! Best of luck!

  33. Wow! Great, keep up the work, this is something that is really needed!

    Thanks for taking the time to work on it.

  34. This is great! I’ve been waiting for this for a very long time.. lol Baking has been the one thing Cycles has been missing.. THANK YOU!

  35. This is awesome.. can’t wait to try it.. THANKS!!!! Now I have a reason to learn cycles 😀

  36. It is hard to go back to Blender internal once you have used cycles. I have played with the experimental build, please please move to the main branch.

  37. Baking is SO crucial for us that we completely avoid cycles because it doesn’t allow baking…

  38. uhh, noob here. You need to copy the code into the python console? If so it says that syntax is wrong. Help?

    • Originally you had to call the operator via Python. In the latest updates you can do it via a user interface already, so no need to deal with scripting at all.

  39. This is awesome and much needed!

  40. This is so cool, but the builds in GraphicaAll are not working in Ubuntu nor in Debian 🙁

  41. I don’t want to sound dumb, but what are cycles and how does this improve the current bake options we have in blunderer now?

    • Cycles materials are alot stronger when it comes to design. i can do a whole lot more with cycles node based system than with internals layer system. =3

  42. Will it be possible to bake an entire scene and then render an entire animation of it? Of course this wouldn’t be physically accurate, but it should be a lot faster.

  43. Hello, I’m not technical enough to understand how to get an account with
    graphical.org but I would like to download the latest Blender Baking in Cycles build. I need to bake an AO UV in Blender cycles.
    I believe there are already artistic and commercial needs for this function especially in product rendering so I believe your work to polish this thing is important and big thanks to you for it.

  44. This is an awesome feature, but for anybody using this right now (19th April 2013), note the following:

    + The image that is baked out will just be black if the material uses displacement (e.g. when you connected a Image Texture Node’s Color output to a Material Output Node’s Displacement input).

    + The texture that is baked out will show the lighting effects from the perspective of your 3D view (not one of your cameras). This will matter for any shiny materials!

  45. Most useful, much love

  46. Hi, quick help request (not sure where to go):
    When I create a cycles material using nodes, it always renders black. There is nothing attached to the displacement socket. The scene is lit. The model is unwrapped and the texture set to the diffuse socket.

    It worked once, now I’m not sure what I’m doing wrong.

    Bug: Blender crashes without warning (when rendering with too many lights or unwrapped models, not sure which, can’t test atm).

    FYI this feature looks amazing (from videos I’ve seen)

  47. Thanks this will be extremely useful for architecture and of course Game designers / interactive walkthroughs.
    Also I’m sure designers (from any engine) will have blender as a first choice when thinking about making the assets for their projects…
    please dont give up with this idea.

  48. Yes please.

  49. Extremely excited. I’ve been waiting for Cycles baking for a long time. I’ve been playing around with a GraphicAll build, and the results look amazing in Unity. Though I’d really like to see vertex color bake support sometime later, once the rest of the system is more polished. Right now, I can bake to a texture map, reimport, and bake the texture to vertex color, but it’s a really slow, clumsy pipeline, and it won’t work forever.

  50. Sorry all, I keep getting a “Python script fail” message … I downloaded 2.7 bake + cuda kernels from graphicall … need help =( thanks a lot

    • bpy.ops.wm.call_menu(name=”NODE_MT_add”)

      • Soooorry
        TypeError: Converting py args to operator properties: : keyword “is_save_external” unrecognized

  51. This would make creating models for use in other programs so much easier!

  52. Sweet! Please do this! It’s awesome!

  53. Yes, please do this.

  54. Oh yes! Thank you very much

  1. Leave a Reply

    Your email address will not be published. Required fields are marked *

     

share this story on