My AO algorithm is as follows, whith the random vectors just all over the hemisphere:
vec3 ao_ray_position= random_in_hemisphere(gi_rec.normal);
ao_ray = ray(gi_rec.p + gi_rec.normal * 0.001f, ao_ray_position);
ao_hit = !world.hit(ao_ray, 0, infinity, gi_rec);
ao_result = Color(ao_hit / gi_samples, ao_hit/ gi_samples, ao_hit/ gi_samples);
which renders this image:
Now this one is from V-Ray with falloff at 8,7, which is the setting I want to implement, but can't figure out how. I've seen many examples of limiting the hemisphere by cone angle but the image just renders black
EDIT: Thanks to Mathis I got it working, the code and the result meanwhile:
float ao = 1.0f;
float dist = distance(gi_rec.p, rec.p);
if (dist < d) {
ao = !gi_hit / dist;
}


