Cycles: ambient occlusion support, with AO factor and distance, and a render pass.
[blender.git] / intern / cycles / render / integrator.cpp
index 47059a0a009207f8e326e3290ebc4b1492532956..ff2afc7119bc53cb75232cbcefbddf434ff3f8d2 100644 (file)
@@ -83,6 +83,9 @@ void Integrator::device_update(Device *device, DeviceScene *dscene)
        kintegrator->seed = hash_int(seed);
        kintegrator->layer_flag = layer_flag << PATH_RAY_LAYER_SHIFT;
 
+       kintegrator->use_ambient_occlusion =
+               ((dscene->data.film.pass_flag & PASS_AO) || dscene->data.background.ao_factor != 0.0f);
+
        /* sobol directions table */
        int dimensions = PRNG_BASE_NUM + (max_bounce + transparent_max_bounce + 2)*PRNG_BOUNCE_NUM;
        uint *directions = dscene->sobol_directions.resize(SOBOL_BITS*dimensions);