In this short write-up I will explain how to use the render layer passes introduced in OctaneRender 2.20. These new render passes are a useful tools to composite a render on a backplate in post. With my limited artistic skills I will try to compose a wine glass on top of a picture of a desk. The wine glass is a free model from Turbo Squid which I subdivided in Octane because the original was modelled very crude. The picture of the desk is a random picture I took from the internet. The hardest part of this exercise was trying to match the camera and the lighting.
The new render passes are named shadows, black shadows, coloured shadows and reflections. These passes only work in conjunction with the render layers. If you enable them in your project without any further configuration, you will only see empty renders for these passes. More formally, these passes capture the "effect" from geometry part of the active render layer onto geometry part of all the other render layers. The first thing that needs to be done is configure object layers for the geometry. You do this by connecting your scene geometry to an object layer map and connect object layer nodes to each pin of the object layer map. Like this:
In the object layer node, it's possible to configure a render layer ID. The render layer ID is number of the render layer the current object belongs to. In this example, the wine glass is in render layer 1 and the light and ground plane are in render layer 2. You can visualize which objects are on which layer via the
Render Layer ID
info channel kernel or render pass. The render target node has an extra pin in 2.20 to connect it with a render layer node. In the render layer node you can configure if render layers are active and which render layer is rendered (the active render layer). There's only 1 active render layer at all times. The best way to render out multiple layers is to configure multiple render target nodes and use the batch render script that comes with the standalone.During rendering, objects that aren't on the active render layer are ignored by camera rays. This means that all objects in the active layer are isolated in the beauty pass. There is no need anymore to isolate objects from the render via masks. The main advantage is that you can easily isolate out of focus or motion blurred objects. This is impossible with masks in some cases. If you still like to use masks and do DOF and motion blur in post, you can still render out an alpha mask of the render layer with the render layer mask info channel or render layer mask pass. Lets quickly look at an example where masks fail. When trying to mask out the blurry blue sphere, it's impossible to avoid leaking through the yellow sphere. With render layers the yellow sphere was never in the render to begin with. You could of course render out the scene without DOF and motion blur and do them in post. But I think that with the fast render times of Octane this is a bit of an obsolete work flow in most cases.
When everything is fully set-up, you can enable the render layer passes:
- Black shadows: Captures black shadows, i.e points on the non-active layer geometry where light is fully blocked by objects on the active layer. If light is blocked, shadows are always captured regardless of the material that receives the shadow. It's assumed that the object that receives the shadows has a white diffuse material. e.g. shadows cast on a polished mirror like surface would not be visible in the render but we capture them in the shadow pass anyway. This pass only uses the alpha channel and should be composed in via the normal blend mode (regular alpha blending).
- Colored shadows: Captures colored shadows cast by objects on the active layer geometry. Only objects with a specular material with fake shadows enabled can cast colored shadows. (TIP: when enabling fake shadows make sure that the kernel has alpha shadows enabled, otherwise it won't work). This pass doesn't have an alpha channel and should be composed in via the multiply blend mode.
- Shadows: This pass is there for convenience. It combines black shadows (in the alpha channel) with colored shadows (in the RGB channels) in a single image. The blend mode is multiply. It captures the same shadows as the matte material with the difference that the matte materials captures all shadows in the alpha channel and hence doesn't keep color information.
- Reflections: Captures light reflected off of objects on the active layer on objects on the non-active layers. This pass respects the materials so the look of the reflections really depends on the materials used.
To get some nice reflections on the glass from the desk, we map the background image onto the ground plane. For this mapping we use the same transformation as the camera. This can be achieved with a script written by Roeland that you can get here. It's also very important to tick the affect alpha option of the specular material of the glass. Otherwise the glass will be opaque in the composite. The rendered passes should look something like this in the end. We only have black shadows because we didn't enable fake shadows. In the reflections we get a little bit of caustics:
All these results can be composed together onto a background plate.
Please feel free to ask any questions if something isn't clear. We're always very interested to see some nice composites made with Octane.
Attached are the GIMP project (I will replace try to do this exercise in Photoshop as well) and the Octane project.
cheers,
Thomas