In the Scene Graph Cameras hall, you’ll learn how to use the Scene Graph camera components to coordinate and create gameplay. All camera components are reusable in your projects to create a consistent experience across your islands that feature the same camera style and gameplay.
Each camera zone in the hall features a Volume device where you walk into the volume to switch that zone's camera, and walk out to get the normal camera view back.
Perspective, Orthographic, and Physical Cameras: Each volume shows one camera type on its own.
Physical Camera: Inside the volume, the camera cycles through real-world camera bodies (sensor sizes) and lenses. This illustrates how each camera changes the shot.
Camera Director: In the camera director volume, a "slideshow" plays that blends from camera to camera.
To see how each camera was set up, open Verse Explorer and search for each of the camera files:
BlendedOrthographicCameraComponent.verseBlendedPerspectiveCameraComponent.verseBlendedPhysicalCameraComponent.verseCameraDirectorSwitcherComponent.versePhysicalCameraBodyPreset.versePhysicalCameraLensPreset.versePhysicalCameraPresetCyclerComponent.verese
To create your own camera entities, see Working with Entities and Components for basic Scene Graph workflows.
The Scene Graph Sample Tutorial illustrates how to create camera zones with one setup for each component. The Physical Camera and Camera Director zones use the following setups:
A Dynamic mode slideshow with random blend styles between two perspective cameras.
A physical camera that picks random bodies and lenses.
For more information about the different camera components, see Camera Components.
Camera Helper Modules
Additional modules and libraries were created to provide extended functionality to the Scene Graph camera components. The following camera modules are available through Verse Explorer in the sample tutorial project:
CameraTransitions.verse: Turns a blend style and duration into the camera system's transition types.VolumeOccupancy.verse: Tracks which players are inside a Volume device and sends clean enter, exit, and change events. Every enter event is paired with exactly one exit event, even when the device reports the same player twice (on respawn for example). Players who are already inside when the round starts are counted.PlayerScreenMessages.verse: Shows a message on one player's screen only, stacked under any messages they already have, instead of on everyone's screen like Print. The camera components use it so their debug messages only go to the players looking through that camera.
Trigger Camera Volume Component
The trigger_camera_volume_component shows the camera on its entity to a player while they're inside a Volume device. It works with perspective, orthographic, physical, and camera director cameras. It adds the camera to that player's own camera director at a selected priority (default 100), then removes the camera when the player leaves the volume. Each player is handled separately.
In the project, the TriggerCameraVolumeComponent.verse file uses the Volume device to trigger the camera or multiple cameras by subscribing to the volume device’s AgentEnterEvent and AgentExitEvents to the camera entity.
From the camera prefab the Volume device is added, the priority for the camera is determined, and the camera component type (perspective, orthographic, physical, and camera director) is added where the camera’s FieldofVision (FOV) or OrthographicProjectionWidth can be set as well as NearClippingPlaneDistance, and FarClippingPlaneDistance.
Physical Camera Preset Cycler Component
The Physical Camera volume uses the physical_camera_preset_cycler_component to change a physical camera's body and lens on a timer while inside the volume. It cycles through the preset list in order or at random (never repeating the same preset twice in a row). It also shows each change on screen to the players looking through the camera.
Physical Camera Body and Lens Presets
In this project, Scene Graph expands the functionality of camera bodies and lenses using the PhysicalCameraBodyPreset.verse and PhysicalCameraLens.Preset.verse scripts. These ready-made camera_body and camera_lens classes match the Unreal Engine Cine Camera presets.
Pick them straight from the Body and Lens dropdowns of any physical camera, and the editor preview updates right away. No code needed to run.
Each script has editable properties that provide customization for the camera body and lens:
Bodies:
Film 16:9
Digital Film 16:9
DSLR 16:9
Super 8mm
Super 16mm
Super 35mm
Academy 35mm
Full Aperture 35mm
VistaVision 35mm
IMAX 70mm, APS-C (Canon)
Full Frame DSLR
Micro Four Thirds
A Custom body for your own sensor size
Lenses:
12mm f/2.8
30mm f/1.4
50mm f/1.8
85mm f/1.8
105mm f/2
200mm f/2 primes
24-70mm f/2.8
0-200mm f/2.8 zooms
A Universal Zoom
A Custom lens
Camera Director Switcher Component
The camera_director_switcher_component turns a camera_director_component into a slideshow that cycles through a list of camera entities in order and loops back to the start. Each blended camera entity is scripted to use different Blend Styles and Blend Duration. Transitions from one camera to another are handled through functions on each of the entities for a seamless experience.
The switcher works by using the following functionality:
Static mode uses each camera as is placed in the scene, with its own blend.
Dynamic mode copies each camera into a blended camera when the game starts, and picks the blend for every switch. You can use one blend style for every switch or a random style each time (with or without instant Cuts), and a random duration between a minimum and a maximum. The copies follow your placed cameras every frame, so you can keep editing the originals.
Timing waits for each blend to finish, then holds the shot for a set number of seconds before the next camera switch.
Works with a trigger volume. If the entity also has a
trigger_camera_volume_component, the slideshow only runs while someone is inside the volume.Enable/Disable can be turned on and off in the editor or from Verse with
Enable(),Disable()andIsEnabled[].Debug options display as an on-screen readout of each switch and its blend, and setup logging.
Blended Cameras
The first two Scene Graph camera examples illustrate how to blend camera components to act as replacements for the standard camera components. By blending cameras, you choose how the director blends to or away from the player.
Standard cameras use a 0.2 second linear blend. With Scene Graph, you can set:
Blend Style: Cut, Linear, SmoothStep or SmootherStep.
Blend Duration in seconds.
They implement a small transition_configurable interface, so your own code can set the next blend at runtime.
Open the following Blended Camera Component scripts with Verse Explorer to see how each blended camera type was set up:
blended_perspective_camera_component.verseblended_orthographic_camera_component.verseblended_physical_camera_component.verse
Additional Camera Component Setups
Open the camera components' Details panels and try different combinations. Most camera components are capable of more functionality, such as:
Choose every blend yourself (Static mode). Place blended cameras in place of the regular ones, give each one its own blend style and duration, and set the switcher to Static. Each camera then always enters and leaves the same way, which works well for a scripted cinematic.
Use the same blend every time. In Dynamic mode, set Transition Type Mode to Constant and pick one blend style, for example SmootherStep, so every switch feels the same. Set the minimum and maximum blend times to the same value to fix the duration too.
Mix camera types in one slideshow. The camera list can hold perspective, orthographic and physical cameras together. For example, cut from a wide perspective shot to a top-down orthographic view to a close-up through a physical camera with a telephoto lens.
Put directors inside directors. In Static mode, a camera in the list can itself be another camera director, so one slideshow can play a whole sequence of shots as one of its steps.
Run a slideshow without a volume. Leave the
trigger_camera_volume_componentoff the director entity and it keeps switching for the whole game. That's useful for lobby, intro, or spectator cameras that you show to players another way.Combine a blended physical camera with the preset cycler. In Dynamic mode, the switcher's copy of a physical camera follows its body and lens changes. A single shot can change lenses while the director blends between shots.
Pick your own list of bodies and lenses. Cut the cycler's lists down to just the presets you want, turn off random picking to go through them in a set order, or add the Custom body and lens with your own values. Leave a list empty to keep the camera's own body or lens.
Use presets without the cycler. The body and lens presets work on any physical camera straight from the Details panel, with no extra component. That makes them an easy way to match a real camera setup.
Layer camera volumes. Each
trigger_camera_volume_componenthas its own priority. Overlap volumes with different priorities, and the higher one wins while a player stands in both. When the player leaves it, the lower one takes over again.Control the components from your own Verse code. The switcher and the cycler can be turned on and off at runtime with
Enable()andDisable(), for example from a button, a trigger or a game phase. Code can set a blended camera's next blend through transition_configurable.Reuse the helpers.
VolumeOccupancy.verseandPlayerScreenMessages.versearen't tied to cameras. Use them in any component that needs to know who is inside a volume, or to show a message to one player only.