diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-01-21 00:31:21 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-01-21 00:32:35 +0300 |
commit | 1ac2d2dcb6d1a18e86d86b8d03f46f879a43f33c (patch) | |
tree | c478f4ae0ea710efa5c2fffd311ad86ea94d8a9f /intern/cycles/integrator | |
parent | 14d261d23afe03ae8b6997fbf8e63a63c1e07eff (diff) |
Fix T93711: Cycles diffuse/glossy baking does not write alpha
With the change to use render passes internally the alpha channel got lost.
Add support for these render passes to output an alpha channel for baking.
Diffstat (limited to 'intern/cycles/integrator')
-rw-r--r-- | intern/cycles/integrator/pass_accessor.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/intern/cycles/integrator/pass_accessor.cpp b/intern/cycles/integrator/pass_accessor.cpp index 4479442df56..9fa5aab9ea9 100644 --- a/intern/cycles/integrator/pass_accessor.cpp +++ b/intern/cycles/integrator/pass_accessor.cpp @@ -141,6 +141,7 @@ bool PassAccessor::get_render_tile_pixels(const RenderBuffers *render_buffers, const PassType type = pass_access_info_.type; const PassMode mode = pass_access_info_.mode; const PassInfo pass_info = Pass::get_info(type, pass_access_info_.include_albedo); + int num_written_components = pass_info.num_components; if (pass_info.num_components == 1) { /* Single channel passes. */ @@ -188,8 +189,10 @@ bool PassAccessor::get_render_tile_pixels(const RenderBuffers *render_buffers, else if ((pass_info.divide_type != PASS_NONE || pass_info.direct_type != PASS_NONE || pass_info.indirect_type != PASS_NONE) && mode != PassMode::DENOISED) { - /* RGB lighting passes that need to divide out color and/or sum direct and indirect. */ + /* RGB lighting passes that need to divide out color and/or sum direct and indirect. + * These can also optionally write alpha like the combined pass. */ get_pass_light_path(render_buffers, buffer_params, destination); + num_written_components = 4; } else { /* Passes that need no special computation, or denoised passes that already @@ -215,7 +218,7 @@ bool PassAccessor::get_render_tile_pixels(const RenderBuffers *render_buffers, } } - pad_pixels(buffer_params, destination, pass_info.num_components); + pad_pixels(buffer_params, destination, num_written_components); return true; } |