[FREE] Photo Session - Ingame Precision Screenshot Utility (Open Source, GitHub)

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 :slight_smile:

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).

6941123--815873--add-script.png

This will provide these settings in the inspector:

6941123--815870--settings.png

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:

6941123--815867--settings-example.png

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

11 Likes

I was wondering how you got that wolf closeup :slight_smile:

thanks for this!!

1 Like

I added more features:

  • capture higher than screen resolutions, i. e. you can now render an 8K image even if you don’t have an 8K screen
  • simulation of flashlight effect when you capture a screen
  • indicator for photo mode at the bottom right corner

8K example as attachment to this post.

New features:

  • output formats: jpg, png, exr, tga
  • aspect ratio
  • auto setup for the camera
  • auto setup for disabled components

New features:

  • 10K, 12K and 16K profiles … because … why not? :smile:
  • automatic DoF for HDRP (others will follow, I wanted to see how it looks like)
  • custom time scale (other than 0)
  • extended auto setup blacklist with camera movement scripts from unity hdrp

Here’s an example screenshot with Auto Depth of Field in 4K:


And attached is the same in 10K.

In case you’d like to try Auto DoF: You need to provide a HDRP volume with the DoF script in it, the gameobject and/or the script can be hidden. Photo Session finds the DoF script and modifies its visibilities and settings. I’ve just added it today, so I’m still experimenting. I’m quite happy with it so far. One thing that comes to mind for adding are multiple focus points, currently only the ceter is in focus. Also a focus indicator on the canvas might be nice. And I’ll probably also add that you can set a gameobject that’ll always be the focus target. And whatever comes to mind while toying around.

2 Likes

@YolanOTHER contributed 360 degree capture, thank you very much :slight_smile:

New Features:

  • 360 degree capture
  • automatic DoF for URP
  • automatic DoF for Built-In Pipeline

Some 360 degree examples:



2 Likes

I made an extensive video with scene setup and photo session in use. Including some new features like showing a photo frame on the canvas:

3 Likes

I toyed around with an Auto Focus option, update is already live on GitHub. Many thanks to @bgolus for helping me with with the shader.

In case anyone wants to try:

  • press F = switch through the focus modes
  • hold M while moving the mouse = set focus point

The current focus mode options are:

  • off
  • center
  • 4x3 grid
  • 16x9 grid
  • manual

I’m not sure if I keep the grids, setting the focus manually turned out to be quite handy. I’ll probably add near and far focus positions.

2 Likes

I updated Photo Session to 0.9.3

Enhancements:

  • keybinds are now adjustable:

7444148--912698--kb.png

  • specify a layer mask for the autofocus raycast:

7444148--912692--lm.png

Bugfixes:

  • camera kept on moving forward when photo mode got exited in case the camera got a collider attached
1 Like

I cannot add libraries to the PhotoSession.cs nor any script created inside the PhotoSession folder…
This is giving me headaches to implement a button in place of a toggle key…

You need to either make yourself familiar with Assembly Definitions or just copy the github code into your Assets folder and delete the asmdef files.

Copying works like a charm, thanks! I’ve tried to understand the Assembly Definitons before but couldnt get my head around it… Probably gonna watch a tutorial or something like that afterwards, I’m in a kinda of hurry right now

I submitted terrain stamps and needed screenshots for that. In order to make this process more fluent I extended Photo Session to support In-Editor screenshots, i. e. this time directly from within the editor, without hitting play.


See bottom right. Or to be more precise:

8043497--1037825--ps.png

  • 4 slots for saving the camera transform and moving to it
  • textfield for naming the slots
  • popup to select between Scene or Game, i. e. from where the camera transform should be copied
  • Save: save the transform of the game or scene camera
  • Move: move the game camera to the saved transform
  • Capture Screenshot: capture the game window and save the screenshot to disk
  • Reset: resets all camera settings
  • Explorer / Finder: open either last screenshot in explorer / finder or just the screenshots folder

All of Photo Session directly within the Unity Editor without going into Photo Session mode :slight_smile:

4 Likes

Congrats on the release @Rowlan :wink:

1 Like

Photo Session has been submitted to the Asset Store in order to reach a much broader audience and to get more feedback. Thank you very much everyone for using this asset for free and thank you very much for your support!

I’ll ask the moderation to lock the thread and will create a new one once the asset is live.

3 Likes

Asset is now shipped so check out the asset live.

2 Likes