Skip to main content

Introduction to Camera3D

The Camera3D node defines the viewpoint from which the 3D scene is rendered. Understanding camera projections, positioning, and movement is essential for creating engaging 3D experiences.
Only one camera can be active per viewport. Cameras register in the nearest Viewport node when ascending the tree.
See doc/classes/Camera3D.xml:7

Basic Camera Setup

See doc/classes/Camera3D.xml:72-75

Projection Types

Godot supports three camera projection modes:
The default projection where distant objects appear smaller (realistic 3D).
See doc/classes/Camera3D.xml:207-209, 186-192, 204-205, 183-184

Field of View (FOV)

Controls how wide the camera can see in perspective mode:
See doc/classes/Camera3D.xml:186-192, 201-202
The default 75° vertical FOV equals approximately:
  • 91° horizontal in 4:3
  • 102° horizontal in 16:10
  • 108° horizontal in 16:9
  • 122° horizontal in 21:9

Near and Far Planes

Define the camera’s visible distance range:
See doc/classes/Camera3D.xml:204-205, 183-184
Very small near values (below 0.05) can cause Z-fighting artifacts. Very large far values reduce depth buffer precision.

Making a Camera Active

See doc/classes/Camera3D.xml:172-174, 72-75, 13-18

Camera Positioning Methods

Using set_perspective

See doc/classes/Camera3D.xml:135-142

Using set_orthogonal

See doc/classes/Camera3D.xml:125-132

Using set_frustum

See doc/classes/Camera3D.xml:115-123

Camera Offset

Adjust the camera viewport without moving the camera:
See doc/classes/Camera3D.xml:198-199, 213-214

Frustum and Culling

Get Frustum Planes

See doc/classes/Camera3D.xml:45-48

Cull Mask

Control which visual layers the camera renders:
See doc/classes/Camera3D.xml:166-170, 107-113, 38-42

Position Queries

Check if Position is Behind Camera

See doc/classes/Camera3D.xml:57-62

Check if Position is in Frustum

See doc/classes/Camera3D.xml:65-69

Screen-World Conversions

Project 3D to 2D (World to Screen)

See doc/classes/Camera3D.xml:144-156

Unproject 2D to 3D (Screen to World)

See doc/classes/Camera3D.xml:85-91

Ray Casting from Screen

See doc/classes/Camera3D.xml:100-105, 93-98

Camera Attributes

Customize exposure, DOF, and other effects:
See doc/classes/Camera3D.xml:160-161

Environment

Set custom environment for this camera:
See doc/classes/Camera3D.xml:180-181

Compositor

Apply post-processing effects:
See doc/classes/Camera3D.xml:163-164

Doppler Tracking

Simulate doppler effect for audio:
See doc/classes/Camera3D.xml:176-178

Camera Following

Smooth camera following pattern:

Third-Person Camera

Orbiting camera with mouse control:

First-Person Camera

Mouse-look FPS camera:

Split-Screen with Multiple Cameras

Create split-screen multiplayer:

Camera Shake Effect

Debugging Cameras

See doc/classes/Camera3D.xml:32-35, 20-23, 26-29

Best Practices

Balance between Z-fighting and visible range:
Different FOV for different game types:
Always interpolate camera movement:
Before positioning UI over 3D:
Don’t render unnecessary layers:

3D Overview

3D coordinate systems and Node3D

Viewport

Understanding viewports

Environment

Environments and post-processing

Input Handling

Mouse and keyboard input

Resources