Math 155B: Advanced Computer Graphics

Final Project

Ancient Baths Final Project - Ancient Baths


Final Project - Ancient Baths

So we were told to "exploit" the advantages and benefits of RayTracing... hmmm. I think I've been pretty successful!

Let's just say that this took way too many renders in between the base concept and the final product. I'm almost completely happy with it but I couldn't get the spotlight functionality to work quite right so this will have to do. I basically took my "Futuristic Court" scene and decided to see where it could take me. Of course that meant strip everything out of there and add textures to the walls and floor, then rip out the floor and put in a pool of water, adjust flooring, scrap everything and try something new: mess around with NURBS surfaces and discover a nice shape for a waterfall, go back to original pool and add waterfall, tear apart the back wall for opening, decide that the columns were in fact a good idea, make them textured and composed of tops and bases, adjust lighting for about 3 hours, move columns into uniform positions, play with textures and materials, put final touches on AntiAliasing algorithm, render the final product.

That's what I did for 2 days straight at Carl's Jr. followed by late nights on the couch with my laptop.


Larger Versions:
1280 x 800
1152 x 876

Screen Saver:
Screen Saver




Progress

Here are a few renders I saved to mark my progress along the way to the finished product. As mentioned before, I ran into some problems. The following is a brief set of documentation notes on what and how I came across and the solutions needed to fix them.


Problem 0:
The first issue I came across actually showed up even before I started this project, but is well worth mentioning because it is quite significant for anyone who is using an ATI graphics card. When I was working on Assignment 5 to get myself familiar with Professor Buss's RayTracing package, I kept getting bad coloration in places. I brought this to office hours and even after an hour of debugging time, Professor Buss and myself were still baffled at why the discoloration occurred on my laptop yet not on his desktop PC. Later, it became clear that ATI graphics boards did not enforce color clamping and we needed to add three lines of code to clamp each component inside the range of [0,1].


Solution:
	curPixelColor.x = Min(1.0, curPixelColor.x);
	curPixelColor.y = Min(1.0, curPixelColor.y);
	curPixelColor.z = Min(1.0, curPixelColor.z);

Problem 1:
At first I thought it was just me, but then found out that I had discovered another bug in the RayTracer software. I was quite surprised at this because I thought that texture mapping would be a commonly-used feature; however, this might be a surprise only because of my roots in game level-design where texture mapping is essential.

From the picture on the left, you can see the texture of the ceiling is repeated only in one direction and smeared across the rest of the polygon. In fact, the walls are repeated only in one direction too, but the texture is large enough that you can't tell. This was quite annoying to try to deal with, but the solution is quite simple:

Solution:
	if ( u<0.0 || u>1.0 )
		u = u-floor(u);
	if ( v<0.0 || v>1.0 )
		v = v-floor(v);

Problem 2:
After some more renders and experimentation I decided I would add a Bezier set as a waterfall into my scene. There were the natural problems of getting the surface shape just right, but that just takes some tinkering for mild adjustments to form a more realistic shape. Then I needed to texture it... this also needed a trial and error approach for stretching the proper directions.




Problem 3:
Directional lighting is not my friend. As I just found out... you need to make sure you set the CutoffAngle or else it defaults to 180 degrees. So I guess that was me miss-reading the documentation. The features of spotlights were not used in the final project, although they will be used in later experiments.