docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Camera render types

    There are two types of Camera in the Universal Render Pipeline (URP):

    • A Base Camera is a general purpose Camera that renders to a render target (a screen, or a Render Texture).
    • An Overlay Camera renders on top of another Camera's output. You can combine the output of a Base Camera with the output of one or more Overlay Cameras. This is called Camera stacking.

    Use a Camera’s Render Type property to make it a Base Camera or an Overlay Camera.

    To change the type of a Camera in the Unity Editor:

    1. Create or select a Camera in your scene.

    2. In the Camera Inspector, use the Render Type drop-down menu to select a different type of Camera. Select either:

      • Base to change the Camera to a Base Camera

      • Overlay to change the Camera to an Overlay Camera

    Render Type in the Camera component Inspector

    You can change a Camera’s type in a script, by setting the renderType property of the Camera's Universal Additional Camera Data component, like this:

    var cameraData = camera.GetUniversalAdditionalCameraData();
    cameraData.renderType = CameraRenderType.Base;
    

    Base Camera

    Base Camera is the default type of Camera in URP. A Base Camera is a general purpose Camera that renders to a given render target.

    To render anything in URP, you must have at least one Base Camera in your scene. You can have multiple Base Cameras in a scene. You can use a Base Camera on its own, or you can use it in a Camera stack. For more information on working with multiple Cameras in URP, refer to Working with multiple cameras.

    When you have an active Base Camera in your scene, this icon appears next to the Camera Gizmo in the Scene view:

    Overlay Camera icon

    For information on the properties that Unity exposes in the Inspector for a Base Camera, refer to the Camera component reference.

    Overlay Camera

    An Overlay Camera is a Camera that renders its view on top of another Camera's output. You can use Overlay Cameras to create effects such as 3D objects in a 2D UI, or a cockpit in a vehicle.

    You must use Overlay Cameras in conjunction with one or more Base Cameras using the Camera Stacking system. You cannot use Overlay Cameras on their own. An Overlay Camera that is not part of a Camera Stack does not perform any steps of its render loop, and is known as an orphan Camera.

    Note

    In this version of URP, Overlay Cameras and Camera Stacking are supported only when using the Universal Renderer.

    When you have an active Overlay Camera in your scene, this icon appears next to the Camera Gizmo in the Scene view:

    Overlay Camera icon

    The Base Camera in a Camera Stack determines most of the properties of the Camera Stack. Because you can only use Overlay Cameras in a Camera Stack, URP uses only the following properties of an Overlay Camera when rendering the scene:

    • Projection
    • FOV Axis
    • Field of View
    • Physical Camera properties
    • Clipping planes
    • Renderer
    • Clear Depth
    • Render Shadows
    • Culling Mask
    • Occlusion Culling

    Unity hides all of the other unused properties in the Inspector. You can access unused properties using a script, but any changes you make to these unused properties will not affect the visual output of any Camera Stacks that use the Overlay Camera.

    Note

    While you can apply post-processing to an individual Overlay Camera within a camera stack, the effects also apply to all the outputs the camera stack renders before the Overlay Camera. This is different to how you can apply post-processing to an individual Base Camera where the effects on only apply to the Base Camera.

    For information on the properties that Unity exposes in the Inspector of an Overlay Camera, refer to the Camera component reference.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)