Coder Social home page Coder Social logo

minart199 / photosession Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yolanother/photosession

0.0 0.0 0.0 567 KB

Pause the game and allow free look movement of the camera in order to capture screenshots

License: MIT License

C# 96.00% ShaderLab 4.00%

photosession's Introduction

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 and the version on the Unity Asset Store doesn't work for HDRP.

So I quickly coded this tool.

Example:

wolfy-example

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.

add-script

This will provide these settings in the inspector:

settings

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 input of that camera needs to be disabled in Photo Sessionmode. In my case the FreeLookCamera script of the FreeLookCameraRig needs to be disabled.

Example values:

settings-example

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 resolution of the screenshots can be set to be the same as the game view, or it can be configured to a number of common resolutions.

image

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

photosession's People

Contributors

roland09 avatar sorratheorc avatar yolanother avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.