Thursday, April 30, 2009

New Render Tests

Here's a render of the front entrance with new shaders. I used a combination of photographs I shot in downtown Providence, RI; images downloaded from the internet; and procedural textures created within Maya. It was a fun challenge creating the wood with worn-down paint, because I actually began with a blue painted piece of wood as my foundation, and then I used a combination of color adjustment layers, masks and layer mixing modes in order to achieve the aged reddish paint look. I'll post images from my process soon.
Here's a photographic reference:
As you can see, I need to do some color correcting to the door because my render is far too red. My HDR is fairly blue, so that's contributing to the large discrepancy in color temperature between the two images.

This is a POV shot from the front steps. I'm abuot 80% there with the existing textures; I need to fix the paint chips on the railing (the white parts) and add some more generalized grunge on the stone.Like the other image, this was rendered with a single HDR and a single Directional Light with raytraced shadows. I anticipate sweetening things with a much more art-directed lighting rig, and the overall temperature will be considerably warmer as well.

Facade Grunge

I should start off noting that the building was never as dirty in real life as it appears in my renders; I've found it necessary to exaggerate the amount of grunge and dirt to help sell the scale, age and overall realism of the buildings. Adding in a sky to the background definitely helps with the scale as well, as you can see in the embarassing comp in the second to last post.

The brick facade is mapped with a layered shader, consisting of a bitmapped texture for the brick and several procedural textures for the grunge. I wanted to make the grunge easy to manipulate, especially since I knew I would need to use it on every building, but would of course need to vary it up so it did not look duplicated. Managing three bitmaps (the brick's color, bump and specular) for a single building was enough for me, and I did not want to make my render times explode by using bitmapped grunge.

In my initial textured test render, I felt that the grunge on the brick looked simply overlaid evenly; it wasn't sitting in the grooves of the grout even with the bump map directed into the grunge shaders:
I decided to create a "grime mask" to pump into my grunge shaders, so that dirt and mildew would appear bolder and more built up in the grout:
This was different from the bump and spec maps, in that the contrast was reasonably high, and the grout tone was consistent, as was the tone between different bricks.

Here's a closeup render of the brick with this new mask added into the shader:
The green mildew is especially more apparent in the crevices, as one might expect it to be in real life. It's such a subtle change, but it goes a long way. I'll need to dial down the grunge a little bit because I feel that it's a bit too strong now, but I'm overall very satisfied with it.

Front Steps Texture Mapping

As I said in my previous post, I had to re-model the stairs to make the texture mapping easier, especially in the grout. Here's the revised geometry:
And the UV layout:
As I did with the brick facade, I kept all the UVs in the first half of the quadrant so I could create a 1:2 width:height texture map.

Here are the color, bump and spec maps:
I created the bump and spec using Color Range selections and various adjustment layers. I'm very happy with the final result.

Wednesday, April 29, 2009

This smells like fish


Unfinished textures, basic lighting, horrible comping...but just to test a few things out. I used a panoramic photo I shot in Japan just for a stand-in reflection dome and sky map, in order to help plan out my rendering pipeline for this shot.

Right now, here's my plan of attack:
1. Render out EXR for the building, including beauty and reflection in the render passes. Longest render.
2. Render out ID passes for windows (the most reflective objects in the scene) as well as other objects that may need color specific correcting. Very quick render.
3. Render out sky dome (background.) Very quick render.
4. If the EXR's from step 1 have faulty reflections, render out a reflection pass in TIF format for the windows and other necessary reflective objects. Very quick render.
5. Comp it all in Nuke and cry if it looks anything like the image you see here.

Weathering the storm


As I said before, adding wear and tear truly helps sell a believable image, because it randomizes otherwise predictable patterns and also gives a sense of scale. Here's an updated image with several texturing revisions, namely on the hero apartment's stairs and front entrance, as well as some tweaked grunge maps on the brick facade.

For the stairs, I ended up having to re-model them before re-texturing, because the original texture maps were too cumbersome when it came to making the grout look like it adhered to the step above it and the step below it. Previously, I'd created each step as a individual objects so that I could easily move each one around on its own, and avoid laying out UVs over and over again. However, this backfired on me, since it was just as easy to create a single object with all the stairs in it, and lay out the UVs fairly quickly. Additionally, this method yielded fewer polygons (which I'm subdividing at render time) and it was very easy to Photoshop the grout between adjacent steps. Luckily, I had built my texture to have its layers clearly organized in Photoshop, and I was able to re-use the majority of this file when I tailored it to the new staircase object. Additionally, after I'd re-modeled and textured the stairs, a friend of mine noted how rigid and straight the stairs looked, and how they would be more worn out in the middle from years of use. I completely agreed, and was able to quickly fix this by adding in some extra cuts to the stairs and "bowing" them downwards in the center. Because I'm subdividing the geometry at render time, I end up getting a nice, smoothly curved ridge. Another nice part of this quick fix was that I did not have to lay out my UV's or alter my texture maps in any way.

The previous texture maps for the entrance were bothering me because they felt too flat and inorganic. I'd been using basic shaders with procedural color inputs, and was using Photoshopped images from photographs for the bump maps. For the revision, I ended up creating both the color and bump maps from photographs, and I think that the result is much more convincing and pleasing to the eye.

I also added in a slate tile texture to the upper front roofing, and fixed the shading on the white window sills on the apartment to the left because they were far too flat. A minor change with what I see as having a major payoff is the grime on the brick facade of the hero apartment. If you look at previous renders, you'll notice that the grunge (especially the green mildew that goes vertically along the left, middle and side of the building) seems to simply rest on top of the brick and grout evenly. I felt that it needed to sink into the crevices (i.e. the grout), because it would be a more porous surface than the brownstone and would be more likely to retain grunge and moisture. I simply exported a mask from Photoshop for the bricks and grout (this ended up being slightly different from the bump map), and mapped it into my grunge shaders to that it would allow the grout's grunge to be bolder. It's a very subtle effect but I'm very happy with it.

I anticipate finishing all of the shading by the end of this week, and will be able to render the exterior shots very shortly after.

Thursday, April 23, 2009

Render Updates

This week I've been trying to add some grunge to the window frames because they were looking far too consistent, which is a bit difficult to avoid when there are so many of them. I added some textures to the stairs as well, which was a bit of a challenge because of the UV mapping involved with the large blocks that are next to the steps. In these renders, I had shut off the object layer containing objects from 2005 that were probably nonexistent in 1963 (black iron lattices along the windows, and gates on the sidewalk level.)
Here are some closer shots. The doors need better bump mapping because they're too similar to the large vertical outer door frames.I'm pretty happy with the base rock texture of the stairs, but the grout (yellowish areas) certainly need some fixing. They're too large and pop out, so they need some grunge on top of them too.
Here's a photo from 2005 for comparison.

Sunday, April 19, 2009

Texture Map Creation

Here's the shader network for the hero brick facade. It's a combination of texture maps and procedurals.I created the base brick texture map by beginning with a photograph of a brick wall, which I shot with a digital SLR with a long lens fairly zoomed in, in order to reduce lens distortion:
I then painted it in Photoshop to make it easily tileable, while minimizing the obvious repeating bricks by painting out the apparent clusters (e.g. a pattern of high-contrast bricks that was unique to a single part of the image.) I was primarily copying and pasting clusters of bricks and using layer masks to blend things into one another. This was more tedious than I'd anticipated, because I had to be sure to retain each individual brick's outline and make sure that no feathering between different layers was apparent. Finally, I adjusted the saturation with an Adjustment Layer so that I could retain the original painted image as well as the editability of the color correction.

I used a combination of Color Range selections, as well as Black & White and Levels Adjustment Layers in order to create the bump maps and specular maps. From top to bottom, here are the color, bump and specular maps:
The bump map is more consistent in contrast than the specular map, because the I wanted the brick to look like it was fairly consistent in depth once I rendered. The specular map has a wider range of contrast and is more sporadic across individual bricks so that I could help break up the glints of light in the render. The grout is darkest so that the specular highlights are nonexistent on those parts of the map.

The most time-consuming and difficult part of the texture map creation was the tiling; the bump and spec maps took literally minutes. Luckily, I won't have to creating too many other texture maps that show obvious repeats when tiled.

Friday, April 17, 2009

Test render (finally)

Here's a test render I recently kicked out. It has things partially textured and quickly lit with an HDRI and single directional light with shadows. I'm pretty happy with the main building's shaders since the grunge helps to sell the scale. I'm finding that I'm having to add on more grunge than actually existed in order to take things from less sterile and CG, to more random and realistic.

My Mom's neighbors were the Tin Man and Princess Lolly.

Wednesday, April 15, 2009

Re-Modeling, Post-Texture Mapping

In laying out the UVs for the buildings' facades, I was careful to translate them around so that I could map an unwarped brick texture map to the geometry. My geometry looked like this (polygons on the left, subdivision approximation on the right):
I used this rainbow texture to test the UV layout:In Maya, my geometry looked like this:
My UVs looked like this:
Everything looked good, until I rendered and got these results:
There is massive warping up at the top, most obviously between the .4 and .5 of the rainbow grid. Because I had used a combination of cylindrical and planar mappings, on the round side and flat side respectively, I figured that the cylindrical mapping was the problematic part. I tried to use a planar mapping on the entire object. However, I got the exact same results.

I considered using a projected texture (rather than relying on the object's UVs), but I did not want to end up having to adjust the projection to be the exact same for the color, bump and specular maps of each texture, as well as doing this another four times for the other buildings. My only other option was to re-model the facade, which I did relatively quickly because I would simply snap UVs to create the same shape as the original facade object. The problem with my original model was that in some areas, namely the corners, too many edges would converge, causing a pinching to occur when the geometry was subdivided. In the revised model, I created it to be more like a grid, with all edges perfectly parallel or perpendicular to one another when they intersected:
Note that even when the geoemetry is subdivided, it retains the grid of the polygon object. I laid out the UVs with a combination of cylindrical and planar projections, as I'd originally done with the old model:
I kept everything within a half of the UV quadrant, so that I could easily create a texture map in the ratio of 1:2 (width:height.) In Maya, the object looked like this:
Ironically, the texture warped all along the center vertical between the flat side and round side. However, when I did a test render, I finally got the results I'd been looking for:
The rainbow grid came out perfectly straight and unwarped, so I could actually move on with texture mapping the facade.

Friday, April 10, 2009

RmF vs. Mental Ray Ambient Occlusion

I set up some test renders to get ambient occlusion passes from RmF, by designating "Occlusion Indirect" as a pass in an EXR:

Open up the Render Globals and go to the "Passes" tab of the RenderMan menu:
Click on the triangle next to "Output" and select "Create Output > Custom" and in the new window that opens, right-click and select "Occlusion Indirect" from the dropdown menu:
Be sure to select "OpenEXR (exr)" in the Image Format menu (as in the first image above.)

I rendered with an Environment Light with the samples set to 256, the Diffuse Softness set at its default .950 and the Max Distance set to 4:
I used these settings knowing that I'd received decent results in Mental Ray with its Ambient Occlusion samples set to 32, as in this post. After using Nuke to pull out the Occlusion Indirect channel from the EXR, I got this result, cropped from a 1920x1080 render that took about 3 minutes to calculate:
Needless to say, the results are pretty horrifying. They were very unexpected (and this is after tweaking the parameters until I set them to the numbers shown above) and very much useless. The windows are gray because the windows' shader was partially transparent, and there is a surface shader mapped to geometry directly behind the windows. In effect, the windows yield a perfectly flat gray; my workaround ended up requiring me to assign an opaque Lambert to the windows. However, the extremely black pockets next to the staircases and behind the gutters made the images absolutely unusable.

I rendered the same scene in Maya 2009, using Mental Ray and assigning an ambient occlusion shader with 64 samples, and got a render in about 5 minutes, which is also cropped here:
The image came out as expected, so as of now, I'm leaning towards rendering the ambient occlusion pass with Mental Ray, with the other passes (e.g. diffuse, specular, shadows, etc.) from Renderman.

Monday, April 6, 2009

The Rendering Debate, Continued: The Trickle-down Effect of Modeling

As I tried to figure out what rendering software I would be using for the exterior shots, I considered the type of lighting I would be using for these. All of them are exterior sunny, clear-sky lighting scenarios, so I knew I wanted to use HDRI because of the way it can get you to 80% of a finished shot, with the remaining 20% consisting of sweetening with direct lighting and 2D compositing. I've been very happy with the global illumination (GI) of RmF from using it over the past couple of years, because of its efficient raytracing and very reasonable render times, and I've also been happy with the GI/Final Gather (FG) results I've gotten with Mental Ray, but the render times have been significantly greater, and I am hoping to get away with using RmF for my exterior shots.

I started off running some tests in RmF, using an Environment Light with all the geometry in my scene given the default Lambert shader. These tests never exported any images; my scene crashed Maya. My scene's file size was in the range of 15 Mb, which was considerably less than 40 Mb scene files I had successfully rendered in the fall of 2007 with RmF in Maya 8.5. I figured that the file size was probably not the main culprit of Maya crashing, but the geometry itself. I remembered that the scenes I was rendering a year and a half ago had consisted of approximately 80% NURBS, 19% polygons and 1% SubDivisions. I was primarily using NURBS because I knew that they would tesselate perfectly in RmF, and this was before I knew that the same was true for SubD surfaces. The tesselation of NURBS was automatic; I did not have to tag anything or tell the renderer to convert anything at render time. In the case of rendering my exterior city block this weekend, however, I was tagging specific objects in my scene to subdivide at render time.

I admit that I had a brute-force approach to modeling this scene; I created everything, from the brick facades down to individual window pane slats, with the intent of subdividing at render time. (See this post on subdividing.) I was doing this in order to get beveled edges to catch glints of light (and actually save myself the hassle of adding in lights to catch edges of objects) as well as give myself the highest resolution in my modeling so that I would get realistically rounded edges even at the closest of camera angles. The result was an exorbitant number of polygons in places where I would not need any subdividing at all. Take this window frame for example:
These pieces of geometry all have "shored up" edges (i.e. edge loop cuts created to help the geometry retain its basic shape while providing "beveled" or rounded edges.) It's a reasonable modeling strategy for a camera angle this close, but duplicate the geometry literally 50 times and throw it as far away from the camera as this...
...and you have an unnecessarily large number of polys that no one cares about. Because I was subdividing virtually every object in the scene (except for the glass, which is represented by the green transparent shader), I ended up crashing Maya over the most basic of renders. Again, this model had the default Lambert shader on it (except for the basic partially transparent green Blinn on the windows) - nothing close to the texture mapped, lit and raytraced scene I would be rendering for production.

I ended up having to completely remove much of the geometry that was to be subdivided, and I replaced it with basic geometry. Essentially, an object with edge loop cuts like this:
would get replaced by a primitive object like this:
After doing this to the majority of the scene (I decided to retain subdivided objects on the hero apartment, since I knew I would be rendering plenty of shots with closer camera angles), I was able to successfully render out some test frames in RmF.

Saturday, April 4, 2009

The Rendering Debate

For the past few days, I've been troubleshooting some renders of the exterior apartment model to get an idea of whether I should use Renderman for Maya or Mental Ray. RmF has the advantages of subdividing geometry at render time, yielding beautiful and quick motion blur, and streamlining the process of exporting multi-pass EXRs. Its downsides are that it is only supported on a few machine in USC's render farm, and it is not commonly used at VFX houses (which are a possible outlet for me at this point in time.) It's also not yet available for Maya 2009.

Mental Ray has the advantages of being more widely supported on our render farm as well as at various VFX houses' farms. It can also subdivide at render time, but only in Maya 2009. Its downsides are its painfully slow to render motion blur, and its tendency to get very buggy (as I've learned over the past couple of years here, especially while taking a compositing class this semester.)

I've been modeling in Maya 2009 because of several GUI updates that have helped me streamline my workflow, such as readily-displayed buttons to isolate selected geometry (which has been extremely useful given the number of objects I have, as well as the high polygon count on certain objects) as well as toggles for specific shading modes such as wireframe on shaded. These are very minor details, but they are welcome additions to my workflow since they allow me to cut corners and work more fluidly, with minimal stopping for digging through menus for various options. Additionally, in my compositing class, Eric Hanson walked us through an introduction to exporting multi-pass EXRs, which is not an available feature in Maya 2008.

As great as the Maya 2009 interface is, I have not gone too in-depth to any of the lighting or rendering features, so I have no commitment to it. However, it has a great advantage in it allowing subdivision at render time, because this saves me the hassle of converting polygon objects to subdivision objects, which annoyingly replaces my own naming (e.g. "stairs_hero_2005") with default conventions (e.g. "subdivSurface_1.") This is especially hindering because I have hundreds of objects in my scene, and many of them are varied duplicates of others, as I started with one apartment building/facade and duplicated it several times in order to create the row of buildings for the wide shots. Again, however, Maya 2009 is not fully supported at the VFX houses at which I have an opportunity to render.

I'm going to keep testing some things, so hopefully I'll be off the fence the next time around.