Cameras
BeginnerDesigner Cameras capture your scene and display it to the player. Without cameras, you can’t see anything in your game. You can have an unlimited number of cameras in your scene.
Create a camera in Game Studio
Camera, then choose the kind of camera you want to create (perspective or orthographic). Game Studio creates an entity with a camera component attached. Property Grid, click Add component and select Camera.
Camera properties
Perspective and orthographic cameras
Perspective cameras provide a “real-world” perspective of the objects in your scene. In this view, objects close to the camera appear larger, and lines of identical lengths appear different due to foreshortening, as in reality. Perspective cameras are most used for games that require a realistic perspective, such as third-person and first-person games. orthographic cameras, objects are always the same size, no matter their distance from the camera. Parallel lines never touch, and there’s no vanishing point. Orthographic cameras are most used for games with isometric perspectives, such as some strategy, 4X, or role-playing games.
Field of view (perspective mode only)
perspective mode, the field of view changes the camera frustum, and has the effect of zooming in and out of the scene. At high settings (90 and above), the field of view creates stretched “fish-eye lens” views. The default setting is 45.
Orthographic size (orthographic mode only)
orthographic mode, the orthographic size has the effect of zooming in and out.
Near and far planes
The near and far planes determine where the camera’s view begins and ends.
- near plane is the closest point the camera can see. The default setting is 0.1. Objects before this point aren’t drawn.
- far plane, also known as the draw distance, is the furthest point the camera can see. Objects beyond this point aren’t drawn. The default setting is 1000.
Xenko renders the area between the near and far planes.
Camera scripts
camera scripts. Xenko includes three camera script templates: an FPS camera script, a side-scrolling camera script, and a basic camera controller script.Add a camera script in Game Studio
- Asset View (in the bottom by default), click Add asset > Scripts and choose the camera script you want to add.
- Scene Editor, select the entity with the camera you want to control.
- Property Grid (on the right by default), click Add component and select the camera script you want to use.
Game Studio adds the camera script to the entity.
Scripts.
Camera slots
Camera slots link the graphics compositor to the cameras in your scene. You bind each camera to a slot, then define which slot the compositor uses. This means you can change the root scene or graphics compositor without having to assign new cameras each time. Camera slots.Render a camera to a texture
Render textures.See also
- Camera slots
- Animate a camera
- Graphics compositor
