10. Vray Compositing

Overview

The configuration workflow for a project that requires Vray renders is very similar to the workflow used by the Webgl setup. The main difference lies in the use of the Template Override operator instead of the Map Override, and the additional configuration that is typically done in the Composite Asset.

The Composite Asset can be used with either Webgl renders or Vray renders. This asset is critical in controlling the amount of renders that need to be produced.

The Goal

Layering is the main method for reducing the total render count.

For example, let’s say we have a chair that is configurable in three ways:

  • Fabrics for the cushion - 500 fabrics

  • Wood type for the frame and legs - 10 different woods

  • Background setting - 3 different backgrounds

Without any layering we would need to render a total of 15000 renders for just this one chair.

This can be reduced to a total of just 513 renders if we layer the background image, the wood frame, and the fabric components on their own separate layers. In addition to this reduced count, the end client would also be able to load configuration changes faster, since the wood frame and fabric renders may be a smaller part of the overall image, and would result in significantly smaller file sizes.

Layers

The comp asset is composed primarily of layers. Each individual layer represents an image sequence. The order of the layers is also important, as it determines how these image sequences get layered on top of each other.

Here is what the composite asset may look like for the example listed above:

Features

Order

The order of each layer determines how the resulting images get layered in the 2D player. The layer ordering is from top to bottom representing background to foreground. In the example above, the Backdrop Layer will be displayed first, then the product Shadow Layer, with the Legs Layer on top of that, and the Fabric Layer displayed on top of the Legs Layer.

Layer Type

There are currently two types of layers available: render layers and image layers.

  • Render Layers - This type of layer will use the Vray or Webgl render engine to pre-generate the image sequence with system jobs.

  • Image Layers - An image layer has a Texture target and this allows the user to reference texture assets directly. For example, the user has a photograph that should be used as the background image of a configuration. This layer will take into consideration the alpha channel of the texture asset.

Attribute Targets

Each render layer can be associated with a set of attributes. Image layers do not have this association.

An association with an attribute means that a new image will be generated for this layer for every possible value of that attribute. In our scenario, if the Legs Layer would be associated only with the Legs attribute, then it would generate a total of 11 renders (the 11th is for the case where no value is selected).

For every additional attribute that layer is associated with, the number of possible combinations would grow exponentially, as it would need to create unique renders for each combination of attribute values.

AOV Operators

The render layers can be assigned an additional AOV (render pass). The ThreeKit platform currently supports an Ambient Occlusion, Normals and Bump Normals pass. The AOV pass is available to be added through the Operators button, as the Vray AOV Properties operator. The resulting render task will generate a separate image for each pass.

Important!

This additional set of images is not currently usable by the composite asset. These images are only available for download, using the Download button available on a render job in the Renders Section.

Override Groups

Each render layer can also have a practically unlimited number of Override Groups associated with them. These override groups allow the user to specify which items should appear on that layer, and how they should appear. This system is similar to the Collections feature in Maya’s Render Layers.

Blending Mode

Each layer can have its own blending mode for compositing on top of the previous layers. The list of blending modes currently includes the following operations:

Masking

The Mask with Layer option on Layers allows us to mask a layer with another layer. You are given the option to choose between Alpha and Luminance based masking. This feature is useful in certain scenarios where isolating a particular object or shape on its own render is impossible without the use of a separate mask.

Override Groups

The Override Groups, as mentioned above, allow the user to specify which objects will be used to render that particular layer. Similarly to the Collection feature in Maya’s Render Layers, the user can specify any number of these Groups, and assign overrides to them.

In order to specify which objects should be included in these groups, the users can reference them by Node Tags, in the group’s Targets.

For example, on the Legs Layer we would like to render only the wood components of the chair. However, on the legs mesh we need to ensure that we see shadows and GI cast by the Fabric and Floor components. If the legs go through the floor a little bit, we also need to mask that portion out. For this purpose the Legs Layer has three Override Groups listed under it:

Legs

This group targets all of the objects that should render as normal, with no overrides applied to them. This would be the objects tagged with the tag LEGS, and those tagged LIGHTS

Floor Masking

Fabric

Capturing Shadows

In order to capture shadows, such as on the Shadow Layer listed above, we would need to use the Material Wrapper override on a set of meshes that needs to receive the shadow. In our case it would be the meshes tagged with the FLOOR tag.

The override would look like this:

Assigning Composite Assets to Items

In order for the composite asset to take effect, it has to be assigned to Catalog item. In our case above with the Chair, this composite asset could be assigned to the Chair catalog item using the Default Composite reference as seen below:

The Composite Asset can be referenced this way by any number of different product items. It will work correctly as long as they pass the same attributes. There could be, for instance, other chair products, or any other furniture products that share the same attributes Fabric, Wood, and Background, and they would all need to be rendered in the same manner, with the three separate layers.

A central Composite Asset linked to all of them would make the maintenance of the compositing much simpler.

There are also cases where the user needs to ensure that the node-tags entered inside the Override Groups are working correctly with a given Catalog Item. For this purpose, the user can choose to load any Catalog Item directly inside the Composite Asset as shown here:

Once a Catalog Item has been loaded this way, clicking on the individual Layers will preview the objects loaded in all the Override Groups inside that Layer. The Viewport will update the changes only when selecting a different Layer than the currently selected one.

Layer Logic

There will be instances where it becomes necessary to apply different changes in the render setup, based on which layer is currently being rendered. As a simple example, let’s say that we would like to use a different VFB file for the Fabric Layer, as opposed to the Wood Layer. The logic for this cannot exist on the Composite Asset, since there is no direct connection between this and the Scene Asset where the VFB is specified. The Composite asset is only a child of the catalog item, and it receives the 3D assets for rendering. Instead, the logic would currently have to exist on the 3D assets. We can use the Layer condition in our rules, to detect which layer is currently being rendered. This allows us to change properties or swap assets per layer. In the example below, we create the Layer condition, and check against the Fabric Layer of our chosen Composite Asset. In this case, we are applying a different set of Vray Post Process corrections for the Fabric layer.

Last updated