As announced in my previous post I present here a shot compositing breakdown from a frame of shot 3 of Ara’s Tale.
This is a medium shot with emphasis on Ara and the environment does only act as nice blurry backdrop to the frame. So the main focus lies on the foreground with the background representing one renderlayer with a simple light setup (1 spotlight with shadow buffers for the moon and 2 hemilights for the ambient lighting).
The idea is ( as with all my previous shots) to have the lights separated into renderlayers to be able to relight the scene in the compositor. In addition to that I want to be able to control lighting aspects for the individual objects (Ara, dress, hair) as well.
The lights I use are the following:
- key light, light coming from the cage. I am using here 2 spotlights with buffered shadows.
- secondary light, light coming from the moon. 1 spotlight with buffered shadows.
- ambient lighting. 2 spotlights without shadows
- rim lighting. To better visualize Ara’s shape I use this extra light which has no real physical scene representation. 2 spotlights with buffered shadows.
Usually I would put all lights belonging to a group on one layer put all the objects to be lit on the same layer and setup a renderlayer with just this layer to be rendered. Doing this for all 4 lightgroups would give you a nice setup to work with. The control over the individual objects can be done through object id masks as an additional channel information in one of the renderlayers.
Unfortunately in this case this does not work so easily. As already mentioned in this post, you cannot use SSS in a renderlayer setup using different lightgroups. The workaround I have to use is to setup an extra scene for each renderlayer containing a SSS/lightgroup element. In this case I have 2 of them: Ara with main and moon light.
With my limited knowledge of python scripting and yet be able to render a whole animation with one command, I use the main scene to pull in the renderlayers of the sss scenes and save them as separate openexr files. The bad side effect of this is that I only get the RGBA and z information with this method. Any other channels (diffuse, shadow specular ..) cannot be saved in this way.
So if needed these additional channels have to be created within the main scene itself, where you are able to save all out into a multilayer exr file.
This little limitation has led me to the following renderlayer setup. To avoid having to calculate the strand setup for each scene I decided to not use the hair in the sss layers.
Renderlayers in main scene. The scene is setup to not use SSS but has approximate ambient occlusion turned on to get the AO pass.
- ara_ambient: Ara with hair lit by the ambient lights
- ara_rim: Ara with hair lit by the rim lights
- hair_main: only the hair lit by the main lights but rendered without shadows. The layers with Ara are used as mask.
- hair_moon: only the hair lit by the moon light but rendered without shadows. The layers with Ara are again used as mask.
- shadow_main: a shadow pass with a complete Ara and the main lights. The material option of the layer is used to put a simple clay material on all objects for faster rendering (although with hair the effect isn’t to much anyway) as we are only interested in the shadow pass.
- shadow_moon: the same as above but this time with the moon light. This layer is also used to get additional channels for the AO, ObjectID, Z and Vector information.
- eyes: an extra layers with Ara’s eyes only and the main and moon lights, masked by the rest of Ara. This will be used to enhance the eyes in the compositing. The specular channel is activated for this layer.
- background: simple layer for the background and two lights.
Renderlayer in extra SSS scene for main light. The scene is setup to use SSS.
- ara_sss_main: Ara without the hair and the main light. Shadows are not included in render. These will later be reintroduced during compositing:
Renderlayer in extra SSS scene for moon light. The scene is setup to use SSS.
- ara_sss_main: again just like the setup for the main light. Ara without the hair and the moon light. Shadows are not included in render.
The values of the individual lights or already roughly setup to avoid too extreme manipulations later on. I did this by doing quick test renders (without the hair) and all materials set to a clay material.
Now if I render this setup into one renderlayer (just as demonstration) I get the following result:
As a first approximation it is not so bad after all. The rendertime for this frame at 50% FullHD resolution is ~ 3min.
No lets go through the individual steps of the compositing.
While the rendering is done in blender 2.49b I have decided to use the actual blender svn version as my tool for the compositing workflow. After some of the annoying bugs are fixed, it has now reached a point of stability which lets me use it in this project without too much headache.
One thing I have to do though, is to apply a gamma node immediately after each image input node. I suppose there are differences in the color management and file saving of exr files in the two versions. But that is only a very minor point and easily overcome.
Creating the main light contribution
Step 2: I have excluded any shadows from the original renders but have an extra layer shadow_main which has the combined shadows for Ara and the hair. I use a rgb curves node for adjustments and finally a multiply node to add the shadow
Creating the moon light contribution
The node tree looks the same as in the main light setup just with different input layers.
You may notice the hue-saturation node at the end of the main light node tree. I have decided to use this node for each sub tree which is going to be mixed with other elements. When adding elements I simply keep the factor of the add node at 1. and control the amount of the elements by tuning the value field of the hue-saturation nodes. I could have used rgb curves for this but I find it much more convenient ( and reproducable) to work with numbers.
Creating the ambient term
Step 8: On top of the ambient light layer I apply the ambient occlusion. Theoretically the AO pass should only be applied to the ambient light ( the name doesn’t come by accident).Just a simple curves node for adjustment and a multiply node
Enhancing the eyes
As you can see currently the eyes are a bit dark. But since the eyes are the part where we connect with a character they should be clearly visible. To do this I reated a setup to have control of the eyes.
Adding the rim light
Adding the background
Step 13: at last we have the final element to incorporate and thats the background. I use a color correction node and a defocus node. All of Ara is in focus, so its ok to use the defocus only on the background. Originally I had it different but the background kept bleeding into Ara’s hair even with very high treshold values. I use an alpha over node to actually combine foreground and background
Doing the color correction and effects
Step 15: lets add some glow but coming only from the dress. I use the object id layer to extract a mask for the dress, extract the dress and use a combination of curves and blur node to create a blurry image of the dress. This blurred image is then added on top of the current one:
Better integration of foreground and background
I have came across this technique in a video tutorial somewhere on the web and it made sense to me, so I used it here as well. To better integrate the foreground to the background I want to blur the image but only a few pixels on both sides at the border between foreground and background. This is sort of antialiasing on steroids
Step 18: First I have to create a mask which only gives me the out line of Ara. I do this by combining the object Id masks for all foreground elements. Usually a simple Kirsch filter would now suffice to get the outline, but the combination of the object id masks has holes in it. So I use a series of dilate/erode nodes to get a solid mask and then apply the kirsch filter. The result is blurred to the desired size to be fit as input mask
Step 19: Take the actual image and blur it. Using a mix node and the outline mask as input to the factor I mix the blurred image to the current one. The effect is very subtle but I think it makes a difference
Step 20: To get rid of the overly clean look I want to introduce some blurring again. For this I separate the image in to its YUVA components and very slightly blur the Y channel only and recombine again. This result is then mixed to the original image
Step 21: To add a vignette, I use the technique shown by Sebastian König in his latest tutorial on the compositor. Its essentially using the lens distortion on max to create an ellipse. With this you can create an elliptic mask blur it ans use as mask for the vignette effect
Thats essentially it. The last image is then used as frame in the shot.
I would love to hear any feedback or corrections and ideas on how to improve this. Especially on the clumsy way to incorporate the SSS elements.