Anti-Aliased Raytracing

I added anti-aliasing to the rendering of the ray tracer. At first I tried regular sampling which is breaking a pixel down into smaller sub-pixels and shooting rays through the center of those pixels and averaging the result. This was better than nothing but still created some artifacts when rendering. The next trial was random sampling to replace aliasing with noise, but the samples can become clumped together and look unnatural. The method that I have settled on for now is jittered sampling which consists of breaking the target pixel down into sub-pixels and shooting rays at a random position through the sub-pixels so that each sub-pixels has at least one ray shot through it. Changing the amount of samples per pixel reduces the aliasing effect.

This type of anti-aliasing is hard coded into the display function. In the next week I am going to abstract this process away so that different methods of anti-aliasing can be used without changing lots of code.

The image that is attached is rendered with jittered sampling with 64 samples per pixel.

Antialiased circles


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s