AO and blue noise
category: general [glöplog]
Working in my AO-raytracer right now.
I started with true montecarlo sampling for the AO rays. It took too many samples to converge this way.
So, I've tested a jitter algorithm and the convergence is much better now.
Do you know if there is any big difference by using Poisson disc instead?
And, do you know any easy way to evaluate the noiseness on my results, so I can compare methods?
Thanks
I started with true montecarlo sampling for the AO rays. It took too many samples to converge this way.
So, I've tested a jitter algorithm and the convergence is much better now.
Do you know if there is any big difference by using Poisson disc instead?
And, do you know any easy way to evaluate the noiseness on my results, so I can compare methods?
Thanks
Quote:
And, do you know any easy way to evaluate the noiseness on my results, so I can compare methods?
Which ever looks the best to your eyes? :)
You can check something like the average difference in the values. Higher noise will make higher differences.
random pt: eyes are a way, but, when two methods looks so similar, eye is not enough.
I'm trying the average differences now, with a reference image rendered in high quality for an hour... it should be enough.
I'm trying the average differences now, with a reference image rendered in high quality for an hour... it should be enough.
You may already know, but.
texel, if you can't decide just post two screenies and let us vote :-)
Quote:
And, do you know any easy way to evaluate the noiseness on my results, so I can compare methods?
If you have several samples per pixel, you can calculate the variance together with the color. The lower the variance, the less noisy.
Thanks so much. Second question is answered now.
Now, where is iq to tell me about the poisson disk - or any other blue noise method?
Now, where is iq to tell me about the poisson disk - or any other blue noise method?
Poisson distributed samples are effectively just a fancier way of stratifying results. The biggest gain is in doing it at all - yes, better sampling patterns will give slightly better results, but you'll hit diminishing returns very soon.
The best way to get better results is by including importance sampling.
The best way to get better results is by including importance sampling.
But ryg, how do you suggest to do it?
calculate the average, calculate the sum of (pixel - average)² for all pixels.
http://en.wikipedia.org/wiki/Variance
http://en.wikipedia.org/wiki/Variance
I think he means importance sampling...
Graga fail.
well, all you need for good importance sampling is to have a rough guess of where the geometry is.
pack each object (triangle, ...) into a bounding sphere or box. per object, determine the N closest other objects (by bounding volume, N is small). that gives you a pretty good idea what your primary occluders are going to be. per point you want to evaluate AO for, calculate the distance to those BVs, and the approximate projected solid angle of that BV. use a function that smoothly falls off based on the dot product between the current sampling direction and (bv_center-sample_point). should be a pretty good density estimate.
alternatively, just do a coarse pre-pass with few samples (but including bent normals), average things over a large area, then use that do drive importance sampling for a more accurate pass.
pack each object (triangle, ...) into a bounding sphere or box. per object, determine the N closest other objects (by bounding volume, N is small). that gives you a pretty good idea what your primary occluders are going to be. per point you want to evaluate AO for, calculate the distance to those BVs, and the approximate projected solid angle of that BV. use a function that smoothly falls off based on the dot product between the current sampling direction and (bv_center-sample_point). should be a pretty good density estimate.
alternatively, just do a coarse pre-pass with few samples (but including bent normals), average things over a large area, then use that do drive importance sampling for a more accurate pass.
no guarantees on these ideas, btw. i'm pretty certain they should work or i wouldn't have suggested them, but i haven't tried them myself.
alternatively instead of placing the geometry and solving for "where does the ray hit the geometry" kind of a problem, you can approach it the way I (and iq) prefer: Say that "here is a geometry, the ray will hit this point". That way you can already know the hits for the primary rays and thus the primary occluders. So, making use of distance fields (yes even in raytracing) might be very possible.
Also I'd like to rip this beautiful statement:
Also I'd like to rip this beautiful statement:
Quote:
no guarantees on these ideas, btw. i'm pretty certain they should work or i wouldn't have suggested them, but i haven't tried them myself.
oh and yeah, the way I suggested would bear a little more error and a way moronic approach to actually getting things done, but hey it might still work :)
also, use cosine-distributed samples and remove the <normal,ray> term. But I think you are doing that already if I remember well.
for the samples, also, a 2d sobol sequence works fine