Camera component reference
In the Universal Render Pipeline (URP), Unity exposes different properties of the Camera component in the Inspector depending on the Camera type. To change the type of the Camera, change the property Render Mode.
- Base Render Mode
- Overlay Render Mode
Projection
Property | Description | |
---|---|---|
Projection | Toggles the camera's capability to simulate perspective. | |
Perspective | Camera will render objects with perspective intact. | |
Orthographic | Camera will render objects uniformly, with no sense of perspective. | |
Size | The viewport size of the Camera when set to Orthographic. | |
FOV Axis | Field of view axis. | |
Field of view | The width of the Camera's view angle, measured in degrees along the selected axis. | |
Physical Camera | Tick this box to enable the Physical Camera properties for this camera. When the Physical Camera properties are enabled, Unity calculates the Field of View using the properties that simulate real-world camera attributes: Focal Length, Sensor Size, and Lens Shift. Physical Camera properties are not visible in the Inspector until you tick this box. |
|
Clipping Planes | Distances from the camera to start and stop rendering. | |
Near | The closest point relative to the Camera that drawing will occur. | |
Far | The furthest point relative to the Camera that drawing will occur. |
Physical Camera
Property | Description | |
---|---|---|
Camera Body | ||
Sensor Type | Specify the real-world camera format you want the camera to simulate. Choose the desired format from the list. When you choose a camera format, Unity sets the the Sensor Size > X and Y properties to the correct values automatically. If you change the Sensor Size values manually, Unity automatically sets this property to Custom. |
|
Sensor Size | Set the size, in millimeters, of the camera sensor. Unity sets the X and Y values automatically when you choose the Sensor Type. You can enter custom values if needed. |
|
Gate Fit | Options for changing the size of the resolution gate (size/aspect ratio of the game view) relative to the film gate (size/aspect ratio of the Physical Camera sensor). For further information about resolution gate and film gate, see documentation on Physical Cameras. |
|
Vertical | Fits the resolution gate to the height of the film gate. If the sensor aspect ratio is larger than the game view aspect ratio, Unity crops the rendered image at the sides. If the sensor aspect ratio is smaller than the game view aspect ratio, Unity overscans the rendered image at the sides. When you choose this setting, changing the sensor width (Sensor Size > X property) has no effect on the rendered image. |
|
Horizontal | Fits the resolution gate to the width of the film gate. If the sensor aspect ratio is larger than the game view aspect ratio, Unity overscans the rendered image on the top and bottom. If the sensor aspect ratio is smaller than the game view aspect ratio, Unity crops the rendered image on the top and bottom. When you choose this setting, changing the sensor height (Sensor Size > Y property) has no effect on the rendered image. |
|
Fill | Fits the resolution gate to either the width or height of the film gate, whichever is smaller. This crops the rendered image. | |
Overscan | Fits the resolution gate to either the width or height of the film gate, whichever is larger. This overscans the rendered image. | |
None | Ignores the resolution gate and uses the film gate only. This stretches the rendered image to fit the game view aspect ratio. | |
Lens | ||
Focal Length | Set the distance, in millimeters, between the camera sensor and the camera lens. Lower values result in a wider Field of View, and vice versa. When you change this value, Unity automatically updates the Field of View property accordingly. |
|
Shift | Shift the lens horizontally or vertically from center. Values are multiples of the sensor size; for example, a shift of 0.5 along the X axis offsets the sensor by half its horizontal size. You can use lens shifts to correct distortion that occurs when the camera is at an angle to the subject (for example, converging parallel lines). Shift the lens along either axis to make the camera frustum oblique. |
Rendering
Property | Description |
---|---|
Renderer | Controls which renderer this Camera uses. |
Post Processing | Enables post-processing effects. |
Anti-aliasing | Use the drop-down to select the method that this Camera uses for post-process anti-aliasing. A Camera can still use multisample anti-aliasing (MSAA), which is a hardware feature, at the same time as post-process anti-aliasing. • None: This Camera can process MSAA but does not process any post-process anti-aliasing. • Fast Approximate Anti-aliasing (FXAA): Smooths edges on a per-pixel level. This is the least resource intensive anti-aliasing technique in URP. • Subpixel Morphological Anti-aliasing (SMAA): Finds patterns in borders of the image and blends the pixels on these borders according to the pattern. |
Quality | Use the drop-down to select the quality of SMAA. The difference in resource intensity is fairly small between Low and High. • Low: The lowest SMAA quality. This is the least resource-intensive option. • Medium: A good balance between SMAA quality and resource intensity. • High: The highest SMAA quality. This is the most resource-intensive option. This property only appears when you select Subpixel Morphological Anti-aliasing (SMAA) from the Anti-aliasing drop-down. |
Stop NaNs | Enable the checkbox to make this Camera replace values that are Not a Number (NaN) with a black pixel. This stops certain effects from breaking, but is a resource-intensive process. Only enable this feature if you experience NaN issues that you can not fix. |
Dithering | Enable the checkbox to apply 8-bit dithering to the final render. This can help reduce banding on wide gradients and low light areas. |
Render Shadows | Enables shadow rendering. |
Priority | A Camera with a higher priority is drawn on top of a Camera with a lower priority. [-100, 100] |
Opaque Texture | Controls whether the Camera creates a CameraOpaqueTexture, which is a copy of the rendered view. |
On | Camera creates a CameraOpaqueTexture. |
Off | Camera does not create a CameraOpaqueTexture. |
Use Pipeline Settings | The value of this setting is determined by the Render Pipeline Asset. |
Depth Texture | Controls whether the Camera creates CameraDepthTexture, which is a copy of the rendered depth values. |
On | The Camera creates a CameraDepthTexture. |
Off | The Camera does not create a CameraDepthTexture. |
Use Pipeline Settings | The value of this setting is determined by the Render Pipeline Asset. |
Culling Mask | Which Layers the Camera renders to. |
Occlusion Culling | Enables Occlusion Culling. |
Stack
Warning: Stack can only be edited if Render Mode is set to Base
A camera stack allows to composite results of several cameras together. The camera stack consists of a Base camera and any number of additional Overlay cameras.
You can use the stack property add Overlay cameras to the stack and they will render in the order as defined in the stack. For more information on configuring and using Camera Stacks, see Camera Stacking.
Environment
Property | Description |
---|---|
Background Type | Controls how to initialize the color buffer at the start of this Camera's render loop. For more information, see the documentation on clearing. |
Skybox | Initializes the color buffer by clearing to a Skybox. Defaults to a background color if no Skybox is found. |
Solid Color | Initializes the color buffer by clearing to a given color. If you select this property, Unity shows the following extra property: Background: the Camera clears its color buffer to this color before rendering. |
Uninitialized | Does not initialize the color buffer. This means that the load action for that specific RenderTarget will be DontCare instead of Load or Clear . DontCare specifies that the previous contents of the RenderTarget don't need to be preserved.Only use this option in order to optimize performance in situations where your Camera or Camera Stack will draw to every pixel in the color buffer, otherwise the behaviour of pixels the Camera doesn't draw is undefined. Note: The results might look different between Editor and Player, as the Editor doesn't run on Tile-Based Deferred Rendering (TBDR) GPUs (found in mobile devices). If you use this option on TBDR GPUs, it causes uninitialized tile memory and the content is undefined. |
Volumes | The settings in this section define how Volumes affect this Camera. |
Update Mode | Select how Unity updates Volumes: every frame or when triggered via scripting. In the Editor, Unity updates Volumes every frame when not in the Play mode. |
Volume Mask | Use the drop-down to set the Layer Mask that defines which Volumes affect this Camera. |
Volume Trigger | Assign a Transform that the Volume system uses to handle the position of this Camera. For example, if your application uses a third person view of a character, set this property to the character's Transform. The Camera then uses the post-processing and Scene settings for Volumes that the character enters. If you do not assign a Transform, the Camera uses its own Transform instead. |
Output
Warning: Output can only be edited if Render Mode is set to Base
Note: When a Camera's Render Mode is set to Base and its Render Target is set to Texture, Unity does not expose the following properties in the Inspector for the Camera:
- HDR
- MSAA
- Allow Dynamic Resolution
- Target Display
This is because the Render Texture determines these properties. To change them, do so on the Render Texture Asset.
Property | Description |
---|---|
Output Texture | Renders this Camera's output to a RenderTexture if this field is assigned, otherwise renders to screen. |
HDR | Enables High Dynamic Range rendering for this camera. This property only appears when you select Screen from the Output Target drop-down. |
MSAA | Enables multi sample antialiasing for this camera. This property only appears when you select Screen from the Output Target drop-down. |
Viewport Rect | Four values that indicate where on the screen this camera view will be drawn. Measured in Viewport Coordinates (values 0-1). This property only appears when you select Screen from the Output Target drop-down. |
X | The beginning horizontal position that the camera view will be drawn. |
Y | The beginning vertical position that the camera view will be drawn. |
W (Width) | Width of the camera output on the screen. |
H (Height) | Height of the camera output on the screen. |
Allow Dynamic Resolution | Enables Dynamic Resolution rendering for this Camera. This property only appears when you select Screen from the Output Target drop-down. |
Target Display | Defines which external device to render to. Between 1 and 8. This property only appears when you select Screen from the Output Target drop-down. |