docs.unity3d.com
    Show / Hide Table of Contents

    Visual Compositor Overview

    • Introduction
      • Dependencies
      • Supported Unity Versions
    • Quick Start
    • Features

    Introduction

    Visual Compositor provides a node based graph editor to do image compositing.
    The graph is used to construct rendering sources and flow, in order to output layers, which are then stacked together using blending options to produce the final image.

    Dependencies

    Selection Groups

    Used to group GameObjects and render particular groups.
    This allows for more flexibility than the layer system, which is limited to 31 unique layers.
    Please see the user documentation for more details on Selection Groups.

    Streaming Image Sequence

    Used to play sequential image sequences in order to apply post-processing on them.

    Timeline

    Used to animate the parameters of Visual Compositor nodes.

    Supported Unity Versions and Settings

    Unity 2020.3 or higher on Built-in, Universal, and High Definition render pipelines with linear (recommended) or gamma workflow.

    Using Visual Compositor on High Definition Render Pipeline (HDRP) requires HDRP assets to use R16G16B16A16 color buffer format.

    Please refer to the installation page to install VisualCompositor package.

    Quick Start

    1. This figure shows the scene that we will use for this guide.
      Note the Selection Groups window, and the created groups for the shapes, ground and lights.

      Quick Start Initial

    2. Create a Compositor Graph asset, by right clicking in the project window and choosing Create > VisualCompositor > Compositor Graph. This creates an asset in our project which stores the graph that we will construct in the following steps.

    3. Create an empty GameObject, and add the Visual Compositor component.

    4. Drag the asset we created in step 2 to the Compositor Graph Asset slot on the Visual Compositor created in step 3.

    5. Open Window > Rendering > Visual Compositor.
      As this window uses a lot of screen area, we recommend to dock this window behind the scene view.

    6. By default, the output of Visual Compositor will be displayed in Display 8.
      We can set the existing Game view to show Display 8, or add a new Game view in the Editor to view the output.
      See more details in the camera section below.

    7. When we select the VisualCompositor GameObject created in step 3, the Visual Compositor window will load the graph in that component, and will automatically create default nodes for newly created graphs.
      See the Visual Compositor window documentation for more details on using this window.

    8. Make sure that the graph is built as shown in the following figure.

    9. Using Selection Group nodes in combination with Render nodes allow us to render specific objects with specific lights.
      In the next figure, there are three Selection Group nodes, with a Union node being used to combine two groups into one group.

    10. Add a Drawn Edges node for extracting edges from the Render node, and a Layer node for compositing over the first layer.
      Please refer to the next figure for node setting details.

      1. Connect the outputs of the Render node to the corresponding inputs of the Drawn Edges node.
      2. Connect the output of the Drawn Edges node to the input of the new Layer node, and set the blend mode is multiply.

    11. The final image is now a composite of the two layers.

    Camera

    Visual Compositor is using a Camera to define where to render its final output via the Target Display property of the Camera.
    This Camera component is automatically added whenever we add Visual Compositor to a GameObject, and it must be different from the Camera that we use to render objects.

    The following Camera properties are automatically setup by Visual Compositor, and we need to ensure that their values are kept as they are.

    Properties Reasons of overriding the values
    Clear Flags Visual Compositor produces the final render output by executing the Compositor Graph asset, and does not require the Camera's rendering process.
    Culling Mask Visual Compositor produces the final render output by executing the Compositor Graph asset, and does not require the Camera's rendering process.

    Other Camera properties are ignored.

    Features

    1. Nodes
    2. Creating Custom Nodes
    3. Timeline Integration
    4. Visual Compositor Window
    5. Project Settings
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023