Monday, July 20, 2009

A couple old renders

I did these in Mental Ray last year. I didn't model them, but I shaded them 100% procedurally and lit them in Maya, and comped them with Shake.

This one was lit with an HDR and just a couple direct lights. I mapped a fractal to the "sun" direct light so that I could get an uneven effect to mimic sunlight passing through clouds.
This one has actually only about five shaders in total; my goal was to get as much done with the lighting as possible. I used photon mapping for the fill and a series of spots, points and direct lights for the sweetening.
I'll be using these methods (and everything else I learned over the past 14 months since creating these) on my thesis.

Wednesday, July 15, 2009

Ambient Occlusion, again

A friend of mine gave me some great advice on saving render time on Ambient Occlusion - tighten it up by reducing the max distance in the AO shader. Check out his site for a ton of great resources. I have been rendering with a max distance of 7, with the intent of crushing it in the compositing stage, but I figured that if don't need such a diffuse AO in the first place, I might as well cut some corners wherever I can.

Here is the same frame, each time with a different max distance for occlusion. The original resolution for each was 1920x1080 with a bit depth of 16 short.

Max Distance 5.0, render time 35 min: Max Distance 4.0, render time 32 min:
Max Distance 3.0, render time 30 min:
Max Distance 2.0, render time 28 min:
Max Distance 1.0, render time 25 min:

Depending on the type of lighting I'll be having, I might need to increase or decrease the max distance for the AO. However, I do know that I will want tight AO for bright midday sun, so I could get away with using something between 1.0 and 2.0, and I'll need something a bit more diffuse AO for an overcast day, so I'd have to mess around with 3.0-4.0. I'll of course render out a single style frame and comp it in before I render out the sequence. I'll figure out which frames I'll need what type of AO for; given that this frame comes from a shot that is 384 frames long, I want to save time wherever I can.

Wednesday, July 8, 2009

Like watching paint dry

Here are some ambient occlusion renders of the kitchen scene. The trouble here is that the shortest of these renders took nearly five hours, and the longest one took over six.
The original size is 1920x1080. I rendered with Mental Ray using its Ambient Occlusion shader with 128 samples, but I think the real killer is the motion blur. MR is painfully slow in rendering it, so I will be trying to do the motion blur in the compositing stage.

It may seem like not a ton has changed since the last ones I posted, so why the ridiculous render times? I've been tweaking virtually every model in the environment. I've been smoothing polygons so their profiles are not jagged (this is probably where much of the render time is coming from), deleting poly's where they are not seen directly by any camera or in any reflections, re-laying out UV's and setting Normal angles. I've also converted some poly objects to subD's or altogether replaced them with NURBS because I know that I'll be using procedural 3D projections for their shaders and therefore won't have to worry about UV maps. I'm still going to try to optimize my scene for rendering.

Friday, July 3, 2009

May Renders

These were done in the middle of May, and are all works in progress.

Tuesday, May 12, 2009

Pre-Lighting

After first texturing the exterior of the apartment building, I felt that I had spent time creating textures that, once are lit, may not eventually need as much detail as I gave them. I do know that the textures will hold up on their own even with basic lighting, but I want to put my better strength in lighting to good use when I approach the other scenes, because it's what I am most comfortable with, and what I enjoy the most. Equally as importantly, the lighting is what I have wanted to use to help emphasize the mood throughout my film. In approaching the interior scenes, I decided to pre-light them using only basic shaders as well as low-resolution geometry, so that I can see how much the lighting is accomplishing, even with the most primitive and unrefined of geometry and textures.
I lit all of these shots with a combination of photon mapping and very basic direct lighting rigs. In addition to the beauty pass, I only rendered an ambient occlusion pass, and did not use any shadows for the lights. I composited these in Nuke, in which I also added lens distortion, vignetting and film grain. The models you see are smoothed versions of the "master" Maya scenes I have created, and the faceting and jagged profiles are for the purpose of speeding up my renders in this pre-lighting phase, and will certainly be much more precisely smoothed out when I do my final renders.

I wanted to see how far I could get with lighting and even basic compositing before starting the texturing. I feel that I have a much stronger understanding of what I can get away with once I start shading things. These two images are updates from my post a couple days ago, with the simple addition of lens distortion, vignetting and film grain:
In terms of modeling, this is easily the most basic environment I have in my film, so I know that I will need to give it some special attention so it does not appear to be so simple. I'll accomplish this largely with the shading and lighting, and will use both to create an interesting composition from such primitive shapes. I'm very happy with the way this pre-light went, because it was very quick and still contributes to the somber mood I'm going for (this is the shot that appears when my mother says her mother died.)
Similarly, I'm very happy with how far such a simple lighting setup went here. Even though some of the geometry is simple proxies (I know that a TV is not a sharply angled box) and there are props that will be added in, I feel that the light plays around the existing contours nicely, and the glow makes things somewhat ethereal. The color is also meant to go for a somber mood; this shot follows the one above, and is when my mother says her father died.
Although I rendered out proxy models such as the TV above, I did use very basic smoothing (1 subdivision for objects that took up less screen space, 2 for the ones that were closer to camera) for many other models. In doing so, I could also help gauge how much smoothing would eventually be necessary for my final, full-quality renders.
In Nuke, I used a Radial gradient to help highlight the stairs, as they are the focus of the dialogue in this shot:
I did the same for the bannister here:
I had a lot of fun pre-lighting this one, because I was placing lights so that their sources were apparent, yet still not directly visible. In other words, I knew that light would be entering through the entrance at the end of the hall, from a window on the left side behind the wall, and there would be some diffuse light entering from the room slightly ahead of the bicycle.
I used a similar approach to lighting this shot, and was able to punch up some contrast in Nuke where I wanted the viewer to look, namely at the stairs and bicycle, and not down the hall, where there is very little detail:
The camera pans from this...
...to this, so I knew that I did not want to draw much attention to the lamp and closet behind it. Therefore, I put it more in darkness and lowered its contrast so it would not attract any unneccesary attention.
I wanted to go for a late afternoon/early evening lighting and color scheme here, since this shot is used when my mother is describing her mother's dinner cooking. That's a wok stove, by the way...plenty of people have been asking me over the course of this project.
This is one of my favorite pre-lights because of how much I got out of such a basic lighting setup: a sense of texture (even without bump or specularity maps) and scale because of the ambient occlusion's size and diffusion.
In pre-lighting, I'm roughing out the basic lighting rig, getting the colors and intensities into ballpark range.
Of course, I'm positioning them too.
Since I have grouped my lighting rigs and appropriately named them in Maya, I can simply export them and re-use them in my full-resolution geometry scenes, and use them to help adjust my texturing. Because I have rendered from multiple angles, I have a much better idea of where I need texture/shading detail and where I do not, and also know where I can re-use lighting rigs across multiple shots.

Monday, May 11, 2009

The Evolution of a Thesis Project

As I'm about to tell you my original idea for my film, I know I'm telling you something very different from what you are about to watch. Over the past 15 months, I have gone through multiple re-vampings of my story and animatic, but have been reluctant to post anything because I knew that if I abandoned an idea for thesis, there was a strong chance I would return to it in the future for a different project, and I did not want it floating around before I got to it. Anyway, It began over a year ago as a narrative between two characters who find friendship as children, become separated soon after, and try to reunite as young adults. I knew that I wanted to use a hybrid of 3D CG and live action talent, and was going to use lighting to help convey the emotion throughout the piece. Over the course of the next six months or so, I pooled together lighting, architectural and prop references together - from the internet, my own digital photo collections, and wherever I went with a camera.

Among my references was an album of digital shots I'd taken more than three years prior in my mother's family's brownstone in the South End of Boston. We were about to hand over the keys to the man who had bought it and planned on renovating it. This was in December of 2004 or January of 2005, and I had been getting into 3D graphics over the year leading up to that. I walked throughout the four floors of the building, taking snapshots of anything I found interesting: old furniture, worn-down paint, grease-caked cooking equipment, weathered sinks, pools of sun entering sky lights, battered bricks, and of course the building itself. I also shot a very choppy, grainy and blurry video of a walkthrough of the building from top to bottom. I think that because of my budding interest in 3D, I had the intention of re-creating some of the items and textures I'd photographed, if not re-creating the entire space.

As I modeled items I needed for my film, such as buildings, mailboxes, lamp posts and other urban objects, I saw myself constantly gravitating back to the reference images I had shot at the apartment. I also found myself having a difficult time ending my story in a way that was compelling, memorable and feasible given my timeline, resources and budget. The live action portion was especially governing the creative freedom of the film, because it was locking me into shooting things a certain way because I was planning on greenscreening pretty much all of it. It became more and more apparent that I was not going to accomplish what I wanted, so after meeting with professors as individuals and as a thesis committee, as well as pitching the idea to friends and former professors from college, I decided that I should save the idea for another time.

My second phase of my film scrapped the usage of live action video, and would be entirely 3D. I retained the original part about using light to help drive the emotion, and was still using many of the references I'd already put in my library. This second version was a series of vignettes, spanning multiple interior and exterior environments I had been sketching over the years, all of which contained an interesting element of lighting, color and composition. However, after I presented this idea to some people, they told me that this would be effective only if there were a cohesive element tying all of the shots together. As I tried to find a common and interesting thread to bring everything together, I kept modeling the exterior as well as individual rooms of my mother's apartment. There was something compelling about this place; family memories coupled with architectural history. The creative potential for combining these two things with lighting and texturing was strong, but the only question was how I would bring them together into a narrative, not to mention doing so without the presence of people.

As I tried to work through this obstacle, I continued modeling from my reference photos. I felt that the exterior and kitchen had the most character, because they both had indications of time periods and usage by the people who lived there, as well as very organic textures and shapes, and I started to get a feel for how I could tell a story without actually needing to show anyone. I had a slightly better sense of direction now, knowing I wanted to take the building from season to season and decade to decade, using lighting and texturing to show the passage of time, but also unsure as to how I could string each shot together. It was not until I saw my mother during the winter break that i really started to figure out a solution to this challenge.

With a dozen or so basic questions, ranging from how long she lived in the apartment to what her favorite memories were, I sat down with my mother and recorded her for a couple hours. I was asking questions specific to how I wanted my film to be: what major historical events she remembered while living there, what she did around and outside the house depending on the season, what she remembered about specific rooms of the home, what family activities they did, and even if there were certain visual memories she had about the space. In the weeks after interviewing my mother, I transcribed all of the audio into a Word document, and printed out a copy so I could take it with me wherever I went and mark it up whenever I had an idea. This was probably the lowest-tech process of my entire project over the past year, and it proved to be one of the most important steps.

I constantly read and re-read the transcript to help group certain sections of dialogue into categories, from time period to family members to rooms to activities. I highlighted the printout and wrote notes on it so that I could better understand how I could organize and edit the audio into a cohesive, flowing piece. I took the audio into Adobe Audition, and made a rough cut over the course of two days, very roughly splicing clips together and grouping them into tracks named according to the categories I'd developed on the transcript. I used the rough cut as an opportunity to get all of my ideas out and test the waters to see what was working and what I could do without; I was editing much in the same way I was taught to write speeches: purging every idea onto paper, then stripping down to the bare essentials, and replacing general ideas with concrete, memorable examples.

The first rough cut was about five and a half minutes - much too long for my project, and much too long to keep most audiences' attention if the film was not character-driven. (And by character, I mean in the traditional sense of a walking, talking one that is actually seen by the audience.) I knew that the initial cut would probably be this long, so I was not discouraged. My goal was to cut and tighten it to less than 3:00, and ideally 2:30 because I figured I should leave room for expansion once I started throwing in the visuals.

I listened to this cut over and over again, several times in a row at first, and then waiting at least a day before listening to it even once, so that I could hear it with fresh ears and be more objective about it. I also imported the audio into Adobe Premier, and began dropping in Playblast camera animations of my models. Waiting a day between listens was very helpful, because it made redundant and slow spots much more apparent, and I could cut out large chunks of dialogue without getting lost in single words or breaths. I ended up cutting it down to 4:00 and 3:30 over the next couple of weeks. Having the visuals there definitely helped to figure out the timing in some cases, as well as decide when I could do without sound altogether.

It took another couple of weeks to cut the audio down to 2:45; it was with this version I ended up working for the longest period of time, animating my camera moves and cutting/transitioning according to it. I showed various progressions of this animatic to the most people as well, and got as much feedback as I could from professors and professionals experienced with the process and creation of animation, to friends and family who were simply interested in watching animation. I wanted the widest range of opinions possible, so that I could gauge the emotional and narrative success of my film, finesse the cinematography and work through technical details. One of the most common pieces of feedback I received was that the pacing was too quick, both because of cuts and because of camera moves, and that this was contradicting the slower emotional pacing I had created with my mother's dialogue. There were several fixes to make: slow down existing camera moves, limit camera animation, extend the length of shots, reduce the number of cuts, use dissolves instead of hard cuts, and add silence throughout the dialogue.

Finally, I arrived at an animatic that has both the content and the pacing that I wanted to tell my mother's story.

Sunday, May 10, 2009

Smoothing vs. Normal Angle

A problem I've been running into lately has been smoothing out polygonal models without smearing their UVs. I'm smoothing them, of course, so that their edges are beveled and broad, rounded surfaces don't become faceted.

My original geometry looked like this:

Notice how the rounded surface consists of about 20 faces (from left to right) that have been cut from about 12 faces, in order to create openings for the windows while preserving the original curvature of the original 12 faces. I also made edge loop cuts to "shore up" the edges and preserve hard edges where I needed them, especially where the rounded part joins the flat part of the facade, as well as the windows, as circled below here:

Upon rendering, there is blatant faceting, a dead giveaway that the building is CG and consists of polygons:
At both far and close angles, the faceting is very obvious.

In modeling my objects, I intended to subdivide them at render time with Renderman, so I would get results like this:
Notice how there is absolutely no faceting at all, and the rainbow grid texture has stayed perfectly in place.

However, Renderman was giving me limited control over its ambient occlusion, among other things, so I tried converting the polygons to subdivisions in both Maya 2008 and 2009, but this warped the UVs, as did Maya 2009's subdividing at render time:
This made my texture maps virtually unusable, as they'd been painted according to the UV layout of the original polygon object. My other attempt at getting rid of the faceting was to smooth out the polygon object, by just doing a Mesh > Smooth operation, using these settings:

This certainly fixed my faceting issue, but it also smeared my UVs:
The smoothed polys I was looking for are circled in green, with the smeared UVs in red:The UV smearing is apparent, even from a wide angle:I did not want to edit my UVs again, because they were too precise for the texture maps I'd created. I also did not want to have to edit my geometry manually, because it ran the same risk of making my textures useless. Luckily, one of my classmates, Thomas Huang, suggested softening the Normals of my geometry. By setting the Normal Angles to 45.0, I was able to give the illusion of a rounded polygonal surface, without changing any geometry or UVs:
The green circles are where the smoothing is apparent, and the red indicates the angles that reveal the silhouette of the geometry, showing that the geometry itself has not been adjusted in any way. These angles don't matter to me though, since they will be occluded by other geometry, such as window sills and frames.

Here's the result of the softened Normals on the whole facade:

This is a huge relief; I don't have to manage any geometry conversions, nor do I have to re-map any UVs; I just have to set a single angle, and I can move on to more important things.

See also: Surface Normal (Wikipedia)

Kitchen Rough Lighting

Here are some very rough, photon-mapped shots of the kitchen. They consist of a beauty pass and ambient occlusion pass, with some very basic compositing. All of the shading you see is either the default Lambert or a basic Blinn. I'm taking a different approach to the interiors from the way I tackled the exteriors: I'm starting off with very basic lighting before I move into the texturing, so that I can see how much I can tailor my texturing according to how much the lighting is accomplishing. When I took a lighting and rendering class last semester, I gave myself the challenge of using lighting solely to convey the mood of scenes, even if it contradicted the subject matter. For example, I would try to use warm lighting on a disaster scene to make it look more calm, which using very cool lighting on a home environment to make it ominous.

This has a warm atmosphere to convey when my grandmother was still healthy and cooking frequently:

This shot has the same render settings, but with differently colored photons being cast. I'm trying to go for a cool tone, to convey how the kitchen was in disuse after my grandmother became sick with cancer:
Here are slices of the raw passes that went into the above images:

Clearly, there is plenty to go on these shots, but as I said, I'm trying to get the lighting in the ballpark before I start texturing.

Saturday, May 9, 2009

The Ups and Downs of Subdividing

Today, I decided to run some tests in taking the scene I've been texturing lately, and rendering it with Mental Ray instead of RmF. As you know, the main advantage I've been seeing in RmF is its ability to subdivide geometry at render time. However, the downside is that it has limited control over certain attributes (namely, ambient occlusion) and is not supported by studios at which I may be rendering. My goal today was the following:
1. Convert all of the tagged "convert to subdivision" polygon objects into subdivision surfaces, and render with Mental Ray in Maya 2008.
2. Render with Mental Ray in Maya 2009, and allow this newer version of MR to subdivide the specified polygons at render time.

#1 was a fairly straightforward process: Select all of the necessary polygon objects via RmF's Shared Global Attributes (which I utilized in this quick runthrough.) As simple as it sounds, it became a massive headache very quickly. Every other time I converted a poly object to subD, it would either reject the operation because the resulting object's name already existed (it would rename anything to a default "polyToSubdShape1," rather than retaining the name of the object from which it originated), or it would flat out not do anything at all. This was making it a hardship for me to even convert literally five objects, and I knew I would not have time to troubleshoot and manage the hundred+ others in my scene. Since this didn't work, I moved on to goal #2.

My second goal of entering Maya 2009 was a multi-step process. Since we do not currently have the Maya 2009 version of RmF, attempting to open a file with existing RmF nodes freezes Maya 2009. In my case, such nodes were the tag for subdividing, among other default ones that are written into a file when you even happen to have RmF loaded when you are working on a file, regardless of whether you use any RmF features. There are multiple ways of helping to get 2009 to open the scene files, which I learned after attempting them tonight:
a. Open the file in Maya 2008, as usual, and delete any tags you might have in your RmF Shared Geometric Attributes window. Save as a new file. However, Maya 2009 still freezes when you try opening this scene.
b. Open the file in Maya 2008, and then export all of the geometry, cameras, etc. into a new Maya file. Open this exported file in Maya 2009. This works.

So back to subdividing. I finally had my scene in Maya 2009, and wanted to take advantage of Mental Ray's ability to subdivide at render time. I rendered out the brick facade of one of the buildings, and let's just say it was like trying out a new sushi restaurant because everyone ele said it was good, then eating there and finding out how crappy the food is, and then being told you have to pay extra to make up for all the other times you ate at your favorite sushi joint and not at this new one. Mental Ray was actually re-mapping my UVs at render time so that my textures were skewing horribly, to the point I would have to lay them out again, making all of my bitmapped textures completely useless. MR interprets poly objects very differently from the way in which RmF does, unfortunately.

Luckily, I had only planned on using RmF for the exterior shots, and was using MR for the interior ones, and I could still work on the UVs in the other shots because the texture maps were not yet completed. However, I still needed to somehow subdivide the geometry so that I would have smooth surfaces and "beveled" edges. I also wanted to stay in Maya 2008, for rendering support reasons, and I also wanted to get rid of any RmF nodes in my file, so that I would have no problem bringing my files to studios that did not have RmF. To help make sure I did not have any such nodes, I disabled RmF via my Plugin Manager, opened the file and read the error messages that appeared in my Script Editor. For example, it would read:
// Warning: file: /G:/.../scenes/groundfloor_2009-04-06_v6.ma line 246705: Unrecognized node type 'RenderMan'; preserving node information during this session. //

Even after saving as a new file, and opening that new file, these error messages would still appear. I had to use a different approach from steps a and b mentioned before:
c. Open the file in NotePad in Windows or TextEdit on a Mac, assuming you've got the file in Maya ascii (.ma) format. Find anything that says "renderman," and delete its entire section of code. Save the file and open in Maya 2008. This works.

This method actually requires a little bit of scripting experience, but it was very easy. I hadn't coded anything since taking a Java class nearly 7 years ago, and I got by just fine. To comment out a line of code, you simply type
//
before that line. So, for example, if the original code is:
createNode RenderMan -s -n "renderManGlobals";

Your commented-out line of code would be:
//createNode RenderMan -s -n "renderManGlobals";

However, even after commenting out every single line of code that had "renderman" or "rman" in it, the file would still open with errors. My only solution was the very delicate approach of completely deleting any sections of code involving renderman. Surprisingly, this didn't corrupt the file, and actually allowed it to open without any problems.

Again, back to subdividing. I decided to give converting poly's to subD's another go. It actually worked, and I went on to rendering it. Again, it was skewing my textures because the new subD object was given a different UV layout from the original poly object. Fearing I would be stuck in RmF permanently if I wanted to subdivide my objects, I resorted to doing a Smooth on my polygon object, which worked just fine. The only downside of this I can foresee right now is that I will have to smooth things at various resolutions depending on the camera angle. Additionally, editing UVs becomes pretty much unmanageable after the poly count goes up. But if it gets the job done, I guess this is where I'll just have to deal with it.

Friday, May 8, 2009

Light at the end of the tunnel...

...is still a little ways' away, but is certainly a little bit closer than the last post.
The basements in the hero apartment and the one to the left are pretty much the last things that need texturing. After that, it's plenty of plussing and sweetening with lights and some shading.

Thursday, May 7, 2009

Gimme

I think I've been getting nostalgic about my Boston roots. It's wicked sad cuz I sweah ta gahd I've lost mosta my accent since graduatin high school in Dohchesta, Mass.

Please don't bother commenting on the depth of field. I know it's impeccably done and does not in any way look like a cheap and lazy hackjob in Photoshop.

What is a "gimme," you ask? To paraphrase animator Tom Sito, a gimme is essentially a hidden "easter egg" that animators would put in their films to slip past the censors. Typically, you wouldn't notice them unless you were specifically looking for them or happened to stare at the right place at just the right time.

Texturing almost done...


I've still got to texture the sidewalk and some of the ground areas, and also sweeten some of the grunge and brick to make them more irregular (more on this later), but I'm pretty much done texturing this and can move onto lighting it.