diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2014-01-03 01:05:07 +0400 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2014-05-03 04:19:09 +0400 |
commit | eec3eaba084725a978f4aefb773a16ae9c0420db (patch) | |
tree | 68e34c3e8ff42af5263c010895b6649961f82eb6 /intern/cycles/kernel/kernel_accumulate.h | |
parent | 97641a0ec946005d9a042f075697109c6590a28d (diff) |
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
Diffstat (limited to 'intern/cycles/kernel/kernel_accumulate.h')
-rw-r--r-- | intern/cycles/kernel/kernel_accumulate.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/intern/cycles/kernel/kernel_accumulate.h b/intern/cycles/kernel/kernel_accumulate.h index 582a220ab3c..82450b73097 100644 --- a/intern/cycles/kernel/kernel_accumulate.h +++ b/intern/cycles/kernel/kernel_accumulate.h @@ -407,5 +407,26 @@ ccl_device_inline float3 path_radiance_clamp_and_sum(KernelGlobals *kg, PathRadi return L_sum; } +ccl_device_inline void path_radiance_accum_sample(PathRadiance *L, PathRadiance *L_sample, int num_samples) +{ + float fac = 1.0f/num_samples; + + L->direct_diffuse += L_sample->direct_diffuse*fac; + L->direct_glossy += L_sample->direct_glossy*fac; + L->direct_transmission += L_sample->direct_transmission*fac; + L->direct_subsurface += L_sample->direct_subsurface*fac; + + L->indirect_diffuse += L_sample->indirect_diffuse*fac; + L->indirect_glossy += L_sample->indirect_glossy*fac; + L->indirect_transmission += L_sample->indirect_transmission*fac; + L->indirect_subsurface += L_sample->indirect_subsurface*fac; + + L->emission += L_sample->emission*fac; + L->background += L_sample->background*fac; + L->ao += L_sample->ao*fac; + L->shadow += L_sample->shadow*fac; + L->mist += L_sample->mist*fac; +} + CCL_NAMESPACE_END |