diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-08-05 16:12:43 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-08-05 17:32:13 +0300 |
commit | 43a124bc1c4a2e096a6a81224fc318ac8f9180a4 (patch) | |
tree | f2a7eae00e49a65d86c42a52c3b843bb85d3b03c | |
parent | fa514564b0c3ec4769c814c2bee587ce9e386571 (diff) |
Fix T99179: holdout does not affect transparency without transparent background
This was by design, but maybe not so useful in practice. It's always possible to
set alpha to 1 in compositing if needed.
-rw-r--r-- | intern/cycles/blender/display_driver.cpp | 12 | ||||
-rw-r--r-- | intern/cycles/kernel/integrator/shade_surface.h | 8 |
2 files changed, 6 insertions, 14 deletions
diff --git a/intern/cycles/blender/display_driver.cpp b/intern/cycles/blender/display_driver.cpp index a1bc064be68..61cd88fb433 100644 --- a/intern/cycles/blender/display_driver.cpp +++ b/intern/cycles/blender/display_driver.cpp @@ -913,8 +913,6 @@ void BlenderDisplayDriver::flush() void BlenderDisplayDriver::draw(const Params ¶ms) { /* See do_update_begin() for why no locking is required here. */ - const bool transparent = true; // TODO(sergey): Derive this from Film. - if (use_gl_context_) { gl_context_mutex_.lock(); } @@ -935,10 +933,8 @@ void BlenderDisplayDriver::draw(const Params ¶ms) glWaitSync((GLsync)gl_upload_sync_, 0, GL_TIMEOUT_IGNORED); } - if (transparent) { - glEnable(GL_BLEND); - glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); - } + glEnable(GL_BLEND); + glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); glActiveTexture(GL_TEXTURE0); @@ -975,9 +971,7 @@ void BlenderDisplayDriver::draw(const Params ¶ms) glDeleteVertexArrays(1, &vertex_array_object); - if (transparent) { - glDisable(GL_BLEND); - } + glDisable(GL_BLEND); gl_render_sync_ = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); glFlush(); diff --git a/intern/cycles/kernel/integrator/shade_surface.h b/intern/cycles/kernel/integrator/shade_surface.h index 1514b3956ad..70b20a93b6a 100644 --- a/intern/cycles/kernel/integrator/shade_surface.h +++ b/intern/cycles/kernel/integrator/shade_surface.h @@ -43,11 +43,9 @@ ccl_device_forceinline bool integrate_surface_holdout(KernelGlobals kg, if (((sd->flag & SD_HOLDOUT) || (sd->object_flag & SD_OBJECT_HOLDOUT_MASK)) && (path_flag & PATH_RAY_TRANSPARENT_BACKGROUND)) { const float3 holdout_weight = shader_holdout_apply(kg, sd); - if (kernel_data.background.transparent) { - const float3 throughput = INTEGRATOR_STATE(state, path, throughput); - const float transparent = average(holdout_weight * throughput); - kernel_accum_holdout(kg, state, path_flag, transparent, render_buffer); - } + const float3 throughput = INTEGRATOR_STATE(state, path, throughput); + const float transparent = average(holdout_weight * throughput); + kernel_accum_holdout(kg, state, path_flag, transparent, render_buffer); if (isequal(holdout_weight, one_float3())) { return false; } |