View Full Version : AA improvement possible by changing contrast ?

06-17-2005, 06:54 AM
There is a question wich I have in mind since a month

If someone would be as crazy to change exposure / contrast brightness for each AA pass instead of doing it afterwards, would'nt it result in less noisy result?

And, to go further, wouldn't it improve AA if I would raise contrast in each pass and lower it afterwards ?

I did some experiments, but I cannot say if the result wasn't a subjective only betterment.

So my questions are:

Is there a good source for a description how the AA method/reconstruction functions ?
Does anybody made some experiences with this ?

06-17-2005, 07:44 AM
wouldn't this only affect the AA if Adaptive Sampling was on? and wouldn't that have the same effect as adjust the Adaptive Sampling threshold?

06-17-2005, 08:36 AM
Yes, what you describe about adaptive AA would certainly be this way.
But I'm not sure if there is no impact on the normal passes.(THinking of the reconstruction filters, wich look for me to have also some contrast related calculations.)

I would be really thankfull, if someone can provide some links about AA topics.

thanks for reply :)

06-18-2005, 06:18 PM
At one point I got interested in learning about Anti-Aliasing and all that stuff. Search Google and you should get a variety of results. Some will be about LCD AA, and others will explain it in pure math. Now that I think about it Wikipedia.org will probably definitely help you, cause that's where I got some technical stuff about it.

I don't know how Lightwave's new AA works, but I'm assuming it's just a different algorithm in the final matrix calculation. But basically what it does from what I've learned, is render a set amount of passes, then combine them with an averaging equation thing. It renders (if I remember correctly) points, and not pixels; points being specific rays shot off within a pixel. Let's say nine: one calculation in the center of the pixel, then 8 more in a grid-type pattern around that center; which is why there are multiple passes and why you will see the camera shift slightly within each of those passes. Or five, on in center, and four around it in a plus sign pattern. Then (not Lightwave but a more simpler version) it adds them all up and divides by the number of them (a simple average). This gives a very smooth but crisp appearance...and no more jaggies.

Some other programs will use different final averaging (I forgot what they called it, might of been matrix, might have been algorithm), like bicubic or bilinear, or another one that I think starts with K. And I think this is what Lightwave refers to as reconstruction filters.

I think this is what Lightwave's Classic one did, and the others are a different average computation (reconstruction filters).

To me it has nothing to do with contrast, although if you were to change the contrast in your image (via objects) within each pass like you said, the averaging will lessen the contrast. Though keep in mind depending on your color resolution you might experience banding when post-processing contrast.

Adaptive sampling is what the book says. It goes through the image and finds contrasty areas, and then only applies AA in those areas. It doesn't change the contrast in the image. If you turn Adaptive off, then your experiment should work. That way it is doing the entire image.

But some one else probably definitely know more than me about this, and I should just shut up.

I hope this helps.

06-19-2005, 01:11 AM
THANKS a lot....

didn't thought about wikipedia (google search was very frustrating)
nut this is exactly what I need.

thanks !

06-20-2005, 02:40 AM
As already said, reconstruction filters should not care about contrast, they work on the spatial distribution of the image samples. They are just a function of distance between pixel center and sample position.
A box filter will merely sum all samples with constant weight, that is equivalent to adding them all up and dividing by the number of samples. The others use other functions to calculate the weight depending on distance, Gaussian is a gaussian "bell", Mitchell a parametrized cubic polynom, Lanczos is a windowed function, usually a sinc function. The book "physically based rendering" has a nice chapter about sampling and reconstruction.

To understand why and when those functions work better than others, you better take some lessons in signal processing. If the conditions of the sampling theorem were kept, Lanczos would be clearly the best, but as you can easily see by the artifacts it produces, the theorem is not (cannot) be fulfilled.

Anyway, back to topic, if you transform the image samples with a non-linear function (gamma correction etc.) it will come out slightly different than transforming the final image, except when using box-filter.
But you can't really say one is better or more correct than the other.

wouldn't it improve AA if I would raise contrast in each pass and lower it afterwards ?
I doubt that, transforming the samples and undoing the transformation again afterwards doesn't really make much sense IMHO. It will basically deform the reconstruction filter that have been carefully designed...i would only manipulate colors once, either before reconstruction or afterwards.

E.g. when you have very bright highlights (e.g. from HDR background) on detailed geometry it usually looks very jaggy in LW, although from a signal-processing standpoint it's alright, your montior just can't display the dynamic range correctly. Doing tonemapping/limiting dynamic range etc. (the latter is in Processing tab of LW) for the individual samples can improve the result for 8bit output, although you inevitably loose some details and the dynamic range, but that's always the same with Antialiasing, sacrificing detail to get rid of artifacts.