Photo Session
Introduction
Photo Session allows you to pause the game, move around with the camera and capture screenshots. It works in the Editor’s Play mode and in the Build.
Malbers released his awesome Realistic Wolves and I wanted to capture close screenshot of those beautiful furry models. I tried to use NVidia’s Ansel for the capturing, but it turned out that Ansel is unsupported for Unity (last update March 2018) and the version on the Unity Asset Store doesn’t work for HDRP.
So I quickly coded this tool.
Example:
I know it’s not much code, but I needed it and thought some of you guys might have use for it as well, so here it is
Download
http://bit.ly/PhotoSessionUnity
Installation and Usage
Currently the focus is on the Malbers assets, but it should work for other purposes as well. In order to use this, add the PhotoSession script to FreeLookCameraRig (or whatever you use for navigating the main camera).
This will provide these settings in the inspector:
Description of the properties:
-
Toggle Key:
Is used to toggle between Gameplay and Photo Session mode -
Photo Camera:
The camera that’s being used for navigating around in the scene in Photo Session mode. This is usually the Main Camera. -
Other Camera Settings:
Custom movement sensitivity settings -
Reuse Previous Camera:
If enabled, then toggling Game and Photo Session mode will restore the camera transform of the previous session. Otherwise the transform of the current gameplay camera will be used for position and rotation of the Photo Camera -
Disabled Components:
In order to have the main camera move around as Photo Camera the gameplay input of that camera needs to be disabled in Photo Session mode. In my case the FreeLookCamera script of the FreeLookCameraRig needs to be disabled.
Example values:
If you hit play in the Unity Editor or if you start a Build, hit the F12 key (depending on your key setting). The game will be paused. You can capture a screenshot by pressing the left mouse button.
The captured screenshots will be stored in parallel to the Assets folder in the Editor or in parallel to the data folder in the Build in a dedicated Screenshots folder.
The size of the screenshots depends on the game window.
Controls
The controls are currently minimalistic:
-
press the Toggle Key (in the example case F12) in order to pause the game
-
navigate with the camera using
-
WSAD keys: move vertical and horizontal
-
QE keys: move up/down
-
Mouse: rotate the camera
-
press left mouse button in order to capture and save a screenshot
-
press the Toggle Key to continue the game
Future Ideas
This asset was created for personal purposes, but I thought you guys might find use for it, so I made it public. There are a lot of other future possibilities:
- indicate a camera display using Canvas when in Photo Mode
- simulate a flash when a screenshot is captured and saved
- help indicators
- various settings like fov, view distance
- various post processing additions like Depth of Field
- swappable post processing settings
- use supersize
- capture stereo
- capture 360 degree (e. g. using Unity’s Frame Recorder)
- slow down time instead of just pausing
- …
Lots of possibilities. Feel free to fork, enhance and share.
Limitations
The functionality currently depends on the Time class and what it provides for pausing a game.
Credits
-
ashleydavis: Unity FreeCam
Unity FreeCam · GitHub -
Chris Bellini: Screenshot Helper
http://untitledgam.es