John Zila
Rants longer than 140 characters.-
Final Scene
Posted on April 8th, 2009 3 commentsThe sampling quality is slightly lower than the previous ones since I have many meshes in this scene, and my KD tree implementation didn’t quite work in time for the deadline. I used an 8-core EC2 instance to render the image and it took 70 minutes. I think I can get that down to a few minutes once KD tree intersections are working perfectly. Once exams are done I’ll go back to it and fix it up such that all the bugs are ironed out and photon mapping is implemented. Then I’ll post my code for all to peruse.

Final Chess Scene
-
Closing in on Final Scene
Posted on April 5th, 2009 1 commentAfter far too much work and way too many all-nighters, I’m finally closing in on my final scene. As you can see, texturing is working quite nicely. Combined with depth of field and soft shadows, the marble chessboard looks quite realistic. I don’t yet have KD-tree optimizations working, so this took 55 minutes to render on an octal core EC2 instance (7h, 21m, 41s of user time).

Pre-Final Chess Scene
-
Further Raytracer Updates
Posted on April 2nd, 2009 3 commentsI’ve been working on it as much as I could, and I currently have the visual features almost done (not including Photon Mapping). I just have to finish texture mapping (hopefully tomorrow) and then I can get my final scene ready.
The top left glass sphere is a mesh, and as you can see, the polygons aren’t visible on its surface.

Glass & Phong Shading (Smooth Meshes)
-
Glossy Reflections
Posted on March 29th, 2009 2 commentsI have implemented glossy reflections now. Image so far:

DoF, Soft Shadows, Glossy Reflections
-
More Raytracer Progress
Posted on March 27th, 2009 No commentsAfter a panicked rush to finish my ML interpreter because of a due date mixup, I’ve started working on my raytracer again. I’ve made reflective surfaces and area shadows work since the last post.
Volume shadows are pretty interesting, since as far as I know usually people implement area shadows. However, I’ve made any volume be able to represent itself as a light source as long as a function is implemented for that volume that uniformly generates a random point inside the volume. I implemented this function for spheres and cubes, which are susceptible to all the same affine transformations as geometry. This allows me to create light sources represented by any closed quadric or rectangular prism. While this function could be implemented for meshes as well, it’d be horribly inefficient since it would have to iterate over all faces, so I didn’t do that.
In any case, I’ve attached a rendering containing all the features implemented so far. The leftmost light is a cube and the rightmost light is a sphere.

Reflection and Volume Shadows Implemented
Edit: added another pretty picture.

More Pretty Soft Shadows
-
Raytracer Progress
Posted on March 23rd, 2009 No commentsI successfully implemented the Depth of Field feature that managed to work on first compile. At first I had it randomizing over a square distribution, but it turned out to be reasonably easy to convert it to a circular distribution. This will remove artifacts from certain situations, e.g. when there are hard corners/edges that are heavily blurred.

Depth of Field functionality implemented
-
Hulu in Canada
Posted on March 20th, 2009 2 commentsI’ve had many requests for a guide on how I got Hulu working in Canada. If you have the unfortunate luck to live in Canada having tasted the forbidden fruit, you have undoubtedly pined for the ability to stream Hulu from the comfort of your own home. Quite frankly the implementation of artificial borders on the internet bugs me a lot, so I’m quite happy when I can help others get around these attempted barriers.
I will thus give you a quick writeup on how you can get this working using an SSH account on a server in the U.S. and an Ubuntu client machine. Note that this is easily transferable to other proxies and other operating systems, but you’ll have to figure out how to get ProxyChains package or some other SOCKS wrapper working.
What you’ll need:
- An SSH account in the U.S. I use a Virtual Private Server (VPS). Alternatively, you can use another proxy, such as Tor, but this guide will show you how to seamlessly create a SOCKS proxy using nothing other than an OpenSSH tunnel.
- A SOCKS proxy wrapping library (I use ProxyChains).
- An Adobe Flash plugin that’s compiled for the same word length as your ProxyChains library. This means that if you use 64-bit Linux, NSPluginWrapper won’t work (since it wraps a 32-bit library, so all of Flash’s internal calls link against the 32-bit networking libraries)–you need to download Adobe’s alpha 64-bit Flash player for Linux. If you need a guide, I’ve linked one here.
Steps to take in Ubuntu (or Debian, for that matter)
- In a terminal:
sudo apt-get install proxychains - Edit /etc/proxychains.conf. Ignoring comments, mine looks like this:
dynamic_chain
tcp_read_time_out 15000
tcp_connect_time_out 10000[ProxyList]
socks4 127.0.0.1 12345Note that I will refer to the 12345 as [socks port] to demonstrate that you can use any non-occupied port larger than 1024 for this (ports <= 1024 are reserved for root).
- If you don’t have SSH keys setup, you may wish to do that to be able to passwordlessly login to your SSH host (guide here).
- Setup the SSH tunnel using the following command:
ssh -f -N -D localhost:[socks port] [user]@[host]- The ‘-f’ starts SSH in the background.
- The ‘-N’ tells SSH not to run a command on the target host (i.e. no shell is started).
- The ‘-D’ sets up a dynamic port forward. Any time an application talks to this port using the SOCKS protocol, all traffic is routed through the tunnel and disseminated as if it originated at the other machine at the end of the tunnel. Note that this means that your application needs to know how to talk over SOCKS, or needs to apply the hack we do below.
- Now you will use a bit of Linux magic. Start a new terminal and set the LD_PRELOAD environmental variable to include the ProxyChains library.
export LD_PRELOAD='/usr/lib/libproxychains.so'This magic variable causes any program launched to have the specified libraries dynamically loaded into the application, which will replace any library calls of the application with the ones defined in the new library. In this case, that involves wrapping any calls to the network stack with SOCKS wrappers and sending them through the proxy (which in this case is the tunnel).
I’ve simplified this step by creating a script: /usr/bin/firefoxproxy:#!/bin/bash
export LD_PRELOAD=’/usr/lib/libproxychains.so’
firefoxNB: if you have the non-proxied Firefox running, you need to kill it first, since firefox only ever has one process running even for multiple windows.
And that’s it! Happy Huluing!
-
Blog::Blog()
Posted on March 20th, 2009 5 commentsI’ve finally gotten around to setting up a Wordpress blog, in time for my last 2 week stretch of projects prior to exams. I’ll try to post here whenever I have something interesting going on, be it a technical post, a social commentary, or an annoyed rant. I update my Twitter reasonably often, so this blog will only be for larger blurbs of information. I’ve attached a Twitter feed here for convenience.

