Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2014-05-07 17:17:56 +0400
committerDalai Felinto <dfelinto@gmail.com>2014-05-07 17:18:00 +0400
commit08bf531956b1c1cff3319d119e8aba55b7a09b9e (patch)
treefb35f4b838a61d18273f002ea0ef44d31fb48544 /intern/cycles/kernel
parent79c345acc21b2b82dfdfe6cf4c8606a07c90e434 (diff)
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.
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r--intern/cycles/kernel/kernel_displace.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/intern/cycles/kernel/kernel_displace.h b/intern/cycles/kernel/kernel_displace.h
index 465d4dd4da6..012f399ca50 100644
--- a/intern/cycles/kernel/kernel_displace.h
+++ b/intern/cycles/kernel/kernel_displace.h
@@ -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) {