18 Mar 2015

COMPOSITING USING LIGHTWAVE BUFFER EXPORT AND NATRON
by Carlo Cestra

Natron is a free compositing software very similar to Nuke. The interface is perfectly identical. The base version doesn't have much plug-ins for visual effects but has the main tools to make professional compositing. Natron is 100% compatible with OpenFX, so if you install any free OpenFX plug-in, you will be able to use it. Natron is also compatible with the main commercial plug-ins. By default Natron is able to open all the main file types, including the .exr file format.
For a documentary, made for the Archaeological Superintendence of Rome, I had to recreate the scene of a diver who, in 1800, came down to the bottom of the lake of Nemi to explore the wreckages of the two Roman ships of Caligula.
In the original work, that dates back a few years ago, I exported the layers with the old Lightwave 10.0 Buffer Export and I made the compositing with After Effects. To make this tutorial I used Lightwave 11.6.1, exporting the buffers with the new “Compositing Buffer Export”, and I did the compositing with Natron v1.2.1.
Let's start with Lightwave.
Here is the scene:


Fig.01


After having modeled and textured all the elements, made ​​a simple setup to the diver and animated the scene, I rendered the scene exporting separated render layers (buffers).
First of all I set up the scene with only a distant light that illuminates from above


Fig.02


then I put a backdrop with only a light gradient.


Fig.03


After I divided the scene in two parts: a scene for the environment and a scene for the diver. This because the two elements will be treated in a different way in compositing phase. I could have render it all together, using masks to separate the two elements later, but, for convenience, I preferred to divide things from the beginning. I had care to leave the diver in the environment's scene (activating "Unseen by Camera" in the object Render properties) so that the rendering engine can compute its ambient occlusion and its shadow projected on the ground.


Fig.04


Below I set the Compositing Buffer Export, for both scenes, initially selecting all available buffers and saving them into a single EXR file.


Fig.05 Background scene
(n.b. the diver is visible in wireframe, but is invisible to the camera)



Fig.06 Diver scene


At this point I made the render of a single frame (F9) for both scenes with this parameters:


Fig.07


So, in summary, I have now two files (background.exr and diver.exr) each containing all the render buffers.


Fig.08



Fig.09


Now let's see how and what buffers to composite in Natron.
The final compositing "tree" will be the following:


Fig.10


With the "Read" tool we can import the .EXR on our workspace (by right clicking on the node graph or by pressing "R" on the keyboard):


Fig.11


Inside the .EXR files there are all the layers we saved with Lightwave (named RGBA Channels).


Fig.12


You have to import the same .EXR and choose the Channel (layer) you need each time (or copy and paste an existing Read node and change the Channels)


Fig.13


First I multiplied the Ambient Occlusion with the Raw color with a Merge node.


Fig.14 AO Buffer



Fig.15


Then I got the Shadow buffer


Fig.16 Shadow Buffer


and with an hand mask I isolated the diver shadow (I will use it later) out from the other shadows.


Fig.17


I applied a light blur to the Shadow buffer (with a "Blur" node) and then I put it in the mask input of a "Grade" node. In this way, lowering the multiply value, I darkened the areas on the image in correspondence of the light areas of the Shadow buffer.


Fig.18


Then I applied the "Radiosity" buffer with a "Merge" node in overlay


Fig.19


and the backdrop, slightly color corrected for a first integration


Fig.20


I utilized the "Z-Depth" buffer to give a bit of depth to the image by simulating the water turbidity. The shades of gray of the depth (see Fig.23) determine the opacity (white=completely opaque, black=completely transparent) of the applied solid color ("Constant1" node). Modifing the whitepoint and blackpoint values in the "Grade1" node you can limit the depth influence controlling the distance of the effect.


Fig.21


The effect should not affect the backdrop so I cut out the "Z Depth" with the alpha channel (in the Mask color selector of the Multiply2 node I chose "Red" because the Alpha Buffer is in gray scale and so we can utilize one of the three rgb channels indifferently).


Fig.22



Fig.23 Z-Depth before cutting



Fig.23b Z-Depth after Apha Channel cut


N.B. You see sharp shades of gray because I saved this images as JPG to make this tutorial. The original EXR files are 16 or 32 bit and so if you export your final work as TIFF 16 or 32 bit the effect will be soft.

Now the same for the focal blur using the same Z-Depth node. I added a "Blur" node masked with the "Z-Depth". With a "Grade" node ("Grade3") we can control the focal lenght modifing the whitepoint and blackpoint values.


Fig.24


Finally a general color correction.


Fig.25


Now let's work on the diver:
I started with the base color ("Raw" buffer)


Fig.26


I overlapped the glass, behind which we can see the man's face. I used the "Rgb" buffer ("beauty" pass), with a "Merge" node and the "Transparency" buffer as mask.


Fig.27



Fig.28 Trasparency Buffer


Then I lowered a bit the gamma value.


Fig.29


To start giving a bit of volume to the diver I applied the ambient occlusion.


Fig.30 AO Buffer


I used a "Merge" node in multiply mode.


Fig.31


For the shadows I used either the "Shading" and the "Shadow" Buffers with a light blur. I used the "Shading" Buffer as mask in a "Color Correction" node. Lowering the gain value I darkened the areas corresponding to the Shading areas.


Fig.32
Shading Buffer (left) and Shadow Buffer (right)



Fig.33


The same for the "Shadow" buffer.


Fig.34


Then I used the "Normal" buffer to slightly correct the lighting. "Normal" buffer is composed of three colors (rgb) and I used each of them as a different light source. So I assumed the red channel as a front light, the green one as a light from below, and the blue one as a backlight.



Fig.35 Normal Buffer


So I used each of these three channels as mask in as many "Grade" nodes. The first "Grade" node has the "Red" mask input, the second one has the "Green" and the third one has the "Blue". Changing the multiply value of each "Grade" node you can act on lighting.
In this way I also avoided the use of "Radiosity" buffer since the result is satisfying and it fits well (as we will see shortly) with the rest of the scene.


Fig.36


Lastly a slight color correction and a little blur.


Fig.37


Now it's time to assemble the two parts, the character with the background.
I combined the two "branches" with a "Merge" node. The “Merge” node has two main inputs, A and B. I inserted the background's branch in the B input and the diver's branch in the A input (not vice versa, since A and B have a stacking order starting from B which is the lowest)


Fig.38


and I inserted the diver shadow that I had left pending. So I took the background "Shadow" buffer and masked all except the diver shadow. I applied a blur on it (in this way I got a soft shadow even though I used a distant light, in Lightwave, that produces only sharp shadows) and I used it as mask in a "Grade" node where I lowered the multiply value. This "Grade" node is inserted at the end of the background tree so the shadow lies on the ground below the diver.


Fig.39


Then I inserted some particles to simulate air bubbles and suspended particulates. Both made ​​with Lightwave and HyperVoxel. For the particles I created a cloud of points in the Modeler.


Fig.40


Once imported into the layout, I applied to the point cloud a displacement to give the particles a slight movement.


Fig.41


For the bubbles I created an emitter that generates particles rising to the top.


Fig.42


After fixing the parameters of HyperVoxel, before making the render, I set all items as "matte objects" to mask properly the particles with respect to the objects in the scene (eg. the particles in front of the diver should be visible, those ones behind no)


Fig.43


At this point I rendered bubbles and particles separately. Regarding the particles I only needed the "beauty" pass ("Rgb" buffer), and the "Depth" buffer. So I used the Compositing Buffer Export selecting only the Depth buffer (Rgb and alpha channel are automatically saved in the EXR file)


Fig.44


Regarding the bubbles I needed only the "beauty" pass so, without using the Compositing Buffer Export, I saved the render just in a TIF file (rgb + alpha).

Let's go back in Natron:
I corrected the particles color with a "Color Correction" node to integrate them into the scene. Then I blurred them using their "Depth" buffer (the particles become blurred in the distance). I added also another "Blur" node to make an overall slightly blur.
N.B. As before, since that the Z-Depth Buffer is in gray scale, you can put indifferently one of the three rgb channel in the input mask channel (in this case I chose the "Red" one).


Fig.45


Same thing for the bubbles, except for the "Depth" which in this case is not needed since they are in focus with the diver and therefore they did not need the focal blur (obviously depends on the framing). I only added a slighty blur to better integrate them with the diver in the underwater shot.


Fig.46


To finish:
I added some grain and a final touch on colors. The image has a greenish tint too strong that I mitigated by adding a bit of violet (complementary color to green) to the gain in the "Color Correct" node. Then I added a "Grade" node to adjust the white level. At last I added some vignetting merging a black constant color masked with a radial mask. I added also a light blur using the same radial mask to blur the edges of the image to better simulate an underwater shot.


Fig.47


Looking at the final image, I noticed that the rocks in the background are too bright and they distract attention from the action of the diver. Back in LightWave Layout I created a mask only for those rocks. I made them as red ​​"matte objects", while I made as black "matte objects" all other objects in the scene.


Fig.48


Then I used this mask


Fig.49


with a "Grade" node to lower a bit the "presence" of the rocks.


Fig.50


and here is the final image.


Fig.51


Once I got the wanted result, I rendered with Lightwave all the frames in the animation activating, in the Compositing Buffer Export, only the buffers I have used to composite this frame (to not overload the EXR file with unused buffers).

Out of curiosity, here is the same image generated by the LightWave render (one pass render without compositing) without taking too much care for details.


Fig.52


To obtain the same image processed in compositing without doing compositing (one render pass, if you succeed!) you have to spend hours, if not days on end, to make render tests. Not to mention that if you realize (after calculating all the frames) that you have to change something (and you will do it, trust me!), you have to modify the scene (making other render tests) and render every frame again. The compositing stage (however small) is necessary to avoid wasting time.


previous article
next article


CARLO CESTRA DIGITAL PRODUCTIONS S.L.
FACEBOOK
GOOGLE+
LINKEDIN
YOUTUBE
ARTSTATION
ALL ORIGINAL CONTENT @2010-2018 CARLO CESTRA DIGITAL PRODUCTIONS
ALL RIGHTS RESERVED. NO PART OF THIS WEBSITE MAY BE REPRODUCED

WEBSITE POWERED BY JOHANNA ROUSSEL