SIGGRAPH

I arrived in New Orleans yesterday, showed up on the doorstep of the wrong hotel and then promptly found the right one.

Today sees the start of the co-located events (I’m going to NPAR – Non-Photorealistic Animation and Rendering), and I’m so psyched! If you’re at SIGGRAPH or in New Orleans and want to hang out and network, drop me an email / comment!

Woohoo! SIGGRAPH!

Tagged with:
 

I recently finished up school, and part of that was finishing up my ray tracing project. At the last minute, I implemented Gouraud shading which is a technique to try to smooth out a triangulated surface. What it really does is just linearly interpolate the normal vectors, where the normal of a vertex is calculated as a weighted average of the normals of the triangles using that vertex.

Long story short:

A render of the Stanford bunny with my raytracer without Gouraud shading.

A render of the Stanford bunny with my raytracer without Gouraud shading.

A render of the Stanford bunny with smooth Gouraud shading.

A render of the Stanford bunny with smooth Gouraud shading.

Also, thanks to an improvement in my parallelization of the problem and a speedup in octtree traversal, I was able to render the Stanford dragon model (~1 million triangles):

The Stanford dragon model.

The Stanford dragon model.

Tagged with:
 

Stanford Bunny

The Stanford Bunny is a graphics benchmark of sorts. It was a high-resolution scan that the imaging lab there did of a ceramic bunny, and the triangulation is a popular model to test systems on.

It contains a little under 70,000 triangles which makes brute-force ray tracing intractable. I mentioned octtrees earlier, and so having built octtrees into my ray tracer, I was able to render the Stanford Bunny in about 40 minutes on one core. Granted, that’s with only 1-pass anti-aliasing, but I feel pretty good about this. I don’t think I’ll have a chance to implement Gouraud shading (or normal interpolation for that matter), but as soon as I do, it will look a lot less blocky.

The Stanford Bunny rendered with my ray tracer.

The Stanford Bunny rendered with my ray tracer.

Tagged with:
 

Raytracing is slow. Incredibly slow. Painfully slow. That’s because you’ve got to check a lot of things to accurately determine what you’re seeing, if it’s in shadow, if it reflects off of something, etc., so it helps quite a bit to be able to get an idea beforehand of where everything is. Enter octtrees.

We’ve got a picture of a model (in this case, the Stanford bunny model). It consists of thousands of tiny triangles that make a surface. Then, imagine a cube surrounding the entire model. If there are two many triangles in that cube, you cut the cube in to eight smaller cubes, and repeat. What this build is a tree where “busy” portions of the space get divided more.

And now for pretty pictures:

The bunny on its own.  There are tricks to smooth it out, but I left it highly triangulated to better represent the idea.

The bunny on its own. There are tricks to smooth it out, but I left it highly triangulated to better represent the idea.


Bunny with balanced wireframe octtree around it.

Bunny with balanced wireframe octtree around it.


Profile of the bunny with a very deep octtree.

Profile of the bunny with a very deep octtree.

I’m finishing up the implementation, and then I’ll be using it as part of my octtree as a intersection speedup.

Tagged with:
 

Orbits

Orbiting planets. The days are about twice as along as they normally are relative to each planet’s year, but that’s an aesthetic preference. Enjoy.

Tagged with:
 

New Render

I got a new render up from my ray tracer that applies planetary textures to spheres and makes them spin on their respective axes (none of the planets in our solar system spin on a “vertical” axis). I hope to do one with their orbits, but I haven’t had a chance to get to it; though, the nice thing is, I just have to define their paths and rotations as a function of time, and where I want the viewpoint to be. It took about 15 minutes to render in full HD 1080×1920 on 18 processors:

Tagged with:
 

It’s all well and good to be able to render shapes in space in a photorealistic way, but at some point you’d like to draw something that doesn’t have just one surface color. After all, a billboard isn’t just a bunch of shapes each of which has one color – it’s one object with paint / ink placed on it in an ordered way.

Texturing accomplishes by taking a primitive shape (like a sphere, triangle, surface of revolution, etc.) and wrapping an image onto and over it. Let’s consider a sphere in space:

A white sphere in space.

A white sphere in space.

Now let’s say we mean it to be Earth. Then we can take a picture of Earth that’s flat:

Flattened map of Earth

Flattened map of Earth

and then map it onto a sphere to get a picture of what we all know Earth to look like:

Behold!

Behold!


Two Mars globes where the left is what is seen with the eye, and the right is a topographic map.

Two Mars globes where the left is what is seen with the eye, and the right is a topographic map.

Tagged with:
 

It occurred to me today that I could render a scene several times with slight perturbations and then mesh them together into a movie. It took about 15 minutes to render on a cluster at Mines, and then about a minute to stitch together with Mencoder. At 18 frames per second, here is the result. Enjoy!

Tagged with:
 

This afternoon I was able to successfully parallelize the ray tracer I wrote for Graphics II to run on the Alamode cluster at Mines. Using 17 machines, I was able to render a 4,096 x 4,096 pixel image with 25 passes and up to 5 reflections. It took only 1 minute and 20 seconds.

Reflective spheres rendered at high resolution on a small cluster.

Reflective spheres rendered at high resolution on a small cluster.


Another image rendered on the same cluster

Another image rendered on the same cluster

For the benefit of those who are not computer scientists, this is what the input file looks like:

8192 8192
0 0 20
-1 -1 1
2 0 0
0 2 0
3 10 10 0.8
0.2
9
# These next few lines will define a triangle
T
# With one of the points at (1, 1, 1)
1 1 1
# and the next point here:
0.12321 0.12321 -1
# and the last point here:
-1 1 1
# and with this color setting
1 1 1 1 1 1 0 1 0.7
T
-1 1 1
-0.12321 0.12321 -1
0.12321 0.12321 -1
1 1 1 1 1 1 0 1 0
T
1 -1 1
0.12321 -0.12321 -1
-1 -1 1
1 1 1 1 1 1 0 1 0
T
-1 -1 1
-0.12321 -0.12321 -1
0.12321 -0.12321 -1
1 1 1 1 1 1 0 1 0
T
1 1 1
0.12321 0.12321 -1
1 -1 1
1 0 0 1 0 0 0 1 0
T
1 -1 1
0.12321 -0.12321 -1
0.12321 0.12321 -1
1 0 0 1 0 0 0 1 0
T
-1 1 1
-0.12321 0.12321 -1
-1 -1 1
1 1 0 1 1 0 0 1 0
T
-1 -1 1
-0.12321 -0.12321 -1
-0.12321 0.12321 -1
1 1 0 1 1 0 0 1 0
S
0 0 0 0.5
1 0 1 1 0 1 0 1 0.3

Tagged with:
 

For Graphics II, we had to implement a raytracer, and then add anti-aliasing and a feature of our choice. I selected mirrored surfaces.

First, anti-aliasing. Here are a few pictures of the same image rendered with a different number of passes to change the smoothness.

Using one pass

Using one pass


Using 5 passes.

Using 5 passes.


Using 50 passes.

Using 50 passes.

And lastly, here’s a scene of several spheres, some of which are reflective.

A set of spheres, some of which are mirror-like.

A set of spheres, some of which are mirror-like.


A reflective sphere next to some triangles.

A reflective sphere next to some triangles.


A mirrored sphere in the center of four other sphere.

A mirrored sphere in the center of four other sphere.


More spheres!

More spheres!

Tagged with: