Fix #36741: cycles AO pass giving values > 1.0 with transparency.
This commit is contained in:
@@ -229,6 +229,7 @@ __device void kernel_path_indirect(KernelGlobals *kg, RNG *rng, int sample, Ray
|
||||
float3 ao_bsdf = shader_bsdf_ao(kg, &sd, ao_factor, &ao_N);
|
||||
float3 ao_D;
|
||||
float ao_pdf;
|
||||
float3 ao_alpha = make_float3(0.0f, 0.0f, 0.0f);
|
||||
|
||||
sample_cos_hemisphere(ao_N, bsdf_u, bsdf_v, &ao_D, &ao_pdf);
|
||||
|
||||
@@ -246,7 +247,7 @@ __device void kernel_path_indirect(KernelGlobals *kg, RNG *rng, int sample, Ray
|
||||
light_ray.dD = differential3_zero();
|
||||
|
||||
if(!shadow_blocked(kg, &state, &light_ray, &ao_shadow))
|
||||
path_radiance_accum_ao(L, throughput, ao_bsdf, ao_shadow, state.bounce);
|
||||
path_radiance_accum_ao(L, throughput, ao_alpha, ao_bsdf, ao_shadow, state.bounce);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -624,6 +625,7 @@ __device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, R
|
||||
float3 ao_bsdf = shader_bsdf_ao(kg, &sd, ao_factor, &ao_N);
|
||||
float3 ao_D;
|
||||
float ao_pdf;
|
||||
float3 ao_alpha = shader_bsdf_alpha(kg, &sd);
|
||||
|
||||
sample_cos_hemisphere(ao_N, bsdf_u, bsdf_v, &ao_D, &ao_pdf);
|
||||
|
||||
@@ -641,7 +643,7 @@ __device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, R
|
||||
light_ray.dD = differential3_zero();
|
||||
|
||||
if(!shadow_blocked(kg, &state, &light_ray, &ao_shadow))
|
||||
path_radiance_accum_ao(&L, throughput, ao_bsdf, ao_shadow, state.bounce);
|
||||
path_radiance_accum_ao(&L, throughput, ao_alpha, ao_bsdf, ao_shadow, state.bounce);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1076,6 +1078,7 @@ __device float4 kernel_branched_path_integrate(KernelGlobals *kg, RNG *rng, int
|
||||
float ao_factor = kernel_data.background.ao_factor;
|
||||
float3 ao_N;
|
||||
float3 ao_bsdf = shader_bsdf_ao(kg, &sd, ao_factor, &ao_N);
|
||||
float3 ao_alpha = shader_bsdf_alpha(kg, &sd);
|
||||
|
||||
for(int j = 0; j < num_samples; j++) {
|
||||
float bsdf_u, bsdf_v;
|
||||
@@ -1100,7 +1103,7 @@ __device float4 kernel_branched_path_integrate(KernelGlobals *kg, RNG *rng, int
|
||||
light_ray.dD = differential3_zero();
|
||||
|
||||
if(!shadow_blocked(kg, &state, &light_ray, &ao_shadow))
|
||||
path_radiance_accum_ao(&L, throughput*num_samples_inv, ao_bsdf, ao_shadow, state.bounce);
|
||||
path_radiance_accum_ao(&L, throughput*num_samples_inv, ao_alpha, ao_bsdf, ao_shadow, state.bounce);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user