Camera

Abhishek Smith

Abhishek Smith

Building Outscal | Land Jobs in the gaming industry | EA, Epic Games, TCS, | CMU, IIT K

Core Camera Setup

  • Field of View: Controls camera view angle (60° default)
  • Orthographic: Perfect for 2D games, no perspective
  • Aspect Ratio: Screen proportion control (16:9, 4:3)
  • Clip Planes: What's visible to the camera
  • Culling Mask: Which layers to render

Render Settings

  • HDR: Enhanced lighting range
  • MSAA: Smooth edges with anti-aliasing
  • RenderTexture: Custom render outputs
  • Depth Mode: Generate depth information
  • Command Buffers: Custom render passes

Coordinate Systems

  • WorldToScreenPoint: Convert 3D positions to screen space
  • ScreenToWorldPoint: Convert screen clicks to world space
  • ScreenPointToRay: Convert screen position to 3D ray

Physical Camera

  • Physical Mode: Real camera simulation
  • Focal Length: Lens zoom (50mm default)
  • Sensor Size: Match real cameras (36x24mm full frame)

Camera Events

  • OnPreCull: Before visibility check
  • OnPreRender: Before drawing scene
  • OnPostRender: After scene is drawn
  • Multi-Display: Handle multiple screens

Pro Tips

  • Cache main camera reference
  • Keep FOV between 60-90 for most games
  • Use physical camera for cinematic looks
  • Handle aspect ratio changes properly

Common Issues

  • Wrong clip planes causing z-fighting
  • Missing culling mask layers
  • HDR without proper setup
  • Command buffer memory leaks

Show More