Viewport

2026/02/04

Type
Learning Resource
Format
Glossary Article
Version
General
Subject Tags
Code
Assets
All else
Copyright 2016-2026, GDQuest
Created
2026/02/16
Updated
2026/02/04

Viewport

A viewport is a lens or view into our virtual game world. It's a rectangular area that captures visuals and sounds in the world and helps to output them to your computer display and speakers.

A game uses at least one viewport and can use as many as the developers need. The one required viewport is called the root viewport in Godot. In 2D, it is represented by the thin rectangle in the editor. If there is no Camera2D node in the game, the player will see the content of the rectangle. Otherwise, the viewport centers on the active camera node.

In 3D, a camera is required to capture the world's geometry, which is then used by the rendering engine to draw the game world.

When would you use more than one viewport?

We use more than one viewport for procedural drawing and visual effects. A viewport helps you to render an image. This image can be displayed directly on the player screen, but you can also use it as a node's texture.

A good example is split-screen co-op. When two players are at different locations in the game world, you need to draw two views of the game side by side. To achieve that, you use one viewport and camera per player.

Another good example is the famous game "Portal". When you create a portal, you see what's on the other side: a view of the world from a different place and angle. To draw this, you use another viewport and camera.

This technique is sometimes also used to draw mirrors in modern 3D games.

Become an Indie Gamedev with GDQuest!

Don't stop here. Step-by-step tutorials are fun but they only take you so far.

Try one of our proven study programs to become an independent Gamedev truly capable of realizing the games you’ve always wanted to make.

Nathan

Founder and teacher at GDQuest
  • Starter Kit
  • Learn Gamedev from Zero
Check out GDSchool

You're welcome in our little community

Get help from peers and pros on GDQuest's Discord server!

20,000 membersJoin Server

Contribute to GDQuest's Free Library

There are multiple ways you can join our effort to create free and open source gamedev resources that are accessible to everyone!