From eec3eaba084725a978f4aefb773a16ae9c0420db Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Thu, 2 Jan 2014 19:05:07 -0200 Subject: Cycles Bake Expand Cycles to use the new baking API in Blender. It works on the selected object, and the panel can be accessed in the Render panel (similar to where it is for the Blender Internal). It bakes for the active texture of each material of the object. The active texture is currently defined as the active Image Texture node present in the material nodetree. If you don't want the baking to override an existent material, make sure the active Image Texture node is not connected to the nodetree. The active texture is also the texture shown in the viewport in the rendered mode. Remember to save your images after the baking is complete. Note: Bake currently only works in the CPU Note: This is not supported by Cycles standalone because a lot of the work is done in Blender as part of the operator only, not the engine (Cycles). Documentation: http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Bake Supported Passes: ----------------- Data Passes * Normal * UV * Diffuse/Glossy/Transmission/Subsurface/Emit Color Light Passes * AO * Combined * Shadow * Diffuse/Glossy/Transmission/Subsurface/Emit Direct/Indirect * Environment Review: D421 Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge Original design by Brecht van Lommel. The entire commit history can be found on the branch: bake-cycles --- intern/cycles/render/scene.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'intern/cycles/render/scene.cpp') diff --git a/intern/cycles/render/scene.cpp b/intern/cycles/render/scene.cpp index 2ed4efe7f2b..4a42b2c9e35 100644 --- a/intern/cycles/render/scene.cpp +++ b/intern/cycles/render/scene.cpp @@ -17,6 +17,7 @@ #include #include "background.h" +#include "bake.h" #include "camera.h" #include "curves.h" #include "device.h" @@ -54,6 +55,7 @@ Scene::Scene(const SceneParams& params_, const DeviceInfo& device_info_) image_manager = new ImageManager(); particle_system_manager = new ParticleSystemManager(); curve_system_manager = new CurveSystemManager(); + bake_manager = new BakeManager(); /* OSL only works on the CPU */ if(device_info_.type == DEVICE_CPU) @@ -103,6 +105,8 @@ void Scene::free_memory(bool final) particle_system_manager->device_free(device, &dscene); curve_system_manager->device_free(device, &dscene); + bake_manager->device_free(device, &dscene); + if(!params.persistent_data || final) image_manager->device_free(device, &dscene); @@ -122,6 +126,7 @@ void Scene::free_memory(bool final) delete particle_system_manager; delete curve_system_manager; delete image_manager; + delete bake_manager; } } @@ -208,6 +213,11 @@ void Scene::device_update(Device *device_, Progress& progress) if(progress.get_cancel()) return; + progress.set_status("Updating Baking"); + bake_manager->device_update(device, &dscene, this, progress); + + if(progress.get_cancel()) return; + progress.set_status("Updating Device", "Writing constant memory"); device->const_copy_to("__data", &dscene.data, sizeof(dscene.data)); } @@ -258,7 +268,8 @@ bool Scene::need_reset() || integrator->need_update || shader_manager->need_update || particle_system_manager->need_update - || curve_system_manager->need_update); + || curve_system_manager->need_update + || bake_manager->need_update); } void Scene::reset() -- cgit v1.2.3