Tuesday, March 4, 2008

Anti-Aliasing Looking Good!

Hey hey, it looks like I have random anti-aliasing looking good! I have been working extremely solidly on this project since it was up on the course website. For the next assignment that Joe briefly mentioned, I am going to get started the day after I turn this in, or directly after I turn this in REGARDLESS of when it is posted.



Here's an image I generated from an Earth texture @ 16 samples per pixel. However, I massively shrunk the original image. When I use my giant earth image, I am still getting some moray aliasing patters. I think I'll up the number of samples to 64 or 128 and try with the giant image.






1 Sample per Pixel


16 Samples Per Pixel


And the sweet, sweet code-ness:

....
RGBColor pixelColor = RGBColor(0,0,0);
int num_samples = 16;
float inv_num_samples = (1 / (float)num_samples);

RGBColor tmpColor;
for (int r = 0; r < c =" 0" o =" myWorld.ViewPlane.eyePoint;" count =" 0;" random1 =" (" random1 =" random1" random2 =" (" random2 =" random2" d =" myWorld.ViewPlane.from_screen_to_world(c+random1," tmpcolor =" myWorld.trace_ray(ray);"> 1){
tmpColor.r = 1.0;
}
if (tmpColor.g > 1){
tmpColor.g = 1.0;
}
if (tmpColor.b > 1){
tmpColor.b = 1.0;
}

tmpColor = tmpColor * inv_num_samples;
pixelColor = pixelColor + tmpColor;
}

myWorld.myfile << " " << (ceil( 255 * pixelColor.r)) << " " << (ceil( 255 * pixelColor.g)) << " " << (ceil( 255 * pixelColor.b)) << " "; // Don't forget to zero this out! This jacked me up bad. pixelColor = RGBColor(0, 0,0); ....

No comments: