Friday, July 31, 2009

Project Challenge: Audi "Rubix"

In this project challenge I'm going to cover my experience working on a commercial for Audi. At the time of writing this the commercial was not released and I do not have a link to it. Hopefully I'll get a link sometime soon after its release. You have to see it to appreciate it I think.

In this commercial we were asked to do every raytracers worst nightmare. Create a photo-real 9x9x9 glass rubix cube full of car parts in a photo-real CG environment. Then animate the cube rotating around and assembling the car as it spins until the car is completely built. For anyone keeping score...A 9x9x9 grid of boxes means that we had 729 cubes, each with at least one object inside it and most of them having several objects. Each individual cube had realistically modeled sides made of glass, which means we were seeing through a minimum of 36 panes and even more if viewing from an angle. So...729 cubes, made of 6 objects each. At least 3 times as many part objects. That put us at 26,244 nodes, just for the geometry of the cube and parts. Once you throw in the nodes for the environment and cube rig I can't even come up with that number...but these were some HUGE files to work in. Probably the most complex I've ever worked with.

When the project began I was one of the first modelers/lighters to start on it. There was a lot of uncertainty about what the environment should be like. It needed to not distract from the cubes, but also look good in its own right. Myself and two other lighters modeled up rough environments with temp glass cubes in it every day for a week or two. All similar but also quite different. As things progressed the environments that kept getting the most response were the very simple plain white rooms. In the beginning these all had white artificial lighting and no natural light sources. We went this direction for a long time, but when you put a glass cube in an evenly lit white room it disappears. We needed to have contrast in the scene in order for the glass to look like glass. I was pulled off of the environment for a week or so while the client, director and supervisors all worked out what they thought the environment should be. I was put on the task of creating the cubes and their glass shaders. At first I went with a totally realistic approach. I modeled all the sides of the glass cubes and stuck them up against each other. I put a realistic glass shader on them and hit render. Now I've never seen an actual 9x9x9 glass rubix cube before so I was a little suprised at first to find that the center of the cube was very dark. It was like the light just couldn't penetrate into the glass. I made the glass totally transparent and fresnel reflection at 100%, but it still had the same problem. The only way to make the center of the glass not get dark was to reduce the IOR for reflections and refractions. So I started breaking reality and it was starting to look better. After I had something kinda working I started adding a slight bump map near the edges of the cubes because I noticed in my glass reference on my desk that towards the corners the glass was warped a bit when the pieces were fused together. As soon as I did this it became aparent that with as many refractions as we needed you couldn't see through the cube again. Parts just became invisible inside all the crazy refractions. Not only that, but the rendertime suffered an almost 200% increase.

Eventually the environment was sorted out again and because I have architecture experience I was taken off the cube glass set up and put back on environments. Another artist took over the glass set up and came up with some nice looking results that totally broke reality, but that didn't matter because it looked good. I worked on variation after variation on the environment nearly right up until it delivered. At one point we finally decided that there wasn't going to be a good way to make the artificial lighting look good. We ripped open some holes in the ceiling and I was told to light the thing naturally. I think that was the best decision we made on the job, it really changed the look of the project and finally it was working.

In the meantime the other lighter who took over the cubes was getting creative with ways to reduce the rendertimes and still get great results. He came up with a great solution, but unfortunatly it was very complex. It was still faster than just waiting for frames though. His solution was to render the parts all by themselves without any glass in the scene. We did this three times. Once with an HDR generated from the actual 3d environment I built. A second time with an HDR of a studio lighting setup, and finally a third that only had a big area light above the parts. Our compositors would blend these three passes together over the environment background render until the parts looked cool. Then they would render an un-premultiplied pass of the parts back out for the lighters. The lighters took that pass into our cubes scenes and projection mapped it from the shot camera back onto the parts. Then we deleted all lighting from the scene. Only the glass cubes and projection mapped parts. This was rendered with the HDR of the CG environment for reflections and refractions. We still needed the ability to render mattes for the compositors, so we had to make scenes that had everything black except the parts which were 100% illuminated white. We also did an extra pass which was just the connecting edges of the glass cubes. This pass was used to tint only the fused faces of the glass cubes to have a greenish hue.

Thursday, July 2, 2009

Project Challenge: Fight Club

I recently had the pleasure...wait...was it a pleasure? After I fully recover and get some sleep I'll look back on this and consider it to have been a pleasure to work on ;)

At any rate. DD recently finished a very cool project for the Blu-Ray released of the movie "Fight Club." We were hired to create some graphics for the dvd menu screen. This project was FULL of challenges. Our goal was to re-create the scene from the film where Ed Nortons character is walking through his empty apartment while one by one pieces of furniture fade into the scene while text pops up over some of the items making it look like items from a catalog. However, in our version we planned to extend that shot into a full 360 degree panorama with half of the room being his apartment from the film and the other half being the gross dirty kitchen from the house on paper street. This also had to be a totally seamless 360 that would loop repeatedly. So as we came back around to the end of the shot we needed to make the rooms blend back together and start empty again. Did I mention that this all needed to be done from start to finish in less than two weeks?

To make this project harder. I wasn't supposed to be on it. However, the CG supervisor on the show was going on vacation and was not going to be here for the last half of the project. DD decided that they needed to have a CG supervisor on the show and they asked me to drop what I was doing on a different commercial and take the reigns as CG supervisor on this fight club project to help finish it. So I got to put on my supervisor cap again for the first time since leaving Blur. I was asked if I would do this about 15 minutes before the original CG sup left for his trip. I got a 15 minute crash course on what was currently done and what still needed to be done and what the expectations were.

We had a small team. Two lighters, two modelers, one compositor (although we did get some help from a few other artists here and there) and myself. The first plan was to get the modeling started. Half of the modeling was done before I came onto the project. The other half continued up until the last minute.

The plan was to render a 900 frame nodal pan around the entire empty living room and kitchen. Then we would create HDR's of the room and map it back onto the walls and render separate passes for all the different items in the room. After spending a little time thinking about this it became clear that we would run into a problem with this approach. First of all we would need multiple reflection and shadow passes for every object in the room, but more than that we were rendering with GI and as lights turn on and bounce off of objects in the room it should change the lighting on the rest of the objects in the room. Unfortunately, there was no way for us to render a pass that was ONLY the bounced light from the addition of a single prop into the room. So we needed to find a new approach.

The next idea was to actually just keep adding one more prop to each pass and then disolve between them in the comp. This was a good approach because we could elimiate all the shadow and reflection passes completely, and we only needed to render about 30 frames of each pass because we would be frequently disolving to other passes. So this was a good plan because we greatly reduced the number of passes and complexity in the comp and made life a bit easier for everyone. Then we discovered the next problem...GI flickering and glossy reflection noise.

We tried raising settings which was helping, but in order to get renders nice and flicker free we would need to bake out the GI. Since this would require over 100 separate GI calcs and would need updated everytime a prop was moved or changed this became a major problem to manage. We didn't have time or tools in place to help us do that. So it was time again to come up with a new plan.

The key to the solution ended up being that the camera was just a nodal pan AND that nothing in the room moves. Items just fade on. Late at night on my first day on the project I started thinking about this problem. The solution to our GI and reflection problem would be to only render single frames and stitch together a panorama. That would greatly reduce the number of frames we had to render. In fact that would mean we only needed one single frame for each prop that fades on. Then it occured to me. Vray has a cylindrical camera. We could render one single high res frame of the entire 360 degree room and map it onto a 3d cylinder in Nuke. We could also bake out our cameras motion and feed that into Nuke also. Then the compositor would just disolve between our single frames and have complete control over when things blended on. The only problem with this plan was that Vrays cylindrical camera didn't work the way I thought it did. So that idea wasn't going to work. However, Vray's spherical camera could do something close enough. Instead of a cylinder we could use a sphere. I rendered out a few lower res spherical panoramas to give to the compositor to try the idea out with. It worked. We scraped all our other methods and moved forward with the spherical pano idea.

In order for the final resolution pano's to hold up we needed to render 6000x3000 pixels. This took a while, but it was a safer way to go. Renders took a maximum of about 10 hours. Things were kind of interesting in the comp. The tree itself was pretty simple...just a huge line up of read nodes and disolves. But because we were rendering panoramic images and only still frames it made some tasks easier, and others harder. For example it was very easy to roto. You didn't have to animate any beziars because the images didn't move. The camera just pans across them. What wasn't easy was rendering mattes. We rendered a few, but we knew going into it that things would be disolving on and screwing up the matte, so we would either have to render a new matte for every time an object blends on, or the compositor would have to work their magic a bit with mattes. Ultimately, roto would be faster.

While lighting was going on we had two and sometimes 3 prop modelers creating props to fill up the rooms with. We were referencing all of these models into the lighting scene so the lighter could keep working while the modelers were updating things. It sounds great in theory, but in all my years I've never seen this work well. The biggest reason this was a problem this time around was that we discovered some bugs in our model publishing tool that was screwing up shaders and geometry in the lighting scene. We also had a lot of trouble with Maya's render layers which have proven to be a total mess. The biggest issue with them was they would lose texture assignments. This has happened on several shows now and I'm not thrilled about it. On top of that we just started using a tool called "Atomic" that greatly simplifies setting up render layers. Its a lot like Blur's "Render Elements" tool, but in some ways much stronger, and others much weaker. Atomic is still going through stages of being integrated with Vray, so we ran into a few issues there as well. The modelers did a great job. Two of them had never used Vray before and the third had used it only once before. They are a talented bunch and quick learners so they picked it up pretty fast.