Cycles-Bake: Ambient Occlusion needs to be computed for COMBINED

Now the COMBINED pass includes the Ambient Occlusion.

This was not reported anywhere, but while working in the Subsurface Scattering I realize we needed this fix for combined.
This commit is contained in:
Dalai Felinto 2014-05-07 10:17:56 -03:00
parent 79c345acc2
commit 08bf531956
Notes: blender-bot 2023-02-14 10:36:35 +01:00
Referenced by issue #40300, objects from inappropriate render layers appear behind translucent objects.
Referenced by issue #40301, driver does not update on frame jump
Referenced by issue #40304, PgUp and PgDn no longer work to move NLA tracks up and down
1 changed files with 14 additions and 10 deletions

View File

@ -16,7 +16,8 @@
CCL_NAMESPACE_BEGIN
ccl_device void compute_light_pass(KernelGlobals *kg, ShaderData *sd, PathRadiance *L, RNG rng, bool is_ao)
ccl_device void compute_light_pass(KernelGlobals *kg, ShaderData *sd, PathRadiance *L, RNG rng,
bool is_combined, bool is_ao)
{
int samples = kernel_data.integrator.aa_samples;
@ -45,22 +46,24 @@ ccl_device void compute_light_pass(KernelGlobals *kg, ShaderData *sd, PathRadian
/* TODO, disable the closures we won't need */
/* sample ambient occlusion */
if(is_ao) {
if(is_combined || is_ao) {
kernel_path_ao(kg, sd, &L_sample, &state, &rng, throughput);
}
/* sample light and BSDF */
else if(kernel_path_integrate_lighting(kg, &rng, sd, &throughput, &state, &L_sample, &ray)) {
if(!is_ao) {
if(kernel_path_integrate_lighting(kg, &rng, sd, &throughput, &state, &L_sample, &ray)) {
#ifdef __LAMP_MIS__
state.ray_t = 0.0f;
state.ray_t = 0.0f;
#endif
/* compute indirect light */
kernel_path_indirect(kg, &rng, ray, throughput, state.num_samples, state, &L_sample);
/* compute indirect light */
kernel_path_indirect(kg, &rng, ray, throughput, state.num_samples, state, &L_sample);
/* sum and reset indirect light pass variables for the next samples */
path_radiance_sum_indirect(&L_sample);
path_radiance_reset_indirect(&L_sample);
/* sum and reset indirect light pass variables for the next samples */
path_radiance_sum_indirect(&L_sample);
path_radiance_reset_indirect(&L_sample);
}
}
/* accumulate into master L */
@ -123,7 +126,8 @@ ccl_device void kernel_bake_evaluate(KernelGlobals *kg, ccl_global uint4 *input,
if(is_light_pass(type)) {
RNG rng = cmj_hash(i, 0);
compute_light_pass(kg, &sd, &L, rng, (type == SHADER_EVAL_AO));
compute_light_pass(kg, &sd, &L, rng, (type == SHADER_EVAL_COMBINED),
(type == SHADER_EVAL_AO));
}
switch (type) {