Lesson 38 +10 XP

Physical Cameras & Viewports

Physical Cameras & Viewports

To achieve cinematic visual styling, Unity cameras support physical camera simulation and multi-display output configurations.

Physical Cameras

Toggle Physical Camera in the Camera Inspector to simulate real-world camera hardware:

  • Focal Length: The distance from the lens to the sensor (in millimeters). Lower values create wide-angle viewports; higher values zoom in on objects.
  • Sensor Size: Adjusts physical film gate dimensions (e.g. 35mm, Super 16).
  • Lens Shift: Offsets the camera sensor along the X and Y axes relative to the lens center. This lets you align horizontal lines (such as tall architectural columns) without tilting the camera, preventing keystoning perspective distortion.

Occlusion Culling

Standard camera frustum culling disables drawing objects outside the camera view. However, objects hidden behind walls are still rendered unless Occlusion Culling is configured:

  1. Go to Window -> Rendering -> Occlusion Culling.
  2. Mark occluder and occludee GameObjects as Occlusion Static.
  3. Bake the occlusion data.
  4. At runtime, the GPU skips drawing objects that are completely blocked by foreground geometry.

Multi-Display Output

Configure rendering to multiple screens:

  • Assign different cameras to different target Displays in the Camera Inspector (Display 1 to Display 8).
  • Use the Display.displays API in script to activate secondary screens when the game starts.

TL;DR

  • Physical Cameras simulate Focal Length, Sensor Size, and Lens Shift parameters.
  • Lens Shift prevents perspective distortion when framing tall objects.
  • Occlusion Culling skips rendering objects hidden behind walls.
  • Target Displays let you draw scenes to multiple physical monitors.