Hi, dear developers team, hi dear community!
I am not good at programming, at algorithms, and I am not a developer in common sense… anyway!
I put my dirty hands on the source code and made this little change to the Ambient Occlusion node.
Now there is an option for shifting a sampling spread.
Why it might be needed:
- more flexible mask with AO
- when you need a sharper mask
I have diff-file ready to commit, but I doubt it’ll work under CUDA and Optix, course I build my custom branch with CPU support only. I hope images will be more oratory than my cumbersome explanation.
What do you think?
path_branched_rng_2D( kg, state->rng_hash, state, sample, num_samples, PRNG_BEVEL_U, &disk_u, &disk_v); float2 d; float phi, r; disk_v = 1.0f-disk_v*(1-max(-1.0f,-min(0.0f,spread))); phi = M_2PI_F*disk_u; r = sqrtf(disk_v)*min(1.0f,1.0f-spread); d.x = r*cosf(phi); d.y = r*sinf(phi); float3 D = make_float3(d.x, d.y, safe_sqrtf(max(0.0f,1.0f - dot(d, d)))); Ray ray; ray.P = ray_offset(sd->P, N); ray.D = D.x * T + D.y * B + D.z * N; ray.t = max_dist; ray.time = sd->time; ray.dP = sd->dP; ray.dD = differential3_zero();