Version: Unity 6 (6000.0)
Language : English
Add and remove cameras in a camera stack in URP
Apply different post processing effects to separate cameras in URP

Set up split-screen rendering in URP

In the Universal Render PipelineA series of operations that take the contents of a Scene, and displays them on a screen. Unity lets you choose from pre-built render pipelines, or write your own. More info
See in Glossary
(URP), multiple Base Cameras or Camera Stacks can render to the same render target. This allows you to create effects such as split screen rendering.

If more than one Base CameraA component which creates an image of a particular viewpoint in your scene. The output is either drawn to the screen or captured as a texture. More info
See in Glossary
or Camera Stack renders to the same area of a render target, Unity draws each pixelThe smallest unit in a computer image. Pixel size depends on your screen resolution. Pixel lighting is calculated at every screen pixel. More info
See in Glossary
in the overlapping area multiple times. Unity draws the Base Camera or Camera Stack with the highest priority last, on top of the previously drawn pixels. For more information on the camera render order optimization, refer to Understand camera render order.

You use the Base Camera’s ViewportThe user’s visible area of an app on their screen.
See in Glossary
Rect
property to define the area of the render target to render to. For more information on viewport coordinates, refer to the Unity Manual and API documentation.

Setting up split screen rendering

Setting up split screen rendering in URP
Setting up split screen rendering in URP
  1. Create a Camera in your sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
    See in Glossary
    . Its Render Mode defaults to Base, making it a Base Camera.
  2. Select the Camera. In the InspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info
    See in Glossary
    , scroll to the Output section. Change the values for Viewport rect to the following:
    • X: 0
    • Y: 0
    • W: 0.5
    • H: 1
  3. Create another Camera in your scene. Its Render Mode defaults to Base, making it a Base Camera.
  4. Select the Camera. In the Inspector, scroll to the Output section. Change the values for Viewport rect to the following:
    • X: 0.5
    • Y: 0
    • W: 0.5
    • H: 1

Unity renders the first Camera to the left-hand side of the screen, and the second Camera to the right-hand side of the screen.

You can change the Viewport rect for a Camera in a script by setting its rect property, like this:

myUniversalAdditionalCameraData.rect = new Rect(0.5f, 0f, 0.5f, 0f);
Add and remove cameras in a camera stack in URP
Apply different post processing effects to separate cameras in URP